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
This commit is contained in:
fanquake 2021-05-11 08:52:06 +10:00 committed by pasta
parent eb7d24419a
commit 16ccb90bbb
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
6 changed files with 18 additions and 19 deletions

View File

@ -74,23 +74,23 @@ 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);
extern int32_t ParseInt32V(const UniValue& v, const std::string &strName);
extern int64_t ParseInt64V(const UniValue& v, const std::string &strName);
extern double ParseDoubleV(const UniValue& v, const std::string &strName);
extern bool ParseBoolV(const UniValue& v, const std::string &strName);
int32_t ParseInt32V(const UniValue& v, const std::string &strName);
int64_t ParseInt64V(const UniValue& v, const std::string &strName);
double ParseDoubleV(const UniValue& v, const std::string &strName);
bool ParseBoolV(const UniValue& v, const std::string &strName);
extern CAmount AmountFromValue(const UniValue& value);
CAmount AmountFromValue(const UniValue& value);
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);

View File

@ -16,7 +16,7 @@
using namespace std::literals;
extern UniValue read_json(const std::string& jsondata);
UniValue read_json(const std::string& jsondata);
BOOST_AUTO_TEST_SUITE(base58_tests)

View File

@ -16,7 +16,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)

View File

@ -36,8 +36,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;

View File

@ -18,7 +18,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)

View File

@ -31,7 +31,7 @@
#include <univalue.h>
// 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("NONE"), (unsigned int) SCRIPT_VERIFY_NONE},