From 846c904624a0a4b9603b0186b08ce9f1293382dd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 11 Jan 2016 04:02:50 -0500 Subject: [PATCH] HLE: Move static variable out of header It's only ever used in the implementation file. --- Source/Core/Core/HLE/HLE.cpp | 14 ++++++++------ Source/Core/Core/HLE/HLE.h | 3 --- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp index c60a32b2f7..b91e23c4fc 100644 --- a/Source/Core/Core/HLE/HLE.cpp +++ b/Source/Core/Core/HLE/HLE.cpp @@ -23,6 +23,8 @@ using namespace PowerPC; typedef void (*TPatchFunction)(); +static std::map s_original_instructions; + enum { HLE_RETURNTYPE_BLR = 0, @@ -72,7 +74,7 @@ void Patch(u32 addr, const char *hle_func_name) { if (!strcmp(OSPatches[i].m_szPatchName, hle_func_name)) { - orig_instruction[addr] = i; + s_original_instructions[addr] = i; return; } } @@ -80,7 +82,7 @@ void Patch(u32 addr, const char *hle_func_name) void PatchFunctions() { - orig_instruction.clear(); + s_original_instructions.clear(); for (u32 i = 0; i < sizeof(OSPatches) / sizeof(SPatch); i++) { Symbol *symbol = g_symbolDB.GetSymbolFromName(OSPatches[i].m_szPatchName); @@ -88,7 +90,7 @@ void PatchFunctions() { for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4) { - orig_instruction[addr] = i; + s_original_instructions[addr] = i; } INFO_LOG(OSHLE, "Patching %s %08x", OSPatches[i].m_szPatchName, symbol->address); } @@ -127,8 +129,8 @@ void Execute(u32 _CurrentPC, u32 _Instruction) u32 GetFunctionIndex(u32 addr) { - std::map::const_iterator iter = orig_instruction.find(addr); - return (iter != orig_instruction.end()) ? iter->second : 0; + auto iter = s_original_instructions.find(addr); + return (iter != s_original_instructions.end()) ? iter->second : 0; } int GetFunctionTypeByIndex(u32 index) @@ -157,7 +159,7 @@ u32 UnPatch(const std::string& patchName) { for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4) { - orig_instruction[addr] = 0; + s_original_instructions[addr] = 0; PowerPC::ppcState.iCache.Invalidate(addr); } return symbol->address; diff --git a/Source/Core/Core/HLE/HLE.h b/Source/Core/Core/HLE/HLE.h index 67568f5208..d45d000e3e 100644 --- a/Source/Core/Core/HLE/HLE.h +++ b/Source/Core/Core/HLE/HLE.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "Common/CommonTypes.h" @@ -35,6 +34,4 @@ namespace HLE int GetFunctionFlagsByIndex(u32 index); bool IsEnabled(int flags); - - static std::map orig_instruction; }