From f98d003e354a1792117b7cbc771d1dd91475a156 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 17:48:29 +0200 Subject: Fix most old style cast except manaserv and libxml2 defines. --- src/log.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/log.cpp') diff --git a/src/log.cpp b/src/log.cpp index d66cdab2f..982f2eed7 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -86,16 +86,16 @@ void Logger::dlog(std::string str) std::stringstream timeStr; timeStr << "[" << ((((tv.tv_sec / 60) / 60) % 24 < 10) ? "0" : "") - << (int)(((tv.tv_sec / 60) / 60) % 24) + << static_cast(((tv.tv_sec / 60) / 60) % 24) << ":" << (((tv.tv_sec / 60) % 60 < 10) ? "0" : "") - << (int)((tv.tv_sec / 60) % 60) + << static_cast((tv.tv_sec / 60) % 60) << ":" << ((tv.tv_sec % 60 < 10) ? "0" : "") - << (int)(tv.tv_sec % 60) + << static_cast(tv.tv_sec % 60) << "." << (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "") - << (int)((tv.tv_usec / 10000) % 100) + << static_cast((tv.tv_usec / 10000) % 100) << "] "; if (mLogFile.is_open()) @@ -118,16 +118,16 @@ void Logger::log1(const char *buf) std::stringstream timeStr; timeStr << "[" << ((((tv.tv_sec / 60) / 60) % 24 < 10) ? "0" : "") - << (int)(((tv.tv_sec / 60) / 60) % 24) + << static_cast(((tv.tv_sec / 60) / 60) % 24) << ":" << (((tv.tv_sec / 60) % 60 < 10) ? "0" : "") - << (int)((tv.tv_sec / 60) % 60) + << static_cast((tv.tv_sec / 60) % 60) << ":" << ((tv.tv_sec % 60 < 10) ? "0" : "") - << (int)(tv.tv_sec % 60) + << static_cast(tv.tv_sec % 60) << "." << (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "") - << (int)((tv.tv_usec / 10000) % 100) + << static_cast((tv.tv_usec / 10000) % 100) << "] "; if (mLogFile.is_open()) @@ -142,10 +142,10 @@ void Logger::log1(const char *buf) void Logger::log(const char *log_text, ...) { - unsigned int size = 1024; + unsigned size = 1024; char* buf = 0; if (strlen(log_text) * 3 > size) - size = (unsigned)strlen(log_text) * 3; + size = static_cast(strlen(log_text) * 3); buf = new char[size]; va_list ap; @@ -163,16 +163,16 @@ void Logger::log(const char *log_text, ...) std::stringstream timeStr; timeStr << "[" << ((((tv.tv_sec / 60) / 60) % 24 < 10) ? "0" : "") - << (int)(((tv.tv_sec / 60) / 60) % 24) + << static_cast(((tv.tv_sec / 60) / 60) % 24) << ":" << (((tv.tv_sec / 60) % 60 < 10) ? "0" : "") - << (int)((tv.tv_sec / 60) % 60) + << static_cast((tv.tv_sec / 60) % 60) << ":" << ((tv.tv_sec % 60 < 10) ? "0" : "") - << (int)(tv.tv_sec % 60) + << static_cast(tv.tv_sec % 60) << "." << (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "") - << (int)((tv.tv_usec / 10000) % 100) + << static_cast((tv.tv_usec / 10000) % 100) << "] "; if (mLogFile.is_open()) -- cgit v1.2.3-70-g09d2