summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 17:24:35 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 17:24:35 +0300
commit0561af8232b50071676ae18d5e78ba43b15bff94 (patch)
tree0d51a5ca7662fbf6f1049a6e6ac81e95d5bbd8e8 /src/net/eathena
parent38659dbd75d81edbe336d5311a1cd1184d359b7e (diff)
downloadplus-0561af8232b50071676ae18d5e78ba43b15bff94.tar.gz
plus-0561af8232b50071676ae18d5e78ba43b15bff94.tar.bz2
plus-0561af8232b50071676ae18d5e78ba43b15bff94.tar.xz
plus-0561af8232b50071676ae18d5e78ba43b15bff94.zip
Fix casting in logging packets.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/messagein.cpp9
-rw-r--r--src/net/eathena/messageout.cpp6
2 files changed, 10 insertions, 5 deletions
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index bacf189c6..49e320aa7 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -79,7 +79,8 @@ int16_t MessageIn::readInt16(const char *const str)
memcpy(&value, mData + static_cast<size_t>(mPos), sizeof(int16_t));
#endif
}
- DEBUGLOG2("readInt16: " + toStringPrint(static_cast<int>(value)),
+ DEBUGLOG2("readInt16: " + toStringPrint(static_cast<unsigned int>(
+ static_cast<uint16_t>(value))),
mPos, str);
mPos += 2;
PacketCounters::incInBytes(2);
@@ -99,7 +100,8 @@ int32_t MessageIn::readInt32(const char *const str)
memcpy(&value, mData + static_cast<size_t>(mPos), sizeof(int32_t));
#endif
}
- DEBUGLOG2("readInt32: " + toStringPrint(value), mPos, str);
+ DEBUGLOG2("readInt32: " + toStringPrint(static_cast<unsigned int>(value)),
+ mPos, str);
mPos += 4;
PacketCounters::incInBytes(4);
return value;
@@ -118,7 +120,8 @@ int64_t MessageIn::readInt64(const char *const str)
memcpy(&value, mData + static_cast<size_t>(mPos), sizeof(int64_t));
#endif
}
- DEBUGLOG2("readInt64: " + toStringPrint(value), mPos, str);
+ DEBUGLOG2("readInt64: " + toStringPrint(static_cast<unsigned int>(value)),
+ mPos, str);
mPos += 8;
PacketCounters::incInBytes(8);
return value;
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 1b0dae6f1..f2b851ad4 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -64,7 +64,8 @@ void MessageOut::writeInt16(const int16_t value, const char *const str)
#else
memcpy(mData + static_cast<size_t>(mPos), &value, sizeof(int16_t));
#endif
- DEBUGLOG2("writeInt16: " + toStringPrint(static_cast<int>(value)),
+ DEBUGLOG2("writeInt16: " + toStringPrint(static_cast<unsigned int>(
+ static_cast<uint16_t>(value))),
mPos, str);
mPos += 2;
PacketCounters::incOutBytes(2);
@@ -72,7 +73,8 @@ void MessageOut::writeInt16(const int16_t value, const char *const str)
void MessageOut::writeInt32(const int32_t value, const char *const str)
{
- DEBUGLOG2("writeInt32: " + toStringPrint(value), mPos, str);
+ DEBUGLOG2("writeInt32: " + toStringPrint(static_cast<unsigned int>(value)),
+ mPos, str);
expand(4);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int32_t swap = SDL_Swap32(value);