Skip to content

Commit 16ccb90

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#21902: refactor: Remove useless extern keyword
fa4bbd3 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 fa4bbd3: patch looks correct Talkless: utACK fa4bbd3, built successfully on Debian Sid, looks OK. jonatack: Light code review ACK fa4bbd3 hebasto: ACK fa4bbd3, 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 fa4bbd3. Tree-SHA512: 1d77d661132defa52ccb2046f7a287deb3669b68835e40ab75a0d9d08fe6efeaf3bea7c0e76c754fd18bfe45972c253a39462014080d014cc5d810498784e3e4
1 parent eb7d244 commit 16ccb90

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

src/rpc/util.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,23 @@ void RPCTypeCheckObj(const UniValue& o,
7474
* Utilities: convert hex-encoded Values
7575
* (throws error if not hex).
7676
*/
77-
extern uint256 ParseHashV(const UniValue& v, std::string strName);
78-
extern uint256 ParseHashO(const UniValue& o, std::string strKey);
79-
extern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName);
80-
extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);
77+
uint256 ParseHashV(const UniValue& v, std::string strName);
78+
uint256 ParseHashO(const UniValue& o, std::string strKey);
79+
std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName);
80+
std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);
8181

82-
extern int32_t ParseInt32V(const UniValue& v, const std::string &strName);
83-
extern int64_t ParseInt64V(const UniValue& v, const std::string &strName);
84-
extern double ParseDoubleV(const UniValue& v, const std::string &strName);
85-
extern bool ParseBoolV(const UniValue& v, const std::string &strName);
82+
int32_t ParseInt32V(const UniValue& v, const std::string &strName);
83+
int64_t ParseInt64V(const UniValue& v, const std::string &strName);
84+
double ParseDoubleV(const UniValue& v, const std::string &strName);
85+
bool ParseBoolV(const UniValue& v, const std::string &strName);
8686

87-
extern CAmount AmountFromValue(const UniValue& value);
87+
CAmount AmountFromValue(const UniValue& value);
8888

8989
using RPCArgList = std::vector<std::pair<std::string, UniValue>>;
90-
extern std::string HelpExampleCli(const std::string& methodname, const std::string& args);
91-
extern std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList& args);
92-
extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args);
93-
extern std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args);
90+
std::string HelpExampleCli(const std::string& methodname, const std::string& args);
91+
std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList& args);
92+
std::string HelpExampleRpc(const std::string& methodname, const std::string& args);
93+
std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args);
9494

9595
CPubKey HexToPubKey(const std::string& hex_in);
9696
CPubKey AddrToPubKey(const FillableSigningProvider& keystore, const std::string& addr_in);

src/test/base58_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
using namespace std::literals;
1818

19-
extern UniValue read_json(const std::string& jsondata);
19+
UniValue read_json(const std::string& jsondata);
2020

2121
BOOST_AUTO_TEST_SUITE(base58_tests)
2222

src/test/key_io_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <univalue.h>
1818

19-
extern UniValue read_json(const std::string& jsondata);
19+
UniValue read_json(const std::string& jsondata);
2020

2121
BOOST_FIXTURE_TEST_SUITE(key_io_tests, BasicTestingSetup)
2222

src/test/script_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ static const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;
3636
unsigned int ParseScriptFlags(std::string strFlags);
3737
std::string FormatScriptFlags(unsigned int flags);
3838

39-
UniValue
40-
read_json(const std::string& jsondata)
39+
UniValue read_json(const std::string& jsondata)
4140
{
4241
UniValue v;
4342

src/test/sighash_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include <univalue.h>
2020

21-
extern UniValue read_json(const std::string& jsondata);
21+
UniValue read_json(const std::string& jsondata);
2222

2323
// Old script.cpp SignatureHash function
2424
uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType)

src/test/transaction_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <univalue.h>
3232

3333
// In script_tests.cpp
34-
extern UniValue read_json(const std::string& jsondata);
34+
UniValue read_json(const std::string& jsondata);
3535

3636
static std::map<std::string, unsigned int> mapFlagNames = {
3737
{std::string("NONE"), (unsigned int) SCRIPT_VERIFY_NONE},

0 commit comments

Comments
 (0)