Merge pull request #1302 from laanwj/2012_05_utilstrings

Get rid of snprintf (except one) with fixed buffers, shorten code
This commit is contained in:
Wladimir J. van der Laan
2012-05-20 01:30:18 -07:00
2 changed files with 37 additions and 81 deletions

View File

@@ -43,11 +43,6 @@ static const int64 CENT = 1000000;
#define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0]))
#define printf OutputDebugStringF
#ifdef snprintf
#undef snprintf
#endif
#define snprintf my_snprintf
#ifndef PRI64d
#if defined(_MSC_VER) || defined(__MSVCRT__)
#define PRI64d "I64d"
@@ -133,6 +128,7 @@ int my_snprintf(char* buffer, size_t limit, const char* format, ...);
*/
std::string real_strprintf(const std::string &format, int dummy, ...);
#define strprintf(format, ...) real_strprintf(format, 0, __VA_ARGS__)
std::string vstrprintf(const std::string &format, va_list ap);
bool error(const char *format, ...);
void LogException(std::exception* pex, const char* pszThread);