[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,
size_t item_size)
: XObject(kernel_state, kTypeEnumerator),
: XObject(kernel_state, kType),
items_per_enumerate_(items_per_enumerate),
item_size_(item_size) {}

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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) {

View File

@ -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;

View File

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

View File

@ -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(); }

View File

@ -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),

View File

@ -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;