Cast this to (void*) in zero-clearing memset calls to fix -Wnontrivial-memcall. Amends for docking (#9247, #8295, #8129, #8135)

This commit is contained in:
ocornut
2026-02-16 16:30:21 +01:00
parent 3fb22b836b
commit 3d79353e45
3 changed files with 4 additions and 4 deletions

View File

@@ -17630,7 +17630,7 @@ struct ImGuiDockNodeSettings
ImVec2ih Pos;
ImVec2ih Size;
ImVec2ih SizeRef;
ImGuiDockNodeSettings() { memset(this, 0, sizeof(*this)); SplitAxis = ImGuiAxis_None; }
ImGuiDockNodeSettings() { memset((void*)this, 0, sizeof(*this)); SplitAxis = ImGuiAxis_None; }
};
//-----------------------------------------------------------------------------
@@ -18662,7 +18662,7 @@ struct ImGuiDockNodeTreeInfo
int CountNodesWithWindows;
//ImGuiWindowClass WindowClassForMerges;
ImGuiDockNodeTreeInfo() { memset(this, 0, sizeof(*this)); }
ImGuiDockNodeTreeInfo() { memset((void*)this, 0, sizeof(*this)); }
};
static void DockNodeFindInfo(ImGuiDockNode* node, ImGuiDockNodeTreeInfo* info)

View File

@@ -2804,7 +2804,7 @@ struct ImGuiWindowClass
bool DockingAlwaysTabBar; // Set to true to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window. // FIXME-DOCK: Move to DockNodeFlags override?
ImGuiWindowClass() { memset(this, 0, sizeof(*this)); ParentViewportId = (ImGuiID)-1; DockingAllowUnclassed = true; }
ImGuiWindowClass() { memset((void*)this, 0, sizeof(*this)); ParentViewportId = (ImGuiID)-1; DockingAllowUnclassed = true; }
};
// Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()

View File

@@ -2115,7 +2115,7 @@ struct ImGuiDockContext
ImVector<ImGuiDockRequest> Requests;
ImVector<ImGuiDockNodeSettings> NodesSettings;
bool WantFullRebuild;
ImGuiDockContext() { memset(this, 0, sizeof(*this)); }
ImGuiDockContext() { memset((void*)this, 0, sizeof(*this)); }
};
#endif // #ifdef IMGUI_HAS_DOCK