From ebb64d5bf4c6a1b3e89e7addbd72ca310be7807b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 May 2021 22:14:15 -0400 Subject: core: Resolve misc cases of variable shadowing Resolves shadowing warnings that aren't in a particularly large subsection of core. Brings us closer to turning -Wshadow into an error. All that remains now is for cases in the kernel (left untouched for now since a big change by bunnei is pending), and a few left over in the service code (will be tackled next). --- src/core/arm/dynarmic/arm_dynarmic_cp15.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/core/arm') diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp index caefc09f4..ebd506121 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp @@ -94,12 +94,11 @@ CallbackOrAccessOneWord DynarmicCP15::CompileGetOneWord(bool two, unsigned opc1, CallbackOrAccessTwoWords DynarmicCP15::CompileGetTwoWords(bool two, unsigned opc, CoprocReg CRm) { if (!two && opc == 0 && CRm == CoprocReg::C14) { // CNTPCT - const auto callback = static_cast( - [](Dynarmic::A32::Jit*, void* arg, u32, u32) -> u64 { - ARM_Dynarmic_32& parent = *(ARM_Dynarmic_32*)arg; - return parent.system.CoreTiming().GetClockTicks(); - }); - return Dynarmic::A32::Coprocessor::Callback{callback, (void*)&parent}; + const auto callback = [](Dynarmic::A32::Jit*, void* arg, u32, u32) -> u64 { + const auto& parent_arg = *static_cast(arg); + return parent_arg.system.CoreTiming().GetClockTicks(); + }; + return Callback{callback, &parent}; } LOG_CRITICAL(Core_ARM, "CP15: mrrc{} p15, {}, , , {}", two ? "2" : "", opc, CRm); -- cgit v1.2.3