aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/util.h b/src/util.h
index ac4b947785..45b3658557 100644
--- a/src/util.h
+++ b/src/util.h
@@ -77,39 +77,23 @@ int LogPrintStr(const std::string &str);
#define LogPrintf(...) LogPrint(NULL, __VA_ARGS__)
-template<typename T1, typename... Args>
-static inline int LogPrint(const char* category, const char* fmt, const T1& v1, const Args&... args)
+template<typename... Args>
+static inline int LogPrint(const char* category, const char* fmt, const Args&... args)
{
if(!LogAcceptCategory(category)) return 0; \
- return LogPrintStr(tfm::format(fmt, v1, args...));
+ return LogPrintStr(tfm::format(fmt, args...));
}
-template<typename T1, typename... Args>
-bool error(const char* fmt, const T1& v1, const Args&... args)
+template<typename... Args>
+bool error(const char* fmt, const Args&... args)
{
- LogPrintStr("ERROR: " + tfm::format(fmt, v1, 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");
+ LogPrintStr("ERROR: " + tfm::format(fmt, args...) + "\n");
return false;
}
void PrintExceptionContinue(const std::exception *pex, const char* pszThread);
void ParseParameters(int argc, const char*const argv[]);
-void FileCommit(FILE *fileout);
+void FileCommit(FILE *file);
bool TruncateFile(FILE *file, unsigned int length);
int RaiseFileDescriptorLimit(int nMinFD);
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);