diff options
| author | Dentomologist <dentomologist@gmail.com> | 2021-03-18 19:24:35 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2021-03-18 21:10:29 -0700 |
| commit | 1cc035eb055bb0fda386b276a00b8fc175913522 (patch) | |
| tree | d7808a2462c17a85c502d21d3ee32a6628189c90 /Source/UnitTests/VideoCommon/VertexLoaderTest.cpp | |
| parent | bc4d0b3ef8e58e1ab7a9ae6b47b228ec2d299635 (diff) | |
VertexLoaderTest: Fix memset assignment warning
Initialize and assign members of TVtxDesc and VAT structs directly
instead of using memset.
Fixes -Wclass-memaccess warning from gcc on Debian.
Diffstat (limited to 'Source/UnitTests/VideoCommon/VertexLoaderTest.cpp')
| -rw-r--r-- | Source/UnitTests/VideoCommon/VertexLoaderTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp index bb09b1608e..8582e03144 100644 --- a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp +++ b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp @@ -23,9 +23,7 @@ TEST(VertexLoaderUID, UniqueEnough) std::unordered_set<VertexLoaderUID> uids; TVtxDesc vtx_desc; - memset(&vtx_desc, 0, sizeof(vtx_desc)); VAT vat; - memset(&vat, 0, sizeof(vat)); uids.insert(VertexLoaderUID(vtx_desc, vat)); vtx_desc.SetLegacyHex(0xFEDCBA9876543210ull); @@ -50,8 +48,12 @@ protected: memset(input_memory, 0, sizeof(input_memory)); memset(output_memory, 0xFF, sizeof(input_memory)); - memset(&m_vtx_desc, 0, sizeof(m_vtx_desc)); - memset(&m_vtx_attr, 0, sizeof(m_vtx_attr)); + m_vtx_desc.low.Hex = 0; + m_vtx_desc.high.Hex = 0; + + m_vtx_attr.g0.Hex = 0; + m_vtx_attr.g1.Hex = 0; + m_vtx_attr.g2.Hex = 0; m_loader = nullptr; |
