From 203b3ee96169ab201d38b107cfcaaa107f14ed86 Mon Sep 17 00:00:00 2001 From: Sammy Fatnassi Date: Sat, 23 Jan 2021 18:36:39 +0900 Subject: [PATCH 1/2] Fixed some compile warnings with Clang on Windows --- backends/imgui_impl_win32.cpp | 2 +- imgui.cpp | 4 +++- imgui_widgets.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backends/imgui_impl_win32.cpp b/backends/imgui_impl_win32.cpp index 4562e896938f..31c3e63d3d4d 100644 --- a/backends/imgui_impl_win32.cpp +++ b/backends/imgui_impl_win32.cpp @@ -272,7 +272,7 @@ static void ImGui_ImplWin32_UpdateGamepads() static BOOL CALLBACK ImGui_ImplWin32_UpdateMonitors_EnumFunc(HMONITOR monitor, HDC, LPRECT, LPARAM) { - MONITORINFO info = { 0 }; + MONITORINFO info = { 0, {0,0,0,0}, {0,0,0,0}, 0 }; info.cbSize = sizeof(MONITORINFO); if (!::GetMonitorInfo(monitor, &info)) return TRUE; diff --git a/imgui.cpp b/imgui.cpp index e97dce139ab7..f993d6f3eddb 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7696,6 +7696,7 @@ static void ImGui::ErrorCheckNewFrameSanityChecks() for (int monitor_n = 0; monitor_n < g.PlatformIO.Monitors.Size; monitor_n++) { ImGuiPlatformMonitor& mon = g.PlatformIO.Monitors[monitor_n]; + IM_UNUSED(mon); IM_ASSERT(mon.MainSize.x > 0.0f && mon.MainSize.y > 0.0f && "Monitor main bounds not setup properly."); IM_ASSERT(ImRect(mon.MainPos, mon.MainPos + mon.MainSize).Contains(ImRect(mon.WorkPos, mon.WorkPos + mon.WorkSize)) && "Monitor work bounds not setup properly. If you don't have work area information, just copy MainPos/MainSize into them."); IM_ASSERT(mon.DpiScale != 0.0f); @@ -13484,7 +13485,8 @@ bool ImGui::DockNodeBeginAmendTabBar(ImGuiDockNode* node) Begin(node->HostWindow->Name); PushOverrideID(node->ID); bool ret = BeginTabBarEx(node->TabBar, node->TabBar->BarRect, node->TabBar->Flags, node); - IM_ASSERT(ret); + IM_UNUSED(ret); + IM_ASSERT(ret); return true; } diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 92964bd43689..789fec770084 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -7305,7 +7305,8 @@ static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, I { if (docked_window != NULL) { - IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_DockNode); + IM_UNUSED(tab_bar); + IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_DockNode); ImGuiID id = ImHashStr(label); KeepAliveID(id); return id; From 9974bf66d6f284adcb353f3b8ec7b91b58b9f7fc Mon Sep 17 00:00:00 2001 From: Sammy Fatnassi Date: Tue, 26 Jan 2021 09:12:56 +0900 Subject: [PATCH 2/2] Removed unecessary parameters and whitespace --- backends/imgui_impl_win32.cpp | 2 +- imgui_widgets.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_win32.cpp b/backends/imgui_impl_win32.cpp index 31c3e63d3d4d..ee128843f0b2 100644 --- a/backends/imgui_impl_win32.cpp +++ b/backends/imgui_impl_win32.cpp @@ -272,7 +272,7 @@ static void ImGui_ImplWin32_UpdateGamepads() static BOOL CALLBACK ImGui_ImplWin32_UpdateMonitors_EnumFunc(HMONITOR monitor, HDC, LPRECT, LPARAM) { - MONITORINFO info = { 0, {0,0,0,0}, {0,0,0,0}, 0 }; + MONITORINFO info = {}; info.cbSize = sizeof(MONITORINFO); if (!::GetMonitorInfo(monitor, &info)) return TRUE; diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 789fec770084..950b21fa4530 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -7306,7 +7306,7 @@ static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, I if (docked_window != NULL) { IM_UNUSED(tab_bar); - IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_DockNode); + IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_DockNode); ImGuiID id = ImHashStr(label); KeepAliveID(id); return id;