Merge pull request #90 from lioncash/nullptr

Change some zero literals to nullptr
This commit is contained in:
James
2015-11-02 21:16:19 +00:00
5 changed files with 7 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ static uint8_t *
gBase = nullptr;
static void *
sFile = NULL;
sFile = nullptr;
static std::vector<MemoryView>
sViews;
@@ -188,8 +188,7 @@ valid(ppcaddr_t address)
bool
protect(ppcaddr_t address, size_t size)
{
auto result = VirtualAlloc(gBase + address, size, MEM_RESERVE, PAGE_NOACCESS);
return result != NULL;
return VirtualAlloc(gBase + address, size, MEM_RESERVE, PAGE_NOACCESS) != nullptr;
}

View File

@@ -270,7 +270,7 @@ MEMAllocFromExpHeapEx(ExpandedHeap *heap, uint32_t size, int alignment)
if (!freeBlock) {
gLog->error("MEMAllocFromExpHeapEx failed, no free block found for size {:08x} ({:08x}+{:x}+{:x})", size, originalSize, sizeof(ExpandedHeapBlock), alignment);
MEMiDumpExpHeap(heap);
return 0;
return nullptr;
}
if (direction == HeapDirection::FromBottom) {

View File

@@ -80,7 +80,7 @@ ghsExit(int code)
tracePrint(GetCurrentFiberState(), 0, 0);
// Must never return...
*static_cast<uint32_t*>(0) = 0;
*static_cast<uint32_t*>(nullptr) = 0;
}
void ghs_mtx_init(void *mtx)

View File

@@ -158,7 +158,7 @@ MEMGetBaseHeapHandle(BaseHeapType type)
if (type >= BaseHeapType::Min && type < BaseHeapType::Max) {
return gMemArenas[static_cast<size_t>(type)];
} else {
return 0;
return nullptr;
}
}
@@ -170,7 +170,7 @@ MEMSetBaseHeapHandle(BaseHeapType type, CommonHeap *heap)
gMemArenas[static_cast<size_t>(type)] = heap;
return previous;
} else {
return 0;
return nullptr;
}
}

View File

@@ -242,7 +242,7 @@ MPInitTask(MPTask *task, MPTaskFunc func, uint32_t userArg1, uint32_t userArg2)
task->result = 0;
task->coreID = CoreCount;
task->duration = 0;
task->userData = 0;
task->userData = nullptr;
}