From 51bb3400817c422715614c335e4740a8388c4662 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Wed, 24 Apr 2019 20:20:15 +0100 Subject: [PATCH] Remove initial declaration from for loop --- src/video/SDL_pixels.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 44626b749..17f1a7199 100644 --- a/src/video/SDL_pixels.c +++ b/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");