Backends: fixed misc zealous Clang warnings.
diff --git a/backends/imgui_impl_dx12.h b/backends/imgui_impl_dx12.h
index 4ff5104..3bb66c1 100644
--- a/backends/imgui_impl_dx12.h
+++ b/backends/imgui_impl_dx12.h
@@ -44,7 +44,7 @@
D3D12_GPU_DESCRIPTOR_HANDLE LegacySingleSrvGpuDescriptor;
#endif
- ImGui_ImplDX12_InitInfo() { memset((void*)this, 0, sizeof(*this)); }
+ ImGui_ImplDX12_InitInfo() { memset(this, 0, sizeof(*this)); }
};
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp
index 9ec9ccb..ac176a0 100644
--- a/backends/imgui_impl_glfw.cpp
+++ b/backends/imgui_impl_glfw.cpp
@@ -101,8 +101,10 @@
// Clang warnings with -Weverything
#if defined(__clang__)
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
-#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
+#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
+#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
+#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning: declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
+#pragma clang diagnostic ignored "-Wglobal-constructors" // warning: declaration requires a global destructor // similar to above, not sure what the exact difference is.
#endif
// GLFW
@@ -957,8 +959,8 @@
int display_w, display_h;
glfwGetWindowSize(window, &w, &h);
glfwGetFramebufferSize(window, &display_w, &display_h);
- float fb_scale_x = (w > 0) ? (float)display_w / w : 1.0f;
- float fb_scale_y = (h > 0) ? (float)display_h / h : 1.0f;
+ float fb_scale_x = (w > 0) ? (float)display_w / (float)w : 1.0f;
+ float fb_scale_y = (h > 0) ? (float)display_h / (float)h : 1.0f;
#if GLFW_HAS_X11_OR_WAYLAND
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData(window);
if (!bd->IsWayland)
diff --git a/backends/imgui_impl_null.cpp b/backends/imgui_impl_null.cpp
index 9503b17..6bf3ddb 100644
--- a/backends/imgui_impl_null.cpp
+++ b/backends/imgui_impl_null.cpp
@@ -17,6 +17,11 @@
#ifndef IMGUI_DISABLE
#include "imgui_impl_null.h"
+// Clang/GCC warnings with -Weverything
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
+#endif
+
IMGUI_IMPL_API bool ImGui_ImplNull_Init()
{
ImGui_ImplNullPlatform_Init();
@@ -75,7 +80,7 @@
{
}
-void ImGui_ImplNullRender_UpdateTexture(ImTextureData* tex)
+static void ImGui_ImplNullRender_UpdateTexture(ImTextureData* tex)
{
if (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantDestroy)
tex->SetStatus(ImTextureStatus_OK);
diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp
index 0a86477..8159295 100644
--- a/backends/imgui_impl_sdl3.cpp
+++ b/backends/imgui_impl_sdl3.cpp
@@ -819,8 +819,8 @@
#else
int display_w, display_h;
SDL_GetWindowSizeInPixels(window, &display_w, &display_h);
- float fb_scale_x = (w > 0) ? (float)display_w / w : 1.0f;
- float fb_scale_y = (h > 0) ? (float)display_h / h : 1.0f;
+ float fb_scale_x = (w > 0) ? (float)display_w / (float)w : 1.0f;
+ float fb_scale_y = (h > 0) ? (float)display_h / (float)h : 1.0f;
#endif
if (out_size != nullptr)