-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Use functions guaranteed to be locale independent (IsDigit, ToLower) in {Format,Parse}Money(...), uint256::SetHex(...), etc. Remove the use of locale dependent boost::is_space(...) #14599
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
Conversation
|
I wonder that if this linter has a |
389d144 to
336d6af
Compare
|
@ken2812221 Thanks for the quick review! Please re-review :-) The locale linter doesn't have the positive "Good job!" message (in the case a dependency in |
336d6af to
124fdab
Compare
ee2433b to
c49621b
Compare
|
Added commit:
|
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
utACK apart from the rtrim to trim change |
c49621b to
b1d84cb
Compare
|
Rebased! |
02727e0 to
2f3ae54
Compare
|
Added another commit: 2f3ae54ac6dd2fe36c2f469d3b96b2a7bfb5ce90 ("Use Please review :-) |
2f3ae54 to
7c9f790
Compare
|
@MarcoFalke @laanwj I've now excluded the trim change to make reviewing easier. Please re-review :-) |
|
utACK 7c9f790 |
|
utACK 8931a95 |
|
re-utACK 8931a95 |
|
@laanwj @ken2812221 Would you mind re-reviewing? :-) |
|
|
||
| // skip 0x | ||
| if (psz[0] == '0' && tolower(psz[1]) == 'x') | ||
| if (psz[0] == '0' && ToLower((unsigned char)psz[1]) == 'x') |
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.
It's kind of strange for a ToLower function to take an unsigned char (because std::strings index as char), but that's not introduced in this PR.
|
re-utACK 8931a95 |
…git, ToLower) in {Format,Parse}Money(...), uint256::SetHex(...), etc. Remove the use of locale dependent boost::is_space(...)
8931a95 Include util/strencodings.h which is required for IsSpace(...) (practicalswift)
7c9f790 Update KNOWN_VIOLATIONS: Remove fixed violations (practicalswift)
587924f Use IsSpace(...) instead of boost::is_space (practicalswift)
c5fd143 Use ToLower(...) instead of std::tolower (practicalswift)
e70cc89 Use IsDigit(...) instead of std::isdigit (practicalswift)
Pull request description:
* Use `ToLower(...)` instead of `std::tolower`. `std::tolower` is locale dependent.
* Use `IsDigit(...)` instead of `std::isdigit`. Some implementations (e.g. Microsoft in 1252 codepage) may classify single-byte characters other than `[0-9]` as digits.
* Update `KNOWN_VIOLATIONS`: Remove fixed violations.
* ~~Replace use of locale dependent Boost trim (`boost::trim`) with locale independent `TrimString`.~~
* Use` IsSpace(...)` instead of `boost::is_space`
Tree-SHA512: defed016136b530b723fa185afdbd00410925a748856ba3afa4cee60f61a67617e30f304f2b9991a67b5fe075d9624f051e14342aee176f45fbc024d59e1aa82
Summary: Use IsDigit(...) instead of std::isdigit Use ToLower(...) instead of std::tolower Use IsSpace(...) instead of boost::is_space Update KNOWN_VIOLATIONS: Remove fixed violations --- Backport of Core [[bitcoin/bitcoin#14599 | PR14599]] Test Plan: ninja check Reviewers: #bitcoin_abc, jasonbcox, deadalnix Reviewed By: #bitcoin_abc, jasonbcox, deadalnix Subscribers: deadalnix, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D6294
Summary: Use IsDigit(...) instead of std::isdigit Use ToLower(...) instead of std::tolower Use IsSpace(...) instead of boost::is_space Update KNOWN_VIOLATIONS: Remove fixed violations --- Backport of Core [[bitcoin/bitcoin#14599 | PR14599]] Test Plan: ninja check Reviewers: #bitcoin_abc, jasonbcox, deadalnix Reviewed By: #bitcoin_abc, jasonbcox, deadalnix Subscribers: deadalnix, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D6294
…t (IsDigit, ToLower) in {Format,Parse}Money(...), uint256::SetHex(...), etc. Remove the use of locale dependent boost::is_space(...)
8931a95 Include util/strencodings.h which is required for IsSpace(...) (practicalswift)
7c9f790 Update KNOWN_VIOLATIONS: Remove fixed violations (practicalswift)
587924f Use IsSpace(...) instead of boost::is_space (practicalswift)
c5fd143 Use ToLower(...) instead of std::tolower (practicalswift)
e70cc89 Use IsDigit(...) instead of std::isdigit (practicalswift)
Pull request description:
* Use `ToLower(...)` instead of `std::tolower`. `std::tolower` is locale dependent.
* Use `IsDigit(...)` instead of `std::isdigit`. Some implementations (e.g. Microsoft in 1252 codepage) may classify single-byte characters other than `[0-9]` as digits.
* Update `KNOWN_VIOLATIONS`: Remove fixed violations.
* ~~Replace use of locale dependent Boost trim (`boost::trim`) with locale independent `TrimString`.~~
* Use` IsSpace(...)` instead of `boost::is_space`
Tree-SHA512: defed016136b530b723fa185afdbd00410925a748856ba3afa4cee60f61a67617e30f304f2b9991a67b5fe075d9624f051e14342aee176f45fbc024d59e1aa82
Merge bitcoin bitcoin#14585, bitcoin#14599: Use functions guaranteed to be locale independent
more info: https://wiki.qt.io/New_Signal_Slot_Syntax + https://stackoverflow.com/a/16795664 + Fix broken notificator on GNOME + Do not use systray on systems which do not support systray + Global specified name for CoinJoin to be constant through the build + Qt + SmartnodeTab at GUI should work with no wallet loaded + TxFee setting is non-static now [refs](bitcoin/bitcoin#12909) + Filter out macOS process serial number. [refs](bitcoin/bitcoin#17184) + Conversion to Windows args to be utf-8 string before parsing them to the Core/Wallet. [refs](bitcoin/bitcoin#13883) + Statically specified functions which are used widely along codebase to be Guaranteed Locale Independent. [refs](bitcoin/bitcoin#14599) + macOS bug-fixes [refs](bitcoin/bitcoin#17887) , [refs](bitcoin/bitcoin#15040) + refactored Timefunctions to be Thread-Safe + added support to multiwallet + refactored locks with fixes to deadlocks + boost::program_options and boost::chrono are NOT IN USE anymore and are deleted from the codebase + ArgsManager slightly refactored + Hidden Command-Line Arguments added + IsServiceEnabled (e.g. zmq, wallet) command_line arguments visibility activation (if certain service is not enabled, all cli commands related to that service will not be shown) + Other fixes and tweaks
…t (IsDigit, ToLower) in {Format,Parse}Money(...), uint256::SetHex(...), etc. Remove the use of locale dependent boost::is_space(...)
8931a95 Include util/strencodings.h which is required for IsSpace(...) (practicalswift)
7c9f790 Update KNOWN_VIOLATIONS: Remove fixed violations (practicalswift)
587924f Use IsSpace(...) instead of boost::is_space (practicalswift)
c5fd143 Use ToLower(...) instead of std::tolower (practicalswift)
e70cc89 Use IsDigit(...) instead of std::isdigit (practicalswift)
Pull request description:
* Use `ToLower(...)` instead of `std::tolower`. `std::tolower` is locale dependent.
* Use `IsDigit(...)` instead of `std::isdigit`. Some implementations (e.g. Microsoft in 1252 codepage) may classify single-byte characters other than `[0-9]` as digits.
* Update `KNOWN_VIOLATIONS`: Remove fixed violations.
* ~~Replace use of locale dependent Boost trim (`boost::trim`) with locale independent `TrimString`.~~
* Use` IsSpace(...)` instead of `boost::is_space`
Tree-SHA512: defed016136b530b723fa185afdbd00410925a748856ba3afa4cee60f61a67617e30f304f2b9991a67b5fe075d9624f051e14342aee176f45fbc024d59e1aa82
ToLower(...)instead ofstd::tolower.std::toloweris locale dependent.IsDigit(...)instead ofstd::isdigit. Some implementations (e.g. Microsoft in 1252 codepage) may classify single-byte characters other than[0-9]as digits.KNOWN_VIOLATIONS: Remove fixed violations.Replace use of locale dependent Boost trim (boost::trim) with locale independentTrimString.IsSpace(...)instead ofboost::is_space