diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2017-08-07 07:36:37 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2017-08-07 07:36:37 +0200 |
commit | 90d4d89230434493c3b1e9174abed2609ba74cf1 (patch) | |
tree | 511237508ac27f66846c0aa9405658b835c9ae43 /src/support | |
parent | a9dd11144152bf40fa797cc0b0c8857c03d3ad6a (diff) |
scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
-BEGIN VERIFY SCRIPT-
sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h
sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp
sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp
sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp
sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp
sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp
-END VERIFY SCRIPT-
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/allocators/secure.h | 2 | ||||
-rw-r--r-- | src/support/allocators/zeroafterfree.h | 2 | ||||
-rw-r--r-- | src/support/events.h | 2 | ||||
-rw-r--r-- | src/support/lockedpool.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/support/allocators/secure.h b/src/support/allocators/secure.h index 9daba86ef3..f20f424941 100644 --- a/src/support/allocators/secure.h +++ b/src/support/allocators/secure.h @@ -45,7 +45,7 @@ struct secure_allocator : public std::allocator<T> { void deallocate(T* p, std::size_t n) { - if (p != NULL) { + if (p != nullptr) { memory_cleanse(p, sizeof(T) * n); } LockedPoolManager::Instance().free(p); diff --git a/src/support/allocators/zeroafterfree.h b/src/support/allocators/zeroafterfree.h index 28a940ad1b..581d5d6318 100644 --- a/src/support/allocators/zeroafterfree.h +++ b/src/support/allocators/zeroafterfree.h @@ -36,7 +36,7 @@ struct zero_after_free_allocator : public std::allocator<T> { void deallocate(T* p, std::size_t n) { - if (p != NULL) + if (p != nullptr) memory_cleanse(p, sizeof(T) * n); std::allocator<T>::deallocate(p, n); } diff --git a/src/support/events.h b/src/support/events.h index 90690876ee..cc6d29aecd 100644 --- a/src/support/events.h +++ b/src/support/events.h @@ -47,7 +47,7 @@ inline raii_evhttp_request obtain_evhttp_request(void(*cb)(struct evhttp_request } inline raii_evhttp_connection obtain_evhttp_connection_base(struct event_base* base, std::string host, uint16_t port) { - auto result = raii_evhttp_connection(evhttp_connection_base_new(base, NULL, host.c_str(), port)); + auto result = raii_evhttp_connection(evhttp_connection_base_new(base, nullptr, host.c_str(), port)); if (!result.get()) throw std::runtime_error("create connection failed"); return result; diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp index 2df6b84a59..2ead72185f 100644 --- a/src/support/lockedpool.cpp +++ b/src/support/lockedpool.cpp @@ -28,7 +28,7 @@ #include <algorithm> -LockedPoolManager* LockedPoolManager::_instance = NULL; +LockedPoolManager* LockedPoolManager::_instance = nullptr; std::once_flag LockedPoolManager::init_flag; /*******************************************************************************/ @@ -87,7 +87,7 @@ template <class Iterator, class Pair> bool extend(Iterator it, const Pair& other void Arena::free(void *ptr) { - // Freeing the NULL pointer is OK. + // Freeing the nullptr pointer is OK. if (ptr == nullptr) { return; } |