[Kernel] Use type constant instead of type enum when calling base constructor.

This commit is contained in:
gibbed 2019-07-29 13:53:44 -05:00
parent 0d6bfc1a6b
commit 7c7d80103e
10 changed files with 14 additions and 19 deletions

View File

@ -14,7 +14,7 @@ namespace kernel {
XEnumerator::XEnumerator(KernelState* kernel_state, size_t items_per_enumerate, XEnumerator::XEnumerator(KernelState* kernel_state, size_t items_per_enumerate,
size_t item_size) size_t item_size)
: XObject(kernel_state, kTypeEnumerator), : XObject(kernel_state, kType),
items_per_enumerate_(items_per_enumerate), items_per_enumerate_(items_per_enumerate),
item_size_(item_size) {} item_size_(item_size) {}

View File

@ -15,7 +15,7 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
XEvent::XEvent(KernelState* kernel_state) : XObject(kernel_state, kTypeEvent) {} XEvent::XEvent(KernelState* kernel_state) : XObject(kernel_state, kType) {}
XEvent::~XEvent() = default; XEvent::~XEvent() = default;

View File

@ -20,13 +20,11 @@ namespace xe {
namespace kernel { namespace kernel {
XFile::XFile(KernelState* kernel_state, vfs::File* file, bool synchronous) XFile::XFile(KernelState* kernel_state, vfs::File* file, bool synchronous)
: XObject(kernel_state, kTypeFile), : XObject(kernel_state, kType), file_(file), is_synchronous_(synchronous) {
file_(file),
is_synchronous_(synchronous) {
async_event_ = threading::Event::CreateAutoResetEvent(false); async_event_ = threading::Event::CreateAutoResetEvent(false);
} }
XFile::XFile() : XObject(kTypeFile) { XFile::XFile() : XObject(kType) {
async_event_ = threading::Event::CreateAutoResetEvent(false); async_event_ = threading::Event::CreateAutoResetEvent(false);
} }

View File

@ -13,7 +13,7 @@ namespace xe {
namespace kernel { namespace kernel {
XIOCompletion::XIOCompletion(KernelState* kernel_state) XIOCompletion::XIOCompletion(KernelState* kernel_state)
: XObject(kernel_state, kTypeIOCompletion) { : XObject(kernel_state, kType) {
notification_semaphore_ = threading::Semaphore::Create(0, kMaxNotifications); notification_semaphore_ = threading::Semaphore::Create(0, kMaxNotifications);
} }

View File

@ -19,7 +19,7 @@ namespace xe {
namespace kernel { namespace kernel {
XModule::XModule(KernelState* kernel_state, ModuleType module_type) XModule::XModule(KernelState* kernel_state, ModuleType module_type)
: XObject(kernel_state, kTypeModule), : XObject(kernel_state, kType),
module_type_(module_type), module_type_(module_type),
processor_module_(nullptr), processor_module_(nullptr),
hmodule_ptr_(0) { hmodule_ptr_(0) {

View File

@ -17,10 +17,9 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
XMutant::XMutant() : XObject(kTypeMutant) {} XMutant::XMutant() : XObject(kType) {}
XMutant::XMutant(KernelState* kernel_state) XMutant::XMutant(KernelState* kernel_state) : XObject(kernel_state, kType) {}
: XObject(kernel_state, kTypeMutant) {}
XMutant::~XMutant() = default; XMutant::~XMutant() = default;

View File

@ -16,7 +16,7 @@ namespace xe {
namespace kernel { namespace kernel {
XNotifyListener::XNotifyListener(KernelState* kernel_state) XNotifyListener::XNotifyListener(KernelState* kernel_state)
: XObject(kernel_state, kTypeNotifyListener) {} : XObject(kernel_state, kType) {}
XNotifyListener::~XNotifyListener() {} XNotifyListener::~XNotifyListener() {}

View File

@ -31,12 +31,10 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
XSocket::XSocket(KernelState* kernel_state) XSocket::XSocket(KernelState* kernel_state) : XObject(kernel_state, kType) {}
: XObject(kernel_state, XObject::kTypeSocket) {}
XSocket::XSocket(KernelState* kernel_state, uint64_t native_handle) XSocket::XSocket(KernelState* kernel_state, uint64_t native_handle)
: XObject(kernel_state, XObject::kTypeSocket), : XObject(kernel_state, kType), native_handle_(native_handle) {}
native_handle_(native_handle) {}
XSocket::~XSocket() { Close(); } XSocket::~XSocket() { Close(); }

View File

@ -49,13 +49,13 @@ using xe::cpu::ppc::PPCOpcode;
uint32_t next_xthread_id_ = 0; uint32_t next_xthread_id_ = 0;
XThread::XThread(KernelState* kernel_state) 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, XThread::XThread(KernelState* kernel_state, uint32_t stack_size,
uint32_t xapi_thread_startup, uint32_t start_address, uint32_t xapi_thread_startup, uint32_t start_address,
uint32_t start_context, uint32_t creation_flags, uint32_t start_context, uint32_t creation_flags,
bool guest_thread, bool main_thread) bool guest_thread, bool main_thread)
: XObject(kernel_state, kTypeThread), : XObject(kernel_state, kType),
thread_id_(++next_xthread_id_), thread_id_(++next_xthread_id_),
guest_thread_(guest_thread), guest_thread_(guest_thread),
main_thread_(main_thread), main_thread_(main_thread),

View File

@ -17,7 +17,7 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
XTimer::XTimer(KernelState* kernel_state) : XObject(kernel_state, kTypeTimer) {} XTimer::XTimer(KernelState* kernel_state) : XObject(kernel_state, kType) {}
XTimer::~XTimer() = default; XTimer::~XTimer() = default;