summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/logger.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index 3ec26a6db..5b8b7819b 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -72,16 +72,16 @@
#define DATESTREAM \
timeStr << "[" \
<< ((((tv.tv_sec / 60) / 60) % 24 < 10) ? "0" : "") \
- << static_cast<int>(((tv.tv_sec / 60) / 60) % 24) \
+ << CAST_S32(((tv.tv_sec / 60) / 60) % 24) \
<< ":" \
<< (((tv.tv_sec / 60) % 60 < 10) ? "0" : "") \
- << static_cast<int>((tv.tv_sec / 60) % 60) \
+ << CAST_S32((tv.tv_sec / 60) % 60) \
<< ":" \
<< ((tv.tv_sec % 60 < 10) ? "0" : "") \
- << static_cast<int>(tv.tv_sec % 60) \
+ << CAST_S32(tv.tv_sec % 60) \
<< "." \
<< (((tv.tv_usec / 10000) % 100) < 10 ? "0" : "") \
- << static_cast<int>((tv.tv_usec / 10000) % 100) \
+ << CAST_S32((tv.tv_usec / 10000) % 100) \
<< "] ";
Logger *logger = nullptr; // Log object
@@ -234,9 +234,9 @@ void Logger::log(const char *const log_text, ...)
unsigned size = 1024;
if (strlen(log_text) * 3 > size)
- size = static_cast<unsigned>(strlen(log_text) * 3);
+ size = CAST_U32(strlen(log_text) * 3);
- char* buf = new char[static_cast<size_t>(size + 1)];
+ char* buf = new char[CAST_SIZE(size + 1)];
va_list ap;
// Use a temporary buffer to fill in the variables
@@ -273,9 +273,9 @@ void Logger::log_r(const char *const log_text, ...)
unsigned size = 1024;
if (strlen(log_text) * 3 > size)
- size = static_cast<unsigned>(strlen(log_text) * 3);
+ size = CAST_U32(strlen(log_text) * 3);
- char* buf = new char[static_cast<size_t>(size + 1)];
+ char* buf = new char[CAST_SIZE(size + 1)];
va_list ap;
// Use a temporary buffer to fill in the variables
@@ -384,7 +384,7 @@ void Logger::unimplimented(const int id)
return;
const std::string str = strprintf("Unimplimented packet: %d (0x%x)",
- id, static_cast<unsigned int>(id));
+ id, CAST_U32(id));
DebugMessageListener::distributeEvent(str);
log(str);
}