Cxx17 refac ci trivial (#4507)

* guard gmtime_r with HAVE_GMTIME_R properly

* resolve dash-cppcheck linter error

* Mark stuff as override to resolve compiler warnings

Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
This commit is contained in:
PastaPastaPasta 2021-10-11 17:55:49 -04:00 committed by GitHub
parent 0f2e8aa504
commit 628c6160b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -538,12 +538,12 @@ bool CCoinJoinServer::IsInputScriptSigValid(const CTxIn& txin) const
txNew.vin.clear();
txNew.vout.clear();
int i = 0;
int nTxInIndex = -1;
CScript sigPubKey = CScript();
{
LOCK(cs_coinjoin);
int i = 0;
for (const auto &entry: vecEntries) {
for (const auto &txout: entry.vecTxOut) {
txNew.vout.push_back(txout);

View File

@ -577,7 +577,7 @@ protected:
struct ValueHolderImpl : ValueHolder {
ValueHolderImpl(const V &_value, size_t _memoryUsage) : ValueHolder(_memoryUsage), value(_value) {}
virtual void Write(const CDataStream& ssKey, CommitTarget &commitTarget) {
virtual void Write(const CDataStream& ssKey, CommitTarget &commitTarget) override {
// we're moving the value instead of copying it. This means that Write() can only be called once per
// ValueHolderImpl instance. Commit() clears the write maps, so this ok.
commitTarget.Write(ssKey, std::move(value));

View File

@ -79,15 +79,15 @@ public:
class MasternodeSyncImpl : public Masternode::Sync
{
public:
bool isSynced()
bool isSynced() override
{
return masternodeSync.IsSynced();
}
bool isBlockchainSynced()
bool isBlockchainSynced() override
{
return masternodeSync.IsBlockchainSynced();
}
std::string getSyncStatus()
std::string getSyncStatus() override
{
return masternodeSync.GetSyncStatus();
}

View File

@ -36,7 +36,7 @@ public:
QTableWidgetItem(text, type),
itemData(data) {}
bool operator<(const QTableWidgetItem& other) const
bool operator<(const QTableWidgetItem& other) const override
{
return itemData < ((CMasternodeListWidgetItem*)&other)->itemData;
}

View File

@ -5284,10 +5284,10 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, std::string& strBack
// Create backup of the ...
struct tm ts;
time_t time_val = GetTime();
#ifdef _MSC_VER
gmtime_s(&ts, &time_val);
#else
#ifdef HAVE_GMTIME_R
gmtime_r(&time_val, &ts);
#else
gmtime_s(&ts, &time_val);
#endif
std::string dateTimeStr = strprintf(".%04i-%02i-%02i-%02i-%02i",
ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday, ts.tm_hour, ts.tm_min);