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/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 +- 6 files changed, 14 insertions(+), 16 deletions(-) (limited to 'src/net') 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(); -- cgit v1.2.3-70-g09d2