From 7c7d80103e919099837eb7f251806055d80be3d8 Mon Sep 17 00:00:00 2001 From: gibbed Date: Mon, 29 Jul 2019 13:53:44 -0500 Subject: [PATCH] [Kernel] Use type constant instead of type enum when calling base constructor. --- src/xenia/kernel/xenumerator.cc | 2 +- src/xenia/kernel/xevent.cc | 2 +- src/xenia/kernel/xfile.cc | 6 ++---- src/xenia/kernel/xiocompletion.cc | 2 +- src/xenia/kernel/xmodule.cc | 2 +- src/xenia/kernel/xmutant.cc | 5 ++--- src/xenia/kernel/xnotifylistener.cc | 2 +- src/xenia/kernel/xsocket.cc | 6 ++---- src/xenia/kernel/xthread.cc | 4 ++-- src/xenia/kernel/xtimer.cc | 2 +- 10 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/xenia/kernel/xenumerator.cc b/src/xenia/kernel/xenumerator.cc index f60983c97..03f324dc1 100644 --- a/src/xenia/kernel/xenumerator.cc +++ b/src/xenia/kernel/xenumerator.cc @@ -14,7 +14,7 @@ namespace kernel { XEnumerator::XEnumerator(KernelState* kernel_state, size_t items_per_enumerate, size_t item_size) - : XObject(kernel_state, kTypeEnumerator), + : XObject(kernel_state, kType), items_per_enumerate_(items_per_enumerate), item_size_(item_size) {} diff --git a/src/xenia/kernel/xevent.cc b/src/xenia/kernel/xevent.cc index 8b233fb5b..0da5358bd 100644 --- a/src/xenia/kernel/xevent.cc +++ b/src/xenia/kernel/xevent.cc @@ -15,7 +15,7 @@ namespace xe { namespace kernel { -XEvent::XEvent(KernelState* kernel_state) : XObject(kernel_state, kTypeEvent) {} +XEvent::XEvent(KernelState* kernel_state) : XObject(kernel_state, kType) {} XEvent::~XEvent() = default; diff --git a/src/xenia/kernel/xfile.cc b/src/xenia/kernel/xfile.cc index 68461edce..8a38b207a 100644 --- a/src/xenia/kernel/xfile.cc +++ b/src/xenia/kernel/xfile.cc @@ -20,13 +20,11 @@ namespace xe { namespace kernel { XFile::XFile(KernelState* kernel_state, vfs::File* file, bool synchronous) - : XObject(kernel_state, kTypeFile), - file_(file), - is_synchronous_(synchronous) { + : XObject(kernel_state, kType), file_(file), is_synchronous_(synchronous) { async_event_ = threading::Event::CreateAutoResetEvent(false); } -XFile::XFile() : XObject(kTypeFile) { +XFile::XFile() : XObject(kType) { async_event_ = threading::Event::CreateAutoResetEvent(false); } diff --git a/src/xenia/kernel/xiocompletion.cc b/src/xenia/kernel/xiocompletion.cc index 0ccc733ed..829163b43 100644 --- a/src/xenia/kernel/xiocompletion.cc +++ b/src/xenia/kernel/xiocompletion.cc @@ -13,7 +13,7 @@ namespace xe { namespace kernel { XIOCompletion::XIOCompletion(KernelState* kernel_state) - : XObject(kernel_state, kTypeIOCompletion) { + : XObject(kernel_state, kType) { notification_semaphore_ = threading::Semaphore::Create(0, kMaxNotifications); } diff --git a/src/xenia/kernel/xmodule.cc b/src/xenia/kernel/xmodule.cc index bde32fb7a..0d734bad4 100644 --- a/src/xenia/kernel/xmodule.cc +++ b/src/xenia/kernel/xmodule.cc @@ -19,7 +19,7 @@ namespace xe { namespace kernel { XModule::XModule(KernelState* kernel_state, ModuleType module_type) - : XObject(kernel_state, kTypeModule), + : XObject(kernel_state, kType), module_type_(module_type), processor_module_(nullptr), hmodule_ptr_(0) { diff --git a/src/xenia/kernel/xmutant.cc b/src/xenia/kernel/xmutant.cc index 0e950c32b..690ae1f11 100644 --- a/src/xenia/kernel/xmutant.cc +++ b/src/xenia/kernel/xmutant.cc @@ -17,10 +17,9 @@ namespace xe { namespace kernel { -XMutant::XMutant() : XObject(kTypeMutant) {} +XMutant::XMutant() : XObject(kType) {} -XMutant::XMutant(KernelState* kernel_state) - : XObject(kernel_state, kTypeMutant) {} +XMutant::XMutant(KernelState* kernel_state) : XObject(kernel_state, kType) {} XMutant::~XMutant() = default; diff --git a/src/xenia/kernel/xnotifylistener.cc b/src/xenia/kernel/xnotifylistener.cc index e1127433c..747f53574 100644 --- a/src/xenia/kernel/xnotifylistener.cc +++ b/src/xenia/kernel/xnotifylistener.cc @@ -16,7 +16,7 @@ namespace xe { namespace kernel { XNotifyListener::XNotifyListener(KernelState* kernel_state) - : XObject(kernel_state, kTypeNotifyListener) {} + : XObject(kernel_state, kType) {} XNotifyListener::~XNotifyListener() {} diff --git a/src/xenia/kernel/xsocket.cc b/src/xenia/kernel/xsocket.cc index 571e13123..ad35ff69a 100644 --- a/src/xenia/kernel/xsocket.cc +++ b/src/xenia/kernel/xsocket.cc @@ -31,12 +31,10 @@ namespace xe { namespace kernel { -XSocket::XSocket(KernelState* kernel_state) - : XObject(kernel_state, XObject::kTypeSocket) {} +XSocket::XSocket(KernelState* kernel_state) : XObject(kernel_state, kType) {} XSocket::XSocket(KernelState* kernel_state, uint64_t native_handle) - : XObject(kernel_state, XObject::kTypeSocket), - native_handle_(native_handle) {} + : XObject(kernel_state, kType), native_handle_(native_handle) {} XSocket::~XSocket() { Close(); } diff --git a/src/xenia/kernel/xthread.cc b/src/xenia/kernel/xthread.cc index 137c15d02..97bc8d4ad 100644 --- a/src/xenia/kernel/xthread.cc +++ b/src/xenia/kernel/xthread.cc @@ -49,13 +49,13 @@ using xe::cpu::ppc::PPCOpcode; uint32_t next_xthread_id_ = 0; XThread::XThread(KernelState* kernel_state) - : XObject(kernel_state, kTypeThread), guest_thread_(true) {} + : XObject(kernel_state, kType), guest_thread_(true) {} XThread::XThread(KernelState* kernel_state, uint32_t stack_size, uint32_t xapi_thread_startup, uint32_t start_address, uint32_t start_context, uint32_t creation_flags, bool guest_thread, bool main_thread) - : XObject(kernel_state, kTypeThread), + : XObject(kernel_state, kType), thread_id_(++next_xthread_id_), guest_thread_(guest_thread), main_thread_(main_thread), diff --git a/src/xenia/kernel/xtimer.cc b/src/xenia/kernel/xtimer.cc index bda94f3c6..b44e80a50 100644 --- a/src/xenia/kernel/xtimer.cc +++ b/src/xenia/kernel/xtimer.cc @@ -17,7 +17,7 @@ namespace xe { namespace kernel { -XTimer::XTimer(KernelState* kernel_state) : XObject(kernel_state, kTypeTimer) {} +XTimer::XTimer(KernelState* kernel_state) : XObject(kernel_state, kType) {} XTimer::~XTimer() = default;