diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-07 19:34:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-07 19:34:52 +0300 |
commit | 9e83411f7e4147d09af5a5006888dcc187ea0ef8 (patch) | |
tree | c084bdf8afabc6220779645dcb5dbf71af6a151f /src/net | |
parent | bc7d91cc0c9c0f6dcad01d612932c6899afb5514 (diff) | |
download | manaplus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.gz manaplus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.bz2 manaplus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.xz manaplus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.zip |
Fix some warnings under gcc 4.7.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/download.cpp | 20 | ||||
-rw-r--r-- | src/net/ea/gamehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.h | 3 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/manaserv/network.cpp | 4 | ||||
-rw-r--r-- | src/net/manaserv/partyhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/net.cpp | 34 | ||||
-rw-r--r-- | src/net/tmwa/messagehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 4 |
9 files changed, 38 insertions, 37 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp index 969318b19..dcce218a9 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -53,12 +53,12 @@ Download::Download(void *ptr, const std::string &url, mPtr(ptr), mUrl(url), mFileName(""), - mWriteFunction(NULL), + mWriteFunction(nullptr), mAdler(0), mUpdateFunction(updateFunction), - mThread(NULL), - mCurl(NULL), - mHeaders(NULL), + mThread(nullptr), + mCurl(nullptr), + mHeaders(nullptr), mIgnoreError(ignoreError) { mError = static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1)); @@ -158,9 +158,9 @@ void Download::cancel() mOptions.cancel = true; if (mThread && SDL_GetThreadID(mThread)) - SDL_WaitThread(mThread, NULL); + SDL_WaitThread(mThread, nullptr); - mThread = NULL; + mThread = nullptr; } char *Download::getError() @@ -204,14 +204,14 @@ int Download::downloadThread(void *ptr) while (attempts < 3 && !complete && !d->mOptions.cancel) { - FILE *file = NULL; + FILE *file = nullptr; d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_STARTING, 0, 0); if (d->mOptions.cancel) { //need terminate thread? - d->mThread = NULL; + d->mThread = nullptr; return 0; } @@ -335,7 +335,7 @@ int Download::downloadThread(void *ptr) if (d->mOptions.cancel) { //need ternibate thread? - d->mThread = NULL; + d->mThread = nullptr; return 0; } attempts++; @@ -354,7 +354,7 @@ int Download::downloadThread(void *ptr) d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_COMPLETE, 0, 0); } - d->mThread = NULL; + d->mThread = nullptr; return 0; } diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index a202cbc86..b74f2384d 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -96,7 +96,7 @@ void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) void GameHandler::processMapQuitResponse(Net::MessageIn &msg) { if (msg.readInt8()) - new OkDialog(_("Game"), _("Request to quit denied!"), NULL); + new OkDialog(_("Game"), _("Request to quit denied!"), nullptr); } } // namespace Ea diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index 3a99bc47f..72b993c4b 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -25,6 +25,7 @@ #include "equipment.h" #include "inventory.h" +#include "localconsts.h" #include "logger.h" #include "playerinfo.h" @@ -58,7 +59,7 @@ class EquipBackend : public Equipment::Backend { int invyIndex = mEquipment[index]; if (invyIndex == -1) - return NULL; + return nullptr; if (PlayerInfo::getInventory()) return PlayerInfo::getInventory()->getItem(invyIndex); diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 3009426ae..02af3dbb4 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -59,7 +59,7 @@ namespace { void action(const gcn::ActionEvent &event A_UNUSED) { - weightNotice = NULL; + weightNotice = nullptr; } } weightListener; @@ -72,7 +72,7 @@ namespace { if (Net::getPlayerHandler()) Net::getPlayerHandler()->respawn(); - deathNotice = NULL; + deathNotice = nullptr; Game::closeDialogs(); diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp index b83bc5748..3303934bd 100644 --- a/src/net/manaserv/network.cpp +++ b/src/net/manaserv/network.cpp @@ -56,9 +56,9 @@ void initialize() } #if defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF - client = enet_host_create(NULL, 3, 0, 0, 0); + client = enet_host_create(nullptr, 3, 0, 0, 0); #else - client = enet_host_create(NULL, 3, 0, 0); + client = enet_host_create(nullptr, 3, 0, 0); #endif if (!client) diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp index 987a40dc5..660657f44 100644 --- a/src/net/manaserv/partyhandler.cpp +++ b/src/net/manaserv/partyhandler.cpp @@ -96,7 +96,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) if (msg.readInt8() == ERRMSG_OK) { mParty->clearMembers(); - player_node->setParty(NULL); + player_node->setParty(nullptr); } } break; diff --git a/src/net/net.cpp b/src/net/net.cpp index 49bb58903..933f7686b 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -48,21 +48,21 @@ #include "debug.h" -Net::AdminHandler *adminHandler = NULL; -Net::CharHandler *charHandler = NULL; -Net::ChatHandler *chatHandler = NULL; -Net::GeneralHandler *generalHandler = NULL; -Net::InventoryHandler *inventoryHandler = NULL; -Net::LoginHandler *loginHandler = NULL; -Net::GameHandler *gameHandler = NULL; -Net::GuildHandler *guildHandler = NULL; -Net::NpcHandler *npcHandler = NULL; -Net::PartyHandler *partyHandler = NULL; -Net::PlayerHandler *playerHandler = NULL; -Net::SpecialHandler *specialHandler = NULL; -Net::TradeHandler *tradeHandler = NULL; -Net::BeingHandler *beingHandler = NULL; -Net::BuySellHandler *buySellHandler = NULL; +Net::AdminHandler *adminHandler = nullptr; +Net::CharHandler *charHandler = nullptr; +Net::ChatHandler *chatHandler = nullptr; +Net::GeneralHandler *generalHandler = nullptr; +Net::InventoryHandler *inventoryHandler = nullptr; +Net::LoginHandler *loginHandler = nullptr; +Net::GameHandler *gameHandler = nullptr; +Net::GuildHandler *guildHandler = nullptr; +Net::NpcHandler *npcHandler = nullptr; +Net::PartyHandler *partyHandler = nullptr; +Net::PlayerHandler *playerHandler = nullptr; +Net::SpecialHandler *specialHandler = nullptr; +Net::TradeHandler *tradeHandler = nullptr; +Net::BeingHandler *beingHandler = nullptr; +Net::BuySellHandler *buySellHandler = nullptr; Net::AdminHandler *Net::getAdminHandler() { @@ -151,13 +151,13 @@ void connectToServer(const ServerInfo &server) // that } - if (networkType == server.type && getGeneralHandler() != NULL) + if (networkType == server.type && getGeneralHandler()) { getGeneralHandler()->reload(); } else { - if (networkType != ServerInfo::UNKNOWN && getGeneralHandler() != NULL) + if (networkType != ServerInfo::UNKNOWN && getGeneralHandler()) getGeneralHandler()->unload(); switch (server.type) diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp index 843339718..830b3bc4f 100644 --- a/src/net/tmwa/messagehandler.cpp +++ b/src/net/tmwa/messagehandler.cpp @@ -32,7 +32,7 @@ namespace TmwAthena { MessageHandler::MessageHandler() - : mNetwork(NULL) + : mNetwork(nullptr) { } diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index e26f48324..6f26035be 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -181,8 +181,8 @@ void Network::disconnect() if (mWorkerThread && SDL_GetThreadID(mWorkerThread)) { - SDL_WaitThread(mWorkerThread, NULL); - mWorkerThread = NULL; + SDL_WaitThread(mWorkerThread, nullptr); + mWorkerThread = nullptr; } if (mSocket) |