summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 10:15:48 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 13:45:01 +0200
commit1a8167867b136ae62463b26a871628526bff17b8 (patch)
treebe6ca573229dc092d567079c5b464f72144d895d /core/os
parent5f5f53e8eba5c9b708714de58d3cca6ceb010279 (diff)
Modernize remaining uses of 0/NULL instead of nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
Diffstat (limited to 'core/os')
-rw-r--r--core/os/memory.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/os/memory.h b/core/os/memory.h
index 0588e47289..03c6a80e89 100644
--- a/core/os/memory.h
+++ b/core/os/memory.h
@@ -142,13 +142,13 @@ template <typename T>
T *memnew_arr_template(size_t p_elements, const char *p_descr = "") {
if (p_elements == 0)
- return 0;
+ return nullptr;
/** overloading operator new[] cannot be done , because it may not return the real allocated address (it may pad the 'element count' before the actual array). Because of that, it must be done by hand. This is the
same strategy used by std::vector, and the Vector class, so it should be safe.*/
size_t len = sizeof(T) * p_elements;
uint64_t *mem = (uint64_t *)Memory::alloc_static(len, true);
- T *failptr = 0; //get rid of a warning
+ T *failptr = nullptr; //get rid of a warning
ERR_FAIL_COND_V(!mem, failptr);
*(mem - 1) = p_elements;