diff options
| author | Lioncash <mathew1800@gmail.com> | 2022-11-22 13:43:53 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2022-11-22 13:58:42 -0500 |
| commit | 8d99aae45b04f1a70cad90e6fdc7ff91aee57edc (patch) | |
| tree | 4a004b735d08ee3181a478a33facc7bb87887643 /src/core/hle/kernel/k_handle_table.h | |
| parent | 3027917f39667b627d3279957a88f99ae063bf6c (diff) | |
k_handle_table: Remove cast to void* in GetObjectForIpc
This was used to get around the KProcess class being incomplete. We can
just move this to the cpp file and eliminate the cast entirely, letting
the compiler do its work.
Diffstat (limited to 'src/core/hle/kernel/k_handle_table.h')
| -rw-r--r-- | src/core/hle/kernel/k_handle_table.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h index 65cae3b27..37a24e7d9 100644 --- a/src/core/hle/kernel/k_handle_table.h +++ b/src/core/hle/kernel/k_handle_table.h @@ -113,21 +113,7 @@ public: return this->GetObjectImpl(handle); } - KScopedAutoObject<KAutoObject> GetObjectForIpc(Handle handle, KThread* cur_thread) const { - // Handle pseudo-handles. - ASSERT(cur_thread != nullptr); - if (handle == Svc::PseudoHandle::CurrentProcess) { - auto* const cur_process = - static_cast<KAutoObject*>(static_cast<void*>(cur_thread->GetOwnerProcess())); - ASSERT(cur_process != nullptr); - return cur_process; - } - if (handle == Svc::PseudoHandle::CurrentThread) { - return static_cast<KAutoObject*>(cur_thread); - } - - return GetObjectForIpcWithoutPseudoHandle(handle); - } + KScopedAutoObject<KAutoObject> GetObjectForIpc(Handle handle, KThread* cur_thread) const; KScopedAutoObject<KAutoObject> GetObjectByIndex(Handle* out_handle, size_t index) const { KScopedDisableDispatch dd{m_kernel}; |
