From cc52558c0e9b1941899c3353c67225e880eb5b9f Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 17 Jun 2020 01:17:24 +0200 Subject: [PATCH] GCMemcard: Assert struct requirements in header. --- Source/Core/Core/HW/GCMemcard/GCMemcard.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.h b/Source/Core/Core/HW/GCMemcard/GCMemcard.h index 2d023e4a1a..7d3ca6404a 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.h +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.h @@ -166,6 +166,8 @@ struct GCMBlock void Erase(); std::array m_block; }; +static_assert(sizeof(GCMBlock) == BLOCK_SIZE); +static_assert(std::is_trivially_copyable_v); #pragma pack(push, 1) struct Header @@ -229,6 +231,7 @@ struct Header GCMemcardErrorCode CheckForErrors(u16 card_size_mbits) const; }; static_assert(sizeof(Header) == BLOCK_SIZE); +static_assert(std::is_trivially_copyable_v
); struct DEntry { @@ -306,6 +309,7 @@ struct DEntry Common::BigEndianValue m_comments_address; }; static_assert(sizeof(DEntry) == DENTRY_SIZE); +static_assert(std::is_trivially_copyable_v); struct BlockAlloc; @@ -341,6 +345,7 @@ struct Directory GCMemcardErrorCode CheckForErrorsWithBat(const BlockAlloc& bat) const; }; static_assert(sizeof(Directory) == BLOCK_SIZE); +static_assert(std::is_trivially_copyable_v); struct BlockAlloc { @@ -375,6 +380,7 @@ struct BlockAlloc GCMemcardErrorCode CheckForErrors(u16 size_mbits) const; }; static_assert(sizeof(BlockAlloc) == BLOCK_SIZE); +static_assert(std::is_trivially_copyable_v); #pragma pack(pop) class GCMemcard