From c6ec5de65962cb3c3edeeef76e9405096e67fd4b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Jan 2017 15:53:31 -0500 Subject: [PATCH] HW/DSP: Use member initializers with structs/unions where applicable --- Source/Core/Core/HW/DSP.cpp | 47 ++++++++++--------------------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index 7de4909c3f..f5884a0521 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -67,7 +67,7 @@ enum // UARAMCount union UARAMCount { - u32 Hex; + u32 Hex = 0; struct { u32 count : 31; @@ -78,61 +78,38 @@ union UARAMCount // Blocks are 32 bytes. union UAudioDMAControl { - u16 Hex; + u16 Hex = 0; struct { u16 NumBlocks : 15; u16 Enable : 1; }; - - UAudioDMAControl(u16 _Hex = 0) : Hex(_Hex) {} }; // AudioDMA struct AudioDMA { - u32 current_source_address; - u16 remaining_blocks_count; - u32 SourceAddress; + u32 current_source_address = 0; + u16 remaining_blocks_count = 0; + u32 SourceAddress = 0; UAudioDMAControl AudioDMAControl; - - AudioDMA() - : current_source_address(0), remaining_blocks_count(0), SourceAddress(0), AudioDMAControl(0) - { - } }; // ARAM_DMA struct ARAM_DMA { - u32 MMAddr; - u32 ARAddr; + u32 MMAddr = 0; + u32 ARAddr = 0; UARAMCount Cnt; - - ARAM_DMA() - { - MMAddr = 0; - ARAddr = 0; - Cnt.Hex = 0; - } }; // So we may abstract GC/Wii differences a little struct ARAMInfo { - bool wii_mode; // Wii EXRAM is managed in Memory:: so we need to skip statesaving, etc - u32 size; - u32 mask; - u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc... - - // Default to GC mode - ARAMInfo() - { - wii_mode = false; - size = ARAM_SIZE; - mask = ARAM_MASK; - ptr = nullptr; - } + bool wii_mode = false; // Wii EXRAM is managed in Memory:: so we need to skip statesaving, etc + u32 size = ARAM_SIZE; + u32 mask = ARAM_MASK; + u8* ptr = nullptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc... }; // STATE_TO_SAVE @@ -143,7 +120,7 @@ UDSPControl g_dspState; union ARAM_Info { - u16 Hex; + u16 Hex = 0; struct { u16 size : 6;