Skip to content

Commit e1bf547

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26705: clang-tidy: Fix modernize-use-default-member-init in headers and force to check all headers
b0e9169 clang-tidy: Force to check all headers (Hennadii Stepanov) 96ee992 clang-tidy: Fix `modernize-use-default-member-init` in headers (Hennadii Stepanov) Pull request description: This PR: - fixes the only [remained](bitcoin/bitcoin#26705 (comment)) check in headers, i.e., `modernize-use-default-member-init` - forces `clang-tidy` check all headers Closes bitcoin/bitcoin#26703. ACKs for top commit: MarcoFalke: review ACK b0e9169 🍹 Tree-SHA512: 4d33fe873094914541ae81968cdb4e7a7a01b3fdd4f25bc6daa8a53f45dab80565a5b3607ddc338f122369ca5a0a2d0d09c8e78cabe1beb6bd50c115bc5c5210
2 parents ba39ffe + b0e9169 commit e1bf547

34 files changed

+70
-74
lines changed

src/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ WarningsAsErrors: '*'
1616
CheckOptions:
1717
- key: performance-move-const-arg.CheckTriviallyCopyableMove
1818
value: false
19-
HeaderFilterRegex: './qt'
19+
HeaderFilterRegex: '.'

src/coins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock,
3232
std::unique_ptr<CCoinsViewCursor> CCoinsViewBacked::Cursor() const { return base->Cursor(); }
3333
size_t CCoinsViewBacked::EstimateSize() const { return base->EstimateSize(); }
3434

35-
CCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), cachedCoinsUsage(0) {}
35+
CCoinsViewCache::CCoinsViewCache(CCoinsView* baseIn) : CCoinsViewBacked(baseIn) {}
3636

3737
size_t CCoinsViewCache::DynamicMemoryUsage() const {
3838
return memusage::DynamicUsage(cacheCoins) + cachedCoinsUsage;

src/coins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class CCoinsViewCache : public CCoinsViewBacked
220220
mutable CCoinsMap cacheCoins;
221221

222222
/* Cached dynamic memory usage for the inner Coin objects. */
223-
mutable size_t cachedCoinsUsage;
223+
mutable size_t cachedCoinsUsage{0};
224224

225225
public:
226226
CCoinsViewCache(CCoinsView *baseIn);

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;

src/crypto/sha256.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ std::string SHA256AutoDetect()
673673

674674
////// SHA-256
675675

676-
CSHA256::CSHA256() : bytes(0)
676+
CSHA256::CSHA256()
677677
{
678678
sha256::Initialize(s);
679679
}

src/crypto/sha256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CSHA256
1515
private:
1616
uint32_t s[8];
1717
unsigned char buf[64];
18-
uint64_t bytes;
18+
uint64_t bytes{0};
1919

2020
public:
2121
static const size_t OUTPUT_SIZE = 32;

src/crypto/sha512.cpp

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

152152
////// SHA-512
153153

154-
CSHA512::CSHA512() : bytes(0)
154+
CSHA512::CSHA512()
155155
{
156156
sha512::Initialize(s);
157157
}

0 commit comments

Comments
 (0)