diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-08 22:47:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-08 22:47:17 +0300 |
commit | 3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9 (patch) | |
tree | 93589fc3f913324254ad543481691565e0baf67e /src/net/ea/network.cpp | |
parent | 8daa939a45794c26a33e109c13c4d6f58a46e00e (diff) | |
download | mv-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.gz mv-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.bz2 mv-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.xz mv-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.zip |
Fix code style in net.
Diffstat (limited to 'src/net/ea/network.cpp')
-rw-r--r-- | src/net/ea/network.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 61a9499d0..c9360e9c9 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -176,7 +176,7 @@ void Network::skip(const int len) if (mInSize >= mToSkip) { mInSize -= mToSkip; - memmove(mInBuffer, mInBuffer + mToSkip, mInSize); + memmove(mInBuffer, mInBuffer + static_cast<size_t>(mToSkip), mInSize); mToSkip = 0; } else @@ -267,7 +267,8 @@ void Network::receive() continue; } - const int ret = TcpNet::recv(mSocket, mInBuffer + mInSize, + const int ret = TcpNet::recv(mSocket, + mInBuffer + static_cast<size_t>(mInSize), BUFFER_SIZE - mInSize); if (!ret) @@ -291,7 +292,9 @@ void Network::receive() if (mInSize >= mToSkip) { mInSize -= mToSkip; - memmove(mInBuffer, mInBuffer + mToSkip, mInSize); + memmove(mInBuffer, + mInBuffer + static_cast<size_t>(mToSkip), + mInSize); mToSkip = 0; } else @@ -332,9 +335,11 @@ void Network::setError(const std::string &error) uint16_t Network::readWord(const int pos) const { #if SDL_BYTEORDER == SDL_BIG_ENDIAN - return SDL_Swap16(*reinterpret_cast<uint16_t*>(mInBuffer + (pos))); + return SDL_Swap16(*reinterpret_cast<uint16_t*>( + mInBuffer + static_cast<size_t>(pos))); #else - return (*reinterpret_cast<uint16_t*>(mInBuffer + (pos))); + return (*reinterpret_cast<uint16_t*>( + mInBuffer + static_cast<size_t>(pos))); #endif } |