Misc: tweaks + fix warnings on backends withtout -wno-memaccess (#4995, #5104)

This commit is contained in:
ocornut
2022-03-13 13:15:32 +07:00
parent 0cff5ac5a1
commit fd06ed833b
20 changed files with 23 additions and 25 deletions

View File

@ -71,7 +71,7 @@ struct ImGui_ImplAllegro5_Data
ALLEGRO_VERTEX_DECL* VertexDecl;
char* ClipboardTextData;
ImGui_ImplAllegro5_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplAllegro5_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts

View File

@ -59,7 +59,7 @@ struct ImGui_ImplDX10_Data
int VertexBufferSize;
int IndexBufferSize;
ImGui_ImplDX10_Data() { memset(this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
ImGui_ImplDX10_Data() { memset((void*)this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
};
struct VERTEX_CONSTANT_BUFFER

View File

@ -60,7 +60,7 @@ struct ImGui_ImplDX11_Data
int VertexBufferSize;
int IndexBufferSize;
ImGui_ImplDX11_Data() { memset(this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
ImGui_ImplDX11_Data() { memset((void*)this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
};
struct VERTEX_CONSTANT_BUFFER

View File

@ -71,7 +71,7 @@ struct ImGui_ImplDX12_Data
UINT numFramesInFlight;
UINT frameIndex;
ImGui_ImplDX12_Data() { memset(this, 0, sizeof(*this)); frameIndex = UINT_MAX; }
ImGui_ImplDX12_Data() { memset((void*)this, 0, sizeof(*this)); frameIndex = UINT_MAX; }
};
struct VERTEX_CONSTANT_BUFFER

View File

@ -46,7 +46,7 @@ struct ImGui_ImplDX9_Data
int VertexBufferSize;
int IndexBufferSize;
ImGui_ImplDX9_Data() { memset(this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
ImGui_ImplDX9_Data() { memset((void*)this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
};
struct CUSTOMVERTEX

View File

@ -105,7 +105,7 @@ struct ImGui_ImplGlfw_Data
GLFWcharfun PrevUserCallbackChar;
GLFWmonitorfun PrevUserCallbackMonitor;
ImGui_ImplGlfw_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplGlfw_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts

View File

@ -61,7 +61,7 @@ struct ImGui_ImplOpenGL2_Data
{
GLuint FontTexture;
ImGui_ImplOpenGL2_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplOpenGL2_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts

View File

@ -193,7 +193,7 @@ struct ImGui_ImplOpenGL3_Data
GLsizeiptr IndexBufferSize;
bool HasClipOrigin;
ImGui_ImplOpenGL3_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplOpenGL3_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts

View File

@ -87,7 +87,7 @@ struct ImGui_ImplSDL2_Data
char* ClipboardTextData;
bool MouseCanUseGlobalState;
ImGui_ImplSDL2_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplSDL2_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts

View File

@ -42,7 +42,7 @@ struct ImGui_ImplSDLRenderer_Data
{
SDL_Renderer* SDLRenderer;
SDL_Texture* FontTexture;
ImGui_ImplSDLRenderer_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplSDLRenderer_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts

View File

@ -118,7 +118,7 @@ struct ImGui_ImplVulkan_Data
ImGui_ImplVulkan_Data()
{
memset(this, 0, sizeof(*this));
memset((void*)this, 0, sizeof(*this));
BufferMemoryAlignment = 256;
}
};

View File

@ -147,7 +147,7 @@ struct ImGui_ImplVulkanH_Window
ImGui_ImplVulkanH_Window()
{
memset(this, 0, sizeof(*this));
memset((void*)this, 0, sizeof(*this));
PresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR;
ClearEnable = true;
}

View File

@ -94,7 +94,7 @@ struct ImGui_ImplWin32_Data
PFN_XInputGetState XInputGetState;
#endif
ImGui_ImplWin32_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplWin32_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts