From 038bb9b3e16107c86bbb331288ec9f416f57f2e9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 30 May 2018 09:49:25 -0400 Subject: [PATCH] AudioInterface: Use member initializers where applicable for unions Migrates more code to the initialization capabilities available since C++11 --- Source/Core/Core/HW/AudioInterface.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/AudioInterface.cpp b/Source/Core/Core/HW/AudioInterface.cpp index d39958f98a..eb6dc2a6c0 100644 --- a/Source/Core/Core/HW/AudioInterface.cpp +++ b/Source/Core/Core/HW/AudioInterface.cpp @@ -73,8 +73,8 @@ enum // AI Control Register union AICR { - AICR() { hex = 0; } - AICR(u32 _hex) { hex = _hex; } + AICR() = default; + explicit AICR(u32 hex_) : hex{hex_} {} struct { u32 PSTAT : 1; // sample counter/playback enable @@ -88,20 +88,19 @@ union AICR u32 AIDFR : 1; // AID Frequency (0=48khz 1=32khz) u32 : 25; }; - u32 hex; + u32 hex = 0; }; // AI Volume Register union AIVR { - AIVR() { hex = 0; } struct { u32 left : 8; u32 right : 8; u32 : 16; }; - u32 hex; + u32 hex = 0; }; // STATE_TO_SAVE