From 567d0204dd0406612143c140bb48e634dfbcb226 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Sep 2016 01:11:52 -0400 Subject: [PATCH] RegisterView: Get rid of explicit memsets in CRegTable's constructor Also gets rid of an unnecessary fill. This is done by just default initializing the arrays --- Source/Core/DolphinWX/Debugger/RegisterView.cpp | 9 --------- Source/Core/DolphinWX/Debugger/RegisterView.h | 14 +++++++------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.cpp b/Source/Core/DolphinWX/Debugger/RegisterView.cpp index ff5593ee83..f7145fd577 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.cpp +++ b/Source/Core/DolphinWX/Debugger/RegisterView.cpp @@ -220,17 +220,8 @@ bool TryParseGPR(wxString str, CRegTable::FormatSpecifier format, u32* value) CRegTable::CRegTable() { - m_formatRegs.fill(FormatSpecifier::Hex8); - for (auto& entry : m_formatFRegs) entry.fill(FormatSpecifier::Hex16); - - memset(m_CachedRegs, 0, sizeof(m_CachedRegs)); - memset(m_CachedSpecialRegs, 0, sizeof(m_CachedSpecialRegs)); - memset(m_CachedFRegs, 0, sizeof(m_CachedFRegs)); - memset(m_CachedRegHasChanged, 0, sizeof(m_CachedRegHasChanged)); - memset(m_CachedSpecialRegHasChanged, 0, sizeof(m_CachedSpecialRegHasChanged)); - memset(m_CachedFRegHasChanged, 0, sizeof(m_CachedFRegHasChanged)); } wxString CRegTable::FormatGPR(int reg_index) diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.h b/Source/Core/DolphinWX/Debugger/RegisterView.h index 8589cd176a..5da6c206fe 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.h +++ b/Source/Core/DolphinWX/Debugger/RegisterView.h @@ -53,13 +53,13 @@ public: private: static constexpr size_t NUM_SPECIALS = 14; - u32 m_CachedRegs[32]; - u32 m_CachedSpecialRegs[NUM_SPECIALS]; - u64 m_CachedFRegs[32][2]; - bool m_CachedRegHasChanged[32]; - bool m_CachedSpecialRegHasChanged[NUM_SPECIALS]; - bool m_CachedFRegHasChanged[32][2]; - std::array m_formatRegs; + std::array m_CachedRegs{}; + std::array m_CachedSpecialRegs{}; + std::array, 32> m_CachedFRegs{}; + std::array m_CachedRegHasChanged{}; + std::array m_CachedSpecialRegHasChanged{}; + std::array, 32> m_CachedFRegHasChanged{}; + std::array m_formatRegs{}; std::array, 32> m_formatFRegs; wxString FormatGPR(int reg_index);