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/ShaderCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/ShaderCache.cpp') diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp index f8b4b881f0..7383dc6595 100644 --- a/Source/Core/VideoCommon/ShaderCache.cpp +++ b/Source/Core/VideoCommon/ShaderCache.cpp @@ -188,7 +188,7 @@ template static void SerializePipelineUid(const UidType& uid, SerializedUidType& serialized_uid) { // Convert to disk format. Ensure all padding bytes are zero. - std::memset(&serialized_uid, 0, sizeof(serialized_uid)); + std::memset(reinterpret_cast(&serialized_uid), 0, sizeof(serialized_uid)); serialized_uid.vertex_decl = uid.vertex_format->GetVertexDeclaration(); serialized_uid.vs_uid = uid.vs_uid; serialized_uid.gs_uid = uid.gs_uid; -- cgit v1.2.3