From 82ebf2d4ff766500e2f72c7e01af2b7aa3221059 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 20 Jul 2012 13:33:15 -0400 Subject: [PATCH] Fixed some minor compiler warnings. --HG-- extra : rebase_source : 9466732b4e5ab87e92e8eb9e2377aa5405bdc23b --- src/file/SDL_rwops.c | 23 +++++++++++------------ src/render/software/SDL_rotate.h | 3 ++- src/video/x11/SDL_x11opengl.c | 2 ++ src/video/x11/SDL_x11xinput2.c | 17 ++++++++++++++--- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index d4868cc7a..c6a0095ad 100755 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -438,9 +438,6 @@ SDL_RWops * SDL_RWFromFile(const char *file, const char *mode) { SDL_RWops *rwops = NULL; -#ifdef HAVE_STDIO_H - FILE *fp = NULL; -#endif if (!file || !*file || !mode || !*mode) { SDL_SetError("SDL_RWFromFile(): No file or no mode specified"); return NULL; @@ -472,15 +469,17 @@ SDL_RWFromFile(const char *file, const char *mode) rwops->close = windows_file_close; #elif HAVE_STDIO_H - #ifdef __APPLE__ - fp = SDL_OpenFPFromBundleOrFallback(file, mode); - #else - fp = fopen(file, mode); - #endif - if (fp == NULL) { - SDL_SetError("Couldn't open %s", file); - } else { - rwops = SDL_RWFromFP(fp, 1); + { + #ifdef __APPLE__ + FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); + #else + FILE *fp = fopen(file, mode); + #endif + if (fp == NULL) { + SDL_SetError("Couldn't open %s", file); + } else { + rwops = SDL_RWFromFP(fp, 1); + } } #else SDL_SetError("SDL not compiled with stdio support"); diff --git a/src/render/software/SDL_rotate.h b/src/render/software/SDL_rotate.h index 6a5a174da..26bb8ad1c 100644 --- a/src/render/software/SDL_rotate.h +++ b/src/render/software/SDL_rotate.h @@ -3,4 +3,5 @@ #endif extern SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle); -extern void _rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); \ No newline at end of file +extern void _rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); + diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index a0e3e91c6..1268deed4 100755 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -95,8 +95,10 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, #ifndef GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile +#ifndef GLX_CONTEXT_ES2_PROFILE_BIT_EXT #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000002 #endif +#endif #ifndef GLX_EXT_swap_control #define GLX_SWAP_INTERVAL_EXT 0x20F1 diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 30742f8d4..cfeb2f9ae 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -29,16 +29,19 @@ #define MAX_AXIS 16 +#if SDL_VIDEO_DRIVER_X11_XINPUT2 static int xinput2_initialized = 0; + +#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH static int xinput2_multitouch_supported = 0; -/* Opcode returned XQueryExtension +#endif + +/* Opcode returned XQueryExtension * It will be used in event processing * to know that the event came from * this extension */ static int xinput2_opcode; - -#if SDL_VIDEO_DRIVER_X11_XINPUT2 static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len, double *output_values,int output_values_len) { int i = 0,z = 0; @@ -237,12 +240,20 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) { int X11_Xinput2IsInitialized() { +#if SDL_VIDEO_DRIVER_X11_XINPUT2 return xinput2_initialized; +#else + return 0; +#endif } int X11_Xinput2IsMutitouchSupported() { +#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH return xinput2_initialized && xinput2_multitouch_supported; +#else + return 0; +#endif } #endif /* SDL_VIDEO_DRIVER_X11 */