summaryrefslogtreecommitdiff
path: root/core/os/memory.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-02 14:52:36 +0200
committerGitHub <noreply@github.com>2020-04-02 14:52:36 +0200
commit058a0afdeca83145d58a95c426dd01216c397ea9 (patch)
treebe0cd59e5a90926e9d653fed9f3b1b77e735ca2f /core/os/memory.cpp
parent5f11e1557156617366d2c316a97716172103980d (diff)
parent95a1400a2ac9de1a29fa305f45b928ce8e3044bd (diff)
Merge pull request #37338 from lupoDharkael/nullprt
Replace NULL with nullptr
Diffstat (limited to 'core/os/memory.cpp')
-rw-r--r--core/os/memory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/os/memory.cpp b/core/os/memory.cpp
index 39d3fce910..d921c10ad4 100644
--- a/core/os/memory.cpp
+++ b/core/os/memory.cpp
@@ -81,7 +81,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
void *mem = malloc(p_bytes + (prepad ? PAD_ALIGN : 0));
- ERR_FAIL_COND_V(!mem, NULL);
+ ERR_FAIL_COND_V(!mem, nullptr);
atomic_increment(&alloc_count);
@@ -103,7 +103,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
- if (p_memory == NULL) {
+ if (p_memory == nullptr) {
return alloc_static(p_bytes, p_pad_align);
}
@@ -130,12 +130,12 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
if (p_bytes == 0) {
free(mem);
- return NULL;
+ return nullptr;
} else {
*s = p_bytes;
mem = (uint8_t *)realloc(mem, p_bytes + PAD_ALIGN);
- ERR_FAIL_COND_V(!mem, NULL);
+ ERR_FAIL_COND_V(!mem, nullptr);
s = (uint64_t *)mem;
@@ -147,7 +147,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
mem = (uint8_t *)realloc(mem, p_bytes);
- ERR_FAIL_COND_V(mem == NULL && p_bytes > 0, NULL);
+ ERR_FAIL_COND_V(mem == nullptr && p_bytes > 0, nullptr);
return mem;
}
@@ -155,7 +155,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
void Memory::free_static(void *p_ptr, bool p_pad_align) {
- ERR_FAIL_COND(p_ptr == NULL);
+ ERR_FAIL_COND(p_ptr == nullptr);
uint8_t *mem = (uint8_t *)p_ptr;