Skip to content

Commit 3a0fd77

Browse files
Empactfanquake
authored andcommitted
Remove use of non-standard zero variadic macros
These are a gnu extension warned against by: gnu-zero-variadic-macro-arguments
1 parent 49f6178 commit 3a0fd77

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/logging/timer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ class Timer
9393
} // namespace BCLog
9494

9595

96-
#define LOG_TIME_MILLIS(end_msg, ...) \
97-
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, ## __VA_ARGS__)
98-
#define LOG_TIME_SECONDS(end_msg, ...) \
99-
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, ## __VA_ARGS__)
96+
#define LOG_TIME_MILLIS_WITH_CATEGORY(end_msg, log_category) \
97+
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)
98+
#define LOG_TIME_SECONDS(end_msg) \
99+
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg)
100100

101101

102102
#endif // BITCOIN_LOGGING_TIMER_H

src/validation.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,11 +2279,11 @@ bool CChainState::FlushStateToDisk(
22792279
LOCK(cs_LastBlockFile);
22802280
if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) {
22812281
if (nManualPruneHeight > 0) {
2282-
LOG_TIME_MILLIS("find files to prune (manual)", BCLog::BENCH);
2282+
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune (manual)", BCLog::BENCH);
22832283

22842284
FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight);
22852285
} else {
2286-
LOG_TIME_MILLIS("find files to prune", BCLog::BENCH);
2286+
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune", BCLog::BENCH);
22872287

22882288
FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight());
22892289
fCheckForPruning = false;
@@ -2321,15 +2321,15 @@ bool CChainState::FlushStateToDisk(
23212321
return AbortNode(state, "Disk space is too low!", _("Error: Disk space is too low!").translated, CClientUIInterface::MSG_NOPREFIX);
23222322
}
23232323
{
2324-
LOG_TIME_MILLIS("write block and undo data to disk", BCLog::BENCH);
2324+
LOG_TIME_MILLIS_WITH_CATEGORY("write block and undo data to disk", BCLog::BENCH);
23252325

23262326
// First make sure all block and undo data is flushed to disk.
23272327
FlushBlockFile();
23282328
}
23292329

23302330
// Then update all block file information (which may refer to block and undo files).
23312331
{
2332-
LOG_TIME_MILLIS("write block index to disk", BCLog::BENCH);
2332+
LOG_TIME_MILLIS_WITH_CATEGORY("write block index to disk", BCLog::BENCH);
23332333

23342334
std::vector<std::pair<int, const CBlockFileInfo*> > vFiles;
23352335
vFiles.reserve(setDirtyFileInfo.size());
@@ -2349,7 +2349,7 @@ bool CChainState::FlushStateToDisk(
23492349
}
23502350
// Finally remove any pruned files
23512351
if (fFlushForPrune) {
2352-
LOG_TIME_MILLIS("unlink pruned files", BCLog::BENCH);
2352+
LOG_TIME_MILLIS_WITH_CATEGORY("unlink pruned files", BCLog::BENCH);
23532353

23542354
UnlinkPrunedFiles(setFilesToPrune);
23552355
}

0 commit comments

Comments
 (0)