diff --git a/examples/common/entry/cmd.cpp b/examples/common/entry/cmd.cpp index 7f60d8df..9834cbea 100644 --- a/examples/common/entry/cmd.cpp +++ b/examples/common/entry/cmd.cpp @@ -42,7 +42,7 @@ static const char* tokenizeCommandLine(const char* _commandLine, char* _buffer, switch (state) { case SkipWhitespace: - for (; isspace(*curr); ++curr); // skip whitespace + for (; isspace(*curr); ++curr) {}; // skip whitespace state = SetTerm; break; @@ -92,7 +92,7 @@ static const char* tokenizeCommandLine(const char* _commandLine, char* _buffer, case Escape: { const char* start = --curr; - for (; '\\' == *curr; ++curr); + for (; '\\' == *curr; ++curr) {}; if ('"' != *curr) { diff --git a/examples/common/entry/entry_ios.mm b/examples/common/entry/entry_ios.mm index 12751a61..e48126bd 100644 --- a/examples/common/entry/entry_ios.mm +++ b/examples/common/entry/entry_ios.mm @@ -16,11 +16,6 @@ #include #include -namespace bgfx -{ - void renderFrame(); -} - namespace entry { struct MainThreadEntry @@ -76,6 +71,7 @@ namespace entry void setWindowSize(uint32_t _width, uint32_t _height) { + BX_UNUSED(_width, _height); } void toggleWindowFrame() @@ -84,6 +80,7 @@ namespace entry void setMouseLock(bool _lock) { + BX_UNUSED(_lock); } } // namespace entry @@ -124,8 +121,8 @@ using namespace entry; if (nil == m_displayLink) { m_displayLink = [self.window.screen displayLinkWithTarget:self selector:@selector(renderFrame)]; - [m_displayLink setFrameInterval:1]; - [m_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + //[m_displayLink setFrameInterval:1]; + //[m_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; } } @@ -163,6 +160,8 @@ using namespace entry; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + BX_UNUSED(application, launchOptions); + CGRect rect = [ [UIScreen mainScreen] bounds]; m_window = [ [UIWindow alloc] initWithFrame: rect]; m_view = [ [View alloc] initWithFrame: rect]; @@ -176,24 +175,29 @@ using namespace entry; - (void)applicationWillResignActive:(UIApplication *)application { + BX_UNUSED(application); [m_view stop]; } - (void)applicationDidEnterBackground:(UIApplication *)application { + BX_UNUSED(application); } - (void)applicationWillEnterForeground:(UIApplication *)application { + BX_UNUSED(application); } - (void)applicationDidBecomeActive:(UIApplication *)application { + BX_UNUSED(application); [m_view start]; } - (void)applicationWillTerminate:(UIApplication *)application { + BX_UNUSED(application); [m_view stop]; } diff --git a/examples/common/entry/entry_osx.mm b/examples/common/entry/entry_osx.mm index 61575e23..0489f3ee 100644 --- a/examples/common/entry/entry_osx.mm +++ b/examples/common/entry/entry_osx.mm @@ -53,6 +53,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { + BX_UNUSED(sender); self->terminated = true; return NSTerminateCancel; } @@ -246,13 +247,13 @@ namespace entry { break; } - while (DispatchEvent(PeekEvent() ) ); + while (DispatchEvent(PeekEvent() ) ) {}; } m_eventQueue.postExitEvent(); - while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ); + while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {}; thread.shutdown(); return 0; @@ -277,6 +278,7 @@ namespace entry void setWindowSize(uint32_t _width, uint32_t _height) { + BX_UNUSED(_width, _height); } void toggleWindowFrame() @@ -285,6 +287,7 @@ namespace entry void setMouseLock(bool _lock) { + BX_UNUSED(_lock); } } // namespace entry diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 184e6985..f87bab06 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1570,7 +1570,7 @@ namespace bgfx { BX_TRACE("render thread start"); Context* ctx = (Context*)_userData; - while (!ctx->renderFrame() ); + while (!ctx->renderFrame() ) {}; BX_TRACE("render thread exit"); return EXIT_SUCCESS; } diff --git a/src/glcontext_eagl.mm b/src/glcontext_eagl.mm index 9811238f..abadc0b1 100644 --- a/src/glcontext_eagl.mm +++ b/src/glcontext_eagl.mm @@ -14,6 +14,7 @@ namespace bgfx { void GlContext::create(uint32_t _width, uint32_t _height) { + BX_UNUSED(_width, _height); CAEAGLLayer* layer = (CAEAGLLayer*)g_bgfxEaglLayer; layer.opaque = true; @@ -82,6 +83,7 @@ namespace bgfx void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) { + BX_UNUSED(_width, _height, _vsync); BX_TRACE("resize context"); } diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index ccc9413d..ee60a20e 100644 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -13,7 +13,7 @@ namespace bgfx { -# define GL_IMPORT(_optional, _proto, _func) _proto _func +# define GL_IMPORT(_optional, _proto, _func, _import) _proto _func # include "glimports.h" # undef GL_IMPORT @@ -21,6 +21,8 @@ namespace bgfx void GlContext::create(uint32_t _width, uint32_t _height) { + BX_UNUSED(_width, _height); + s_opengl = bx::dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"); BX_CHECK(NULL != s_opengl, "OpenGL dynamic library is not found!"); @@ -75,6 +77,7 @@ namespace bgfx void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) { + BX_UNUSED(_width, _height, _vsync); } void GlContext::swap() @@ -86,10 +89,10 @@ namespace bgfx void GlContext::import() { -# define GL_IMPORT(_optional, _proto, _func) \ +# define GL_IMPORT(_optional, _proto, _func, _import) \ { \ - _func = (_proto)bx::dlsym(s_opengl, #_func); \ - BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. NSGLGetProcAddress(\"%s\")", #_func); \ + _func = (_proto)bx::dlsym(s_opengl, #_import); \ + BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGL context. NSGLGetProcAddress(\"%s\")", #_import); \ } # include "glimports.h" # undef GL_IMPORT