Merge pull request #6468 from lioncash/downcast

JitInterface: Remove a downcast within InitJitCore
This commit is contained in:
Markus Wick 2018-03-19 09:00:56 +01:00 committed by GitHub
commit 22aba8c56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -46,21 +46,20 @@ void DoState(PointerWrap& p)
} }
CPUCoreBase* InitJitCore(int core) CPUCoreBase* InitJitCore(int core)
{ {
CPUCoreBase* ptr = nullptr;
switch (core) switch (core)
{ {
#if _M_X86 #if _M_X86
case PowerPC::CORE_JIT64: case PowerPC::CORE_JIT64:
ptr = new Jit64(); g_jit = new Jit64();
break; break;
#endif #endif
#if _M_ARM_64 #if _M_ARM_64
case PowerPC::CORE_JITARM64: case PowerPC::CORE_JITARM64:
ptr = new JitArm64(); g_jit = new JitArm64();
break; break;
#endif #endif
case PowerPC::CORE_CACHEDINTERPRETER: case PowerPC::CORE_CACHEDINTERPRETER:
ptr = new CachedInterpreter(); g_jit = new CachedInterpreter();
break; break;
default: default:
@ -68,9 +67,8 @@ CPUCoreBase* InitJitCore(int core)
g_jit = nullptr; g_jit = nullptr;
return nullptr; return nullptr;
} }
g_jit = static_cast<JitBase*>(ptr);
g_jit->Init(); g_jit->Init();
return ptr; return g_jit;
} }
CPUCoreBase* GetCore() CPUCoreBase* GetCore()