summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeyorp <Freeyorp101@hotmail.com>2010-11-24 13:57:16 +1300
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-12-08 00:07:16 +0100
commitb0ecb15a2167afefd9ac39cc478e2e707a223faf (patch)
tree250169dc67983305c0e2c9b32cc4e210bc1a1d71
parentec95564944562bbd020f005d155f6ce3943eea02 (diff)
downloadmanaserv-b0ecb15a2167afefd9ac39cc478e2e707a223faf.tar.gz
manaserv-b0ecb15a2167afefd9ac39cc478e2e707a223faf.tar.bz2
manaserv-b0ecb15a2167afefd9ac39cc478e2e707a223faf.tar.xz
manaserv-b0ecb15a2167afefd9ac39cc478e2e707a223faf.zip
Fix many compiler warnings.
Reviewed-by: Bertram
-rw-r--r--src/account-server/accounthandler.cpp2
-rw-r--r--src/chat-server/chathandler.cpp4
-rw-r--r--src/common/inventorydata.h7
-rw-r--r--src/game-server/being.cpp2
-rw-r--r--src/game-server/being.h5
-rw-r--r--src/game-server/commandhandler.cpp10
-rw-r--r--src/game-server/inventory.cpp5
-rw-r--r--src/game-server/item.cpp6
-rw-r--r--src/game-server/item.h19
-rw-r--r--src/scripting/luautil.cpp4
10 files changed, 31 insertions, 33 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 44946405..5b1ccd05 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -587,7 +587,7 @@ void AccountHandler::handleUnregisterMessage(AccountClient &client,
}
void AccountHandler::handleRequestRegisterInfoMessage(AccountClient &client,
- MessageIn &msg)
+ MessageIn &)
{
LOG_INFO("AccountHandler::handleRequestRegisterInfoMessage");
MessageOut reply(APMSG_REGISTER_INFO_RESPONSE);
diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp
index 9a87c0c1..11865605 100644
--- a/src/chat-server/chathandler.cpp
+++ b/src/chat-server/chathandler.cpp
@@ -571,7 +571,7 @@ void ChatHandler::handleQuitChannelMessage(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void ChatHandler::handleListChannelsMessage(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleListChannelsMessage(ChatClient &client, MessageIn &)
{
MessageOut reply(CPMSG_LIST_CHANNELS_RESPONSE);
@@ -652,7 +652,7 @@ void ChatHandler::handleTopicChange(ChatClient &client, MessageIn &msg)
storage->addTransaction(trans);
}
-void ChatHandler::handleDisconnectMessage(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleDisconnectMessage(ChatClient &client, MessageIn &)
{
MessageOut reply(CPMSG_DISCONNECT_RESPONSE);
reply.writeInt8(ERRMSG_OK);
diff --git a/src/common/inventorydata.h b/src/common/inventorydata.h
index 4d5336a1..4c637cc3 100644
--- a/src/common/inventorydata.h
+++ b/src/common/inventorydata.h
@@ -27,17 +27,12 @@
/**
* Numbers of inventory slots
*/
-
-enum
-{
- INVENTORY_SLOTS = 50
-};
+#define INVENTORY_SLOTS 50
/**
* Structure storing an item in the inventory.
* When the itemId is zero, this item represents "amount" consecutive empty slots.
*/
-
struct InventoryItem
{
unsigned int itemId;
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index bbd7b4c6..895afde4 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -396,7 +396,7 @@ double Being::getModifiedAttribute(unsigned int id) const
return ret->second.getModifiedAttribute();
}
-void Being::setModAttribute(unsigned int id, double value)
+void Being::setModAttribute(unsigned int, double)
{
// No-op to satisfy shared structure.
// The game-server calculates this manually.
diff --git a/src/game-server/being.h b/src/game-server/being.h
index 375220c9..5e9565cc 100644
--- a/src/game-server/being.h
+++ b/src/game-server/being.h
@@ -84,7 +84,8 @@ class Being : public Actor
* WARNING: Has to be in sync with the same enum in the Being class
* of the client!
*/
- enum Action {
+ enum Action
+ {
STAND,
WALK,
ATTACK,
@@ -239,7 +240,7 @@ class Being : public Actor
* @note The game server calculates this manually, so nothing happens
* here.
*/
- void setModAttribute(unsigned int id, double value);
+ void setModAttribute(unsigned int, double);
/**
* Checks whether or not an attribute exists in this being.
diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp
index d9445334..5bd6a04f 100644
--- a/src/game-server/commandhandler.cpp
+++ b/src/game-server/commandhandler.cpp
@@ -733,7 +733,7 @@ static void handleRecall(Character *player, std::string &args)
GameState::warp(other, map, pos.x, pos.y);
}
-static void handleReload(Character *player, std::string &args)
+static void handleReload(Character *, std::string &)
{
// reload the items and monsters
itemManager->reload();
@@ -832,7 +832,9 @@ static void handleGivePermission(Character *player, std::string &args)
if (permission & other->getAccountLevel())
{
say(player->getName()+" already has the permission "+strPermission, player);
- } else {
+ }
+ else
+ {
permission += other->getAccountLevel();
// change the player's account level
other->setAccountLevel(permission);
@@ -992,7 +994,7 @@ static void handleAnnounce(Character *player, std::string &msg)
GameState::sayToAll(msg);
}
-static void handleWhere(Character *player, std::string &args)
+static void handleWhere(Character *player, std::string &)
{
std::stringstream str;
str << "Your current location is map "
@@ -1005,7 +1007,7 @@ static void handleWhere(Character *player, std::string &args)
say (str.str(), player);
}
-static void handleRights(Character *player, std::string &args)
+static void handleRights(Character *player, std::string &)
{
std::list<std::string>classes;
classes = PermissionManager::getClassList(player);
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp
index b74c727b..982c19e1 100644
--- a/src/game-server/inventory.cpp
+++ b/src/game-server/inventory.cpp
@@ -321,7 +321,8 @@ void Inventory::checkSize()
* If not, forcibly delete (drop?) items from the end until it is.
*/
while (mPoss->inventory.size() > INVENTORY_SLOTS
- || mClient->getModifiedAttribute(ATTR_INV_CAPACITY) < 0) {
+ || mClient->getModifiedAttribute(ATTR_INV_CAPACITY) < 0)
+ {
LOG_WARN("Inventory: oversize inventory! Deleting '"
<< mPoss->inventory.rbegin()->second.amount
<< "' items of type '"
@@ -373,7 +374,7 @@ unsigned int Inventory::insert(unsigned int itemId, unsigned int amount)
{
if (!amount)
return 0;
- int lim = it == it_end ? INVENTORY_SLOTS : it->first;
+ int lim = (it == it_end) ? INVENTORY_SLOTS : it->first;
while (amount && slot < lim)
{
int additions = std::min(amount, maxPerSlot);
diff --git a/src/game-server/item.cpp b/src/game-server/item.cpp
index 02c6a513..9c73e9dc 100644
--- a/src/game-server/item.cpp
+++ b/src/game-server/item.cpp
@@ -31,12 +31,6 @@
#include "game-server/state.h"
#include "scripting/script.h"
-bool ItemEffectInfo::apply(Being *itemUser)
-{
- LOG_WARN("Virtual defintion used in effect application!");
- return false;
-}
-
bool ItemEffectAttrMod::apply(Being *itemUser)
{
LOG_DEBUG("Applying modifier.");
diff --git a/src/game-server/item.h b/src/game-server/item.h
index 215b738f..50619536 100644
--- a/src/game-server/item.h
+++ b/src/game-server/item.h
@@ -58,7 +58,8 @@ enum
SET_STATE_NOT_FLOATING
};
-struct ItemAutoAttackInfo {
+struct ItemAutoAttackInfo
+{
unsigned int base;
unsigned int range;
unsigned int baseSpeed;
@@ -67,7 +68,8 @@ struct ItemAutoAttackInfo {
std::map< unsigned int, double > attrBonus;
};
-enum ItemTriggerType {
+enum ItemTriggerType
+{
ITT_NULL = 0,
ITT_IN_INVY, // Associated effects apply when the item is in the inventory
ITT_ACTIVATE, // Associated effects apply when the item is activated
@@ -77,7 +79,8 @@ enum ItemTriggerType {
ITT_EQUIPCHG // When the item is still equipped, but in a different way
};
-enum ItemEffectType {
+enum ItemEffectType
+{
// Effects that are removed automatically when the trigger ends
// (ie. item no longer exists in invy, unequipped)
IET_ATTR_MOD = 0, // Modify a given attribute with a given value
@@ -91,8 +94,8 @@ enum ItemEffectType {
class ItemEffectInfo
{
public:
- virtual bool apply(Being *itemUser);
- virtual void dispell(Being *itemUser) {}
+ virtual bool apply(Being *itemUser) = 0;
+ virtual void dispell(Being *itemUser) = 0;
};
class ItemEffectAttrMod : public ItemEffectInfo
@@ -124,8 +127,10 @@ class ItemEffectAutoAttack : public ItemEffectInfo
class ItemEffectConsumes : public ItemEffectInfo
{
public:
- bool apply(Being *itemUser) { return true; }
- void dispell(Being *itemUser) {}
+ bool apply(Being *)
+ { return true; }
+ void dispell(Being *)
+ {}
};
class ItemEffectScript : public ItemEffectInfo
diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp
index cec3ae76..4a5bee9a 100644
--- a/src/scripting/luautil.cpp
+++ b/src/scripting/luautil.cpp
@@ -33,13 +33,13 @@ void raiseScriptError(lua_State *s, const char *format, ...)
va_start(args, format);
char message[1024];
vsprintf(message, format, args);
- va_end( args );
+ va_end(args);
LOG_WARN("Lua script error: "<< message);
luaL_error(s, message);
}
-void raiseWarning(lua_State *s, const char *format, ...)
+void raiseWarning(lua_State *, const char *format, ...)
{
va_list args;
va_start(args, format);