From eafe0056721d828636be540cddf3c1226f88f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 16 Dec 2020 15:01:20 +0100 Subject: Fix -Wclass-memaccess warnings We want to clear/memset the padding bytes, not just each member, so using assignment or {} initialization is not an option. To silence the warnings, cast the object pointer to u8* (which is not undefined behavior) to make it explicit to the compiler that we want to fill the object representation. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp') diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 20f4d116a6..2f7e92664a 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -295,8 +295,8 @@ void VideoBackendBase::DoState(PointerWrap& p) void VideoBackendBase::InitializeShared() { - memset(&g_main_cp_state, 0, sizeof(g_main_cp_state)); - memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state)); + memset(reinterpret_cast(&g_main_cp_state), 0, sizeof(g_main_cp_state)); + memset(reinterpret_cast(&g_preprocess_cp_state), 0, sizeof(g_preprocess_cp_state)); memset(texMem, 0, TMEM_SIZE); // do not initialize again for the config window -- cgit v1.2.3