(partial) Merge bitcoin/bitcoin#22981: doc: Fix incorrect C++ named args

fac49470ca36ff944a613f4358386bf8e0967427 doc: Fix incorrect C++ named args (MarcoFalke)

Pull request description:

  Incorrect named args are source of bugs, like #22979.

  Fix that by correcting them and adjust the format, so that clang-tidy can check it.

ACKs for top commit:
  fanquake:
    ACK fac49470ca36ff944a613f4358386bf8e0967427 - `run-clang-tidy` works for me now.

Tree-SHA512: 2694e17a1586394baf30bbc479a913e4bad361221e8470b8739caf30aacea736befc73820f3fe56f6207d9f5d969323278d43a647f58c3497e8e44cad79f8934
This commit is contained in:
fanquake 2021-11-18 07:37:28 +08:00 committed by Vijay
parent 2b71a9b030
commit 71689fe6dc
No known key found for this signature in database
GPG Key ID: 47820EC166FDF549
9 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@
static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs)
{ {
LockPoints lp; LockPoints lp;
pool.addUnchecked(CTxMemPoolEntry(tx, fee, /* time */ 0, /* height */ 1, /* spendsCoinbase */ false, /* sigOps */ 1, lp)); pool.addUnchecked(CTxMemPoolEntry(tx, fee, /*time=*/0, /*entry_height=*/1, /*spends_coinbase=*/false, /*sigops*/1, lp));
} }
static void RpcMempool(benchmark::Bench& bench) static void RpcMempool(benchmark::Bench& bench)

View File

@ -4279,7 +4279,7 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
size_t nMessageSize = msg.data.size(); size_t nMessageSize = msg.data.size();
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", msg.m_type, nMessageSize, pnode->GetId()); LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", msg.m_type, nMessageSize, pnode->GetId());
if (gArgs.GetBoolArg("-capturemessages", false)) { if (gArgs.GetBoolArg("-capturemessages", false)) {
CaptureMessage(pnode->addr, msg.m_type, msg.data, /* incoming */ false); CaptureMessage(pnode->addr, msg.m_type, msg.data, /*is_incoming=*/false);
} }
TRACE6(net, outbound_message, TRACE6(net, outbound_message,

View File

@ -5060,7 +5060,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
); );
if (gArgs.GetBoolArg("-capturemessages", false)) { if (gArgs.GetBoolArg("-capturemessages", false)) {
CaptureMessage(pfrom->addr, msg.m_type, MakeUCharSpan(msg.m_recv), /* incoming */ true); CaptureMessage(pfrom->addr, msg.m_type, MakeUCharSpan(msg.m_recv), /* is_incoming */ true);
} }
msg.SetVersion(pfrom->GetCommonVersion()); msg.SetVersion(pfrom->GetCommonVersion());

View File

@ -74,7 +74,7 @@ int main(int argc, char* argv[])
#if defined(WIN32) #if defined(WIN32)
if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal"); if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal");
#else #else
setenv("QT_QPA_PLATFORM", "minimal", /* overwrite */ 0); setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
#endif #endif
BitcoinApplication app; BitcoinApplication app;

View File

@ -1060,7 +1060,7 @@ static RPCHelpMan submitblock()
bool new_block; bool new_block;
auto sc = std::make_shared<submitblock_StateCatcher>(block.GetHash()); auto sc = std::make_shared<submitblock_StateCatcher>(block.GetHash());
RegisterSharedValidationInterface(sc); RegisterSharedValidationInterface(sc);
bool accepted = chainman.ProcessNewBlock(Params(), blockptr, /* fForceProcessing */ true, /* fNewBlock */ &new_block); bool accepted = chainman.ProcessNewBlock(Params(), blockptr, /*force_processing=*/true, /*new_block=*/&new_block);
UnregisterSharedValidationInterface(sc); UnregisterSharedValidationInterface(sc);
if (!new_block && accepted) { if (!new_block && accepted) {
return "duplicate"; return "duplicate";

View File

@ -1849,7 +1849,7 @@ static RPCHelpMan utxoupdatepsbt()
} }
} }
// We don't actually need private keys further on; hide them as a precaution. // We don't actually need private keys further on; hide them as a precaution.
HidingSigningProvider public_provider(&provider, /* nosign */ true, /* nobip32derivs */ false); HidingSigningProvider public_provider(&provider, /*hide_secret=*/true, /*hide_origin=*/false);
// Fetch previous transactions (inputs): // Fetch previous transactions (inputs):
CCoinsView viewDummy; CCoinsView viewDummy;
@ -1881,7 +1881,7 @@ static RPCHelpMan utxoupdatepsbt()
// Update script/keypath information using descriptor data. // Update script/keypath information using descriptor data.
// Note that SignPSBTInput does a lot more than just constructing ECDSA signatures // Note that SignPSBTInput does a lot more than just constructing ECDSA signatures
// we don't actually care about those here, in fact. // we don't actually care about those here, in fact.
SignPSBTInput(public_provider, psbtx, i, /* sighash_type */ SIGHASH_ALL); SignPSBTInput(public_provider, psbtx, i, /*sighash=*/ SIGHASH_ALL);
} }
// Update script/keypath information using descriptor data. // Update script/keypath information using descriptor data.

View File

@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
/*nKeyedNetGroupIn=*/1, /*nKeyedNetGroupIn=*/1,
/*nLocalHostNonceIn=*/1, /*nLocalHostNonceIn=*/1,
CAddress(), CAddress(),
/*pszDest=*/"", /*addrNameIn=*/"",
ConnectionType::INBOUND, ConnectionType::INBOUND,
/*inbound_onion=*/false}; /*inbound_onion=*/false};
nodes[1]->SetCommonVersion(PROTOCOL_VERSION); nodes[1]->SetCommonVersion(PROTOCOL_VERSION);
@ -361,7 +361,7 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
/*nKeyedNetGroupIn=*/1, /*nKeyedNetGroupIn=*/1,
/*nLocalHostNonceIn=*/1, /*nLocalHostNonceIn=*/1,
CAddress(), CAddress(),
/*pszDest=*/"", /*addrNameIn=*/"",
ConnectionType::OUTBOUND_FULL_RELAY, ConnectionType::OUTBOUND_FULL_RELAY,
/*inbound_onion=*/false}; /*inbound_onion=*/false};
nodes[2]->SetCommonVersion(PROTOCOL_VERSION); nodes[2]->SetCommonVersion(PROTOCOL_VERSION);

View File

@ -93,7 +93,7 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, con
const auto info_all = tx_pool.infoAll(); const auto info_all = tx_pool.infoAll();
if (!info_all.empty()) { if (!info_all.empty()) {
const auto& tx_to_remove = *PickValue(fuzzed_data_provider, info_all).tx; const auto& tx_to_remove = *PickValue(fuzzed_data_provider, info_all).tx;
WITH_LOCK(tx_pool.cs, tx_pool.removeRecursive(tx_to_remove, /* dummy */ MemPoolRemovalReason::BLOCK)); WITH_LOCK(tx_pool.cs, tx_pool.removeRecursive(tx_to_remove, MemPoolRemovalReason::BLOCK /* dummy */));
std::vector<uint256> all_txids; std::vector<uint256> all_txids;
tx_pool.queryHashes(all_txids); tx_pool.queryHashes(all_txids);
assert(all_txids.size() < info_all.size()); assert(all_txids.size() < info_all.size());

View File

@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
{ {
bool ignored; bool ignored;
auto ProcessBlock = [&](std::shared_ptr<const CBlock> block) -> bool { auto ProcessBlock = [&](std::shared_ptr<const CBlock> block) -> bool {
return Assert(m_node.chainman)->ProcessNewBlock(Params(), block, /* fForceProcessing */ true, /* fNewBlock */ &ignored); return Assert(m_node.chainman)->ProcessNewBlock(Params(), block, /*force_processing=*/true, /*new_block=*/&ignored);
}; };
// Process all mined blocks // Process all mined blocks