summaryrefslogtreecommitdiff
path: root/src/net/tmwa/messageout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/messageout.cpp')
-rw-r--r--src/net/tmwa/messageout.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index c12105581..17314937d 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -55,7 +55,7 @@ void MessageOut::expand(size_t bytes)
void MessageOut::writeInt16(Sint16 value)
{
- DEBUGLOG("writeInt16: " + toString((int)value));
+ DEBUGLOG("writeInt16: " + toString(static_cast<int>(value)));
expand(2);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
Sint16 swap = SDL_Swap16(value);
@@ -81,8 +81,8 @@ void MessageOut::writeInt32(Sint32 value)
PacketCounters::incOutBytes(4);
}
-#define LOBYTE(w) ((unsigned char)(w))
-#define HIBYTE(w) ((unsigned char)(((unsigned short)(w)) >> 8))
+#define LOBYTE(w) (static_cast<unsigned char>(w))
+#define HIBYTE(w) (static_cast<unsigned char>((static_cast<unsigned short>(w)) >> 8))
void MessageOut::writeCoordinates(unsigned short x, unsigned short y,
unsigned char direction)
@@ -99,7 +99,7 @@ void MessageOut::writeCoordinates(unsigned short x, unsigned short y,
data[1] = 1;
data[2] = 2;
data[0] = HIBYTE(temp);
- data[1] = (unsigned char) temp;
+ data[1] = static_cast<unsigned char>(temp);
temp = y;
temp <<= 4;
data[1] |= HIBYTE(temp);
@@ -134,7 +134,7 @@ void MessageOut::writeCoordinates(unsigned short x, unsigned short y,
break;
default:
// OOPSIE! Impossible or unknown
- direction = (unsigned char) -1;
+ direction = static_cast<unsigned char>(-1);
}
data[2] |= direction;
PacketCounters::incOutBytes(3);