jitstate: const correctness

GetReturnFromRunCodeAddress is const qualified, so this can accept a const
pointer. This also allows for making the constructor accept a const
pointer as well.
This commit is contained in:
Lioncash 2016-08-16 13:41:16 -04:00 committed by MerryMage
parent 9ed9f4c565
commit 74ee92ee38
2 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@
namespace Dynarmic { namespace Dynarmic {
namespace BackendX64 { namespace BackendX64 {
void JitState::ResetRSB(BlockOfCode* code) { void JitState::ResetRSB(const BlockOfCode* code) {
for (auto& value : rsb_codeptrs) { for (auto& value : rsb_codeptrs) {
value = u64(code->GetReturnFromRunCodeAddress()); value = u64(code->GetReturnFromRunCodeAddress());
} }

View file

@ -18,7 +18,7 @@ class BlockOfCode;
constexpr size_t SpillCount = 32; constexpr size_t SpillCount = 32;
struct JitState { struct JitState {
JitState(BlockOfCode* code) { ResetRSB(code); } explicit JitState(const BlockOfCode* code) { ResetRSB(code); }
u32 Cpsr = 0; u32 Cpsr = 0;
std::array<u32, 16> Reg{}; // Current register file. std::array<u32, 16> Reg{}; // Current register file.
@ -43,7 +43,7 @@ struct JitState {
u32 rsb_ptr = 0; u32 rsb_ptr = 0;
std::array<u64, RSBSize> rsb_location_descriptors; std::array<u64, RSBSize> rsb_location_descriptors;
std::array<u64, RSBSize> rsb_codeptrs; std::array<u64, RSBSize> rsb_codeptrs;
void ResetRSB(BlockOfCode* code); void ResetRSB(const BlockOfCode* code);
u32 FPSCR_IDC = 0; u32 FPSCR_IDC = 0;
u32 FPSCR_UFC = 0; u32 FPSCR_UFC = 0;