Skip to content

Commit fad55e7

Browse files
author
MarcoFalke
committed
doc: Fixup ToIntegral docs
1 parent 9275869 commit fad55e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/util/strencodings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void SplitHostPort(std::string in, uint16_t& portOut, std::string& hostOut);
7272

7373
// LocaleIndependentAtoi is provided for backwards compatibility reasons.
7474
//
75-
// New code should use the ParseInt64/ParseUInt64/ParseInt32/ParseUInt32 functions
75+
// New code should use ToIntegral or the ParseInt* functions
7676
// which provide parse error feedback.
7777
//
7878
// The goal of LocaleIndependentAtoi is to replicate the exact defined behaviour
@@ -125,7 +125,7 @@ constexpr inline bool IsSpace(char c) noexcept {
125125
/**
126126
* Convert string to integral type T. Leading whitespace, a leading +, or any
127127
* trailing character fail the parsing. The required format expressed as regex
128-
* is `-?[0-9]+`.
128+
* is `-?[0-9]+`. The minus sign is only permitted for signed integer types.
129129
*
130130
* @returns std::nullopt if the entire string could not be parsed, or if the
131131
* parsed value is not in the range representable by the type T.

test/lint/lint-locale-dependence.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export LC_ALL=C
3838
# https://stackoverflow.com/a/34878283 for more details.
3939

4040
# TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent stoul/strtol with locale
41-
# independent ToIntegral<T>(...).
41+
# independent ToIntegral<T>(...) or the ParseInt*() functions.
4242
# TODO: Reduce KNOWN_VIOLATIONS by replacing uses of locale dependent snprintf with strprintf.
4343
KNOWN_VIOLATIONS=(
4444
"src/bitcoin-tx.cpp.*stoul"

0 commit comments

Comments
 (0)