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.
This commit is contained in:
Léo Lam committed 2020-12-16 15:37:43 +01:00
1 parent 5a5c22dc6c
commit eafe005672
5 files changed
+8 -8

No files matched your search

@@ -25,7 +25,7 @@ void SetupUnit::Init(u8 primitiveType)
OutputVertexData* SetupUnit::GetVertex()
{
memset(m_VertWritePointer, 0, sizeof(*m_VertWritePointer));
memset(reinterpret_cast<u8*>(m_VertWritePointer), 0, sizeof(*m_VertWritePointer));
return m_VertWritePointer;
}