diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -984,7 +985,7 @@ result.pushKV("coinbasetxn", coinbasetxn); result.pushKV("coinbasevalue", int64_t(coinbasevalue / SATOSHI)); result.pushKV("longpollid", ::ChainActive().Tip()->GetBlockHash().GetHex() + - i64tostr(nTransactionsUpdatedLast)); + ToString(nTransactionsUpdatedLast)); result.pushKV("target", hashTarget.GetHex()); result.pushKV("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1); result.pushKV("mutable", aMutable); diff --git a/src/sync.cpp b/src/sync.cpp --- a/src/sync.cpp +++ b/src/sync.cpp @@ -47,8 +47,7 @@ std::string ToString() const { return strprintf("%s %s:%s%s (in thread %s)", mutexName, sourceFile, - itostr(sourceLine), (fTry ? " (TRY)" : ""), - m_thread_name); + sourceLine, (fTry ? " (TRY)" : ""), m_thread_name); } std::string Name() const { return mutexName; } diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp --- a/src/test/fuzz/integer.cpp +++ b/src/test/fuzz/integer.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -91,11 +92,10 @@ // ()GetVirtualTransactionSize(i64, i64, u32); (void)HexDigit(ch); (void)MoneyRange(i64 * SATOSHI); - (void)i64tostr(i64); + (void)ToString(i64); (void)IsDigit(ch); (void)IsSpace(ch); (void)IsSwitchChar(ch); - (void)itostr(i32); (void)memusage::DynamicUsage(ch); (void)memusage::DynamicUsage(i16); (void)memusage::DynamicUsage(i32); diff --git a/src/test/fuzz/locale.cpp b/src/test/fuzz/locale.cpp --- a/src/test/fuzz/locale.cpp +++ b/src/test/fuzz/locale.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include @@ -805,10 +806,9 @@ const int64_t atoi64c_without_locale = atoi64(random_string.c_str()); const int64_t random_int64 = fuzzed_data_provider.ConsumeIntegral(); - const std::string i64tostr_without_locale = i64tostr(random_int64); + const std::string tostring_without_locale = ToString(random_int64); const int32_t random_int32 = fuzzed_data_provider.ConsumeIntegral(); - const std::string itostr_without_locale = itostr(random_int32); const std::string strprintf_int_without_locale = strprintf("%d", random_int64); const double random_double = @@ -839,10 +839,8 @@ assert(atoi64c_without_locale == atoi64c_with_locale); const int atoi_with_locale = atoi(random_string); assert(atoi_without_locale == atoi_with_locale); - const std::string i64tostr_with_locale = i64tostr(random_int64); - assert(i64tostr_without_locale == i64tostr_with_locale); - const std::string itostr_with_locale = itostr(random_int32); - assert(itostr_without_locale == itostr_with_locale); + const std::string tostring_with_locale = ToString(random_int64); + assert(tostring_without_locale == tostring_with_locale); const std::string strprintf_int_with_locale = strprintf("%d", random_int64); assert(strprintf_int_without_locale == strprintf_int_with_locale); const std::string strprintf_double_with_locale = diff --git a/src/util/strencodings.h b/src/util/strencodings.h --- a/src/util/strencodings.h +++ b/src/util/strencodings.h @@ -62,8 +62,6 @@ std::string EncodeBase32(const std::string &str); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); -std::string i64tostr(int64_t n); -std::string itostr(int n); int64_t atoi64(const char *psz); int64_t atoi64(const std::string &str); int atoi(const std::string &str); diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp --- a/src/util/strencodings.cpp +++ b/src/util/strencodings.cpp @@ -451,14 +451,6 @@ return out.str(); } -std::string i64tostr(int64_t n) { - return strprintf("%d", n); -} - -std::string itostr(int n) { - return strprintf("%d", n); -} - int64_t atoi64(const char *psz) { #ifdef _MSC_VER return _atoi64(psz); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -239,7 +240,7 @@ if (nOrderPos == -1) { return; } - mapValue["n"] = i64tostr(nOrderPos); + mapValue["n"] = ToString(nOrderPos); } struct COutputEntry {