From 8e691d0f73384f13ae3491b60867c105cf818038 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 10 Apr 2020 15:02:55 -0400 Subject: [PATCH] Runtime/Audio: Replace bitfield unions with constructor initializers --- Runtime/Audio/CStreamAudioManager.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Runtime/Audio/CStreamAudioManager.cpp b/Runtime/Audio/CStreamAudioManager.cpp index 51ee8d788..ba6c4db21 100644 --- a/Runtime/Audio/CStreamAudioManager.cpp +++ b/Runtime/Audio/CStreamAudioManager.cpp @@ -446,14 +446,9 @@ public: private: dspadpcm_header x0_header; std::string x60_fileName; // arg1 - union { - u32 dummy = 0; - struct { - bool x70_24_unclaimed : 1; - bool x70_25_headerReadCancelled : 1; - u8 x70_26_headerReadState : 2; // 0: not read 1: reading 2: read - }; - }; + bool x70_24_unclaimed : 1; + bool x70_25_headerReadCancelled : 1; + u8 x70_26_headerReadState : 2; // 0: not read 1: reading 2: read s8 x71_companionRight = -1; s8 x72_companionLeft = -1; float x73_volume = 0.f; @@ -465,13 +460,16 @@ private: static std::array g_Streams; public: - CDSPStreamManager() { x70_24_unclaimed = true; } + CDSPStreamManager() : x70_24_unclaimed(true), x70_25_headerReadCancelled(false), x70_26_headerReadState(0) {} CDSPStreamManager(std::string_view fileName, s32 handle, float volume, bool oneshot) - : x60_fileName(fileName), x73_volume(volume), x74_oneshot(oneshot), x78_handleId(handle) { - if (!CDvdFile::FileExists(fileName)) - x70_24_unclaimed = true; - } + : x60_fileName(fileName) + , x70_24_unclaimed(!CDvdFile::FileExists(fileName)) + , x70_25_headerReadCancelled(false) + , x70_26_headerReadState(0) + , x73_volume(volume) + , x74_oneshot(oneshot) + , x78_handleId(handle) {} static s32 FindUnclaimedStreamIdx() { for (size_t i = 0; i < g_Streams.size(); ++i) {