From 7c9bd7151248c2e03c9f4cf7f68d75df9fc5eff2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 14 Mar 2015 10:41:42 +0000 Subject: [PATCH] Examples: MSVC: increase warning level from /W3 to /W4 for OpenGL examples --- examples/directx11_example/main.cpp | 5 +---- examples/directx9_example/main.cpp | 5 +---- examples/libs/gl3w/GL/gl3w.c | 5 +++++ examples/opengl3_example/imgui_impl_glfw_gl3.cpp | 8 ++++---- examples/opengl3_example/main.cpp | 4 ++-- examples/opengl3_example/opengl3_example.vcxproj | 8 ++++---- examples/opengl_example/imgui_impl_glfw.cpp | 8 ++++---- examples/opengl_example/main.cpp | 4 ++-- examples/opengl_example/opengl_example.vcxproj | 8 ++++---- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index 3bf4924f..b051fd24 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -128,11 +128,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return DefWindowProc(hWnd, msg, wParam, lParam); } -int main(int argc, char** argv) +int main(int, char**) { - (void)argc; - (void)argv; - // Create application window WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"ImGui Example", NULL }; RegisterClassEx(&wc); diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index 07fbb7b4..9a01ba31 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -41,11 +41,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return DefWindowProc(hWnd, msg, wParam, lParam); } -int main(int argc, char** argv) +int main(int, char**) { - (void)argc; - (void)argv; - // Create application window WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"ImGui Example", NULL }; RegisterClassEx(&wc); diff --git a/examples/libs/gl3w/GL/gl3w.c b/examples/libs/gl3w/GL/gl3w.c index d66b972f..bea6e40e 100644 --- a/examples/libs/gl3w/GL/gl3w.c +++ b/examples/libs/gl3w/GL/gl3w.c @@ -1,5 +1,10 @@ #include +#ifdef _MSC_VER +#pragma warning (disable: 4055) // warning C4055: 'type cast' : from data pointer 'void *' to function pointer +#pragma warning (disable: 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression +#endif + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN 1 #include diff --git a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp index fa669d9c..07bf5a57 100644 --- a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp +++ b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp @@ -123,18 +123,18 @@ static void ImGui_ImplGlfwGL3_SetClipboardText(const char* text) glfwSetClipboardString(g_Window, text); } -void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods) +void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow*, int button, int action, int /*mods*/) { if (action == GLFW_PRESS && button >= 0 && button < 3) g_MousePressed[button] = true; } -void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset) +void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow*, double /*xoffset*/, double yoffset) { g_MouseWheel += (float)yoffset; // Use fractional mouse wheel, 1.0 unit 5 lines. } -void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) +void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow*, int key, int, int action, int mods) { ImGuiIO& io = ImGui::GetIO(); if (action == GLFW_PRESS) @@ -146,7 +146,7 @@ void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, in io.KeyAlt = (mods & GLFW_MOD_ALT) != 0; } -void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow* window, unsigned int c) +void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow*, unsigned int c) { ImGuiIO& io = ImGui::GetIO(); if (c > 0 && c < 0x10000) diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 9651970b..dc88a7c6 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -8,10 +8,10 @@ static void error_callback(int error, const char* description) { - fprintf(stderr, "Error: %s\n", description); + fprintf(stderr, "Error %d: %s\n", error, description); } -int main(int argc, char** argv) +int main(int, char**) { // Setup window glfwSetErrorCallback(error_callback); diff --git a/examples/opengl3_example/opengl3_example.vcxproj b/examples/opengl3_example/opengl3_example.vcxproj index 2a2c0b4f..202c5f73 100644 --- a/examples/opengl3_example/opengl3_example.vcxproj +++ b/examples/opengl3_example/opengl3_example.vcxproj @@ -83,7 +83,7 @@ - Level3 + Level4 Disabled $(SolutionDir)\libs\glfw\include;$(SolutionDir)\libs\gl3w;..\..;%(AdditionalIncludeDirectories) @@ -97,7 +97,7 @@ - Level3 + Level4 Disabled $(SolutionDir)\libs\glfw\include;$(SolutionDir)\libs\gl3w;..\..;%(AdditionalIncludeDirectories) @@ -111,7 +111,7 @@ - Level3 + Level4 MaxSpeed true true @@ -130,7 +130,7 @@ - Level3 + Level4 MaxSpeed true true diff --git a/examples/opengl_example/imgui_impl_glfw.cpp b/examples/opengl_example/imgui_impl_glfw.cpp index a6b9cb40..00313e45 100644 --- a/examples/opengl_example/imgui_impl_glfw.cpp +++ b/examples/opengl_example/imgui_impl_glfw.cpp @@ -103,18 +103,18 @@ static void ImGui_ImplGlfw_SetClipboardText(const char* text) glfwSetClipboardString(g_Window, text); } -void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods) +void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow*, int button, int action, int /*mods*/) { if (action == GLFW_PRESS && button >= 0 && button < 3) g_MousePressed[button] = true; } -void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset) +void ImGui_ImplGlfw_ScrollCallback(GLFWwindow*, double /*xoffset*/, double yoffset) { g_MouseWheel += (float)yoffset; // Use fractional mouse wheel, 1.0 unit 5 lines. } -void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) +void ImGui_ImplGlFw_KeyCallback(GLFWwindow*, int key, int, int action, int mods) { ImGuiIO& io = ImGui::GetIO(); if (action == GLFW_PRESS) @@ -126,7 +126,7 @@ void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int a io.KeyAlt = (mods & GLFW_MOD_ALT) != 0; } -void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c) +void ImGui_ImplGlfw_CharCallback(GLFWwindow*, unsigned int c) { ImGuiIO& io = ImGui::GetIO(); if (c > 0 && c < 0x10000) diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index c9d303d0..471f9a29 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -7,10 +7,10 @@ static void error_callback(int error, const char* description) { - fprintf(stderr, "Error: %s\n", description); + fprintf(stderr, "Error %d: %s\n", error, description); } -int main(int argc, char** argv) +int main(int, char**) { // Setup window glfwSetErrorCallback(error_callback); diff --git a/examples/opengl_example/opengl_example.vcxproj b/examples/opengl_example/opengl_example.vcxproj index f39a929f..718fedc5 100644 --- a/examples/opengl_example/opengl_example.vcxproj +++ b/examples/opengl_example/opengl_example.vcxproj @@ -83,7 +83,7 @@ - Level3 + Level4 Disabled $(SolutionDir)\libs\glfw\include;..\..;%(AdditionalIncludeDirectories) @@ -97,7 +97,7 @@ - Level3 + Level4 Disabled $(SolutionDir)\libs\glfw\include;..\..;%(AdditionalIncludeDirectories) @@ -111,7 +111,7 @@ - Level3 + Level4 MaxSpeed true true @@ -130,7 +130,7 @@ - Level3 + Level4 MaxSpeed true true