From 35cfd460655878c9a615abc8ea1cb2f7577a7f3b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Apr 2013 18:57:48 +0300 Subject: some other fixes from cpplint. --- src/net/messagein.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/net/messagein.cpp') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 4ea6c7415..cca7eee01 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -30,8 +30,8 @@ #include "debug.h" #define MAKEWORD(low, high) \ - (static_cast((static_cast(low)) | \ - (static_cast(static_cast(high))) << 8)) + (static_cast((static_cast(low)) | \ + (static_cast(static_cast(high))) << 8)) namespace Net { @@ -64,8 +64,8 @@ void MessageIn::readCoordinates(uint16_t &x, uint16_t &y) { const unsigned char *const p = reinterpret_cast(mData + mPos); - x = static_cast(p[0] | ((p[1] & 0x07) << 8)); - y = static_cast((p[1] >> 3) | ((p[2] & 0x3F) << 5)); + x = static_cast(p[0] | ((p[1] & 0x07) << 8)); + y = static_cast((p[1] >> 3) | ((p[2] & 0x3F) << 5)); } mPos += 3; PacketCounters::incInBytes(3); @@ -114,9 +114,9 @@ void MessageIn::readCoordinates(uint16_t &x, uint16_t &y, uint8_t &direction) { const char *const data = mData + mPos; int16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff); - x = static_cast(temp >> 6); + x = static_cast(temp >> 6); temp = MAKEWORD(data[2] & 0x00f0, data[1] & 0x003f); - y = static_cast(temp >> 4); + y = static_cast(temp >> 4); serverDir = static_cast(data[2] & 0x000f); direction = fromServerDirection(serverDir); @@ -136,15 +136,15 @@ void MessageIn::readCoordinatePair(uint16_t &srcX, uint16_t &srcY, { const char *const data = mData + mPos; int16_t temp = MAKEWORD(data[3], data[2] & 0x000f); - dstX = static_cast(temp >> 2); + dstX = static_cast(temp >> 2); dstY = MAKEWORD(data[4], data[3] & 0x0003); temp = MAKEWORD(data[1], data[0]); - srcX = static_cast(temp >> 6); + srcX = static_cast(temp >> 6); temp = MAKEWORD(data[2], data[1] & 0x003f); - srcY = static_cast(temp >> 4); + srcY = static_cast(temp >> 4); } mPos += 5; DEBUGLOG(std::string("readCoordinatePair: ").append(toString( @@ -215,7 +215,7 @@ std::string MessageIn::readRawString(int length) if (stringEnd) { - const long len2 = length - (stringEnd - stringBeg) - 1; + const size_t len2 = length - (stringEnd - stringBeg) - 1; const char *const stringBeg2 = stringEnd + 1; const char *const stringEnd2 = static_cast(memchr(stringBeg2, '\0', len2)); -- cgit v1.2.3-60-g2f50