From fa4bbd306e1ca369d02eb864983fbb4d64b50ca9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 10 May 2021 09:13:33 +0200 Subject: [PATCH] refactor: Remove useless extern keyword --- src/rpc/util.h | 18 +++++++++--------- src/test/base58_tests.cpp | 2 +- src/test/key_io_tests.cpp | 2 +- src/test/script_tests.cpp | 3 +-- src/test/sighash_tests.cpp | 2 +- src/test/transaction_tests.cpp | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/rpc/util.h b/src/rpc/util.h index 0120dbcc983..d43ee33b0f7 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -72,10 +72,10 @@ void RPCTypeCheckObj(const UniValue& o, * Utilities: convert hex-encoded Values * (throws error if not hex). */ -extern uint256 ParseHashV(const UniValue& v, std::string strName); -extern uint256 ParseHashO(const UniValue& o, std::string strKey); -extern std::vector ParseHexV(const UniValue& v, std::string strName); -extern std::vector ParseHexO(const UniValue& o, std::string strKey); +uint256 ParseHashV(const UniValue& v, std::string strName); +uint256 ParseHashO(const UniValue& o, std::string strKey); +std::vector ParseHexV(const UniValue& v, std::string strName); +std::vector ParseHexO(const UniValue& o, std::string strKey); /** * Validate and return a CAmount from a UniValue number or string. @@ -84,13 +84,13 @@ extern std::vector ParseHexO(const UniValue& o, std::string strKe * @param[in] decimals Number of significant digits (default: 8). * @returns a CAmount if the various checks pass. */ -extern CAmount AmountFromValue(const UniValue& value, int decimals = 8); +CAmount AmountFromValue(const UniValue& value, int decimals = 8); using RPCArgList = std::vector>; -extern std::string HelpExampleCli(const std::string& methodname, const std::string& args); -extern std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList& args); -extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args); -extern std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args); +std::string HelpExampleCli(const std::string& methodname, const std::string& args); +std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList& args); +std::string HelpExampleRpc(const std::string& methodname, const std::string& args); +std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args); CPubKey HexToPubKey(const std::string& hex_in); CPubKey AddrToPubKey(const FillableSigningProvider& keystore, const std::string& addr_in); diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index dd760fe9997..a090cb340be 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -16,7 +16,7 @@ using namespace std::literals; -extern UniValue read_json(const std::string& jsondata); +UniValue read_json(const std::string& jsondata); BOOST_FIXTURE_TEST_SUITE(base58_tests, BasicTestingSetup) diff --git a/src/test/key_io_tests.cpp b/src/test/key_io_tests.cpp index 611e9f26233..8629d13840c 100644 --- a/src/test/key_io_tests.cpp +++ b/src/test/key_io_tests.cpp @@ -15,7 +15,7 @@ #include -extern UniValue read_json(const std::string& jsondata); +UniValue read_json(const std::string& jsondata); BOOST_FIXTURE_TEST_SUITE(key_io_tests, BasicTestingSetup) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 171234f745f..62fd81673d9 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -39,8 +39,7 @@ static const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; unsigned int ParseScriptFlags(std::string strFlags); std::string FormatScriptFlags(unsigned int flags); -UniValue -read_json(const std::string& jsondata) +UniValue read_json(const std::string& jsondata) { UniValue v; diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 2eb980e8cde..195565c1f8b 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -21,7 +21,7 @@ #include -extern UniValue read_json(const std::string& jsondata); +UniValue read_json(const std::string& jsondata); // Old script.cpp SignatureHash function uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 9bbf9567f5c..40c53cb2ec5 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -39,7 +39,7 @@ typedef std::vector valtype; // In script_tests.cpp -extern UniValue read_json(const std::string& jsondata); +UniValue read_json(const std::string& jsondata); static std::map mapFlagNames = { {std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH},