summaryrefslogtreecommitdiff
path: root/src/net/tmwa/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
commit4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe (patch)
tree714897eca03fbcb764f5b450a29cc1aef8d33433 /src/net/tmwa/network.cpp
parent9e83411f7e4147d09af5a5006888dcc187ea0ef8 (diff)
downloadmanaplus-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.gz
manaplus-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.bz2
manaplus-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.xz
manaplus-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.zip
Fix more gcc 4.7 warnings.
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r--src/net/tmwa/network.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 6f26035be..3181ec898 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -104,16 +104,17 @@ int networkThread(void *data)
return 0;
}
-Network *Network::mInstance = 0;
+Network *Network::mInstance = nullptr;
Network::Network() :
- mSocket(0),
+ mSocket(nullptr),
mInBuffer(new char[BUFFER_SIZE]),
mOutBuffer(new char[BUFFER_SIZE]),
- mInSize(0), mOutSize(0),
+ mInSize(0),
+ mOutSize(0),
mToSkip(0),
mState(IDLE),
- mWorkerThread(0)
+ mWorkerThread(nullptr)
{
SDLNet_Init();
@@ -129,8 +130,8 @@ Network::~Network()
disconnect();
SDL_DestroyMutex(mMutex);
- mMutex = 0;
- mInstance = 0;
+ mMutex = nullptr;
+ mInstance = nullptr;
delete[] mInBuffer;
delete[] mOutBuffer;
@@ -189,7 +190,7 @@ void Network::disconnect()
{
// need call SDLNet_TCP_DelSocket?
SDLNet_TCP_Close(mSocket);
- mSocket = 0;
+ mSocket = nullptr;
}
}
@@ -212,7 +213,7 @@ void Network::unregisterHandler(MessageHandler *handler)
for (const Uint16 *i = handler->handledMessages; *i; ++i)
mMessageHandlers.erase(*i);
- handler->setNetwork(0);
+ handler->setNetwork(nullptr);
}
void Network::clearHandlers()
@@ -221,7 +222,7 @@ void Network::clearHandlers()
for (i = mMessageHandlers.begin(); i != mMessageHandlers.end(); ++i)
{
if (i->second)
- i->second->setNetwork(0);
+ i->second->setNetwork(nullptr);
}
mMessageHandlers.clear();
}