mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Resolve [-Wclass-memaccess]
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -153,14 +154,8 @@ NativeVertexFormat* GetUberVertexFormat(const PortableVertexDeclaration& decl)
|
||||
// The padding in the structs can cause the memcmp() in the map to create duplicates.
|
||||
// Avoid this by initializing the padding to zero.
|
||||
PortableVertexDeclaration new_decl;
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
std::memset(&new_decl, 0, sizeof(new_decl));
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
static_assert(std::is_trivially_copyable_v<PortableVertexDeclaration>);
|
||||
std::memset(static_cast<void*>(&new_decl), 0, sizeof(new_decl));
|
||||
new_decl.stride = decl.stride;
|
||||
|
||||
auto MakeDummyAttribute = [](AttributeFormat& attr, ComponentFormat type, int components,
|
||||
|
Reference in New Issue
Block a user