From b95ce122c51ff023455d28c29d86ce3c4b19e9a5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 22 Nov 2012 11:55:11 -0800 Subject: [PATCH] Fixed clang -Weverything warnings --- include/SDL_pixels.h | 6 ++++-- include/SDL_system.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/SDL_pixels.h b/include/SDL_pixels.h index 50f80fae4..99b475f3d 100644 --- a/include/SDL_pixels.h +++ b/include/SDL_pixels.h @@ -114,9 +114,10 @@ enum #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 @@ enum (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 diff --git a/include/SDL_system.h b/include/SDL_system.h index aa141489d..47e557575 100644 --- a/include/SDL_system.h +++ b/include/SDL_system.h @@ -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 @@ extern "C" { #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 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); /* 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