Fixed some minor compiler warnings.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 20 Jul 2012 13:33:15 -0400
changeset 6375 93f9a24d1c02
parent 6374 d4ed97e63c22
child 6376 f7ec45572c54
Fixed some minor compiler warnings.
src/file/SDL_rwops.c
src/render/software/SDL_rotate.h
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11xinput2.c
--- a/src/file/SDL_rwops.c	Fri Jul 20 13:32:34 2012 -0400
+++ b/src/file/SDL_rwops.c	Fri Jul 20 13:33:15 2012 -0400
@@ -438,9 +438,6 @@
 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 @@
     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");
--- a/src/render/software/SDL_rotate.h	Fri Jul 20 13:32:34 2012 -0400
+++ b/src/render/software/SDL_rotate.h	Fri Jul 20 13:33:15 2012 -0400
@@ -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);
+
--- a/src/video/x11/SDL_x11opengl.c	Fri Jul 20 13:32:34 2012 -0400
+++ b/src/video/x11/SDL_x11opengl.c	Fri Jul 20 13:33:15 2012 -0400
@@ -95,8 +95,10 @@
 
 #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
--- a/src/video/x11/SDL_x11xinput2.c	Fri Jul 20 13:32:34 2012 -0400
+++ b/src/video/x11/SDL_x11xinput2.c	Fri Jul 20 13:33:15 2012 -0400
@@ -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 @@
 
 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 */