warning fixes SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Tue, 16 Oct 2018 10:50:15 +0300
branchSDL-1.2
changeset 6064872fdc71670
parent 605 e7abf44fc35c
child 607 1a1189c2978f
warning fixes
IMG_png.c
IMG_xcf.c
     1.1 --- a/IMG_png.c	Tue Oct 16 10:21:50 2018 +0300
     1.2 +++ b/IMG_png.c	Tue Oct 16 10:50:15 2018 +0300
     1.3 @@ -239,7 +239,7 @@
     1.4  			return -1;
     1.5  		}
     1.6  		lib.png_set_interlace_handling =
     1.7 -			(void (*) (png_structp))
     1.8 +			(int (*) (png_structp))
     1.9  			SDL_LoadFunction(lib.handle, "png_set_interlace_handling");
    1.10  		if ( lib.png_set_interlace_handling == NULL ) {
    1.11  			SDL_UnloadObject(lib.handle);
    1.12 @@ -507,7 +507,7 @@
    1.13  
    1.14  	/* Create the array of pointers to image data */
    1.15  	row_pointers = (png_bytep*) malloc(sizeof(png_bytep)*height);
    1.16 -	if ( (row_pointers == NULL) ) {
    1.17 +	if (row_pointers == NULL) {
    1.18  		error = "Out of memory";
    1.19  		goto done;
    1.20  	}
     2.1 --- a/IMG_xcf.c	Tue Oct 16 10:21:50 2018 +0300
     2.2 +++ b/IMG_xcf.c	Tue Oct 16 10:50:15 2018 +0300
     2.3 @@ -520,9 +520,9 @@
     2.4  
     2.5  static Uint32 rgb2grey (Uint32 a) {
     2.6    Uint8 l;
     2.7 -  l = 0.2990 * ((a && 0x00FF0000) >> 16)
     2.8 -    + 0.5870 * ((a && 0x0000FF00) >>  8)
     2.9 -    + 0.1140 * ((a && 0x000000FF));
    2.10 +  l = (Uint8)(0.2990 * ((a & 0x00FF0000) >> 16)
    2.11 +    + 0.5870 * ((a & 0x0000FF00) >>  8)
    2.12 +    + 0.1140 * ((a & 0x000000FF)));
    2.13  
    2.14    return (l << 16) | (l << 8) | l;
    2.15  }