Fixed clang -Weverything warnings
authorSam Lantinga <slouken@libsdl.org>
Thu, 22 Nov 2012 11:55:11 -0800
changeset 6683 b1124b32b07d
parent 6682 a0cbe4e5a07a
child 6684 992268e65626
Fixed clang -Weverything warnings
include/SDL_pixels.h
include/SDL_system.h
--- a/include/SDL_pixels.h	Mon Nov 19 00:39:19 2012 +0300
+++ b/include/SDL_pixels.h	Thu Nov 22 11:55:11 2012 -0800
@@ -114,9 +114,10 @@
 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
 
 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
-    ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
+    ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
      ((bits) << 8) | ((bytes) << 0))
 
+#define SDL_PIXELFLAG(X)	(((X) >> 28) & 0x0F)
 #define SDL_PIXELTYPE(X)	(((X) >> 24) & 0x0F)
 #define SDL_PIXELORDER(X)	(((X) >> 20) & 0x0F)
 #define SDL_PIXELLAYOUT(X)	(((X) >> 16) & 0x0F)
@@ -140,8 +141,9 @@
       (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
       (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
 
+/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
 #define SDL_ISPIXELFORMAT_FOURCC(format)    \
-    ((format) && !((format) & 0x80000000))
+    ((format) && (SDL_PIXELFLAG(format) != 1))
 
 /* Note: If you modify this list, update SDL_GetPixelFormatName() */
 enum
--- a/include/SDL_system.h	Mon Nov 19 00:39:19 2012 +0300
+++ b/include/SDL_system.h	Thu Nov 22 11:55:11 2012 -0800
@@ -30,7 +30,7 @@
 
 #include "SDL_stdinc.h"
 
-#if __IPHONEOS__
+#if defined(__IPHONEOS__) && __IPHONEOS__
 #include "SDL_video.h"
 #include "SDL_keyboard.h"
 #endif
@@ -44,7 +44,7 @@
 #endif
 
 /* Platform specific functions for iOS */
-#if __IPHONEOS__
+#if defined(__IPHONEOS__) && __IPHONEOS__
 
 extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
@@ -53,7 +53,7 @@
 
 
 /* Platform specific functions for Android */
-#if __ANDROID__
+#if defined(__ANDROID__) && __ANDROID__
 
 /* Get the JNI environment for the current thread
    This returns JNIEnv*, but the prototype is void* so we don't need jni.h