summaryrefslogtreecommitdiff
path: root/src/net/tmwa/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 17:48:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 17:49:00 +0200
commitf98d003e354a1792117b7cbc771d1dd91475a156 (patch)
treedc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/net/tmwa/network.cpp
parentbb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff)
downloadmanaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.zip
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r--src/net/tmwa/network.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index ad8be300c..5beb05c20 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -257,7 +257,7 @@ void Network::flush()
SDL_mutexP(mMutex);
ret = SDLNet_TCP_Send(mSocket, mOutBuffer, mOutSize);
- if (ret < (int)mOutSize)
+ if (ret < static_cast<int>(mOutSize))
{
setError("Error in SDLNet_TCP_Send(): " +
std::string(SDLNet_GetError()));
@@ -396,7 +396,7 @@ void Network::receive()
{
// TODO Try to get this to block all the time while still being able
// to escape the loop
- int numReady = SDLNet_CheckSockets(set, ((Uint32)500));
+ int numReady = SDLNet_CheckSockets(set, (static_cast<Uint32>(500)));
int ret;
switch (numReady)
{
@@ -476,9 +476,9 @@ void Network::setError(const std::string &error)
Uint16 Network::readWord(int pos)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- return SDL_Swap16((*(Uint16*)(mInBuffer + (pos))));
+ return SDL_Swap16((*static_cast<Uint16*>(mInBuffer + (pos))));
#else
- return (*(Uint16*)(mInBuffer + (pos)));
+ return (*reinterpret_cast<Uint16*>(mInBuffer + (pos)));
#endif
}