clang-tidy: Fix modernize-use-default-member-init in headers

See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html
This commit is contained in:
Hennadii Stepanov
2023-01-31 11:50:10 +00:00
parent 357d750cab
commit 96ee992ac3
33 changed files with 69 additions and 73 deletions

View File

@@ -308,7 +308,7 @@ BerkeleyDatabase::~BerkeleyDatabase()
}
}
BerkeleyBatch::BerkeleyBatch(BerkeleyDatabase& database, const bool read_only, bool fFlushOnCloseIn) : pdb(nullptr), activeTxn(nullptr), m_database(database)
BerkeleyBatch::BerkeleyBatch(BerkeleyDatabase& database, const bool read_only, bool fFlushOnCloseIn) : m_database(database)
{
database.AddRef();
database.Open();

View File

@@ -207,9 +207,9 @@ private:
bool HasKey(DataStream&& key) override;
protected:
Db* pdb;
Db* pdb{nullptr};
std::string strFile;
DbTxn* activeTxn;
DbTxn* activeTxn{nullptr};
bool fReadOnly;
bool fFlushOnClose;
BerkeleyEnvironment *env;

View File

@@ -123,7 +123,7 @@ class WalletDatabase
{
public:
/** Create dummy DB handle */
WalletDatabase() : nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0) {}
WalletDatabase() : nUpdateCounter(0) {}
virtual ~WalletDatabase() {};
/** Open the database if it is not already opened. */
@@ -165,9 +165,9 @@ public:
virtual std::string Format() = 0;
std::atomic<unsigned int> nUpdateCounter;
unsigned int nLastSeen;
unsigned int nLastFlushed;
int64_t nLastWalletUpdate;
unsigned int nLastSeen{0};
unsigned int nLastFlushed{0};
int64_t nLastWalletUpdate{0};
/** Make a DatabaseBatch connected to this database */
virtual std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) = 0;

View File

@@ -954,10 +954,10 @@ private:
using Clock = std::chrono::steady_clock;
using NowFn = std::function<Clock::time_point()>;
CWallet& m_wallet;
bool m_could_reserve;
bool m_could_reserve{false};
NowFn m_now;
public:
explicit WalletRescanReserver(CWallet& w) : m_wallet(w), m_could_reserve(false) {}
explicit WalletRescanReserver(CWallet& w) : m_wallet(w) {}
bool reserve()
{