diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/net/ea/network.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/net/ea/network.cpp')
-rw-r--r-- | src/net/ea/network.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 66115b789..9efc807c7 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -165,7 +165,7 @@ void Network::flush() toString(mOutSize)).append(" bytes")); } */ - if (ret < static_cast<int>(mOutSize)) + if (ret < CAST_S32(mOutSize)) { SDL_mutexV(mMutexOut); setError("Error in TcpNet::send(): " + @@ -188,7 +188,7 @@ void Network::skip(const int len) if (mInSize >= mToSkip) { mInSize -= mToSkip; - memmove(mInBuffer, mInBuffer + static_cast<size_t>(mToSkip), mInSize); + memmove(mInBuffer, mInBuffer + CAST_SIZE(mToSkip), mInSize); mToSkip = 0; } else @@ -258,7 +258,7 @@ void Network::receive() while (mState == CONNECTED) { const int numReady = TcpNet::checkSockets( - set, (static_cast<uint32_t>(500))); + set, (CAST_U32(500))); switch (numReady) { case -1: @@ -280,7 +280,7 @@ void Network::receive() } const int ret = TcpNet::recv(mSocket, - mInBuffer + static_cast<size_t>(mInSize), + mInBuffer + CAST_SIZE(mInSize), BUFFER_SIZE - mInSize); if (!ret) @@ -305,7 +305,7 @@ void Network::receive() { mInSize -= mToSkip; memmove(mInBuffer, - mInBuffer + static_cast<size_t>(mToSkip), + mInBuffer + CAST_SIZE(mToSkip), mInSize); mToSkip = 0; } @@ -348,10 +348,10 @@ uint16_t Network::readWord(const int pos) const { #if SDL_BYTEORDER == SDL_BIG_ENDIAN return SDL_Swap16(*reinterpret_cast<uint16_t*>( - mInBuffer + static_cast<size_t>(pos))); + mInBuffer + CAST_SIZE(pos))); #else return (*reinterpret_cast<uint16_t*>( - mInBuffer + static_cast<size_t>(pos))); + mInBuffer + CAST_SIZE(pos))); #endif } |