mirror of
https://github.com/encounter/aurora.git
synced 2025-12-21 10:49:19 +00:00
Directory: Avoid use of unnamed struct in union
Anonymous structs have a limitation on GCC when involving non-trivial default constructors, as it's a compiler extension and not actually standard C++ to use anonymous structs. We can give the struct a concrete name, which fixes this issue.
This commit is contained in:
@@ -8,14 +8,15 @@ namespace kabufuda {
|
||||
class Directory {
|
||||
friend class Card;
|
||||
#pragma pack(push, 4)
|
||||
struct Data {
|
||||
std::array<File, MaxFiles> m_files;
|
||||
std::array<uint8_t, 0x3a> padding;
|
||||
uint16_t m_updateCounter;
|
||||
uint16_t m_checksum;
|
||||
uint16_t m_checksumInv;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
std::array<File, MaxFiles> m_files;
|
||||
std::array<uint8_t, 0x3a> padding;
|
||||
uint16_t m_updateCounter;
|
||||
uint16_t m_checksum;
|
||||
uint16_t m_checksumInv;
|
||||
};
|
||||
Data data;
|
||||
std::array<uint8_t, BlockSize> raw;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -42,6 +42,8 @@ union SRAMFlags {
|
||||
};
|
||||
|
||||
union SRAM {
|
||||
using FlashID = std::array<std::array<uint8_t, 12>, 2>;
|
||||
|
||||
std::array<uint8_t, 64> p_SRAM;
|
||||
struct // Stored configuration value from the system SRAM area
|
||||
{
|
||||
@@ -56,7 +58,6 @@ union SRAM {
|
||||
SRAMFlags flags; // Device and operations flag
|
||||
|
||||
// Stored configuration value from the extended SRAM area
|
||||
using FlashID = std::array<std::array<uint8_t, 12>, 2>;
|
||||
FlashID flash_id; // flash_id[2][12] 96bit memorycard unlock flash ID
|
||||
uint32_t wirelessKbd_id; // Device ID of last connected wireless keyboard
|
||||
std::array<uint16_t, 4> wirelessPad_id; // 16-bit device ID of last connected pad.
|
||||
|
||||
Reference in New Issue
Block a user