mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
util: Remove zero-argument versions of LogPrint and error
Changes in tinyformat, recently imported from upstream have made the zero-argument versions of formatting functions unnecessary. Remove them. This is a slight semantic change: `%` characters in the zero-argument call are now regarded and need to be escaped. As for as I know, the only use of this is in `main.cpp`.
This commit is contained in:
parent
695041e495
commit
a5072a7730
@ -4159,7 +4159,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
|||||||
int nGoodTransactions = 0;
|
int nGoodTransactions = 0;
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
int reportDone = 0;
|
int reportDone = 0;
|
||||||
LogPrintf("[0%]...");
|
LogPrintf("[0%%]...");
|
||||||
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
|
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
|
||||||
{
|
{
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
|
28
src/util.h
28
src/util.h
@ -77,33 +77,17 @@ int LogPrintStr(const std::string &str);
|
|||||||
|
|
||||||
#define LogPrintf(...) LogPrint(NULL, __VA_ARGS__)
|
#define LogPrintf(...) LogPrint(NULL, __VA_ARGS__)
|
||||||
|
|
||||||
template<typename T1, typename... Args>
|
template<typename... Args>
|
||||||
static inline int LogPrint(const char* category, const char* fmt, const T1& v1, const Args&... args)
|
static inline int LogPrint(const char* category, const char* fmt, const Args&... args)
|
||||||
{
|
{
|
||||||
if(!LogAcceptCategory(category)) return 0; \
|
if(!LogAcceptCategory(category)) return 0; \
|
||||||
return LogPrintStr(tfm::format(fmt, v1, args...));
|
return LogPrintStr(tfm::format(fmt, args...));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T1, typename... Args>
|
template<typename... Args>
|
||||||
bool error(const char* fmt, const T1& v1, const Args&... args)
|
bool error(const char* fmt, const Args&... args)
|
||||||
{
|
{
|
||||||
LogPrintStr("ERROR: " + tfm::format(fmt, v1, args...) + "\n");
|
LogPrintStr("ERROR: " + tfm::format(fmt, args...) + "\n");
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zero-arg versions of logging and error, these are not covered by
|
|
||||||
* the variadic templates above (and don't take format arguments but
|
|
||||||
* bare strings).
|
|
||||||
*/
|
|
||||||
static inline int LogPrint(const char* category, const char* s)
|
|
||||||
{
|
|
||||||
if(!LogAcceptCategory(category)) return 0;
|
|
||||||
return LogPrintStr(s);
|
|
||||||
}
|
|
||||||
static inline bool error(const char* s)
|
|
||||||
{
|
|
||||||
LogPrintStr(std::string("ERROR: ") + s + "\n");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user