[Commits] SDL_image: Fixed iOS build warnings

libsdl.org revision control commits-owner at libsdl.org
Tue Dec 12 22:19:02 PST 2017


details:   https://hg.libsdl.org/SDL_image/rev/b5bcb9cb9f6d
changeset: 550:b5bcb9cb9f6d
user:      Sam Lantinga <slouken at libsdl.org>
date:      Tue Dec 12 22:18:18 2017 -0800
description:
Fixed iOS build warnings

diffstat:

 IMG.c         |  16 ++++++++--------
 IMG_ImageIO.m |   4 ++--
 IMG_bmp.c     |   2 +-
 IMG_xpm.c     |   2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diffs (72 lines):

diff -r 66bf925397f4 -r b5bcb9cb9f6d IMG.c
--- a/IMG.c	Sun Dec 10 09:11:46 2017 -0800
+++ b/IMG.c	Tue Dec 12 22:18:18 2017 -0800
@@ -57,15 +57,15 @@
     return(&linked_version);
 }
 
-extern int IMG_InitJPG();
-extern void IMG_QuitJPG();
-extern int IMG_InitPNG();
-extern void IMG_QuitPNG();
-extern int IMG_InitTIF();
-extern void IMG_QuitTIF();
+extern int IMG_InitJPG(void);
+extern void IMG_QuitJPG(void);
+extern int IMG_InitPNG(void);
+extern void IMG_QuitPNG(void);
+extern int IMG_InitTIF(void);
+extern void IMG_QuitTIF(void);
 
-extern int IMG_InitWEBP();
-extern void IMG_QuitWEBP();
+extern int IMG_InitWEBP(void);
+extern void IMG_QuitWEBP(void);
 
 static int initialized = 0;
 
diff -r 66bf925397f4 -r b5bcb9cb9f6d IMG_ImageIO.m
--- a/IMG_ImageIO.m	Sun Dec 10 09:11:46 2017 -0800
+++ b/IMG_ImageIO.m	Tue Dec 12 22:18:18 2017 -0800
@@ -229,7 +229,7 @@
     Gmask = 0x0000FF00;
     Bmask = 0x000000FF;
 
-    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, Rmask, Gmask, Bmask, Amask);
+    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, (int)w, (int)h, 32, Rmask, Gmask, Bmask, Amask);
     if (surface)
     {
         // Sets up a context to be drawn to with surface->pixels as the area to be drawn to
@@ -306,7 +306,7 @@
     }
 
     CGColorSpaceGetColorTable(color_space, entries);
-    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, bits_per_pixel, 0, 0, 0, 0);
+    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, (int)w, (int)h, bits_per_pixel, 0, 0, 0, 0);
     if (surface) {
         uint8_t* pixels = (uint8_t*)surface->pixels;
         CGDataProviderRef provider = CGImageGetDataProvider(image_ref);
diff -r 66bf925397f4 -r b5bcb9cb9f6d IMG_bmp.c
--- a/IMG_bmp.c	Sun Dec 10 09:11:46 2017 -0800
+++ b/IMG_bmp.c	Tue Dec 12 22:18:18 2017 -0800
@@ -245,7 +245,7 @@
     /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
     Uint32 biSize;
     Sint32 biWidth;
-    Sint32 biHeight;
+    Sint32 biHeight = 0;
     Uint16 biPlanes;
     Uint16 biBitCount;
     Uint32 biCompression;
diff -r 66bf925397f4 -r b5bcb9cb9f6d IMG_xpm.c
--- a/IMG_xpm.c	Sun Dec 10 09:11:46 2017 -0800
+++ b/IMG_xpm.c	Tue Dec 12 22:18:18 2017 -0800
@@ -883,7 +883,7 @@
             break;
         }
         buf[6] = '\0';
-        *rgb = SDL_strtol(buf, NULL, 16);
+        *rgb = (Uint32)SDL_strtol(buf, NULL, 16);
         return 1;
     } else {
         int i;


More information about the commits mailing list