-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Use nullptr (C++11) instead of zero (0) as the null pointer constant #10645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use nullptr (C++11) instead of zero (0) as the null pointer constant #10645
Conversation
4add252
to
a0fbff2
Compare
utACK a0fbff2c8c0621d2ef4759078b3c690f1c33748b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
a0fbff2
to
b1975c0
Compare
Rebased! |
b1975c0
to
93ebb25
Compare
…the pointer literal instead of the macro NULL 90d4d89 scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL (practicalswift) Pull request description: Since C++11 the macro `NULL` may be: * an integer literal with value zero, or * a prvalue of type `std::nullptr_t` By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf With this patch applied there are no `NULL` macro usages left in the repo: ``` $ git grep NULL -- "*.cpp" "*.h" | egrep -v '(/univalue/|/secp256k1/|/leveldb/|_NULL|NULLDUMMY|torcontrol.*NULL|NULL cert)' | wc -l 0 ``` The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR #10483 (scripted, this PR) * `0` → `nullptr` is handled in PR #10645 (manual) Tree-SHA512: 3c395d66f2ad724a8e6fed74b93634de8bfc0c0eafac94e64e5194c939499fefd6e68f047de3083ad0b4eff37df9a8a3a76349aa17d55eabbd8e0412f140a297
c5e92c4
to
f71710d
Compare
utACK f71710d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK f71710dad454f5afe431479d0aea578b36d68206. Looks good @practicalswift . Thanks for doing this!
One open question for @laanwj
src/tinyformat.h
Outdated
@@ -898,7 +898,7 @@ class FormatListN : public FormatList | |||
// Special 0-arg version - MSVC says zero-sized C array in struct is nonstandard | |||
template<> class FormatListN<0> : public FormatList | |||
{ | |||
public: FormatListN() : FormatList(0, 0) {} | |||
public: FormatListN() : FormatList(nullptr, 0) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be an argument to not making style changes to tinyformat.h
, which occasionally pulls in changes from upstream. Don't know what @laanwj's view is on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, we should generally minimize changes to tinyformat.h, and if it is just style it just adds burden on us with no clear gain.
If you get upstream to accept this it's okay with me. But I think they want to keep compatiblity with older C++.
f71710d
to
36d326e
Compare
…nter constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR #10483 (scripted) * `0` → `nullptr` is handled in PR #10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR #10483 * `0 → nullptr` was handled in the recently merged PR #10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
Cherry-picked from: - bitcoin/bitcoin#9233 - bitcoin/bitcoin#10483 - bitcoin/bitcoin#10645 - bitcoin/bitcoin#10969 - bitcoin/bitcoin#11351 Co-authored-by: fsb4000 <fsb4000@yandex.ru> Co-authored-by: practicalswift <practicalswift@users.noreply.github.com> Co-authored-by: Dan Raviv <dan@soundradix.com>
Locked memory manager Add a pool for locked memory chunks, replacing `LockedPageManager`. Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#8321 - bitcoin/bitcoin#8753 - bitcoin/bitcoin#9063 - bitcoin/bitcoin#9070 - bitcoin/bitcoin#11385 - bitcoin/bitcoin#12048 - Excludes change to benchmark. - bitcoin/bitcoin#15117 - bitcoin/bitcoin#16161 - Excludes Travis CI changes. - Includes change from bitcoin/bitcoin#13163 - bitcoin/bitcoin#15600 - bitcoin/bitcoin#18443 - Assorted small changes from: - bitcoin/bitcoin#9233 - bitcoin/bitcoin#10483 - bitcoin/bitcoin#10645 - bitcoin/bitcoin#10969 - bitcoin/bitcoin#11351 - bitcoin/bitcoin#19111 - Excludes change to `src/rpc/server.cpp` - bitcoin/bitcoin#9804 - Only the commit for `src/key.cpp` - bitcoin/bitcoin#9598
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
…ull pointer constant 36d326e Use nullptr instead of zero (0) as the null pointer constant (practicalswift) Pull request description: Use `nullptr` instead of zero (0) as the null pointer constant. The road towards `nullptr` (C++11) is split into two PRs: * `NULL` → `nullptr` is handled in PR bitcoin#10483 (scripted) * `0` → `nullptr` is handled in PR bitcoin#10645 (manual, this PR) By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`. For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter & Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
…(void*)0 bea8e9e Document the preference of nullptr over NULL or (void*)0 (practicalswift) Pull request description: Document the preference of `nullptr` over `NULL` or `(void*)0`. After this commit: ``` $ git grep "[^A-Za-z_]NULL[^A-Za-z_]" | grep -vE '(leveldb|univalue|secp256k1|torcontrol|NULL certificates|ctaes|release-notes|patches|configure.ac|developer-notes)' $ ``` Some context: * `NULL → nullptr` was handled in the recently merged PR bitcoin#10483 * `0 → nullptr` was handled in the recently merged PR bitcoin#10645 Tree-SHA512: f863096aa4eb21705910f89713ca9cc0d83c6df2147e3d3530c3e1589b96f6c68de8755dcf37d8ce99ebda3cfb69805e00eab13bf65424aaf16170e9dda3958a
Use
nullptr
instead of zero (0) as the null pointer constant.The road towards
nullptr
(C++11) is split into two PRs:NULL
→nullptr
is handled in PR scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL #10483 (scripted)0
→nullptr
is handled in PR Use nullptr (C++11) instead of zero (0) as the null pointer constant #10645 (manual, this PR)By using the C++11 keyword
nullptr
we are guaranteed a prvalue of typestd::nullptr_t
.For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter &
Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf