diff --git a/src/xenia/kernel/kernel_state.cc b/src/xenia/kernel/kernel_state.cc index a3544b4ad..5435e45c0 100644 --- a/src/xenia/kernel/kernel_state.cc +++ b/src/xenia/kernel/kernel_state.cc @@ -123,7 +123,7 @@ uint32_t KernelState::title_id() const { xex2_opt_execution_info* exec_info = 0; executable_module_->GetOptHeader(XEX_HEADER_EXECUTION_INFO, - (void**)&exec_info); + &exec_info); if (exec_info) { return exec_info->title_id; @@ -202,7 +202,7 @@ void KernelState::SetExecutableModule(object_ref module) { } xex2_opt_tls_info* tls_header = nullptr; - executable_module_->GetOptHeader(XEX_HEADER_TLS_INFO, (void**)&tls_header); + executable_module_->GetOptHeader(XEX_HEADER_TLS_INFO, &tls_header); if (tls_header) { auto pib = memory_->TranslateVirtual( process_info_block_address_); diff --git a/src/xenia/kernel/objects/xthread.cc b/src/xenia/kernel/objects/xthread.cc index 471ba3c6b..8330a4244 100644 --- a/src/xenia/kernel/objects/xthread.cc +++ b/src/xenia/kernel/objects/xthread.cc @@ -166,7 +166,7 @@ X_STATUS XThread::Create() { // Games will specify a certain number of 4b slots that each thread will get. xex2_opt_tls_info* tls_header = nullptr; if (module) { - module->GetOptHeader(XEX_HEADER_TLS_INFO, (void**)&tls_header); + module->GetOptHeader(XEX_HEADER_TLS_INFO, &tls_header); } const uint32_t kDefaultTlsSlotCount = 32; diff --git a/src/xenia/kernel/objects/xuser_module.h b/src/xenia/kernel/objects/xuser_module.h index 36df80282..e8896fede 100644 --- a/src/xenia/kernel/objects/xuser_module.h +++ b/src/xenia/kernel/objects/xuser_module.h @@ -47,6 +47,12 @@ class XUserModule : public XModule { // Get optional header - FOR HOST USE ONLY! X_STATUS GetOptHeader(xe_xex2_header_keys key, void** out_ptr); + // Get optional header - FOR HOST USE ONLY! + template + X_STATUS GetOptHeader(xe_xex2_header_keys key, T* out_ptr) { + return GetOptHeader(key, reinterpret_cast(out_ptr)); + } + // Get optional header that can safely be returned to guest code. X_STATUS GetOptHeader(xe_xex2_header_keys key, uint32_t* out_header_guest_ptr); diff --git a/src/xenia/kernel/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl_modules.cc index 9b1889e08..6f95ef3a1 100644 --- a/src/xenia/kernel/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl_modules.cc @@ -143,7 +143,7 @@ SHIM_CALL XexCheckExecutablePrivilege_shim(PPCContext* ppc_context, } uint32_t flags = 0; - module->GetOptHeader(XEX_HEADER_SYSTEM_FLAGS, (void **)&flags); + module->GetOptHeader(XEX_HEADER_SYSTEM_FLAGS, &flags); SHIM_SET_RETURN_32((flags & mask) > 0); }