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 Feb 10, 2020
1 parent 081a0ab commit 612e8e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static inline void LogPrintf(const char* fmt, const Args&... args)
// evaluating arguments when logging for the category is not enabled.
#define LogPrint(category, ...) \
do { \
if (LogAcceptCategory((category))) { \
if ((category) == BCLog::LogFlags::ALL || LogAcceptCategory((category))) { \
LogPrintf(__VA_ARGS__); \
} \
} while (0)
Expand Down
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(end_msg, log_category) \
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)
#define LOG_TIME_SECONDS(end_msg, log_category) \
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)


#endif // BITCOIN_LOGGING_TIMER_H
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ bool CChainState::FlushStateToDisk(
// Flush best chain related state. This can only be done if the blocks / block index write was also done.
if (fDoFullFlush && !CoinsTip().GetBestBlock().IsNull()) {
LOG_TIME_SECONDS(strprintf("write coins cache to disk (%d coins, %.2fkB)",
coins_count, coins_mem_usage / 1000));
coins_count, coins_mem_usage / 1000), BCLog::ALL);

// Typical Coin structures on disk are around 48 bytes in size.
// Pushing a new one to the database can cause it to be written
Expand Down

0 comments on commit 612e8e1

Please sign in to comment.