From 07bfe0abbb40d7131bbf12beb9eb829dbd8fb53b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 11 Sep 2015 23:04:19 -0400 Subject: general: Replace 0 literals with nullptr where applicable --- src/common/chunk_file.h | 4 ++-- src/common/memory_util.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 8be0b1109..1e1bcff31 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -575,10 +575,10 @@ public: } template* (*TNew)(), void (*TFree)(LinkedListItem*), void (*TDo)(PointerWrap&, T*)> - void DoLinkedList(LinkedListItem*& list_start, LinkedListItem** list_end=0) + void DoLinkedList(LinkedListItem*& list_start, LinkedListItem** list_end = nullptr) { LinkedListItem* list_cur = list_start; - LinkedListItem* prev = 0; + LinkedListItem* prev = nullptr; while (true) { diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 5ef784224..b299b0f0f 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -28,9 +28,9 @@ void* AllocateExecutableMemory(size_t size, bool low) { #if defined(_WIN32) - void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); #else - static char *map_hint = 0; + static char* map_hint = nullptr; #if defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) // This OS has no flag to enforce allocation below the 4 GB boundary, // but if we hint that we want a low address it is very likely we will @@ -85,9 +85,9 @@ void* AllocateExecutableMemory(size_t size, bool low) void* AllocateMemoryPages(size_t size) { #ifdef _WIN32 - void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); + void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); #else - void* ptr = mmap(0, size, PROT_READ | PROT_WRITE, + void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (ptr == MAP_FAILED) -- cgit v1.2.3