summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-12-16 15:01:20 +0100
committerLéo Lam <leo@leolam.fr>2020-12-16 15:37:43 +0100
commiteafe0056721d828636be540cddf3c1226f88f334 (patch)
treed0b5fd956ef86fb54c66a9c8d88edc78ce6f2878 /Source/Core/VideoCommon/BPStructs.cpp
parent5a5c22dc6c802585f8b7016ad4fffec0aa9604c4 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 585b072727..2376fd0840 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -43,7 +43,7 @@ static const float s_gammaLUT[] = {1.0f, 1.7f, 2.2f, 1.0f};
void BPInit()
{
- memset(&bpmem, 0, sizeof(bpmem));
+ memset(reinterpret_cast<u8*>(&bpmem), 0, sizeof(bpmem));
bpmem.bpMask = 0xFFFFFF;
}