summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-08 22:44:39 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-08 22:44:39 +0300
commita61ac4664d55cddb18d2d861e76629bd07676129 (patch)
tree59f5ba3ff7e65bbe94651db9ad2cf68b847d8f96 /src/net
parentbb3a85b045a6135f7228023a7ba55fb1c9e6bd90 (diff)
downloadplus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.gz
plus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.bz2
plus-a61ac4664d55cddb18d2d861e76629bd07676129.tar.xz
plus-a61ac4664d55cddb18d2d861e76629bd07676129.zip
Add some missing const.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/buyingstorehandler.h2
-rw-r--r--src/net/cashshophandler.h2
-rw-r--r--src/net/eathena/buyingstorehandler.cpp2
-rw-r--r--src/net/eathena/buyingstorehandler.h2
-rw-r--r--src/net/eathena/cashshophandler.cpp3
-rw-r--r--src/net/eathena/cashshophandler.h2
-rw-r--r--src/net/eathena/markethandler.cpp8
-rw-r--r--src/net/eathena/markethandler.h3
-rw-r--r--src/net/eathena/npchandler.h3
-rw-r--r--src/net/eathena/vendinghandler.cpp2
-rw-r--r--src/net/eathena/vendinghandler.h3
-rw-r--r--src/net/markethandler.h2
-rw-r--r--src/net/tmwa/buyingstorehandler.cpp2
-rw-r--r--src/net/tmwa/buyingstorehandler.h2
-rw-r--r--src/net/tmwa/cashshophandler.cpp3
-rw-r--r--src/net/tmwa/cashshophandler.h2
-rw-r--r--src/net/tmwa/markethandler.cpp3
-rw-r--r--src/net/tmwa/markethandler.h2
-rw-r--r--src/net/tmwa/vendinghandler.cpp3
-rw-r--r--src/net/tmwa/vendinghandler.h4
-rw-r--r--src/net/vendinghandler.h2
21 files changed, 32 insertions, 25 deletions
diff --git a/src/net/buyingstorehandler.h b/src/net/buyingstorehandler.h
index 0c5cc7c5c..3d994b2bc 100644
--- a/src/net/buyingstorehandler.h
+++ b/src/net/buyingstorehandler.h
@@ -46,7 +46,7 @@ class BuyingStoreHandler notfinal
virtual void create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const = 0;
+ const std::vector<ShopItem*> &items) const = 0;
virtual void close() const = 0;
diff --git a/src/net/cashshophandler.h b/src/net/cashshophandler.h
index a5aca004a..73bd6f399 100644
--- a/src/net/cashshophandler.h
+++ b/src/net/cashshophandler.h
@@ -46,7 +46,7 @@ class CashShopHandler notfinal
const ItemColor color,
const int amount) const = 0;
- virtual void buyItems(std::vector<ShopItem*> &items) const = 0;
+ virtual void buyItems(const std::vector<ShopItem*> &items) const = 0;
virtual void close() const = 0;
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 5fcc9c4aa..88928183c 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -45,7 +45,7 @@ BuyingStoreHandler::BuyingStoreHandler()
void BuyingStoreHandler::create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const
+ const std::vector<ShopItem*> &items) const
{
createOutPacket(CMSG_BUYINGSTORE_CREATE);
outMsg.writeInt16(CAST_S16(89 + items.size() * 8), "len");
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index 026d80306..f271dc60d 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -37,7 +37,7 @@ class BuyingStoreHandler final : public Net::BuyingStoreHandler
void create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const override final;
+ const std::vector<ShopItem*> &items) const override final;
void close() const override final;
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 026297673..56b6b3fbf 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -50,7 +50,8 @@ void CashShopHandler::buyItem(const int points,
outMsg.writeInt16(CAST_S16(itemId), "item id");
}
-void CashShopHandler::buyItems(std::vector<ShopItem*> &items A_UNUSED) const
+void CashShopHandler::buyItems(const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
// +++ probably need impliment buy many items at same time
}
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index d6a1e2f14..7d7fe1fbc 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -39,7 +39,7 @@ class CashShopHandler final : public Net::CashShopHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final
+ void buyItems(const std::vector<ShopItem*> &items) const override final
A_CONST;
void close() const override final;
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp
index b055d574a..c019c6251 100644
--- a/src/net/eathena/markethandler.cpp
+++ b/src/net/eathena/markethandler.cpp
@@ -64,14 +64,14 @@ void MarketHandler::buyItem(const int itemId,
}
}
-void MarketHandler::buyItems(std::vector<ShopItem*> &items) const
+void MarketHandler::buyItems(const std::vector<ShopItem*> &items) const
{
int cnt = 0;
const int pairSize = 6;
- FOR_EACH (std::vector<ShopItem*>::iterator, it, items)
+ FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items)
{
- ShopItem *const item = *it;
+ const ShopItem *const item = *it;
const int usedQuantity = item->getUsedQuantity();
const int type = item->getType();
if (!usedQuantity)
@@ -87,7 +87,7 @@ void MarketHandler::buyItems(std::vector<ShopItem*> &items) const
createOutPacket(CMSG_NPC_MARKET_BUY);
outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len");
- FOR_EACH (std::vector<ShopItem*>::iterator, it, items)
+ FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items)
{
ShopItem *const item = *it;
const int usedQuantity = item->getUsedQuantity();
diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h
index 797ed28bd..e99aa6bc9 100644
--- a/src/net/eathena/markethandler.h
+++ b/src/net/eathena/markethandler.h
@@ -40,7 +40,8 @@ class MarketHandler final : public Net::MarketHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final;
+ void buyItems(const std::vector<ShopItem*> &items) const
+ override final;
};
} // namespace EAthena
diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h
index 5a718fe98..049d69a72 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -59,7 +59,8 @@ class NpcHandler final : public Ea::NpcHandler
const ItemColor color,
const int amount) const override final;
- void buyItems(std::vector<ShopItem*> &items) const override final;
+ void buyItems(std::vector<ShopItem*> &items) const
+ override final;
void sellItem(const BeingId beingId,
const int itemId,
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index ce2b8d384..739f39acd 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -91,7 +91,7 @@ void VendingHandler::buy2(const Being *const being,
void VendingHandler::createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const
+ const std::vector<ShopItem*> &items) const
{
createOutPacket(CMSG_VENDING_CREATE_SHOP);
outMsg.writeInt16(CAST_S16(85 + items.size() * 8), "len");
diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h
index 531b5f5ec..b824a8d8e 100644
--- a/src/net/eathena/vendinghandler.h
+++ b/src/net/eathena/vendinghandler.h
@@ -47,7 +47,8 @@ class VendingHandler final : public Net::VendingHandler
void createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const override final;
+ const std::vector<ShopItem*> &items) const
+ override final;
};
} // namespace EAthena
diff --git a/src/net/markethandler.h b/src/net/markethandler.h
index aaf10d2d1..88a18601e 100644
--- a/src/net/markethandler.h
+++ b/src/net/markethandler.h
@@ -48,7 +48,7 @@ class MarketHandler notfinal
const ItemColor color,
const int amount) const = 0;
- virtual void buyItems(std::vector<ShopItem*> &items) const = 0;
+ virtual void buyItems(const std::vector<ShopItem*> &items) const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp
index b6b594d4c..882206761 100644
--- a/src/net/tmwa/buyingstorehandler.cpp
+++ b/src/net/tmwa/buyingstorehandler.cpp
@@ -35,7 +35,7 @@ BuyingStoreHandler::BuyingStoreHandler()
void BuyingStoreHandler::create(const std::string &name A_UNUSED,
const int maxMoney A_UNUSED,
const bool flag A_UNUSED,
- std::vector<ShopItem*> &items A_UNUSED) const
+ const std::vector<ShopItem*> &items A_UNUSED) const
{
}
diff --git a/src/net/tmwa/buyingstorehandler.h b/src/net/tmwa/buyingstorehandler.h
index 557267022..b9816310a 100644
--- a/src/net/tmwa/buyingstorehandler.h
+++ b/src/net/tmwa/buyingstorehandler.h
@@ -38,7 +38,7 @@ class BuyingStoreHandler final : public Net::BuyingStoreHandler
void create(const std::string &name,
const int maxMoney,
const bool flag,
- std::vector<ShopItem*> &items) const override final
+ const std::vector<ShopItem*> &items) const override final
A_CONST;
void close() const override final A_CONST;
diff --git a/src/net/tmwa/cashshophandler.cpp b/src/net/tmwa/cashshophandler.cpp
index e0856dae6..53bb46392 100644
--- a/src/net/tmwa/cashshophandler.cpp
+++ b/src/net/tmwa/cashshophandler.cpp
@@ -39,7 +39,8 @@ void CashShopHandler::buyItem(const int points A_UNUSED,
{
}
-void CashShopHandler::buyItems(std::vector<ShopItem*> &items A_UNUSED) const
+void CashShopHandler::buyItems(const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
}
diff --git a/src/net/tmwa/cashshophandler.h b/src/net/tmwa/cashshophandler.h
index 2d6836d28..6c622270d 100644
--- a/src/net/tmwa/cashshophandler.h
+++ b/src/net/tmwa/cashshophandler.h
@@ -40,7 +40,7 @@ class CashShopHandler final : public Net::CashShopHandler
const ItemColor color,
const int amount) const override final A_CONST;
- void buyItems(std::vector<ShopItem*> &items) const override final
+ void buyItems(const std::vector<ShopItem*> &items) const override final
A_CONST;
void close() const override final A_CONST;
diff --git a/src/net/tmwa/markethandler.cpp b/src/net/tmwa/markethandler.cpp
index 3d65c6b8a..f9cb58d41 100644
--- a/src/net/tmwa/markethandler.cpp
+++ b/src/net/tmwa/markethandler.cpp
@@ -43,7 +43,8 @@ void MarketHandler::buyItem(const int itemId A_UNUSED,
{
}
-void MarketHandler::buyItems(std::vector<ShopItem*> &items A_UNUSED) const
+void MarketHandler::buyItems(const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
}
diff --git a/src/net/tmwa/markethandler.h b/src/net/tmwa/markethandler.h
index e0cb95c7d..4c40abe16 100644
--- a/src/net/tmwa/markethandler.h
+++ b/src/net/tmwa/markethandler.h
@@ -41,7 +41,7 @@ class MarketHandler final : public Net::MarketHandler
const ItemColor color,
const int amount) const override final A_CONST;
- void buyItems(std::vector<ShopItem*> &items) const override final
+ void buyItems(const std::vector<ShopItem*> &items) const override final
A_CONST;
};
diff --git a/src/net/tmwa/vendinghandler.cpp b/src/net/tmwa/vendinghandler.cpp
index c69adcb85..b2da37855 100644
--- a/src/net/tmwa/vendinghandler.cpp
+++ b/src/net/tmwa/vendinghandler.cpp
@@ -55,7 +55,8 @@ void VendingHandler::buy2(const Being *const being A_UNUSED,
void VendingHandler::createShop(const std::string &name A_UNUSED,
const bool flag A_UNUSED,
- std::vector<ShopItem*> &items A_UNUSED) const
+ const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
}
diff --git a/src/net/tmwa/vendinghandler.h b/src/net/tmwa/vendinghandler.h
index 585614fab..b06b15263 100644
--- a/src/net/tmwa/vendinghandler.h
+++ b/src/net/tmwa/vendinghandler.h
@@ -50,8 +50,8 @@ class VendingHandler final : public Net::VendingHandler
void createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const override final
- A_CONST;
+ const std::vector<ShopItem*> &items) const
+ override final A_CONST;
};
} // namespace TmwAthena
diff --git a/src/net/vendinghandler.h b/src/net/vendinghandler.h
index f89ff3b0c..e313d2ac8 100644
--- a/src/net/vendinghandler.h
+++ b/src/net/vendinghandler.h
@@ -55,7 +55,7 @@ class VendingHandler notfinal
virtual void createShop(const std::string &name,
const bool flag,
- std::vector<ShopItem*> &items) const = 0;
+ const std::vector<ShopItem*> &items) const = 0;
};
} // namespace Net