summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-12 17:07:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-12 17:07:09 +0300
commit566ae30ff94caf6c92fc7d64f021b567933f8a60 (patch)
treeeae43b8899444f99a97fdd00bc5df8a117c316e9 /src
parent247418a3ec0b50479c7bac80322202b01527ae61 (diff)
downloadmanaverse-566ae30ff94caf6c92fc7d64f021b567933f8a60.tar.gz
manaverse-566ae30ff94caf6c92fc7d64f021b567933f8a60.tar.bz2
manaverse-566ae30ff94caf6c92fc7d64f021b567933f8a60.tar.xz
manaverse-566ae30ff94caf6c92fc7d64f021b567933f8a60.zip
fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/actions/commands.cpp4
-rw-r--r--src/gui/popups/skillpopup.h2
-rw-r--r--src/listeners/pincodelistener.cpp3
-rw-r--r--src/logger.h4
-rw-r--r--src/net/character.h6
-rw-r--r--src/net/chathandler.h5
-rw-r--r--src/net/ea/npchandler.cpp6
-rw-r--r--src/net/ea/tradehandler.cpp3
-rw-r--r--src/net/eathena/adminhandler.cpp19
-rw-r--r--src/net/eathena/beinghandler.cpp29
-rw-r--r--src/net/eathena/charserverhandler.cpp18
-rw-r--r--src/net/eathena/chathandler.cpp7
-rw-r--r--src/net/eathena/inventoryhandler.cpp16
-rw-r--r--src/net/eathena/mailhandler.cpp4
-rw-r--r--src/net/eathena/npchandler.cpp16
-rw-r--r--src/net/eathena/partyhandler.cpp5
-rw-r--r--src/net/eathena/playerhandler.cpp8
-rw-r--r--src/net/eathena/questhandler.cpp2
-rw-r--r--src/net/eathena/serverfeatures.cpp2
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/messagein.cpp6
-rw-r--r--src/net/tmwa/adminhandler.cpp3
-rw-r--r--src/net/tmwa/beinghandler.cpp2
-rw-r--r--src/net/tmwa/mailhandler.cpp3
-rw-r--r--src/net/tmwa/mailhandler.h1
-rw-r--r--src/net/tmwa/serverfeatures.cpp2
-rw-r--r--src/net/tmwa/serverfeatures.h2
-rw-r--r--src/resources/db/itemdb.cpp22
28 files changed, 103 insertions, 99 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 541a09aa0..692837ce6 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -668,7 +668,7 @@ impHandler(debugSpawn)
return true;
}
-impHandler0(serverIgnoreWhisper)
+impHandler(serverIgnoreWhisper)
{
std::string args = getNick(event);
if (args.empty())
@@ -678,7 +678,7 @@ impHandler0(serverIgnoreWhisper)
return true;
}
-impHandler0(serverUnIgnoreWhisper)
+impHandler(serverUnIgnoreWhisper)
{
std::string args = getNick(event);
if (args.empty())
diff --git a/src/gui/popups/skillpopup.h b/src/gui/popups/skillpopup.h
index fc6c47835..d56321e38 100644
--- a/src/gui/popups/skillpopup.h
+++ b/src/gui/popups/skillpopup.h
@@ -67,4 +67,4 @@ class SkillPopup final : public Popup
extern SkillPopup *skillPopup;
-#endif // GUI_POPUPS_ITEMPOPUP_H
+#endif // GUI_POPUPS_SKILLPOPUP_H
diff --git a/src/listeners/pincodelistener.cpp b/src/listeners/pincodelistener.cpp
index 0c64bb73c..8938d0a8a 100644
--- a/src/listeners/pincodelistener.cpp
+++ b/src/listeners/pincodelistener.cpp
@@ -31,7 +31,8 @@ PincodeListener pincodeListener;
void PincodeListener::action(const ActionEvent &event)
{
- EditDialog *const dialog = dynamic_cast<EditDialog*>(event.getSource());
+ const EditDialog *const dialog = dynamic_cast<EditDialog*>(
+ event.getSource());
if (dialog)
{
const std::string pincode = dialog->getMsg();
diff --git a/src/logger.h b/src/logger.h
index ba1aa3f29..d288d7c8d 100644
--- a/src/logger.h
+++ b/src/logger.h
@@ -120,8 +120,8 @@ class Logger final
void dlog(const std::string &str);
void dlog2(const std::string &str,
- const int pos,
- const char* const comment);
+ const int pos,
+ const char* const comment);
#endif
void setDebugLog(const bool n)
diff --git a/src/net/character.h b/src/net/character.h
index bab115b7f..c80482ad5 100644
--- a/src/net/character.h
+++ b/src/net/character.h
@@ -42,9 +42,9 @@ namespace Net
struct Character final
{
Character() :
- slot(0U),
dummy(nullptr),
- data()
+ data(),
+ slot(0U)
{
}
@@ -55,9 +55,9 @@ struct Character final
delete2(dummy);
}
- uint8_t slot; /**< The index in the list of characters */
LocalPlayer *dummy; /**< A dummy representing this character */
PlayerInfoBackend data;
+ uint16_t slot; /**< The index in the list of characters */
};
} // namespace Net
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index 8fce6313d..3a9e3debe 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -66,7 +66,10 @@ class ChatHandler notfinal
virtual void clear() = 0;
- virtual void createChatRoom(const std::string &title, const std::string &password, const int limit, const bool isPublic) = 0;
+ virtual void createChatRoom(const std::string &title,
+ const std::string &password,
+ const int limit,
+ const bool isPublic) = 0;
};
} // namespace Net
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index ef43acd25..fedc7c744 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -82,7 +82,7 @@ void NpcHandler::processNpcMessage(Net::MessageIn &msg)
mDialog->addText(message);
}
-void NpcHandler::processNpcClose(Net::MessageIn &msg A_UNUSED)
+void NpcHandler::processNpcClose(Net::MessageIn &msg)
{
// Show the close button
getNpc(msg);
@@ -91,7 +91,7 @@ void NpcHandler::processNpcClose(Net::MessageIn &msg A_UNUSED)
mDialog->showCloseButton();
}
-void NpcHandler::processNpcNext(Net::MessageIn &msg A_UNUSED)
+void NpcHandler::processNpcNext(Net::MessageIn &msg)
{
// Show the next button
getNpc(msg);
@@ -100,7 +100,7 @@ void NpcHandler::processNpcNext(Net::MessageIn &msg A_UNUSED)
mDialog->showNextButton();
}
-void NpcHandler::processNpcIntInput(Net::MessageIn &msg A_UNUSED)
+void NpcHandler::processNpcIntInput(Net::MessageIn &msg)
{
// Request for an integer
getNpc(msg);
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index d22a602a6..fbb7a5629 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -209,7 +209,8 @@ void TradeHandler::processTradeComplete(Net::MessageIn &msg A_UNUSED)
PlayerInfo::setTrading(false);
}
-void TradeHandler::processTradeRequestContinue(const std::string &partner) const
+void TradeHandler::processTradeRequestContinue(const std::string &partner)
+ const
{
if (player_relations.hasPermission(partner,
PlayerRelation::TRADE))
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index c05c00771..7ef2dc645 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -24,11 +24,6 @@
#include "notifymanager.h"
-#include "gui/chatconsts.h"
-
-#include "net/chathandler.h"
-#include "net/net.h"
-
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -114,8 +109,8 @@ void AdminHandler::warp(const std::string &map, const int x, const int y) const
{
MessageOut outMsg(CMSG_PLAYER_MAPMOVE);
outMsg.writeString(map, 16, "map");
- outMsg.writeInt16(x, "x");
- outMsg.writeInt16(y, "y");
+ outMsg.writeInt16(static_cast<int16_t>(x), "x");
+ outMsg.writeInt16(static_cast<int16_t>(y), "y");
}
void AdminHandler::resetStats() const
@@ -151,8 +146,8 @@ void AdminHandler::mute(const Being *const being,
MessageOut outMsg(CMSG_ADMIN_MUTE);
outMsg.writeInt32(being->getId(), "account id");
- outMsg.writeInt8(type, "type");
- outMsg.writeInt16(limit, "value");
+ outMsg.writeInt8(static_cast<int8_t>(type), "type");
+ outMsg.writeInt16(static_cast<int16_t>(limit), "value");
}
void AdminHandler::muteName(const std::string &name) const
@@ -174,9 +169,9 @@ void AdminHandler::setTileType(const int x, const int y,
const int type) const
{
MessageOut outMsg(CMSG_ADMIN_SET_TILE_TYPE);
- outMsg.writeInt16(x, "x");
- outMsg.writeInt16(y, "y");
- outMsg.writeInt16(type, "type");
+ outMsg.writeInt16(static_cast<int16_t>(x), "x");
+ outMsg.writeInt16(static_cast<int16_t>(y), "y");
+ outMsg.writeInt16(static_cast<int16_t>(type), "type");
}
void AdminHandler::unequipAll(const Being *const being) const
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 7f00dc9de..32305c4b1 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -736,7 +736,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const
requestNameById(id);
}
- uint8_t dir = dstBeing->getDirectionDelayed();
+ const uint8_t dir = dstBeing->getDirectionDelayed();
if (dir)
{
if (dir != dstBeing->getDirection())
@@ -874,7 +874,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
int16_t speed = msg.readInt16("speed");
const uint16_t stunMode = msg.readInt16("opt1");
// probably wrong effect usage
- uint32_t statusEffects = msg.readInt16("opt2");
+ const uint32_t statusEffects = msg.readInt16("opt2");
msg.readInt32("option");
const int16_t job = msg.readInt16("class");
@@ -946,13 +946,14 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
const int hairColor = msg.readInt16("hair color");
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
- uint16_t gloves = msg.readInt16("head dir / gloves");
+ const uint16_t gloves = msg.readInt16("head dir / gloves");
// may be use robe as gloves?
msg.readInt16("robe");
msg.readInt32("guild id");
msg.readInt16("guild emblem");
msg.readInt16("manner");
- dstBeing->setStatusEffectBlock(32, msg.readInt32("opt3"));
+ dstBeing->setStatusEffectBlock(32, static_cast<uint16_t>(
+ msg.readInt32("opt3")));
msg.readUInt8("karma");
uint8_t gender = msg.readUInt8("gender");
@@ -1036,7 +1037,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
// {
const uint16_t stunMode = msg.readInt16("opt1");
// probably wrong effect usage
- uint32_t statusEffects = msg.readInt16("opt2");
+ const uint32_t statusEffects = msg.readInt16("opt2");
// }
// else
// {
@@ -1109,13 +1110,14 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
const int hairColor = msg.readInt16("hair color");
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
- uint16_t gloves = msg.readInt16("head dir / gloves");
+ const uint16_t gloves = msg.readInt16("head dir / gloves");
// may be use robe as gloves?
msg.readInt16("robe");
msg.readInt32("guild id");
msg.readInt16("guild emblem");
msg.readInt16("manner");
- dstBeing->setStatusEffectBlock(32, msg.readInt32("opt3"));
+ dstBeing->setStatusEffectBlock(32, static_cast<uint16_t>(
+ msg.readInt32("opt3")));
msg.readUInt8("karma");
uint8_t gender = msg.readUInt8("gender");
@@ -1151,10 +1153,10 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
// because server don't send direction in move packet, we fixing it
- int d = 0;
+ uint8_t d = 0;
if (srcX == dstX && srcY == dstY)
{ // if player did one step from invisible area to visible,
- //move path is broken
+ // move path is broken
int x2 = localPlayer->getTileX();
int y2 = localPlayer->getTileY();
if (abs(x2 - srcX) > abs(y2 - srcY))
@@ -1195,13 +1197,13 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
// Information about a being in range
const int id = msg.readInt32("being id");
mSpawnId = id;
- int spawnId = id;
+ const int spawnId = id;
int16_t speed = msg.readInt16("speed");
// if (visible)
// {
const uint16_t stunMode = msg.readInt16("opt1");
// probably wrong effect usage
- uint32_t statusEffects = msg.readInt16("opt2");
+ const uint32_t statusEffects = msg.readInt16("opt2");
// }
// else
// {
@@ -1274,13 +1276,14 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
const int hairColor = msg.readInt16("hair color");
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
- uint16_t gloves = msg.readInt16("head dir / gloves");
+ const uint16_t gloves = msg.readInt16("head dir / gloves");
// may be use robe as gloves?
msg.readInt16("robe");
msg.readInt32("guild id");
msg.readInt16("guild emblem");
msg.readInt16("manner");
- dstBeing->setStatusEffectBlock(32, msg.readInt32("opt3"));
+ dstBeing->setStatusEffectBlock(32, static_cast<uint16_t>(
+ msg.readInt32("opt3")));
msg.readUInt8("karma");
uint8_t gender = msg.readUInt8("gender");
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 2f6898303..cea59955c 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -401,25 +401,25 @@ void CharServerHandler::processPincodeStatus(Net::MessageIn &msg)
const uint16_t state = static_cast<uint16_t>(msg.readInt16("state"));
switch (state)
{
- case 0: // pin ok
+ case 0: // pin ok
break;
- case 1: // ask for pin
+ case 1: // ask for pin
break;
- case 2: // create new pin
- case 4: // create new pin?
+ case 2: // create new pin
+ case 4: // create new pin?
{
mNeedCreatePin = true;
break;
}
- case 3: // pin must be changed
+ case 3: // pin must be changed
break;
- case 5: // client show error?
+ case 5: // client show error?
break;
- case 6: // Unable to use your KSSN number
+ case 6: // Unable to use your KSSN number
break;
- case 7: // char select window shows a button
+ case 7: // char select window shows a button
break;
- case 8: // pincode was incorrect
+ case 8: // pincode was incorrect
break;
default:
logger->log("processPincodeStatus: unknown pin state: %d",
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 031222e3e..14c0fcea5 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -252,9 +252,10 @@ void ChatHandler::createChatRoom(const std::string &title,
const bool isPublic)
{
MessageOut outMsg(CMSG_CREAYE_CHAT_ROOM);
- outMsg.writeInt16(password.size() + title.size() + 5, "len");
+ outMsg.writeInt16(static_cast<int16_t>(
+ password.size() + title.size() + 5), "len");
outMsg.writeInt16(static_cast<int16_t>(limit), "limit");
- outMsg.writeInt8(isPublic ? 1 : 0, "public");
+ outMsg.writeInt8(static_cast<int8_t>(isPublic ? 1 : 0), "public");
outMsg.writeString(password, 8, "password");
outMsg.writeString(title, 36, "title");
}
@@ -312,7 +313,7 @@ void ChatHandler::processChat(Net::MessageIn &msg)
void ChatHandler::processGmChat2(Net::MessageIn &msg)
{
- int chatMsgLength = msg.readInt16("len") - 16;
+ const int chatMsgLength = msg.readInt16("len") - 16;
msg.readInt32("font color");
msg.readInt16("font type");
msg.readInt16("font size");
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 958866650..6b4a54abe 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -242,15 +242,17 @@ void InventoryHandler::moveItem2(const int source,
void InventoryHandler::useCard(const int index) const
{
MessageOut outMsg(CMSG_PLAYER_USE_CARD);
- outMsg.writeInt16(index + INVENTORY_OFFSET, "index");
+ outMsg.writeInt16(static_cast<int16_t>(index + INVENTORY_OFFSET), "index");
}
void InventoryHandler::insertCard(const int cardIndex,
const int itemIndex) const
{
MessageOut outMsg(CMSG_PLAYER_INSERT_CARD);
- outMsg.writeInt16(cardIndex + INVENTORY_OFFSET, "card index");
- outMsg.writeInt16(itemIndex + INVENTORY_OFFSET, "item index");
+ outMsg.writeInt16(static_cast<int16_t>(cardIndex + INVENTORY_OFFSET),
+ "card index");
+ outMsg.writeInt16(static_cast<int16_t>(itemIndex + INVENTORY_OFFSET),
+ "item index");
}
void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
@@ -267,6 +269,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
equipment->setBackend(&mEquips);
}
const int number = (msg.getLength() - 4) / 31;
+ const uint8_t identified = 1;
for (int loop = 0; loop < number; loop++)
{
@@ -288,7 +291,6 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
msg.readInt8("flags");
// need get actual identify flag
- uint8_t identified = 1;
if (inventory)
{
inventory->setItem(index, itemId, 1, refine,
@@ -401,6 +403,7 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
msg.readString(24, "storage name");
const int number = (msg.getLength() - 4) / 23;
+ const uint8_t identified = 1;
for (int loop = 0; loop < number; loop++)
{
@@ -418,7 +421,6 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
msg.readInt8("flags");
// need get actual identify flag
- uint8_t identified = 1;
if (playerInvintory)
{
// Trick because arrows are not considered equipment
@@ -500,6 +502,7 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
BLOCK_START("InventoryHandler::processPlayerStorageEquip")
msg.readInt16("len");
const int number = (msg.getLength() - 4 - 24) / 31;
+ const uint8_t identified = 1;
msg.readString(24, "storage name");
for (int loop = 0; loop < number; loop++)
@@ -521,7 +524,6 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
msg.readInt8("flags");
// need get identified from flags
- uint8_t identified = 1;
mInventoryItems.push_back(Ea::InventoryItem(index,
itemId, amount, refine, identified, false));
}
@@ -536,7 +538,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
const int amount = msg.readInt32("amount");
const int itemId = msg.readInt16("item id");
msg.readUInt8("type");
- unsigned char identified = msg.readUInt8("identify");
+ const unsigned char identified = msg.readUInt8("identify");
msg.readUInt8("attribute");
const uint8_t refine = msg.readUInt8("refine");
msg.readInt16("card0");
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index 3cbefb623..4a28061a3 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -46,7 +46,7 @@ MailHandler::MailHandler() :
void MailHandler::handleMessage(Net::MessageIn &msg)
{
- switch(msg.getId())
+ switch (msg.getId())
{
case SMSG_MAIL_OPEN_WINDOW:
processMailOpen(msg);
@@ -60,7 +60,7 @@ void MailHandler::handleMessage(Net::MessageIn &msg)
void MailHandler::processMailOpen(Net::MessageIn &msg) const
{
const int flag = msg.readInt32("flag");
- switch(flag)
+ switch (flag)
{
case 0: // open window
break;
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index cef952252..90a441d0a 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -203,10 +203,10 @@ void NpcHandler::produceMix(const int nameId,
const int materialId3) const
{
MessageOut outMsg(CMSG_NPC_PRODUCE_MIX);
- outMsg.writeInt16(nameId, "name id");
- outMsg.writeInt16(materialId1, "material 1");
- outMsg.writeInt16(materialId2, "material 2");
- outMsg.writeInt16(materialId3, "material 3");
+ outMsg.writeInt16(static_cast<int16_t>(nameId), "name id");
+ outMsg.writeInt16(static_cast<int16_t>(materialId1), "material 1");
+ outMsg.writeInt16(static_cast<int16_t>(materialId2), "material 2");
+ outMsg.writeInt16(static_cast<int16_t>(materialId3), "material 3");
}
void NpcHandler::cooking(const CookingType::Type type,
@@ -214,7 +214,7 @@ void NpcHandler::cooking(const CookingType::Type type,
{
MessageOut outMsg(CMSG_NPC_COOKING);
outMsg.writeInt16(static_cast<int16_t>(type), "type");
- outMsg.writeInt16(nameId, "name id");
+ outMsg.writeInt16(static_cast<int16_t>(nameId), "name id");
}
void NpcHandler::repair(const int index) const
@@ -232,19 +232,19 @@ void NpcHandler::refine(const int index) const
void NpcHandler::identify(const int index) const
{
MessageOut outMsg(CMSG_NPC_IDENTIFY);
- outMsg.writeInt16(index, "index");
+ outMsg.writeInt16(static_cast<int16_t>(index), "index");
}
void NpcHandler::selectArrow(const int nameId) const
{
MessageOut outMsg(CMSG_NPC_SELECT_ARROW);
- outMsg.writeInt16(nameId, "name id");
+ outMsg.writeInt16(static_cast<int16_t>(nameId), "name id");
}
void NpcHandler::selectAutoSpell(const int skillId) const
{
MessageOut outMsg(CMSG_NPC_SELECT_AUTO_SPELL);
- outMsg.writeInt32(skillId, "skill id");
+ outMsg.writeInt32(static_cast<int16_t>(skillId), "skill id");
}
int NpcHandler::getNpc(Net::MessageIn &msg)
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 5ef628744..ab5d17d47 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -150,7 +150,7 @@ void PartyHandler::inviteResponse(const std::string &inviter A_UNUSED,
{
MessageOut outMsg(CMSG_PARTY_INVITED2);
outMsg.writeInt32(localPlayer->getId());
- outMsg.writeInt8(accept ? 1 : 0);
+ outMsg.writeInt8(static_cast<int8_t>(accept ? 1 : 0));
}
}
@@ -432,7 +432,8 @@ void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const
nick);
break;
case 5:
- NotifyManager::notify(NotifyTypes::PARTY_INVITE_PARTY_BLOCKED_INVITE,
+ NotifyManager::notify(
+ NotifyTypes::PARTY_INVITE_PARTY_BLOCKED_INVITE,
nick);
break;
case 7:
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index 29aacdd47..c677cd3f8 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/playerhandler.cpp
@@ -241,10 +241,10 @@ void PlayerHandler::setShortcut(const int idx,
const int level) const
{
MessageOut outMsg(CMSG_SET_SHORTCUTS);
- outMsg.writeInt16(idx, "index");
- outMsg.writeInt8(type, "type");
+ outMsg.writeInt16(static_cast<int16_t>(idx), "index");
+ outMsg.writeInt8(static_cast<int8_t>(type), "type");
outMsg.writeInt32(id, "id");
- outMsg.writeInt16(level, "level");
+ outMsg.writeInt16(static_cast<int16_t>(level), "level");
}
void PlayerHandler::removeOption() const
@@ -255,7 +255,7 @@ void PlayerHandler::removeOption() const
void PlayerHandler::changeCart(const int type) const
{
MessageOut outMsg(CMSG_CHANGE_CART);
- outMsg.writeInt16(type, "type");
+ outMsg.writeInt16(static_cast<int16_t>(type), "type");
}
void PlayerHandler::setMemo() const
diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp
index 61a1704a4..ce892db88 100644
--- a/src/net/eathena/questhandler.cpp
+++ b/src/net/eathena/questhandler.cpp
@@ -179,4 +179,4 @@ void QuestHandler::processRemoveQuest(Net::MessageIn &msg)
}
}
-} // namespace TmwAthena
+} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index e0f073cd2..a6c52491f 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -47,4 +47,4 @@ bool ServerFeatures::haveChangePartyLeader() const
return true;
}
-} // EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index dbd4c756f..bca6f8f50 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -41,6 +41,6 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveChangePartyLeader() const override final;
};
-} // namespace Net
+} // namespace EAthena
#endif // NET_EATHENA_SERVERFEATURES_H
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 212ce9d55..2f064a8a0 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -54,9 +54,9 @@ MessageIn::~MessageIn()
if (mPos != mLength && mPos != 2)
{
logger->log("Wrong actual or planned inbound packet size!");
- logger->log(" packet id: %d 0x%x",
- static_cast<int>(mId),
- static_cast<int>(mId));
+ logger->log(" packet id: %u 0x%x",
+ static_cast<unsigned int>(mId),
+ static_cast<unsigned int>(mId));
logger->log(" planned size: %u", mLength);
logger->log(" read size: %u", mPos);
}
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 2e98504c7..fb7b284d0 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -44,7 +44,8 @@ namespace TmwAthena
{
AdminHandler::AdminHandler() :
- MessageHandler()
+ MessageHandler(),
+ Ea::AdminHandler()
{
static const uint16_t _messages[] =
{
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 195579946..75f1e2875 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -810,7 +810,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const
requestNameById(id);
}
- uint8_t dir = dstBeing->getDirectionDelayed();
+ const uint8_t dir = dstBeing->getDirectionDelayed();
if (dir)
{
if (dir != dstBeing->getDirection())
diff --git a/src/net/tmwa/mailhandler.cpp b/src/net/tmwa/mailhandler.cpp
index 1e80f817c..b018a0ce1 100644
--- a/src/net/tmwa/mailhandler.cpp
+++ b/src/net/tmwa/mailhandler.cpp
@@ -20,9 +20,6 @@
#include "net/tmwa/mailhandler.h"
-#include "net/tmwa/messageout.h"
-#include "net/tmwa/protocol.h"
-
#include "debug.h"
extern Net::MailHandler *mailHandler;
diff --git a/src/net/tmwa/mailhandler.h b/src/net/tmwa/mailhandler.h
index f90415086..2336dac1b 100644
--- a/src/net/tmwa/mailhandler.h
+++ b/src/net/tmwa/mailhandler.h
@@ -27,7 +27,6 @@
namespace TmwAthena
{
-class MessageOut;
class MailHandler final : public MessageHandler, public Net::MailHandler
{
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 4aa1bfadd..547803354 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -48,4 +48,4 @@ bool ServerFeatures::haveChangePartyLeader() const
return false;
}
-} // TmwAthena
+} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index f934c31e2..4fad87256 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -41,6 +41,6 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveChangePartyLeader() const override final;
};
-} // namespace Net
+} // namespace TmwAthena
#endif // NET_TMWA_SERVERFEATURES_H
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 5c435f35e..7dfecb6ae 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -603,7 +603,7 @@ const ItemDB::ItemInfos &ItemDB::getItemInfos()
return mItemInfos;
}
-int parseSpriteName(const std::string &name)
+static int parseSpriteName(const std::string &name)
{
int id = -1;
if (name == "race" || name == "type")
@@ -667,7 +667,7 @@ int parseSpriteName(const std::string &name)
return id;
}
-int parseDirectionName(const std::string &name)
+static int parseDirectionName(const std::string &name)
{
int id = -1;
if (name == "down")
@@ -725,7 +725,7 @@ int parseDirectionName(const std::string &name)
return id;
}
-void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
{
const std::string gender = XML::getProperty(node, "gender", "unisex");
if (!node->xmlChildrenNode)
@@ -743,7 +743,7 @@ void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
itemInfo->setSprite(filename, Gender::OTHER, race);
}
-void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
{
const std::string event = XML::getProperty(node, "event", "");
const std::string filename = reinterpret_cast<const char*>(
@@ -763,8 +763,8 @@ void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
}
}
-void loadFloorSprite(SpriteDisplay *const display,
- const XmlNodePtrConst floorNode)
+static void loadFloorSprite(SpriteDisplay *const display,
+ const XmlNodePtrConst floorNode)
{
for_each_xml_child_node(spriteNode, floorNode)
{
@@ -785,8 +785,8 @@ void loadFloorSprite(SpriteDisplay *const display,
}
}
-void loadReplaceSprite(ItemInfo *const itemInfo,
- const XmlNodePtr replaceNode)
+static void loadReplaceSprite(ItemInfo *const itemInfo,
+ const XmlNodePtr replaceNode)
{
const std::string removeSprite = XML::getProperty(
replaceNode, "sprite", "");
@@ -917,9 +917,9 @@ void loadReplaceSprite(ItemInfo *const itemInfo,
}
}
-void loadOrderSprite(ItemInfo *const itemInfo,
- const XmlNodePtr node,
- const bool drawAfter)
+static void loadOrderSprite(ItemInfo *const itemInfo,
+ const XmlNodePtr node,
+ const bool drawAfter)
{
const int sprite = parseSpriteName(XML::getProperty(node, "name", ""));
const int priority = XML::getProperty(node, "priority", 0);