summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions/chat.cpp5
-rw-r--r--src/actions/commands.cpp7
-rw-r--r--src/being/being.cpp10
-rw-r--r--src/being/localplayer.cpp3
-rw-r--r--src/gui/widgets/browserbox_unittest.cc2
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp1
-rw-r--r--src/gui/windows/shopwindow.cpp3
-rw-r--r--src/net/ea/charserverhandler.cpp2
-rw-r--r--src/net/eathena/adminhandler.cpp2
-rw-r--r--src/net/eathena/auctionhandler.cpp2
-rw-r--r--src/net/eathena/battlegroundhandler.cpp1
-rw-r--r--src/net/eathena/beinghandler.cpp1
-rw-r--r--src/net/eathena/buyingstorehandler.cpp1
-rw-r--r--src/net/eathena/buysellhandler.cpp1
-rw-r--r--src/net/eathena/cashshophandler.cpp1
-rw-r--r--src/net/eathena/charserverhandler.cpp1
-rw-r--r--src/net/eathena/charserverrecv.cpp2
-rw-r--r--src/net/eathena/chathandler.cpp1
-rw-r--r--src/net/eathena/elementalhandler.cpp2
-rw-r--r--src/net/eathena/gamehandler.cpp1
-rw-r--r--src/net/eathena/generalhandler.cpp2
-rw-r--r--src/net/eathena/guildhandler.cpp1
-rw-r--r--src/net/eathena/homunculushandler.cpp1
-rw-r--r--src/net/eathena/inventoryhandler.cpp1
-rw-r--r--src/net/eathena/loginhandler.cpp2
-rw-r--r--src/net/eathena/loginrecv.cpp2
-rw-r--r--src/net/eathena/mailhandler.cpp2
-rw-r--r--src/net/eathena/maphandler.cpp2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp2
-rw-r--r--src/net/eathena/npchandler.cpp1
-rw-r--r--src/net/eathena/partyhandler.cpp1
-rw-r--r--src/net/eathena/pethandler.cpp2
-rw-r--r--src/net/eathena/playerhandler.cpp1
-rw-r--r--src/net/eathena/roulettehandler.cpp2
-rw-r--r--src/net/eathena/searchstorehandler.cpp1
-rw-r--r--src/net/tmwa/adminhandler.cpp2
-rw-r--r--src/net/tmwa/auctionhandler.cpp2
-rw-r--r--src/net/tmwa/bankhandler.cpp2
-rw-r--r--src/net/tmwa/battlegroundhandler.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp2
-rw-r--r--src/net/tmwa/buyingstorehandler.cpp2
-rw-r--r--src/net/tmwa/buysellhandler.cpp2
-rw-r--r--src/net/tmwa/cashshophandler.cpp2
-rw-r--r--src/net/tmwa/charserverhandler.cpp2
-rw-r--r--src/net/tmwa/charserverrecv.cpp2
-rw-r--r--src/net/tmwa/chathandler.cpp1
-rw-r--r--src/net/tmwa/elementalhandler.cpp2
-rw-r--r--src/net/tmwa/familyhandler.cpp2
-rw-r--r--src/net/tmwa/friendshandler.cpp2
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/generalhandler.cpp2
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/homunculushandler.cpp2
-rw-r--r--src/net/tmwa/inventoryhandler.cpp2
-rw-r--r--src/net/tmwa/loginhandler.cpp1
-rw-r--r--src/net/tmwa/mailhandler.cpp2
-rw-r--r--src/net/tmwa/maphandler.cpp2
-rw-r--r--src/net/tmwa/markethandler.cpp2
-rw-r--r--src/net/tmwa/mercenaryhandler.cpp2
-rw-r--r--src/net/tmwa/npchandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.cpp2
-rw-r--r--src/net/tmwa/pethandler.cpp2
-rw-r--r--src/net/tmwa/playerhandler.cpp2
-rw-r--r--src/net/tmwa/roulettehandler.cpp2
-rw-r--r--src/net/tmwa/searchstorehandler.cpp2
-rw-r--r--src/net/tmwa/serverfeatures.cpp1
-rw-r--r--src/net/tmwa/skillhandler.cpp2
-rw-r--r--src/net/tmwa/tradehandler.cpp2
-rw-r--r--src/net/tmwa/vendinghandler.cpp2
-rw-r--r--src/resources/beingcommon.cpp7
-rw-r--r--src/resources/inventory/inventory.cpp6
-rw-r--r--src/resources/loaders/xmlloader.cpp1
-rw-r--r--src/resources/mapreader.cpp4
-rw-r--r--src/resources/sdlgfxblitfunc.cpp2
-rw-r--r--src/soundmanager.cpp3
75 files changed, 28 insertions, 132 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index 40ff966be..e1f801c0b 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -300,8 +300,11 @@ impHandler(msg2)
std::string recvnick;
std::string message;
- if ((chatHandler != nullptr) && splitWhisper(event.args, recvnick, message))
+ if (chatHandler != nullptr &&
+ splitWhisper(event.args, recvnick, message))
+ {
chatHandler->privateMessage(recvnick, message);
+ }
return true;
}
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index bad59ec29..f22d7bc93 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -577,15 +577,14 @@ impHandler(sendMail)
impHandler(info)
{
- if ((event.tab == nullptr) ||
- (localPlayer == nullptr) ||
+ if (event.tab == nullptr ||
+ localPlayer == nullptr ||
Net::getNetworkType() == ServerType::TMWATHENA)
{
return false;
}
- if ((event.tab != nullptr) &&
- (guildHandler != nullptr) &&
+ if (guildHandler != nullptr &&
event.tab->getType() == ChatTabType::GUILD)
{
const Guild *const guild = localPlayer->getGuild();
diff --git a/src/being/being.cpp b/src/being/being.cpp
index fb19b2f61..deac96e2c 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -652,7 +652,7 @@ void Being::takeDamage(Being *restrict const attacker,
const int attackId,
const int level) restrict2
{
- if ((userPalette == nullptr) || (attacker == nullptr))
+ if (userPalette == nullptr || attacker == nullptr)
return;
BLOCK_START("Being::takeDamage1")
@@ -726,7 +726,7 @@ void Being::takeDamage(Being *restrict const attacker,
color = &userPalette->getColor(UserColorId::HIT_MONSTER_PLAYER);
}
- if ((chatWindow != nullptr) && mShowBattleEvents)
+ if (chatWindow != nullptr && mShowBattleEvents)
{
if (this == localPlayer)
{
@@ -746,7 +746,7 @@ void Being::takeDamage(Being *restrict const attacker,
ChatMsgType::BY_PLAYER);
}
}
- if ((font != nullptr) && (particleEngine != nullptr) && (color != nullptr))
+ if (font != nullptr && particleEngine != nullptr)
{
// Show damage number
particleEngine->addTextSplashEffect(damage,
@@ -2260,13 +2260,13 @@ void Being::drawEmotion(Graphics *restrict const graphics,
{
int x;
int y;
- if (mShowBadges == 2 && (mDispName != nullptr) && (gui != nullptr))
+ if (mShowBadges == 2 && mDispName != nullptr && gui != nullptr)
{
const Font *restrict const font = gui->getFont();
x = mDispName->getX() - offsetX + mDispName->getWidth();
y = mDispName->getY() - offsetY - font->getHeight();
}
- else if (mShowBadges == 3 && (mDispName != nullptr) && (gui != nullptr))
+ else if (mShowBadges == 3 && mDispName != nullptr && gui != nullptr)
{
x = px + 8 - mBadgesCount * 8;
y = mDispName->getY() - offsetY;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index c0f4caa80..5c275b3f6 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -106,12 +106,9 @@ typedef std::map<int, Guild*>::const_iterator GuildMapCIter;
LocalPlayer *localPlayer = nullptr;
-class SkillDialog;
-
extern OkDialog *weightNotice;
extern time_t weightNoticeTime;
-
LocalPlayer::LocalPlayer(const BeingId id,
const BeingTypeId subtype) :
Being(id, ActorType::Player, subtype, nullptr),
diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc
index b3f536452..1be712783 100644
--- a/src/gui/widgets/browserbox_unittest.cc
+++ b/src/gui/widgets/browserbox_unittest.cc
@@ -47,8 +47,6 @@
#include "debug.h"
-
-
TEST_CASE("BrowserBox leak test1", "")
{
logger = new Logger();
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index 400ae0d88..3990137e0 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -485,7 +485,6 @@ void ItemShortcutContainer::mousePressed(MouseEvent &event)
{
event.consume();
if (popupMenu != nullptr &&
- selShortcut != nullptr &&
viewport != nullptr)
{
popupMenu->showItemPopup(viewport->mMouseX,
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index 5dbc0bec9..9f4872e62 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -532,7 +532,8 @@ void ShopWindow::loadList()
const std::string shopListName = settings.serverConfigDir
+ "/shoplist.txt";
- if ((stat(shopListName.c_str(), &statbuf) == 0) && S_ISREG(statbuf.st_mode))
+ if (stat(shopListName.c_str(), &statbuf) == 0 &&
+ S_ISREG(statbuf.st_mode))
{
shopFile.open(shopListName.c_str(), std::ios::in);
if (!shopFile.is_open())
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index a64d70a46..d0703e501 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -31,8 +31,6 @@
#include "debug.h"
-
-
namespace Ea
{
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 8a88f15d4..87ab97fec 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -32,8 +32,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp
index ddae97485..24c09f16a 100644
--- a/src/net/eathena/auctionhandler.cpp
+++ b/src/net/eathena/auctionhandler.cpp
@@ -29,8 +29,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/battlegroundhandler.cpp b/src/net/eathena/battlegroundhandler.cpp
index 961e3781e..606b90cc1 100644
--- a/src/net/eathena/battlegroundhandler.cpp
+++ b/src/net/eathena/battlegroundhandler.cpp
@@ -25,7 +25,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 80a62e38e..d87b37b3d 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -28,7 +28,6 @@
#include "debug.h"
-
extern int packetVersion;
extern int serverVersion;
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 518e1bfaa..32ec084c9 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -32,7 +32,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp
index 3bf349cc0..19d555ff3 100644
--- a/src/net/eathena/buysellhandler.cpp
+++ b/src/net/eathena/buysellhandler.cpp
@@ -29,7 +29,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 9928c1a94..40af5324e 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -28,7 +28,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 219961ba7..a184abd07 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -37,7 +37,6 @@
#include "debug.h"
-
extern int packetVersion;
extern int serverVersion;
diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp
index f11a84efa..44c90a227 100644
--- a/src/net/eathena/charserverrecv.cpp
+++ b/src/net/eathena/charserverrecv.cpp
@@ -54,10 +54,8 @@
#include "debug.h"
-
extern int packetVersion;
-
namespace EAthena
{
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index cf40d215d..0b630ee63 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -38,7 +38,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/elementalhandler.cpp b/src/net/eathena/elementalhandler.cpp
index 4bdc8beb1..cc27fc39b 100644
--- a/src/net/eathena/elementalhandler.cpp
+++ b/src/net/eathena/elementalhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp
index c80a11cd3..ca7fdf81a 100644
--- a/src/net/eathena/gamehandler.cpp
+++ b/src/net/eathena/gamehandler.cpp
@@ -39,7 +39,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index a5c14c67f..71187cac7 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -72,8 +72,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 83182f0b2..178a628fc 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -38,7 +38,6 @@
GuildTab *guildTab = nullptr;
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp
index 832ddb3be..482d29bce 100644
--- a/src/net/eathena/homunculushandler.cpp
+++ b/src/net/eathena/homunculushandler.cpp
@@ -29,7 +29,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index ae4c68b89..7044b1611 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -35,7 +35,6 @@
#include "debug.h"
-
extern int packetVersion;
// this conversion from bit corrupted LOOK_* to EquipSlot
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index 78d5d54ff..1c8e25e69 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -35,8 +35,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/loginrecv.cpp b/src/net/eathena/loginrecv.cpp
index 92de540da..13818c9cf 100644
--- a/src/net/eathena/loginrecv.cpp
+++ b/src/net/eathena/loginrecv.cpp
@@ -260,7 +260,7 @@ void LoginRecv::processLoginData(Net::MessageIn &msg)
msg.readInt16("new");
if (msg.getVersion() >= 20170315)
{
- for(int f = 0; f < 32; f ++)
+ for (int f = 0; f < 32; f ++)
msg.readUInt8("unused2");
}
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index f00497def..4ecbfdda4 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -27,8 +27,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/maphandler.cpp b/src/net/eathena/maphandler.cpp
index c8d65509b..042f87778 100644
--- a/src/net/eathena/maphandler.cpp
+++ b/src/net/eathena/maphandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 56e458a1c..0159a5cbd 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -29,8 +29,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 0790cbfcf..38a54a6fd 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -43,7 +43,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 231aa61f9..7f59ec4db 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -37,7 +37,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index b4a88c027..043acbedc 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -29,8 +29,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index 86274c272..02c56c869 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/playerhandler.cpp
@@ -44,7 +44,6 @@
#include "debug.h"
-
extern int packetVersion;
extern int serverVersion;
diff --git a/src/net/eathena/roulettehandler.cpp b/src/net/eathena/roulettehandler.cpp
index 2f9b52205..6e107af38 100644
--- a/src/net/eathena/roulettehandler.cpp
+++ b/src/net/eathena/roulettehandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace EAthena
{
diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp
index b39577d3c..d9b4625cc 100644
--- a/src/net/eathena/searchstorehandler.cpp
+++ b/src/net/eathena/searchstorehandler.cpp
@@ -25,7 +25,6 @@
#include "debug.h"
-
extern int packetVersion;
namespace EAthena
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 1be501c66..cd6583520 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -32,8 +32,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/auctionhandler.cpp b/src/net/tmwa/auctionhandler.cpp
index 4f7932410..d1538c1db 100644
--- a/src/net/tmwa/auctionhandler.cpp
+++ b/src/net/tmwa/auctionhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/bankhandler.cpp b/src/net/tmwa/bankhandler.cpp
index d1c78c35f..521eb6d4c 100644
--- a/src/net/tmwa/bankhandler.cpp
+++ b/src/net/tmwa/bankhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/battlegroundhandler.cpp b/src/net/tmwa/battlegroundhandler.cpp
index 64d0b95bb..ecb80f177 100644
--- a/src/net/tmwa/battlegroundhandler.cpp
+++ b/src/net/tmwa/battlegroundhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index c0729b505..da0b18fbf 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -28,8 +28,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp
index 156d6c72c..53fe39fa7 100644
--- a/src/net/tmwa/buyingstorehandler.cpp
+++ b/src/net/tmwa/buyingstorehandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 221191056..e343614bd 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -35,8 +35,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/cashshophandler.cpp b/src/net/tmwa/cashshophandler.cpp
index 912dfb0b5..0c2315560 100644
--- a/src/net/tmwa/cashshophandler.cpp
+++ b/src/net/tmwa/cashshophandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 39dc852d5..200d09703 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -39,8 +39,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp
index 95cf04f26..0130960e0 100644
--- a/src/net/tmwa/charserverrecv.cpp
+++ b/src/net/tmwa/charserverrecv.cpp
@@ -52,8 +52,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 4a1741a12..1b706495f 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -36,7 +36,6 @@
#include "debug.h"
-
extern unsigned int tmwServerVersion;
namespace TmwAthena
diff --git a/src/net/tmwa/elementalhandler.cpp b/src/net/tmwa/elementalhandler.cpp
index b19ba62c8..bf9caae25 100644
--- a/src/net/tmwa/elementalhandler.cpp
+++ b/src/net/tmwa/elementalhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/familyhandler.cpp b/src/net/tmwa/familyhandler.cpp
index 15648cfc8..b347e9880 100644
--- a/src/net/tmwa/familyhandler.cpp
+++ b/src/net/tmwa/familyhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/friendshandler.cpp b/src/net/tmwa/friendshandler.cpp
index 8b5f2d298..99f99c576 100644
--- a/src/net/tmwa/friendshandler.cpp
+++ b/src/net/tmwa/friendshandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index e3baec5fd..2fec57df3 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -37,8 +37,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 736f8d859..577d384b7 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -72,8 +72,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 2c557f1a1..926d15d59 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -23,8 +23,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp
index 2ba8ed91e..320e43b7d 100644
--- a/src/net/tmwa/homunculushandler.cpp
+++ b/src/net/tmwa/homunculushandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 65d0019f6..cf4c2f269 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -33,8 +33,6 @@
#include "debug.h"
-
-
// missing EQUIP_RING1_SLOT
const EquipSlot::Type EQUIP_CONVERT[] =
{
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 22ea04859..ea57a6f5a 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -32,7 +32,6 @@
#include "debug.h"
-
extern unsigned int tmwServerVersion;
namespace TmwAthena
diff --git a/src/net/tmwa/mailhandler.cpp b/src/net/tmwa/mailhandler.cpp
index 84b60d63b..c339fd067 100644
--- a/src/net/tmwa/mailhandler.cpp
+++ b/src/net/tmwa/mailhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/maphandler.cpp b/src/net/tmwa/maphandler.cpp
index ba169c285..277cf8e9c 100644
--- a/src/net/tmwa/maphandler.cpp
+++ b/src/net/tmwa/maphandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/markethandler.cpp b/src/net/tmwa/markethandler.cpp
index c7733a578..7f58df4bc 100644
--- a/src/net/tmwa/markethandler.cpp
+++ b/src/net/tmwa/markethandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp
index ce0344b17..9e1b58c50 100644
--- a/src/net/tmwa/mercenaryhandler.cpp
+++ b/src/net/tmwa/mercenaryhandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 7eefe800f..e58ca4d69 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -39,8 +39,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index 59b8f8db2..64bebcde7 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -36,8 +36,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index c8eb797d1..adb82f16f 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 5240396e9..0bfe06fd2 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -44,8 +44,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/roulettehandler.cpp b/src/net/tmwa/roulettehandler.cpp
index c811b4adc..33e16b870 100644
--- a/src/net/tmwa/roulettehandler.cpp
+++ b/src/net/tmwa/roulettehandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/searchstorehandler.cpp b/src/net/tmwa/searchstorehandler.cpp
index 5a57a3634..54de0cc63 100644
--- a/src/net/tmwa/searchstorehandler.cpp
+++ b/src/net/tmwa/searchstorehandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 1cdbc77e0..5af454314 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -24,7 +24,6 @@
extern unsigned int tmwServerVersion;
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp
index 4fe1022c3..47d08ac62 100644
--- a/src/net/tmwa/skillhandler.cpp
+++ b/src/net/tmwa/skillhandler.cpp
@@ -27,8 +27,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 242817872..10273c7a7 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -33,8 +33,6 @@
#include "debug.h"
-
-
extern std::string tradePartnerName;
namespace TmwAthena
diff --git a/src/net/tmwa/vendinghandler.cpp b/src/net/tmwa/vendinghandler.cpp
index c6d760e4a..6742b762c 100644
--- a/src/net/tmwa/vendinghandler.cpp
+++ b/src/net/tmwa/vendinghandler.cpp
@@ -22,8 +22,6 @@
#include "debug.h"
-
-
namespace TmwAthena
{
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp
index ec3744da0..7401933a6 100644
--- a/src/resources/beingcommon.cpp
+++ b/src/resources/beingcommon.cpp
@@ -58,15 +58,16 @@ void BeingCommon::readWalkingAttributes(BeingInfo *const info,
XmlNodePtrConst node,
const int moreBlockFlags)
{
- unsigned char block = 0;
+ uint8_t block = 0;
std::string walkStr = XML::getProperty(
node, "walkType", "walk");
- const unsigned char allFlags = BlockMask::GROUND |
+ const uint8_t allFlags = CAST_U8(
+ BlockMask::GROUND |
BlockMask::WALL |
BlockMask::WATER |
BlockMask::AIR |
- moreBlockFlags;
+ moreBlockFlags);
StringVect tokens;
splitToStringVector(tokens, walkStr, ',');
FOR_EACH (StringVectCIter, it, tokens)
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index 97bb255fe..df7104d03 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -492,8 +492,12 @@ void Inventory::virtualRestore(const Item *const item,
mVirtualRemove[index] -= amount;
if (mVirtualRemove[index] < 0)
mVirtualRemove.erase(index);
- if (index < 0 || index >= CAST_S32(mSize) || (mItems[index] == nullptr))
+ if (index < 0 ||
+ index >= CAST_S32(mSize) ||
+ mItems[index] == nullptr)
+ {
return;
+ }
mItems[index]->mQuantity += amount;
}
}
diff --git a/src/resources/loaders/xmlloader.cpp b/src/resources/loaders/xmlloader.cpp
index 61618530e..2374e44d1 100644
--- a/src/resources/loaders/xmlloader.cpp
+++ b/src/resources/loaders/xmlloader.cpp
@@ -61,4 +61,3 @@ XML::Document *Loader::getXml(const std::string &idPath,
return static_cast<XML::Document*>(ResourceManager::get(
"xml_" + idPath, ResourceLoader::load, &rl));
}
-
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 22fcd7bd8..cc9a2917d 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -627,9 +627,9 @@ inline static void setTile(Map *const map,
case MapLayerType::HEIGHTS:
{
- if ((set == nullptr) || (heights == nullptr))
+ if (set == nullptr || heights == nullptr)
break;
- if ((heights != nullptr) && map->getVersion() >= 2)
+ if (map->getVersion() >= 2)
{
heights->setHeight(x, y, CAST_U8(
gid - set->getFirstGid() + 1));
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index 89fe0b21e..e635c20d5 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -337,7 +337,7 @@ static void _SDL_gfxBlitBlitterRGBA(SDL_gfxBlitInfo *info)
const int srcskip = info->s_skip;
Uint8 *dst = info->d_pixels;
const int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
+ const SDL_PixelFormat *const srcfmt = info->src;
while ((height--) != 0)
{
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp
index 1e8561ca7..21cf9a528 100644
--- a/src/soundmanager.cpp
+++ b/src/soundmanager.cpp
@@ -516,8 +516,7 @@ void SoundManager::playGuiSfx(const std::string &path)
if (sample != nullptr)
{
logger->log("SoundManager::playGuiSfx() Playing: %s", path.c_str());
- const int ret = static_cast<const int>(
- sample->play(0, 120, mGuiChannel));
+ const int ret = static_cast<int>(sample->play(0, 120, mGuiChannel));
if (ret != -1)
mGuiChannel = ret;
if (!mCacheSounds)