diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-15 10:46:15 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2018-06-18 12:27:01 +0000 |
| commit | f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch) | |
| tree | 7c6044fd3a17a2665841959dac9b3b2110b27924 /src/inkgc | |
| parent | Run clang-tidy’s modernize-use-override pass. (diff) | |
| download | inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip | |
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as
a pointer.
Diffstat (limited to 'src/inkgc')
| -rw-r--r-- | src/inkgc/gc-alloc.h | 2 | ||||
| -rw-r--r-- | src/inkgc/gc-core.h | 18 | ||||
| -rw-r--r-- | src/inkgc/gc-soft-ptr.h | 2 | ||||
| -rw-r--r-- | src/inkgc/gc.cpp | 12 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/inkgc/gc-alloc.h b/src/inkgc/gc-alloc.h index a92f38d7a..7a48bfa43 100644 --- a/src/inkgc/gc-alloc.h +++ b/src/inkgc/gc-alloc.h @@ -47,7 +47,7 @@ public: return std::numeric_limits<std::size_t>::max() / sizeof(T); } - pointer allocate(size_type count, void const * =NULL) { + pointer allocate(size_type count, void const * =nullptr) { return static_cast<pointer>(::operator new(count * sizeof(T), SCANNED, collect)); } diff --git a/src/inkgc/gc-core.h b/src/inkgc/gc-core.h index 407c857fb..e5f8cb772 100644 --- a/src/inkgc/gc-core.h +++ b/src/inkgc/gc-core.h @@ -131,8 +131,8 @@ void request_early_collection(); inline void *operator new(std::size_t size, Inkscape::GC::ScanPolicy scan, Inkscape::GC::CollectionPolicy collect, - Inkscape::GC::CleanupFunc cleanup=NULL, - void *data=NULL) + Inkscape::GC::CleanupFunc cleanup=nullptr, + void *data=nullptr) { using namespace Inkscape::GC; @@ -154,15 +154,15 @@ inline void *operator new(std::size_t size, throw std::bad_alloc(); } if (cleanup) { - Core::register_finalizer_ignore_self(mem, cleanup, data, NULL, NULL); + Core::register_finalizer_ignore_self(mem, cleanup, data, nullptr, nullptr); } return mem; } inline void *operator new(std::size_t size, Inkscape::GC::ScanPolicy scan, - Inkscape::GC::CleanupFunc cleanup=NULL, - void *data=NULL) + Inkscape::GC::CleanupFunc cleanup=nullptr, + void *data=nullptr) { return operator new(size, scan, Inkscape::GC::AUTO, cleanup, data); } @@ -170,16 +170,16 @@ inline void *operator new(std::size_t size, inline void *operator new[](std::size_t size, Inkscape::GC::ScanPolicy scan, Inkscape::GC::CollectionPolicy collect, - Inkscape::GC::CleanupFunc cleanup=NULL, - void *data=NULL) + Inkscape::GC::CleanupFunc cleanup=nullptr, + void *data=nullptr) { return operator new(size, scan, collect, cleanup, data); } inline void *operator new[](std::size_t size, Inkscape::GC::ScanPolicy scan, - Inkscape::GC::CleanupFunc cleanup=NULL, - void *data=NULL) + Inkscape::GC::CleanupFunc cleanup=nullptr, + void *data=nullptr) { return operator new[](size, scan, Inkscape::GC::AUTO, cleanup, data); } diff --git a/src/inkgc/gc-soft-ptr.h b/src/inkgc/gc-soft-ptr.h index 45a3ddcf7..9d71f389c 100644 --- a/src/inkgc/gc-soft-ptr.h +++ b/src/inkgc/gc-soft-ptr.h @@ -26,7 +26,7 @@ namespace GC { template <typename T> class soft_ptr { public: - soft_ptr(T *pointer=NULL) : _pointer(pointer) { + soft_ptr(T *pointer=nullptr) : _pointer(pointer) { _register(); } diff --git a/src/inkgc/gc.cpp b/src/inkgc/gc.cpp index b1bd07af6..d44647066 100644 --- a/src/inkgc/gc.cpp +++ b/src/inkgc/gc.cpp @@ -81,16 +81,16 @@ int debug_general_register_disappearing_link(void **p_ptr, void const *base) { void dummy_do_init() {} -void *dummy_base(void *) { return NULL; } +void *dummy_base(void *) { return nullptr; } void dummy_register_finalizer(void *, CleanupFunc, void *, CleanupFunc *old_func, void **old_data) { if (old_func) { - *old_func = NULL; + *old_func = nullptr; } if (old_data) { - *old_data = NULL; + *old_data = nullptr; } } @@ -196,12 +196,12 @@ void die_because_not_initialized() { void *stub_malloc(std::size_t) { die_because_not_initialized(); - return NULL; + return nullptr; } void *stub_base(void *) { die_because_not_initialized(); - return NULL; + return nullptr; } void stub_register_finalizer_ignore_self(void *, CleanupFunc, void *, @@ -249,7 +249,7 @@ void stub_free(void *) { } Ops Core::_ops = { - NULL, + nullptr, &stub_malloc, &stub_malloc, &stub_malloc, |
