Skip to content

Commit

Permalink
Remove use of non-standard zero variadic macros
Browse files Browse the repository at this point in the history
These are a gnu extension warned against by: gnu-zero-variadic-macro-arguments
  • Loading branch information
Empact authored and fanquake committed Apr 30, 2020
1 parent 49f6178 commit 3a0fd77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/logging/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class Timer
} // namespace BCLog


#define LOG_TIME_MILLIS(end_msg, ...) \
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, ## __VA_ARGS__)
#define LOG_TIME_SECONDS(end_msg, ...) \
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, ## __VA_ARGS__)
#define LOG_TIME_MILLIS_WITH_CATEGORY(end_msg, log_category) \
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)
#define LOG_TIME_SECONDS(end_msg) \
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg)


#endif // BITCOIN_LOGGING_TIMER_H
10 changes: 5 additions & 5 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2279,11 +2279,11 @@ bool CChainState::FlushStateToDisk(
LOCK(cs_LastBlockFile);
if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) {
if (nManualPruneHeight > 0) {
LOG_TIME_MILLIS("find files to prune (manual)", BCLog::BENCH);
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune (manual)", BCLog::BENCH);

FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight);
} else {
LOG_TIME_MILLIS("find files to prune", BCLog::BENCH);
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune", BCLog::BENCH);

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

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

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

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

UnlinkPrunedFiles(setFilesToPrune);
}
Expand Down

0 comments on commit 3a0fd77

Please sign in to comment.