From 5b4e74ab44a2ae4eab9db71c860885802e2ba28d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 21:49:16 +0300 Subject: Fix code style. --- src/enums/being/attacktype.h | 3 ++- src/enums/equipslot.h | 3 +-- src/enums/gui/chatmsgtype.h | 6 +++--- src/enums/net/auctionsearchtype.h | 2 +- src/enums/net/packettypes.h | 6 +++--- src/gui/windows/charcreatedialog.cpp | 5 +++-- src/gui/windows/charcreatedialog.h | 1 - src/gui/windows/chatwindow.h | 2 -- src/gui/windows/updaterwindow.cpp | 3 ++- src/input/inputmanager.h | 1 - src/net/eathena/auctionhandler.cpp | 4 ++-- src/net/eathena/charserverhandler.cpp | 4 ++-- src/net/eathena/searchstorehandler.cpp | 2 -- src/net/eathena/vendinghandler.cpp | 12 ++++++------ src/net/tmwa/auctionhandler.h | 6 +++--- src/net/tmwa/charserverhandler.cpp | 2 +- src/particle/imageparticle.h | 2 -- 17 files changed, 29 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/enums/being/attacktype.h b/src/enums/being/attacktype.h index c040d66f9..02379e60a 100644 --- a/src/enums/being/attacktype.h +++ b/src/enums/being/attacktype.h @@ -42,5 +42,6 @@ namespace AttackType TOUCH_SKILL = 12, MISS = 0xffff // pseudo value for miss attacks }; -} +} // namespace AttackType + #endif // ENUMS_BEING_ATTACKTYPE_H diff --git a/src/enums/equipslot.h b/src/enums/equipslot.h index 8c6c5abbb..bd6423dee 100644 --- a/src/enums/equipslot.h +++ b/src/enums/equipslot.h @@ -53,7 +53,6 @@ namespace EquipSlot SHADOW_ACCESSORY2_SLOT = 21, VECTOREND }; -} - +} // namespace EquipSlot #endif // ENUMS_EQUIPSLOT_H diff --git a/src/enums/gui/chatmsgtype.h b/src/enums/gui/chatmsgtype.h index 94b9e62b3..baacb57fd 100644 --- a/src/enums/gui/chatmsgtype.h +++ b/src/enums/gui/chatmsgtype.h @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#ifndef GUI_CHATMSGTYPE_H -#define GUI_CHATMSGTYPE_H +#ifndef ENUMS_GUI_CHATMSGTYPE_H +#define ENUMS_GUI_CHATMSGTYPE_H namespace ChatMsgType { @@ -39,4 +39,4 @@ namespace ChatMsgType }; } // namespace ChatMsgType -#endif // GUI_CHATMSGTYPE_H +#endif // ENUMS_GUI_CHATMSGTYPE_H diff --git a/src/enums/net/auctionsearchtype.h b/src/enums/net/auctionsearchtype.h index e908e2d42..281db6875 100644 --- a/src/enums/net/auctionsearchtype.h +++ b/src/enums/net/auctionsearchtype.h @@ -31,7 +31,7 @@ namespace AuctionSearchType Card = 2, Misc = 3, Name = 4, - AuctionId = 5, + AuctionId = 5 }; } // namespace AuctionSearchType diff --git a/src/enums/net/packettypes.h b/src/enums/net/packettypes.h index b1349b216..4da22895a 100644 --- a/src/enums/net/packettypes.h +++ b/src/enums/net/packettypes.h @@ -18,8 +18,8 @@ * along with this program. If not, see . */ -#ifndef ENUMS_NET_PACKETLIMITER_H -#define ENUMS_NET_PACKETLIMITER_H +#ifndef ENUMS_NET_PACKETTYPES_H +#define ENUMS_NET_PACKETTYPES_H enum PacketTypes { @@ -39,4 +39,4 @@ enum PacketTypes PACKET_SIZE }; -#endif // ENUMS_NET_PACKETLIMITER_H +#endif // ENUMS_NET_PACKETTYPES_H diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index fe22b0317..1452433d6 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -35,7 +35,6 @@ #include "gui/windows/charselectdialog.h" #include "gui/widgets/label.h" #include "gui/widgets/playerbox.h" -#include "gui/widgets/radiobutton.h" #include "gui/widgets/slider.h" #include "gui/widgets/tabstrip.h" #include "gui/widgets/textfield.h" @@ -216,7 +215,9 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, if (serverFeatures->haveCreateCharGender()) { const int size = config.getIntValue("fontSize"); - mGenderStrip = new TabStrip(this, "gender_" + getWindowName(), size + 16); + mGenderStrip = new TabStrip(this, + "gender_" + getWindowName(), + size + 16); mGenderStrip->setPressFirst(false); mGenderStrip->addActionListener(this); mGenderStrip->setActionEventId("gender_"); diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index d179982ad..ed1a8fcf3 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -35,7 +35,6 @@ class Button; class CharSelectDialog; class Label; class PlayerBox; -class RadioButton; class Slider; class TabStrip; class TextField; diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index df8ba8b06..d0af5a74c 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -23,8 +23,6 @@ #ifndef GUI_WINDOWS_CHATWINDOW_H #define GUI_WINDOWS_CHATWINDOW_H -#include "enums/being/beingdirection.h" - #include "enums/gui/chatmsgtype.h" #include "gui/widgets/window.h" diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 37f0f283f..30477821e 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -1045,7 +1045,8 @@ bool UpdaterWindow::validateFile(const std::string &filePath, unsigned long UpdaterWindow::getFileHash(const std::string &filePath) { int size = 0; - const char *const buf = static_cast(PhysFs::loadFile(filePath, size)); + const char *const buf = static_cast( + PhysFs::loadFile(filePath, size)); if (!buf) return 0; return Net::Download::adlerBuffer(buf, size); diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index 6205f2d11..672060a72 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -30,7 +30,6 @@ #include #include -#include #include diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp index 6ef2ca81c..1fe68d760 100644 --- a/src/net/eathena/auctionhandler.cpp +++ b/src/net/eathena/auctionhandler.cpp @@ -127,7 +127,7 @@ void AuctionHandler::processAuctionClose(Net::MessageIn &msg) void AuctionHandler::cancelReg() const { createOutPacket(CMSG_AUCTION_CANCEL_REG); - outMsg.writeInt16(0, "type"); // unused + outMsg.writeInt16(0, "type"); // unused } void AuctionHandler::setItem(const Item *const item, @@ -178,7 +178,7 @@ void AuctionHandler::search(const AuctionSearchType::Type type, outMsg.writeInt16(static_cast(type), "search type"); outMsg.writeInt32(auctionId, "auction id"); outMsg.writeString(text, 24, "search text"); - outMsg.writeInt16(page, "page"); + outMsg.writeInt16(static_cast(page), "page"); } void AuctionHandler::buy() const diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 09d5257ce..c3d3665ad 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -285,7 +285,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot, outMsg.writeInt16(static_cast(race), "race"); if (serverFeatures->haveCreateCharGender()) { - int sex = 0; + uint8_t sex = 0; if (gender == Gender::UNSPECIFIED) sex = 99; else @@ -606,7 +606,7 @@ void CharServerHandler::processCharChangeSlot(Net::MessageIn &msg) msg.readInt16("unused"); } -void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg A_UNUSED) +void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg) { BLOCK_START("CharServerHandler::processCharDeleteFailed") unlockCharSelectDialog(); diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp index 602a8dce1..38baadd6d 100644 --- a/src/net/eathena/searchstorehandler.cpp +++ b/src/net/eathena/searchstorehandler.cpp @@ -20,8 +20,6 @@ #include "net/eathena/searchstorehandler.h" -#include "net/eathena/protocol.h" - #include "debug.h" extern Net::SearchStoreHandler *searchStoreHandler; diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index 47428a040..3228cf0db 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -182,8 +182,8 @@ void VendingHandler::buy(const Being *const being, createOutPacket(CMSG_VENDING_BUY); outMsg.writeInt16(12, "len"); outMsg.writeInt32(being->getId(), "account id"); - outMsg.writeInt16(amount, "amount"); - outMsg.writeInt16(index, "index"); + outMsg.writeInt16(static_cast(amount), "amount"); + outMsg.writeInt16(static_cast(index), "index"); } void VendingHandler::buy2(const Being *const being, @@ -198,8 +198,8 @@ void VendingHandler::buy2(const Being *const being, outMsg.writeInt16(16, "len"); outMsg.writeInt32(being->getId(), "account id"); outMsg.writeInt32(vendId, "vend id"); - outMsg.writeInt16(amount, "amount"); - outMsg.writeInt16(index, "index"); + outMsg.writeInt16(static_cast(amount), "amount"); + outMsg.writeInt16(static_cast(index), "index"); } void VendingHandler::createShop(const std::string &name, @@ -207,9 +207,9 @@ void VendingHandler::createShop(const std::string &name, std::vector &items) const { createOutPacket(CMSG_VENDING_CREATE_SHOP); - outMsg.writeInt16(85 + items.size() * 8, "len"); + outMsg.writeInt16(static_cast(85 + items.size() * 8), "len"); outMsg.writeString(name, 80, "shop name"); - outMsg.writeInt8(flag ? 1 : 0, "flag"); + outMsg.writeInt8(static_cast(flag ? 1 : 0), "flag"); FOR_EACH (std::vector::const_iterator, it, items) { const ShopItem *const item = *it; diff --git a/src/net/tmwa/auctionhandler.h b/src/net/tmwa/auctionhandler.h index f3c1fe9c8..5f793a78d 100644 --- a/src/net/tmwa/auctionhandler.h +++ b/src/net/tmwa/auctionhandler.h @@ -54,9 +54,9 @@ class AuctionHandler final : public MessageHandler, public Net::AuctionHandler const int money) const override final; void search(const AuctionSearchType::Type type, - const int auctionId, - const std::string &text, - const int page) const override final; + const int auctionId, + const std::string &text, + const int page) const override final; void buy() const override final; diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index a61d00e7c..a8815da5b 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -525,7 +525,7 @@ void CharServerHandler::changeSlot(const int oldSlot A_UNUSED, { } -void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg A_UNUSED) +void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg) { BLOCK_START("CharServerHandler::processCharDeleteFailed") unlockCharSelectDialog(); diff --git a/src/particle/imageparticle.h b/src/particle/imageparticle.h index dcc705a71..a2fadde7a 100644 --- a/src/particle/imageparticle.h +++ b/src/particle/imageparticle.h @@ -27,8 +27,6 @@ #include "utils/stringmap.h" -#include - class Image; /** -- cgit v1.2.3-60-g2f50