Răsfoiți Sursa

Avoid clang/gcc warnings: -Wnontrivial-memaccess in backends. (#8295, #8129, #8135)

ocornut 8 luni în urmă
părinte
comite
0514332474

+ 1 - 1
backends/imgui_impl_dx12.h

@@ -43,7 +43,7 @@ struct ImGui_ImplDX12_InitInfo
     D3D12_GPU_DESCRIPTOR_HANDLE LegacySingleSrvGpuDescriptor;
     D3D12_GPU_DESCRIPTOR_HANDLE LegacySingleSrvGpuDescriptor;
 #endif
 #endif
 
 
-    ImGui_ImplDX12_InitInfo()   { memset(this, 0, sizeof(*this)); }
+    ImGui_ImplDX12_InitInfo()   { memset((void*)this, 0, sizeof(*this)); }
 };
 };
 
 
 // Follow "Getting Started" link and check examples/ folder to learn about using backends!
 // Follow "Getting Started" link and check examples/ folder to learn about using backends!

+ 1 - 1
backends/imgui_impl_vulkan.cpp

@@ -225,7 +225,7 @@ struct ImGui_ImplVulkan_Texture
     VkImageView                 ImageView;
     VkImageView                 ImageView;
     VkDescriptorSet             DescriptorSet;
     VkDescriptorSet             DescriptorSet;
 
 
-    ImGui_ImplVulkan_Texture() { memset(this, 0, sizeof(*this)); }
+    ImGui_ImplVulkan_Texture() { memset((void*)this, 0, sizeof(*this)); }
 };
 };
 
 
 // Vulkan data
 // Vulkan data

+ 1 - 1
misc/freetype/imgui_freetype.cpp

@@ -169,7 +169,7 @@ namespace
         const FT_Glyph_Metrics* LoadGlyph(uint32_t in_codepoint);
         const FT_Glyph_Metrics* LoadGlyph(uint32_t in_codepoint);
         const FT_Bitmap*        RenderGlyphAndGetInfo(GlyphInfo* out_glyph_info);
         const FT_Bitmap*        RenderGlyphAndGetInfo(GlyphInfo* out_glyph_info);
         void                    BlitGlyph(const FT_Bitmap* ft_bitmap, uint32_t* dst, uint32_t dst_pitch, unsigned char* multiply_table = nullptr);
         void                    BlitGlyph(const FT_Bitmap* ft_bitmap, uint32_t* dst, uint32_t dst_pitch, unsigned char* multiply_table = nullptr);
-        FreeTypeFont()          { memset(this, 0, sizeof(*this)); }
+        FreeTypeFont()          { memset((void*)this, 0, sizeof(*this)); }
         ~FreeTypeFont()         { CloseFont(); }
         ~FreeTypeFont()         { CloseFont(); }
 
 
         // [Internals]
         // [Internals]