diff options
author | fanquake <fanquake@gmail.com> | 2021-05-11 08:52:06 +1000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-05-11 08:52:37 +1000 |
commit | 4a267057617a8aa6dc9793c4d711725df5338025 (patch) | |
tree | e2eded26fa28dddde5c3fa3cc9ff0f20a9cf8f04 /src | |
parent | 4bc3b16349848100e6a127c71a3a2fe7e1e57c2d (diff) | |
parent | fa4bbd306e1ca369d02eb864983fbb4d64b50ca9 (diff) | |
download | bitcoin-4a267057617a8aa6dc9793c4d711725df5338025.tar.xz |
Merge bitcoin/bitcoin#21902: refactor: Remove useless extern keyword
fa4bbd306e1ca369d02eb864983fbb4d64b50ca9 refactor: Remove useless extern keyword (MarcoFalke)
Pull request description:
It is redundant, confusing and useless.
https://en.cppreference.com/w/cpp/language/storage_duration#external_linkage
ACKs for top commit:
practicalswift:
cr ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9: patch looks correct
Talkless:
utACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9, built successfully on Debian Sid, looks OK.
jonatack:
Light code review ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9
hebasto:
ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9, I've verified that all of the remained `extern` keywords specify either (a) a variable with external linkage, or (b) a symbol with "C" language linkage.
promag:
Code review ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9.
Tree-SHA512: 1d77d661132defa52ccb2046f7a287deb3669b68835e40ab75a0d9d08fe6efeaf3bea7c0e76c754fd18bfe45972c253a39462014080d014cc5d810498784e3e4
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/util.h | 18 | ||||
-rw-r--r-- | src/test/base58_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/key_io_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/script_tests.cpp | 3 | ||||
-rw-r--r-- | src/test/sighash_tests.cpp | 2 | ||||
-rw-r--r-- | 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 0120dbcc98..d43ee33b0f 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<unsigned char> ParseHexV(const UniValue& v, std::string strName); -extern std::vector<unsigned char> 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<unsigned char> ParseHexV(const UniValue& v, std::string strName); +std::vector<unsigned char> 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<unsigned char> 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<std::pair<std::string, UniValue>>; -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 dd760fe999..a090cb340b 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 611e9f2623..8629d13840 100644 --- a/src/test/key_io_tests.cpp +++ b/src/test/key_io_tests.cpp @@ -15,7 +15,7 @@ #include <univalue.h> -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 171234f745..62fd81673d 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 2eb980e8cd..195565c1f8 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -21,7 +21,7 @@ #include <univalue.h> -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 9bbf9567f5..40c53cb2ec 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -39,7 +39,7 @@ typedef std::vector<unsigned char> valtype; // In script_tests.cpp -extern UniValue read_json(const std::string& jsondata); +UniValue read_json(const std::string& jsondata); static std::map<std::string, unsigned int> mapFlagNames = { {std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH}, |