mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	HLE: Updated all uses of NULL to nullptr (to be C++11 compliant)
This commit is contained in:
		@@ -128,7 +128,7 @@ Object* ObjectPool::CreateByIDType(int type) {
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
        ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type);
 | 
			
		||||
        return NULL;
 | 
			
		||||
        return nullptr;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -122,7 +122,7 @@ bool ReleaseMutex(Mutex* mutex) {
 | 
			
		||||
Result ReleaseMutex(Handle handle) {
 | 
			
		||||
    Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle);
 | 
			
		||||
 | 
			
		||||
    _assert_msg_(KERNEL, (mutex != NULL), "ReleaseMutex tried to release a NULL mutex!");
 | 
			
		||||
    _assert_msg_(KERNEL, (mutex != nullptr), "ReleaseMutex tried to release a nullptr mutex!");
 | 
			
		||||
 | 
			
		||||
    if (!ReleaseMutex(mutex)) {
 | 
			
		||||
        return -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -223,7 +223,7 @@ void SwitchContext(Thread* t) {
 | 
			
		||||
        t->wait_type = WAITTYPE_NONE;
 | 
			
		||||
        LoadContext(t->context);
 | 
			
		||||
    } else {
 | 
			
		||||
        SetCurrentThread(NULL);
 | 
			
		||||
        SetCurrentThread(nullptr);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -238,7 +238,7 @@ Thread* NextThread() {
 | 
			
		||||
        next = g_thread_ready_queue.pop_first();
 | 
			
		||||
    }
 | 
			
		||||
    if (next == 0) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
        return nullptr;
 | 
			
		||||
    }
 | 
			
		||||
    return Kernel::g_object_pool.GetFast<Thread>(next);
 | 
			
		||||
}
 | 
			
		||||
@@ -312,8 +312,8 @@ Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 prio
 | 
			
		||||
Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s32 processor_id,
 | 
			
		||||
    u32 stack_top, int stack_size) {
 | 
			
		||||
 | 
			
		||||
    if (name == NULL) {
 | 
			
		||||
        ERROR_LOG(KERNEL, "CreateThread(): NULL name");
 | 
			
		||||
    if (name == nullptr) {
 | 
			
		||||
        ERROR_LOG(KERNEL, "CreateThread(): nullptr name");
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
    if ((u32)stack_size < 0x200) {
 | 
			
		||||
@@ -353,19 +353,19 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
 | 
			
		||||
/// Get the priority of the thread specified by handle
 | 
			
		||||
u32 GetThreadPriority(const Handle handle) {
 | 
			
		||||
    Thread* thread = g_object_pool.GetFast<Thread>(handle);
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!");
 | 
			
		||||
    return thread->current_priority;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Set the priority of the thread specified by handle
 | 
			
		||||
Result SetThreadPriority(Handle handle, s32 priority) {
 | 
			
		||||
    Thread* thread = NULL;
 | 
			
		||||
    Thread* thread = nullptr;
 | 
			
		||||
    if (!handle) {
 | 
			
		||||
        thread = GetCurrentThread(); // TODO(bunnei): Is this correct behavior?
 | 
			
		||||
    } else {
 | 
			
		||||
        thread = g_object_pool.GetFast<Thread>(handle);
 | 
			
		||||
    }
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!");
 | 
			
		||||
 | 
			
		||||
    // If priority is invalid, clamp to valid range
 | 
			
		||||
    if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user