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/net/tmwa/messageout.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/net/tmwa/messageout.cpp') 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(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(w)) +#define HIBYTE(w) (static_cast((static_cast(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(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(-1); } data[2] |= direction; PacketCounters::incOutBytes(3); -- cgit v1.2.3-60-g2f50