src/video/x11/SDL_x11video.c
branchSDL-1.2
changeset 11362 464908ca2d22
parent 7491 3665bc284271
child 12653 9b0e5c555c0f
     1.1 --- a/src/video/x11/SDL_x11video.c	Thu Jun 01 00:39:07 2017 -0400
     1.2 +++ b/src/video/x11/SDL_x11video.c	Sun Aug 27 19:03:15 2017 -0700
     1.3 @@ -1462,7 +1462,7 @@
     1.4  
     1.5  int X11_SetGammaRamp(_THIS, Uint16 *ramp)
     1.6  {
     1.7 -	int i, ncolors;
     1.8 +	int i, result, ncolors;
     1.9  	XColor xcmap[256];
    1.10  
    1.11  	/* See if actually setting the gamma is supported */
    1.12 @@ -1481,12 +1481,13 @@
    1.13  		xcmap[i].blue  = ramp[2*256+c];
    1.14  		xcmap[i].flags = (DoRed|DoGreen|DoBlue);
    1.15  	}
    1.16 -	if ( XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors) != 0 ) {
    1.17 +	result = 0;
    1.18 +	if ( XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors) == False ) {
    1.19  		SDL_SetError("Setting gamma correction failed");
    1.20 -		return(-1);
    1.21 +		result = -1;
    1.22  	}
    1.23  	XSync(GFX_Display, False);
    1.24 -	return(0);
    1.25 +	return result;
    1.26  }
    1.27  
    1.28  /* Note:  If we are terminated, this could be called in the middle of