Skip to content

Commit

Permalink
Remove initial declaration from for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Apr 24, 2019
1 parent 40d97bf commit 51bb340
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/SDL_pixels.c
Expand Up @@ -292,10 +292,11 @@ void SDL_DitherColors(SDL_Color *colors, int bpp)
Uint16 SDL_CalculatePitch(SDL_Surface *surface)
{
unsigned int pitch = 0;
Uint8 byte;

/* Surface should be 4-byte aligned for speed */
/* The code tries to prevent from an Uint16 overflow. */;
for (Uint8 byte = surface->format->BytesPerPixel; byte; byte--) {
for (byte = surface->format->BytesPerPixel; byte; byte--) {
pitch += (unsigned int)surface->w;
if (pitch < surface->w) {
SDL_SetError("A scanline is too wide");
Expand Down

0 comments on commit 51bb340

Please sign in to comment.