aboutsummaryrefslogtreecommitdiff
path: root/src/util/strencodings.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2021-09-30 14:18:50 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2021-09-30 14:21:17 +0000
commit4343f114cc661cf031ec915538c11b9b030e2e15 (patch)
tree0b0cc9ec8fbea9cc65490dd2ae437478b78c3a72 /src/util/strencodings.cpp
parent2d8e0c0c3c0d3c4cee7bb52d1edf501f40c53463 (diff)
downloadbitcoin-4343f114cc661cf031ec915538c11b9b030e2e15.tar.xz
Replace use of locale dependent atoi(…) with locale-independent std::from_chars(…) (C++17)
test: Add test cases for LocaleIndependentAtoi fuzz: Assert legacy atoi(s) == LocaleIndependentAtoi<int>(s) fuzz: Assert legacy atoi64(s) == LocaleIndependentAtoi<int64_t>(s)
Diffstat (limited to 'src/util/strencodings.cpp')
-rw-r--r--src/util/strencodings.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp
index 0aa80ea0ae..88fec6740a 100644
--- a/src/util/strencodings.cpp
+++ b/src/util/strencodings.cpp
@@ -403,20 +403,6 @@ std::string FormatParagraph(const std::string& in, size_t width, size_t indent)
return out.str();
}
-int64_t atoi64(const std::string& str)
-{
-#ifdef _MSC_VER
- return _atoi64(str.c_str());
-#else
- return strtoll(str.c_str(), nullptr, 10);
-#endif
-}
-
-int atoi(const std::string& str)
-{
- return atoi(str.c_str());
-}
-
/** Upper bound for mantissa.
* 10^18-1 is the largest arbitrary decimal that will fit in a signed 64-bit integer.
* Larger integers cannot consist of arbitrary combinations of 0-9: