diff options
| author | Minty-Meeo <45425365+Minty-Meeo@users.noreply.github.com> | 2023-03-23 12:49:09 -0500 |
|---|---|---|
| committer | get <45425365+Minty-Meeo@users.noreply.github.com> | 2023-04-12 03:59:57 -0500 |
| commit | 678c93589a642a72d8f2122fca681b886e442ccd (patch) | |
| tree | ccb1c48778b01c2df616bbdc895c452424fd3619 /Source/Core/VideoCommon/VertexLoaderManager.cpp | |
| parent | 2bb619a508ecb3df24be709345fae7ef0dbd434d (diff) | |
Resolve [-Wclass-memaccess]
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index 0236201001..fb24803f1c 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -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, |
