From 1a8167867b136ae62463b26a871628526bff17b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 10:15:48 +0200 Subject: 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 --- core/os/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/os') 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 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; -- cgit v1.2.3