Remove initial declaration from for loop SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Wed, 24 Apr 2019 20:20:15 +0100
branchSDL-1.2
changeset 127210c327f0edd70
parent 12653 9b0e5c555c0f
child 12722 33940ce0a0ba
Remove initial declaration from for loop
src/video/SDL_pixels.c
     1.1 --- a/src/video/SDL_pixels.c	Sat Mar 16 19:16:24 2019 -0700
     1.2 +++ b/src/video/SDL_pixels.c	Wed Apr 24 20:20:15 2019 +0100
     1.3 @@ -292,10 +292,11 @@
     1.4  Uint16 SDL_CalculatePitch(SDL_Surface *surface)
     1.5  {
     1.6  	unsigned int pitch = 0;
     1.7 +	Uint8 byte;
     1.8  
     1.9  	/* Surface should be 4-byte aligned for speed */
    1.10  	/* The code tries to prevent from an Uint16 overflow. */;
    1.11 -	for (Uint8 byte = surface->format->BytesPerPixel; byte; byte--) {
    1.12 +	for (byte = surface->format->BytesPerPixel; byte; byte--) {
    1.13  		pitch += (unsigned int)surface->w;
    1.14  		if (pitch < surface->w) {
    1.15  			SDL_SetError("A scanline is too wide");