From 8c27ed59625a5ba6758a72ddbb902bc48ce26d8e Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Thu, 30 Jan 2014 20:31:49 -0800 Subject: [PATCH] SDL: Fixed clang warnings. --- examples/common/entry/entry_p.h | 12 +++++------- examples/common/entry/entry_sdl.cpp | 4 ++-- premake/example-common.lua | 4 ++++ premake/premake4.lua | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/common/entry/entry_p.h b/examples/common/entry/entry_p.h index 9d950622a..da79edc3e 100644 --- a/examples/common/entry/entry_p.h +++ b/examples/common/entry/entry_p.h @@ -10,13 +10,11 @@ #include "entry.h" -#ifndef ENTRY_CONFIG_USE_SDL -# define ENTRY_CONFIG_USE_SDL 0 //BX_PLATFORM_OSX -#endif // ENTRY_CONFIG_USE_SDL - -#ifndef ENTRY_CONFIG_USE_NATIVE -# define ENTRY_CONFIG_USE_NATIVE !ENTRY_CONFIG_USE_SDL -#endif // ENTRY_CONFIG_USE_NATIVE +#if !defined(ENTRY_CONFIG_USE_SDL) && \ + !defined(ENTRY_CONFIG_USE_NATIVE) +# define ENTRY_CONFIG_USE_SDL 0 +# define ENTRY_CONFIG_USE_NATIVE 1 +#endif // ... #if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT) # define ENTRY_DEFAULT_WIDTH 1280 diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 28856072d..938baa906 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -338,8 +338,8 @@ namespace entry SDL_Event event; SDL_UserEvent& uev = event.user; uev.type = SDL_USER_SET_WINDOW_SIZE; - uev.data1 = (void*)_width; - uev.data2 = (void*)_height; + uev.data1 = reinterpret_cast(_width); + uev.data2 = reinterpret_cast(_height); SDL_PushEvent(&event); } diff --git a/premake/example-common.lua b/premake/example-common.lua index 8fcbf6d02..f920660ea 100644 --- a/premake/example-common.lua +++ b/premake/example-common.lua @@ -13,6 +13,10 @@ project ("example-common") BGFX_DIR .. "3rdparty", } + defines { +-- "ENTRY_CONFIG_USE_SDL=1", + } + files { BGFX_DIR .. "examples/common/**.cpp", BGFX_DIR .. "examples/common/**.h", diff --git a/premake/premake4.lua b/premake/premake4.lua index 4ff662f97..60a89deb0 100644 --- a/premake/premake4.lua +++ b/premake/premake4.lua @@ -117,6 +117,7 @@ function exampleProject(_name, _uuid) links { "Cocoa.framework", "OpenGL.framework", +-- "SDL2", } configuration { "ios*" }