Skip to content
Permalink
Browse files
Remove initial declaration from for loop
  • Loading branch information
ccawley2011 committed Apr 24, 2019
1 parent 40d97bf commit 51bb3400817c422715614c335e4740a8388c4662
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/video/SDL_pixels.c
@@ -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");

0 comments on commit 51bb340

Please sign in to comment.