summaryrefslogtreecommitdiff
path: root/src/log.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 17:48:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 17:49:00 +0200
commitf98d003e354a1792117b7cbc771d1dd91475a156 (patch)
treedc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/log.cpp
parentbb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff)
downloadplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz
plus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2
plus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz
plus-f98d003e354a1792117b7cbc771d1dd91475a156.zip
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/log.cpp')
-rw-r--r--src/log.cpp28
1 files changed, 14 insertions, 14 deletions
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<int>(((tv.tv_sec / 60) / 60) % 24)
<< ":"
<< (((tv.tv_sec / 60) % 60 < 10) ? "0" : "")
- << (int)((tv.tv_sec / 60) % 60)
+ << static_cast<int>((tv.tv_sec / 60) % 60)
<< ":"
<< ((tv.tv_sec % 60 < 10) ? "0" : "")
- << (int)(tv.tv_sec % 60)
+ << static_cast<int>(tv.tv_sec % 60)
<< "."
<< (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "")
- << (int)((tv.tv_usec / 10000) % 100)
+ << static_cast<int>((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<int>(((tv.tv_sec / 60) / 60) % 24)
<< ":"
<< (((tv.tv_sec / 60) % 60 < 10) ? "0" : "")
- << (int)((tv.tv_sec / 60) % 60)
+ << static_cast<int>((tv.tv_sec / 60) % 60)
<< ":"
<< ((tv.tv_sec % 60 < 10) ? "0" : "")
- << (int)(tv.tv_sec % 60)
+ << static_cast<int>(tv.tv_sec % 60)
<< "."
<< (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "")
- << (int)((tv.tv_usec / 10000) % 100)
+ << static_cast<int>((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<unsigned>(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<int>(((tv.tv_sec / 60) / 60) % 24)
<< ":"
<< (((tv.tv_sec / 60) % 60 < 10) ? "0" : "")
- << (int)((tv.tv_sec / 60) % 60)
+ << static_cast<int>((tv.tv_sec / 60) % 60)
<< ":"
<< ((tv.tv_sec % 60 < 10) ? "0" : "")
- << (int)(tv.tv_sec % 60)
+ << static_cast<int>(tv.tv_sec % 60)
<< "."
<< (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "")
- << (int)((tv.tv_usec / 10000) % 100)
+ << static_cast<int>((tv.tv_usec / 10000) % 100)
<< "] ";
if (mLogFile.is_open())