From e291e8f1a7cf98d14a9390b112d08d74586776c8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 20 Dec 2016 22:43:02 -0500 Subject: [PATCH] JitRegCache: Convert #define macro into a typed constant --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/Core/PowerPC/Jit64/JitRegCache.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 53a0c49998..0c10f85c02 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -950,7 +950,7 @@ BitSet8 Jit64::ComputeStaticGQRs(const PPCAnalyst::CodeBlock& cb) const BitSet32 Jit64::CallerSavedRegistersInUse() const { BitSet32 result; - for (int i = 0; i < NUMXREGS; i++) + for (size_t i = 0; i < RegCache::NUM_XREGS; i++) { if (!gpr.IsFreeX(i)) result[i] = true; diff --git a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h index 6fa704b1d8..112d248e96 100644 --- a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h +++ b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h @@ -31,11 +31,11 @@ struct X64CachedReg bool locked; }; -#define NUMXREGS 16 - class RegCache { public: + static constexpr size_t NUM_XREGS = 16; + RegCache(); virtual ~RegCache() = default; @@ -129,6 +129,6 @@ protected: float ScoreRegister(Gen::X64Reg xreg); std::array regs; - std::array xregs; + std::array xregs; Gen::XEmitter* emit; };