summaryrefslogtreecommitdiff
path: root/src/net/tmwa
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
parent9e83411f7e4147d09af5a5006888dcc187ea0ef8 (diff)
downloadmv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.gz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.bz2
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.xz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.zip
Fix more gcc 4.7 warnings.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp6
-rw-r--r--src/net/tmwa/chathandler.cpp2
-rw-r--r--src/net/tmwa/generalhandler.cpp6
-rw-r--r--src/net/tmwa/network.cpp19
-rw-r--r--src/net/tmwa/npchandler.cpp4
5 files changed, 19 insertions, 18 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 03b63aa16..69f7165ec 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -123,7 +123,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
player_node = mSelectedCharacter->dummy;
PlayerInfo::setBackend(mSelectedCharacter->data);
- mSelectedCharacter->dummy = 0;
+ mSelectedCharacter->dummy = nullptr;
delete_all(mCharacters);
mCharacters.clear();
@@ -151,7 +151,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
if (player_node)
{
player_node->setTileCoords(x, y);
- player_node->setMap(0);
+ player_node->setMap(nullptr);
}
}
break;
@@ -271,7 +271,7 @@ void CharServerHandler::chooseCharacter(Net::Character *character)
return;
mSelectedCharacter = character;
- mCharSelectDialog = 0;
+ mCharSelectDialog = nullptr;
MessageOut outMsg(CMSG_CHAR_SELECT);
outMsg.writeInt8(static_cast<unsigned char>(mSelectedCharacter->slot));
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index fe6592d93..5af248e5c 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -145,7 +145,7 @@ void ChatHandler::sendRaw(const std::string &args)
{
std::string line = args;
std::string str;
- MessageOut *outMsg = 0;
+ MessageOut *outMsg = nullptr;
if (line == "")
return;
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 0a9541477..293986bde 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -120,7 +120,7 @@ GeneralHandler::GeneralHandler():
GeneralHandler::~GeneralHandler()
{
delete mNetwork;
- mNetwork = 0;
+ mNetwork = nullptr;
}
void GeneralHandler::handleMessage(Net::MessageIn &msg)
@@ -294,10 +294,10 @@ void GeneralHandler::processEvent(Mana::Channels channel,
}
delete Ea::guildTab;
- Ea::guildTab = 0;
+ Ea::guildTab = nullptr;
delete Ea::partyTab;
- Ea::partyTab = 0;
+ Ea::partyTab = nullptr;
}
}
}
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();
}
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 1c2654087..6b6ffcbb6 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -92,7 +92,7 @@ void NpcHandler::handleMessage(Net::MessageIn &msg)
break;
}
- mDialog = 0;
+ mDialog = nullptr;
}
void NpcHandler::talk(int npcId)
@@ -195,7 +195,7 @@ int NpcHandler::getNpc(Net::MessageIn &msg, bool haveLength)
const int npcId = msg.readInt32();
NpcDialogs::const_iterator diag = mNpcDialogs.find(npcId);
- mDialog = 0;
+ mDialog = nullptr;
if (diag == mNpcDialogs.end())
{