Fixed clang -Weverything warnings
authorSam Lantinga <slouken@libsdl.org>
Thu, 22 Nov 2012 11:55:11 -0800
changeset 6683b1124b32b07d
parent 6682 a0cbe4e5a07a
child 6684 992268e65626
Fixed clang -Weverything warnings
include/SDL_pixels.h
include/SDL_system.h
     1.1 --- a/include/SDL_pixels.h	Mon Nov 19 00:39:19 2012 +0300
     1.2 +++ b/include/SDL_pixels.h	Thu Nov 22 11:55:11 2012 -0800
     1.3 @@ -114,9 +114,10 @@
     1.4  #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
     1.5  
     1.6  #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
     1.7 -    ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
     1.8 +    ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
     1.9       ((bits) << 8) | ((bytes) << 0))
    1.10  
    1.11 +#define SDL_PIXELFLAG(X)	(((X) >> 28) & 0x0F)
    1.12  #define SDL_PIXELTYPE(X)	(((X) >> 24) & 0x0F)
    1.13  #define SDL_PIXELORDER(X)	(((X) >> 20) & 0x0F)
    1.14  #define SDL_PIXELLAYOUT(X)	(((X) >> 16) & 0x0F)
    1.15 @@ -140,8 +141,9 @@
    1.16        (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
    1.17        (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
    1.18  
    1.19 +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
    1.20  #define SDL_ISPIXELFORMAT_FOURCC(format)    \
    1.21 -    ((format) && !((format) & 0x80000000))
    1.22 +    ((format) && (SDL_PIXELFLAG(format) != 1))
    1.23  
    1.24  /* Note: If you modify this list, update SDL_GetPixelFormatName() */
    1.25  enum
     2.1 --- a/include/SDL_system.h	Mon Nov 19 00:39:19 2012 +0300
     2.2 +++ b/include/SDL_system.h	Thu Nov 22 11:55:11 2012 -0800
     2.3 @@ -30,7 +30,7 @@
     2.4  
     2.5  #include "SDL_stdinc.h"
     2.6  
     2.7 -#if __IPHONEOS__
     2.8 +#if defined(__IPHONEOS__) && __IPHONEOS__
     2.9  #include "SDL_video.h"
    2.10  #include "SDL_keyboard.h"
    2.11  #endif
    2.12 @@ -44,7 +44,7 @@
    2.13  #endif
    2.14  
    2.15  /* Platform specific functions for iOS */
    2.16 -#if __IPHONEOS__
    2.17 +#if defined(__IPHONEOS__) && __IPHONEOS__
    2.18  
    2.19  extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
    2.20  extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
    2.21 @@ -53,7 +53,7 @@
    2.22  
    2.23  
    2.24  /* Platform specific functions for Android */
    2.25 -#if __ANDROID__
    2.26 +#if defined(__ANDROID__) && __ANDROID__
    2.27  
    2.28  /* Get the JNI environment for the current thread
    2.29     This returns JNIEnv*, but the prototype is void* so we don't need jni.h