diff options
| author | Léo Lam <leo@leolam.fr> | 2023-04-14 01:29:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 01:29:46 +0100 |
| commit | ae18aa0639bdf2d51c8bf738bd7f794d89aa22e4 (patch) | |
| tree | 1dc008a5333267aea8e48c20f5a59029b9aba27e /Source/Core/VideoCommon/CPMemory.cpp | |
| parent | 5c03b8af88e80e9502dcb0b20e17d9debf2617b3 (diff) | |
| parent | f29019180f12e8287661ebde19f0b1baed966bc9 (diff) | |
Merge pull request #11687 from Minty-Meeo/warnings
Resolve GCC/Clang Warnings
Diffstat (limited to 'Source/Core/VideoCommon/CPMemory.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/CPMemory.cpp | 12 |
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) |
