summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/CPMemory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/CPMemory.cpp')
-rw-r--r--Source/Core/VideoCommon/CPMemory.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/CPMemory.cpp b/Source/Core/VideoCommon/CPMemory.cpp
index 3d72a6f70b..a42ee8fc2e 100644
--- a/Source/Core/VideoCommon/CPMemory.cpp
+++ b/Source/Core/VideoCommon/CPMemory.cpp
@@ -4,6 +4,7 @@
#include "VideoCommon/CPMemory.h"
#include <cstring>
+#include <type_traits>
#include "Common/ChunkFile.h"
#include "Common/Logging/Log.h"
@@ -17,14 +18,9 @@ CPState g_preprocess_cp_state;
void CopyPreprocessCPStateFromMain()
{
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wclass-memaccess"
-#endif
- std::memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
+ static_assert(std::is_trivially_copyable_v<CPState>);
+ std::memcpy(static_cast<void*>(&g_preprocess_cp_state),
+ static_cast<const void*>(&g_main_cp_state), sizeof(CPState));
}
std::pair<std::string, std::string> GetCPRegInfo(u8 cmd, u32 value)