mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-13 11:44:42 +02:00
doc: Remove ParseInt mentions in documentation
In the dev notes, remove the whole section, because:
* ParseDouble was removed in commit
fa9d72a794
* The locale-dependent atoi is already checked by
test/lint/lint-locale-dependence.py
Co-authored-by: Fabian Jahr <fjahr@protonmail.com>
This commit is contained in:
@ -1009,10 +1009,6 @@ Strings and formatting
|
|||||||
buffer overflows, and surprises with `\0` characters. Also, some C string manipulations
|
buffer overflows, and surprises with `\0` characters. Also, some C string manipulations
|
||||||
tend to act differently depending on platform, or even the user locale.
|
tend to act differently depending on platform, or even the user locale.
|
||||||
|
|
||||||
- Use `ToIntegral` from [`strencodings.h`](/src/util/strencodings.h) for number parsing. In legacy code you might also find `ParseInt*` family of functions, `ParseDouble` or `LocaleIndependentAtoi`.
|
|
||||||
|
|
||||||
- *Rationale*: These functions do overflow checking and avoid pesky locale issues.
|
|
||||||
|
|
||||||
- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers.
|
- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers.
|
||||||
|
|
||||||
- *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion.
|
- *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion.
|
||||||
|
@ -105,8 +105,7 @@ bool SplitHostPort(std::string_view in, uint16_t& portOut, std::string& hostOut)
|
|||||||
|
|
||||||
// LocaleIndependentAtoi is provided for backwards compatibility reasons.
|
// LocaleIndependentAtoi is provided for backwards compatibility reasons.
|
||||||
//
|
//
|
||||||
// New code should use ToIntegral or the ParseInt* functions
|
// New code should use ToIntegral.
|
||||||
// which provide parse error feedback.
|
|
||||||
//
|
//
|
||||||
// The goal of LocaleIndependentAtoi is to replicate the defined behaviour of
|
// The goal of LocaleIndependentAtoi is to replicate the defined behaviour of
|
||||||
// std::atoi as it behaves under the "C" locale, and remove some undefined
|
// std::atoi as it behaves under the "C" locale, and remove some undefined
|
||||||
|
Reference in New Issue
Block a user