Use nullptr (C++11) instead of zero (0) as the null pointer constant#10645
Merged
maflcko merged 1 commit intobitcoin:masterfrom Aug 16, 2017
Merged
Conversation
4add252 to
a0fbff2
Compare
Contributor
|
utACK a0fbff2c8c0621d2ef4759078b3c690f1c33748b |
a0fbff2 to
b1975c0
Compare
Contributor
Author
|
Rebased! |
b1975c0 to
93ebb25
Compare
laanwj
added a commit
that referenced
this pull request
Aug 14, 2017
…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
Contributor
Author
Member
|
utACK f71710d |
dcousens
approved these changes
Aug 15, 2017
jnewbery
reviewed
Aug 15, 2017
Contributor
jnewbery
left a comment
There was a problem hiding this comment.
Tested ACK f71710dad454f5afe431479d0aea578b36d68206. Looks good @practicalswift . Thanks for doing this!
One open question for @laanwj
src/tinyformat.h
Outdated
Contributor
There was a problem hiding this comment.
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?
Member
There was a problem hiding this comment.
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
Contributor
Author
maflcko
pushed a commit
that referenced
this pull request
Aug 16, 2017
…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
laanwj
added a commit
that referenced
this pull request
Aug 18, 2017
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
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Dec 9, 2019
…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
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Dec 9, 2019
…(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
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jan 2, 2020
…(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
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jan 3, 2020
…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
str4d
added a commit
to str4d/zcash
that referenced
this pull request
Jul 31, 2020
Cherry-picked from: - bitcoin/bitcoin#9233 - bitcoin/bitcoin#10483 - bitcoin/bitcoin#10645 - bitcoin/bitcoin#10969 - bitcoin/bitcoin#11351 Co-authored-by: fsb4000 <[email protected]> Co-authored-by: practicalswift <[email protected]> Co-authored-by: Dan Raviv <[email protected]>
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Sep 29, 2020
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
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Jun 24, 2021
…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
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Jun 26, 2021
…(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
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Jan 29, 2022
…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
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Feb 22, 2022
…(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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
nullptrinstead of zero (0) as the null pointer constant.The road towards
nullptr(C++11) is split into two PRs:NULL→nullptris handled in PR scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL #10483 (scripted)0→nullptris 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
nullptrwe 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