Skip to content

Commit 18d6f16

Browse files
Merge #7103: backport: bitcoin#26705, bitcoin#26706, bitcoin-core/gui#686 - clang-tidy: for all headers and related fixes
f842c28 Merge bitcoin#26705: clang-tidy: Fix `modernize-use-default-member-init` in headers and force to check all headers (MarcoFalke) 6b2b1fe Merge bitcoin-core/gui#686: clang-tidy: Force checks for headers in `src/qt` (Hennadii Stepanov) 2772030 Merge bitcoin#26706: doc: Properly report optional RPC args (fanquake) 3173806 lint: multiple clang-tidy warnings for dash specific code (Konstantin Akimov) 3779f71 refactor: replace define to const for default sample height in traffic widged (Konstantin Akimov) 2c07d66 refactor: simplify GetParams to GetLLLMQType in dkgsession's interface (Konstantin Akimov) a0cd036 fix: follow-up for bitcoin#24925 - use rand values instead 0 (Konstantin Akimov) 1c7f056 fix: add clang-tidy nolint exception readability-redundant-declaration for cs_main forward declarations (Konstantin Akimov) 8a635ec ci: add a new category of commits `lint` which groups refactorings and fixes to please linters (Konstantin Akimov) Pull request description: ## What was done? Backport bitcoin#26705 to enforce clang-tidy for all headers. This backport: - fixes the only [remained](bitcoin#26705 (comment)) check in headers, i.e., `modernize-use-default-member-init` - forces `clang-tidy` check all headers It has significant amount of failures for dash specific code; this backport is extracted from #7100 to its own PR and 2 more PRs are added to fix multiple issues in backported code: bitcoin#26706, bitcoin-core/gui#686 to fix related failures. ## How Has This Been Tested? Run CI & fix failures ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK f842c28 (a bit concerned about touching 3rd-party files but since we aren't going to update them from their upstream ever I think it's ok-ish to fix them too instead of complicating clang-tidy settings) kwvg: utACK f842c28 Tree-SHA512: 2efbf3bddc748351ff702f0eda29b50f72348e516ebbb0e6e784bafb20850e7a231255c5019838ba05152c3e73c48b2f5ca6f4856842f2c7e4664b0242cd1c57
2 parents 5432d30 + f842c28 commit 18d6f16

136 files changed

Lines changed: 304 additions & 388 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/semantic-pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
build
3131
guix
3232
ci
33+
lint
3334
chore
3435
revert
3536
trivial

src/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ readability-redundant-string-init,
2626
CheckOptions:
2727
- key: performance-move-const-arg.CheckTriviallyCopyableMove
2828
value: false
29+
HeaderFilterRegex: '.'

src/active/dkgsessionhandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static void RelayInvToParticipants(const CDKGSession& session, const CConnman& c
343343
"HasMasternodeQuorumNodes[%d] for quorumHash[%s] forMember[%s] relayMembers[%s]",
344344
inv.ToString(), relayMembers.size(), connman.GetNodeCount(ConnectionDirection::Both),
345345
connman.GetNetworkActive(),
346-
connman.HasMasternodeQuorumNodes(session.GetParams().type, session.BlockIndex()->GetBlockHash()),
346+
connman.HasMasternodeQuorumNodes(session.GetType(), session.BlockIndex()->GetBlockHash()),
347347
session.BlockIndex()->GetBlockHash().ToString(), session.ProTx().ToString().substr(0, 4), ss.str());
348348

349349
std::stringstream ss2;

src/bls/bls.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class CBLSLazyWrapper
390390
private:
391391
mutable std::mutex mutex;
392392

393-
mutable std::array<uint8_t, BLSObject::SerSize> vecBytes;
393+
mutable std::array<uint8_t, BLSObject::SerSize> vecBytes{};
394394

395395
mutable BLSObject obj;
396396
mutable bool objInitialized{false};
@@ -403,7 +403,6 @@ class CBLSLazyWrapper
403403

404404
public:
405405
CBLSLazyWrapper() :
406-
vecBytes{},
407406
bufLegacyScheme(bls::bls_legacy_scheme.load())
408407
{}
409408

src/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static constexpr int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME;
3535
*/
3636
static constexpr int64_t MAX_BLOCK_TIME_GAP = 25 * 60;
3737

38-
extern RecursiveMutex cs_main;
38+
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)
3939

4040
class CBlockFileInfo
4141
{

src/coinjoin/coinjoin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CChainLocksHandler;
3434
class CInstantSendManager;
3535
} // namespace llmq
3636

37-
extern RecursiveMutex cs_main;
37+
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)
3838

3939
// timeouts
4040
static constexpr int COINJOIN_AUTO_TIMEOUT_MIN = 5;

src/crypto/ripemd160.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void Transform(uint32_t* s, const unsigned char* chunk)
239239

240240
////// RIPEMD160
241241

242-
CRIPEMD160::CRIPEMD160() : bytes(0)
242+
CRIPEMD160::CRIPEMD160()
243243
{
244244
ripemd160::Initialize(s);
245245
}

src/crypto/ripemd160.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CRIPEMD160
1414
private:
1515
uint32_t s[5];
1616
unsigned char buf[64];
17-
uint64_t bytes;
17+
uint64_t bytes{0};
1818

1919
public:
2020
static const size_t OUTPUT_SIZE = 20;

src/crypto/sha1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void Transform(uint32_t* s, const unsigned char* chunk)
146146

147147
////// SHA1
148148

149-
CSHA1::CSHA1() : bytes(0)
149+
CSHA1::CSHA1()
150150
{
151151
sha1::Initialize(s);
152152
}

src/crypto/sha1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CSHA1
1414
private:
1515
uint32_t s[5];
1616
unsigned char buf[64];
17-
uint64_t bytes;
17+
uint64_t bytes{0};
1818

1919
public:
2020
static const size_t OUTPUT_SIZE = 20;

0 commit comments

Comments
 (0)