summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/enet/include/enet/enet.h2
-rw-r--r--libs/enet/protocol.c4
-rw-r--r--libs/enet/unix.c2
-rw-r--r--libs/enet/win32.c2
-rw-r--r--mana.cbp1
-rw-r--r--src/actorsprite.h2
-rw-r--r--src/chatlog.cpp4
-rw-r--r--src/client.cpp18
-rw-r--r--src/configuration.h12
-rw-r--r--src/gui/palette.h16
-rw-r--r--src/gui/quitdialog.h4
-rw-r--r--src/gui/setup_players.cpp7
-rw-r--r--src/gui/setup_video.cpp4
-rw-r--r--src/gui/specialswindow.h5
-rw-r--r--src/gui/widgets/chattab.h1
-rw-r--r--src/gui/widgets/dropdown.h4
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/widgets/itemcontainer.h8
-rw-r--r--src/gui/widgets/shopitems.h2
-rw-r--r--src/gui/widgets/spacer.h12
-rw-r--r--src/localplayer.cpp20
-rw-r--r--src/log.cpp4
-rw-r--r--src/main.cpp4
-rw-r--r--src/main.h2
-rw-r--r--src/net/manaserv/charhandler.cpp4
-rw-r--r--src/net/manaserv/manaserv_protocol.h4
-rw-r--r--src/playerrelations.cpp9
-rw-r--r--src/playerrelations.h8
-rw-r--r--src/resources/resourcemanager.h8
-rw-r--r--src/resources/theme.h4
-rw-r--r--src/resources/userpalette.h3
-rw-r--r--src/utils/copynpaste.cpp2
-rw-r--r--src/utils/mkdir.cpp8
-rw-r--r--src/utils/specialfolder.cpp2
-rw-r--r--src/utils/specialfolder.h2
35 files changed, 98 insertions, 101 deletions
diff --git a/libs/enet/include/enet/enet.h b/libs/enet/include/enet/enet.h
index 02dc2c0a..c5338676 100644
--- a/libs/enet/include/enet/enet.h
+++ b/libs/enet/include/enet/enet.h
@@ -12,7 +12,7 @@ extern "C"
#include <stdlib.h>
-#ifdef WIN32
+#ifdef _WIN32
#include "enet/win32.h"
#else
#include "enet/unix.h"
diff --git a/libs/enet/protocol.c b/libs/enet/protocol.c
index d7c3fede..b51ab469 100644
--- a/libs/enet/protocol.c
+++ b/libs/enet/protocol.c
@@ -1575,7 +1575,7 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch
enet_uint32 packetLoss = currentPeer -> packetsLost * ENET_PEER_PACKET_LOSS_SCALE / currentPeer -> packetsSent;
#ifdef ENET_DEBUG
-#ifdef WIN32
+#ifdef _WIN32
printf (
#else
fprintf (stderr,
@@ -1625,7 +1625,7 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch
host -> headerFlags |= ENET_PROTOCOL_HEADER_FLAG_COMPRESSED;
shouldCompress = compressedSize;
#ifdef ENET_DEBUG_COMPRESS
-#ifdef WIN32
+#ifdef _WIN32
printf (
#else
fprintf (stderr,
diff --git a/libs/enet/unix.c b/libs/enet/unix.c
index 69715413..75c78bc8 100644
--- a/libs/enet/unix.c
+++ b/libs/enet/unix.c
@@ -2,7 +2,7 @@
@file unix.c
@brief ENet Unix system specific functions
*/
-#ifndef WIN32
+#ifndef _WIN32
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/libs/enet/win32.c b/libs/enet/win32.c
index e1fae233..0b32e633 100644
--- a/libs/enet/win32.c
+++ b/libs/enet/win32.c
@@ -2,7 +2,7 @@
@file win32.c
@brief ENet Win32 system specific functions
*/
-#ifdef WIN32
+#ifdef _WIN32
#include <time.h>
#define ENET_BUILDING_LIB 1
diff --git a/mana.cbp b/mana.cbp
index fa4495c0..4261269f 100644
--- a/mana.cbp
+++ b/mana.cbp
@@ -22,7 +22,6 @@
<Add option="-Wno-unknown-pragmas" />
<Add option="-DUSE_OPENGL" />
<Add option="-DENABLE_NLS" />
- <Add option="-DWIN32" />
</Compiler>
<Linker>
<Add option="-enable-auto-import" />
diff --git a/src/actorsprite.h b/src/actorsprite.h
index 81bbd963..af06b478 100644
--- a/src/actorsprite.h
+++ b/src/actorsprite.h
@@ -185,7 +185,7 @@ protected:
/**
* Handle an update to a status or stun effect
*
- * \param The StatusEffect to effect
+ * \param effect The StatusEffect to effect
* \param effectId -1 for stun, otherwise the effect index
*/
virtual void handleStatusEffect(StatusEffect *effect, int effectId);
diff --git a/src/chatlog.cpp b/src/chatlog.cpp
index f33b1aff..011fa3aa 100644
--- a/src/chatlog.cpp
+++ b/src/chatlog.cpp
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <sys/time.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#elif defined __APPLE__
#include <Carbon/Carbon.h>
@@ -167,7 +167,7 @@ void ChatLogger::setServerName(const std::string &serverName)
void ChatLogger::makeDir(const std::string &dir)
{
-#ifdef WIN32
+#ifdef _WIN32
mkdir(dir.c_str());
#else
mkdir(dir.c_str(), 0750);
diff --git a/src/client.cpp b/src/client.cpp
index 5736cec4..642d9376 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -86,7 +86,7 @@
#include <physfs.h>
#include <SDL_image.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <SDL_syswm.h>
#include "utils/specialfolder.h"
#else
@@ -278,7 +278,7 @@ Client::Client(const Options &options):
std::string path = options.brandingPath;
// Strip blah.mana from the path
-#ifdef WIN32
+#ifdef _WIN32
int loc1 = path.find_last_of('/');
int loc2 = path.find_last_of('\\');
int loc = std::max(loc1, loc2);
@@ -297,14 +297,14 @@ Client::Client(const Options &options):
resman->addToSearchPath(mLocalDataDir, false);
std::string iconFile = branding.getValue("appIcon", "icons/mana");
-#ifdef WIN32
+#ifdef _WIN32
iconFile += ".ico";
#else
iconFile += ".png";
#endif
iconFile = resman->getPath(iconFile);
logger->log("Loading icon from file: %s", iconFile.c_str());
-#ifdef WIN32
+#ifdef _WIN32
static SDL_SysWMinfo pInfo;
SDL_GetWMInfo(&pInfo);
// Attempt to load icon from .ico file
@@ -1069,7 +1069,7 @@ void Client::action(const gcn::ActionEvent &event)
void Client::initRootDir()
{
mRootDir = PHYSFS_getBaseDir();
-#ifdef WIN32
+#ifdef _WIN32
std::string portableName = mRootDir + "portable.xml";
struct stat statbuf;
@@ -1135,7 +1135,7 @@ void Client::initHomeDir()
#elif defined __HAIKU__
mLocalDataDir = std::string(PHYSFS_getUserDir()) +
"/config/data/Mana";
-#elif defined WIN32
+#elif defined _WIN32
mLocalDataDir = getSpecialFolderLocation(CSIDL_LOCAL_APPDATA);
if (mLocalDataDir.empty())
mLocalDataDir = std::string(PHYSFS_getUserDir());
@@ -1163,7 +1163,7 @@ void Client::initHomeDir()
mConfigDir = std::string(PHYSFS_getUserDir()) +
"/config/settings/Mana" +
branding.getValue("appName", "manasource");
-#elif defined WIN32
+#elif defined _WIN32
mConfigDir = getSpecialFolderLocation(CSIDL_APPDATA);
if (mConfigDir.empty())
mConfigDir = mLocalDataDir;
@@ -1315,7 +1315,7 @@ void Client::initUpdatesDir()
{
if (!resman->mkdir("/" + mUpdatesDir))
{
-#if defined WIN32
+#if defined _WIN32
std::string newDir = mLocalDataDir + "\\" + mUpdatesDir;
std::string::size_type loc = newDir.find("/", 0);
@@ -1351,7 +1351,7 @@ void Client::initScreenshotDir()
}
else if (mScreenshotDir.empty())
{
-#ifdef WIN32
+#ifdef _WIN32
mScreenshotDir = getSpecialFolderLocation(CSIDL_MYPICTURES);
if (mScreenshotDir.empty())
mScreenshotDir = getSpecialFolderLocation(CSIDL_DESKTOP);
diff --git a/src/configuration.h b/src/configuration.h
index 44ce688d..a675002b 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -113,9 +113,9 @@ class ConfigurationObject
/**
* Serialises a container into a list of configuration options
*
- * \param IT Iterator type over CONT
- * \param T Elements that IT iterates over
- * \param CONT The associated container type
+ * \tparam IT Iterator type over CONT
+ * \tparam T Elements that IT iterates over
+ * \tparam CONT The associated container type
*
* \param name Name of the list the elements should be stored under
* \param begin Iterator start
@@ -151,9 +151,9 @@ class ConfigurationObject
/**
* Serialises a container into a list of configuration options
*
- * \param IT Iterator type over CONT
- * \param T Elements that IT iterates over
- * \param CONT The associated container type
+ * \tparam IT Iterator type over CONT
+ * \tparam T Elements that IT iterates over
+ * \tparam CONT The associated container type
*
* \param name Name of the list the elements should be read from under
* \param empty Initial (empty) container to write to
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 51cf7d5f..fcee670f 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -70,9 +70,9 @@ class Palette
*
* @return the requested color
*/
- inline const gcn::Color &getColor(int type, int alpha = 255)
+ const gcn::Color &getColor(int type, int alpha = 255)
{
- gcn::Color* col = &mColors[type].color;
+ gcn::Color *col = &mColors[type].color;
col->a = alpha;
return *col;
}
@@ -84,7 +84,7 @@ class Palette
*
* @return the gradient type of the color with the given index
*/
- inline GradientType getGradientType(int type)
+ GradientType getGradientType(int type) const
{
return mColors[type].grad;
}
@@ -96,7 +96,7 @@ class Palette
*
* @return the color char of the color with the given index
*/
- inline char getColorChar(int type)
+ char getColorChar(int type) const
{
return mColors[type].ch;
}
@@ -108,8 +108,8 @@ class Palette
*
* @return the gradient delay of the color with the given index
*/
- inline int getGradientDelay(int type)
- { return mColors[type].delay; }
+ int getGradientDelay(int type) const
+ { return mColors[type].delay; }
/**
* Updates all colors, that are non-static.
@@ -147,7 +147,7 @@ class Palette
int delay;
int committedDelay;
- void set(int type, gcn::Color& color, GradientType grad, int delay)
+ void set(int type, gcn::Color &color, GradientType grad, int delay)
{
ColorElem::type = type;
ColorElem::color = color;
@@ -157,7 +157,7 @@ class Palette
ColorElem::gradientIndex = rand();
}
- inline int getRGB()
+ int getRGB() const
{
return (committedColor.r << 16) | (committedColor.g << 8) |
committedColor.b;
diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h
index 21fe2f8a..1571c7d1 100644
--- a/src/gui/quitdialog.h
+++ b/src/gui/quitdialog.h
@@ -41,9 +41,9 @@ class QuitDialog : public Window, public gcn::ActionListener,
{
public:
/**
- * Constructor
+ * Constructor.
*
- * @pointerToMe will be set to NULL when the QuitDialog is destroyed
+ * @param pointerToMe will be set to NULL when the QuitDialog is destroyed
*/
QuitDialog(QuitDialog **pointerToMe);
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 6fab8bd2..e9faaf3a 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -131,15 +131,14 @@ public:
signalBeforeUpdate();
freeWidgets();
- std::vector<std::string> *player_names = player_relations.getPlayers();
if (mPlayers)
delete mPlayers;
- mPlayers = player_names;
+ mPlayers = player_relations.getPlayers();
// set up widgets
- for (unsigned int r = 0; r < player_names->size(); ++r)
+ for (unsigned int r = 0; r < mPlayers->size(); ++r)
{
- std::string name = (*player_names)[r];
+ std::string name = (*mPlayers)[r];
gcn::Widget *widget = new Label(name);
mWidgets.push_back(widget);
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index d72b402b..ea5dc140 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -301,7 +301,7 @@ void Setup_Video::apply()
* See http://libsdl.org/cgi/docwiki.cgi/SDL_SetVideoMode
*/
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
// checks for opengl usage
if (!config.getBoolValue("opengl"))
{
@@ -327,7 +327,7 @@ void Setup_Video::apply()
logger->error(errorMessage.str());
}
}
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
}
else
{
diff --git a/src/gui/specialswindow.h b/src/gui/specialswindow.h
index b440ce13..9917acc2 100644
--- a/src/gui/specialswindow.h
+++ b/src/gui/specialswindow.h
@@ -38,7 +38,8 @@ class TabbedArea;
struct SpecialEntry;
-class SpecialsWindow : public Window, public gcn::ActionListener {
+class SpecialsWindow : public Window, public gcn::ActionListener
+{
public:
SpecialsWindow();
@@ -51,7 +52,7 @@ class SpecialsWindow : public Window, public gcn::ActionListener {
void draw(gcn::Graphics *graphics);
- bool hasSpecials()
+ bool hasSpecials() const
{ return !mEntries.empty(); }
private:
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 6d262e11..bc139079 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -45,7 +45,6 @@ class ChatTab : public Tab, public AutoCompleteLister
*
* @param line Text message.
* @param own Type of message (usually the owner-type).
- * @param channelName which channel to send the message to.
* @param ignoreRecord should this not be recorded?
*/
void chatLog(std::string line, Own own = BY_SERVER,
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index e0cfd0d7..c7b3cdb1 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -41,9 +41,7 @@ class DropDown : public gcn::DropDown
* Contructor.
*
* @param listModel the ListModel to use.
- * @param scrollArea the ScrollArea to use.
- * @param listBox the listBox to use.
- * @see ListModel, ScrollArea, ListBox.
+ * @see ListModel
*/
DropDown(gcn::ListModel *listModel = 0);
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 546a16d2..d88a5747 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -52,7 +52,7 @@
static const int BOX_WIDTH = 35;
static const int BOX_HEIGHT = 43;
-ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
+ItemContainer::ItemContainer(Inventory *inventory):
mInventory(inventory),
mGridColumns(1),
mGridRows(1),
@@ -60,7 +60,6 @@ ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
mHighlightedIndex(-1),
mLastUsedSlot(-1),
mSelectionStatus(SEL_NONE),
- mForceQuantity(forceQuantity),
mSwapItems(false),
mDescItems(false)
{
@@ -159,7 +158,7 @@ void ItemContainer::draw(gcn::Graphics *graphics)
}
// Draw item caption
std::string caption;
- if (item->getQuantity() > 1 || mForceQuantity)
+ if (item->getQuantity() > 1)
caption = toString(item->getQuantity());
else if (item->isEquipped())
caption = "Eq.";
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 4d5afde2..0da894ea 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -54,11 +54,8 @@ class ItemContainer : public gcn::Widget,
* Constructor. Initializes the graphic.
*
* @param inventory
- * @param gridColumns Amount of columns in grid.
- * @param gridRows Amount of rows in grid.
- * @param offset Index offset
*/
- ItemContainer(Inventory *inventory, bool forceQuantity = false);
+ ItemContainer(Inventory *inventory);
virtual ~ItemContainer();
@@ -184,7 +181,6 @@ class ItemContainer : public gcn::Widget,
int mSelectedIndex, mHighlightedIndex;
int mLastUsedSlot;
SelectionState mSelectionStatus;
- bool mForceQuantity;
bool mSwapItems;
bool mDescItems;
int mDragPosX, mDragPosY;
@@ -201,4 +197,4 @@ class ItemContainer : public gcn::Widget,
SelectionListenerList mSelectionListeners;
};
-#endif
+#endif // ITEMCONTAINER_H
diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h
index 0e95d9a0..f3e774aa 100644
--- a/src/gui/widgets/shopitems.h
+++ b/src/gui/widgets/shopitems.h
@@ -62,7 +62,7 @@ class ShopItems : public gcn::ListModel
*
* @param inventoryIndex the inventory index of the item
* @param id the id of the item
- * @param quantity number of available copies of the item
+ * @param amount number of available copies of the item
* @param price price of the item
*/
void addItem(int inventoryIndex, int id, int amount, int price);
diff --git a/src/gui/widgets/spacer.h b/src/gui/widgets/spacer.h
index cc171890..4756b452 100644
--- a/src/gui/widgets/spacer.h
+++ b/src/gui/widgets/spacer.h
@@ -37,17 +37,17 @@ class Spacer : public gcn::Widget
/**
* Constructor.
*
- * @note Can be called empty, will default to a 5x5 px space
+ * @note Can be called empty, will default to a space of 5x5 pixels.
*
- * @param w - width in px.
- * @param h - height in px.
+ * @param w width in pixels.
+ * @param h height in pixels.
*/
- Spacer(int x = 5, int y = 5);
+ Spacer(int w = 5, int h = 5);
/**
- * Draws the Space.
+ * Draws nothing.
*/
- void draw(gcn::Graphics *g){}
+ void draw(gcn::Graphics *g) {}
};
#endif // SPACER_H
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 0a041021..0ee35ebe 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -1032,14 +1032,24 @@ void LocalPlayer::event(Event::Channel channel, const Event &event)
{
if (event.getInt("id") == EXP)
{
- int change = 0,
- oldXp = event.getInt("oldValue"),
- newXp = event.getInt("newValue");
-
+ int change = 0;
+ int oldXp = event.getInt("oldValue");
+ int newXp = event.getInt("newValue");
+
+ // When the new XP is lower than the old one,
+ // it means that a new level has been reached.
+ // Thus, the xp difference can only be obtained
+ // with the exp needed for the next level.
+ // The new XP value is then the XP obtained for the new level.
if (newXp < oldXp)
- change = PlayerInfo::getAttribute(EXP_NEEDED) - oldXp;
+ {
+ change = PlayerInfo::getAttribute(EXP_NEEDED)
+ - oldXp + newXp;
+ }
else
+ {
change = newXp - oldXp;
+ }
if (change > 0)
addMessageToQueue(toString(change) + " xp");
diff --git a/src/log.cpp b/src/log.cpp
index bb8a78bb..f430589b 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -21,7 +21,7 @@
#include "log.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#elif __APPLE__
#include <Carbon/Carbon.h>
@@ -106,7 +106,7 @@ void Logger::log(const char *log_text, ...)
void Logger::error(const std::string &error_text)
{
log("Error: %s", error_text.c_str());
-#ifdef WIN32
+#ifdef _WIN32
MessageBox(NULL, error_text.c_str(), "Error", MB_ICONERROR | MB_OK);
#elif defined __APPLE__
Str255 msg;
diff --git a/src/main.cpp b/src/main.cpp
index 08ae4a8c..fccc4c9d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -165,14 +165,14 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
}
}
-#ifdef WIN32
+#ifdef _WIN32
extern "C" char const *_nl_locale_name_default(void);
#endif
static void initInternationalization()
{
#if ENABLE_NLS
-#ifdef WIN32
+#ifdef _WIN32
SetEnvironmentVariable("LANG", _nl_locale_name_default());
// mingw doesn't like LOCALEDIR to be defined for some reason
bindtextdomain("mana", "translations/");
diff --git a/src/main.h b/src/main.h
index 82ece500..169ee7d1 100644
--- a/src/main.h
+++ b/src/main.h
@@ -52,7 +52,7 @@
#ifdef HAVE_CONFIG_H
#include "../config.h"
-#elif defined WIN32
+#elif defined _WIN32
#include "winver.h"
#elif defined __APPLE__
#define PACKAGE_VERSION "0.5.3"
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp
index 2bc76fa9..5017d6ea 100644
--- a/src/net/manaserv/charhandler.cpp
+++ b/src/net/manaserv/charhandler.cpp
@@ -103,8 +103,8 @@ void CharHandler::handleCharacterInfo(Net::MessageIn &msg)
CachedCharacterInfo info;
info.slot = msg.readInt8();
info.name = msg.readString();
- info.gender = msg.readInt8() == ManaServ::GENDER_MALE ? ::GENDER_MALE :
- ::GENDER_FEMALE;
+ info.gender = msg.readInt8() == ManaServ::GENDER_MALE ?
+ ::GENDER_MALE : ::GENDER_FEMALE;
info.hairStyle = msg.readInt8();
info.hairColor = msg.readInt8();
info.level = msg.readInt16();
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h
index 11de34ef..2b6322ff 100644
--- a/src/net/manaserv/manaserv_protocol.h
+++ b/src/net/manaserv/manaserv_protocol.h
@@ -26,7 +26,7 @@ namespace ManaServ {
enum {
PROTOCOL_VERSION = 1,
- SUPPORTED_DB_VERSION = 17
+ SUPPORTED_DB_VERSION = 18
};
/**
@@ -426,8 +426,6 @@ enum BeingDirection
/**
* Beings Genders
- * WARNING: Has to be in sync with the same enum in the Being class
- * of the client!
*/
enum BeingGender
{
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index 8b6e6255..4a70e695 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -249,7 +249,7 @@ void PlayerRelationsManager::setRelation(const std::string &player_name,
signalUpdate(player_name);
}
-std::vector<std::string> * PlayerRelationsManager::getPlayers()
+std::vector<std::string> * PlayerRelationsManager::getPlayers() const
{
std::vector<std::string> *retval = new std::vector<std::string>();
@@ -273,10 +273,11 @@ void PlayerRelationsManager::removePlayer(const std::string &name)
}
-PlayerRelation::Relation PlayerRelationsManager::getRelation(const std::string &name)
+PlayerRelation::Relation PlayerRelationsManager::getRelation(const std::string &name) const
{
- if (mRelations[name])
- return mRelations[name]->mRelation;
+ std::map<std::string, PlayerRelation *>::const_iterator it = mRelations.find(name);
+ if (it != mRelations.end())
+ return it->second->mRelation;
return PlayerRelation::NEUTRAL;
}
diff --git a/src/playerrelations.h b/src/playerrelations.h
index d6ca31ad..fd76aa03 100644
--- a/src/playerrelations.h
+++ b/src/playerrelations.h
@@ -135,7 +135,7 @@ public:
/**
* Updates the relationship with this player.
*/
- PlayerRelation::Relation getRelation(const std::string &name);
+ PlayerRelation::Relation getRelation(const std::string &name) const;
/**
* Deletes the information recorded for a player.
@@ -182,16 +182,16 @@ public:
* For a given ignore strategy short name, find the appropriate index in
* the ignore strategies vector.
*
- * \param The short name of the ignore strategy to look up
+ * \param shortName The short name of the ignore strategy to look up
* \return The appropriate index, or -1
*/
- int getPlayerIgnoreStrategyIndex(const std::string &shortname);
+ int getPlayerIgnoreStrategyIndex(const std::string &shortName);
/**
* Retrieves a sorted vector of all players for which we have any relations
* recorded.
*/
- std::vector<std::string> *getPlayers();
+ std::vector<std::string> *getPlayers() const;
/**
* Removes all recorded player info.
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 870182e4..9b40814f 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -128,11 +128,11 @@ class ResourceManager
/**
* Adds a preformatted resource to the resource map.
*
- * @param path The file name.
- * @param Resource The Resource to add.
- * @return true if successfull, false otherwise.
+ * @param idPath The resource identifier path.
+ * @param resource The Resource to add.
+ * @return true if successful, false otherwise.
*/
- bool addResource(const std::string &idPath, Resource* resource);
+ bool addResource(const std::string &idPath, Resource *resource);
/**
* Copies a file from one place to another (useful for extracting
diff --git a/src/resources/theme.h b/src/resources/theme.h
index d6d660e2..57274291 100644
--- a/src/resources/theme.h
+++ b/src/resources/theme.h
@@ -183,12 +183,12 @@ class Theme : public Palette, public EventListener
*
* @return the requested color
*/
- inline static const gcn::Color &getThemeColor(int type, int alpha = 255)
+ static const gcn::Color &getThemeColor(int type, int alpha = 255)
{
return mInstance->getColor(type, alpha);
}
- const static gcn::Color &getThemeColor(char c, bool &valid)
+ static const gcn::Color &getThemeColor(char c, bool &valid)
{
return mInstance->getColor(c, valid);
}
diff --git a/src/resources/userpalette.h b/src/resources/userpalette.h
index 01f66ca7..1dd5cf6a 100644
--- a/src/resources/userpalette.h
+++ b/src/resources/userpalette.h
@@ -114,8 +114,6 @@ class UserPalette : public Palette, public gcn::ListModel
/**
* Sets the gradient delay for the specified color.
- *
- * @param grad gradient type to set
*/
void setGradientDelay(int type, int delay)
{ mColors[type].delay = delay; }
@@ -191,7 +189,6 @@ class UserPalette : public Palette, public gcn::ListModel
/**
* Initialise color
*
- * @param c character that needs initialising
* @param rgb default color if not found in config
* @param text identifier of color
*/
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 3d2e3b80..458a6d27 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -35,7 +35,7 @@
#include <SDL_syswm.h>
#include "copynpaste.h"
-#ifdef WIN32
+#ifdef _WIN32
bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
{
bool ret = false;
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp
index 75ab8595..ee40488e 100644
--- a/src/utils/mkdir.cpp
+++ b/src/utils/mkdir.cpp
@@ -22,7 +22,7 @@
#include <cstring>
#include <cerrno>
-#if defined WIN32
+#if defined _WIN32
#include <windows.h>
#endif
@@ -51,7 +51,7 @@ int mkdir_r(const char *pathname) {
}
for (p=tmp; *p; p++) {
-#if defined WIN32
+#if defined _WIN32
if (*p == '/' || *p == '\\')
#else
if (*p == '/')
@@ -77,13 +77,13 @@ int mkdir_r(const char *pathname) {
return -1;
}
-#if defined WIN32
+#if defined _WIN32
if (!CreateDirectory(tmp, 0))
#else
if (mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
#endif
{
-#if defined WIN32
+#if defined _WIN32
// hack, hack. just assume that x: might be a drive
// letter, and try again
if (!(strlen(tmp) == 2 &&
diff --git a/src/utils/specialfolder.cpp b/src/utils/specialfolder.cpp
index 63337578..0c82ce68 100644
--- a/src/utils/specialfolder.cpp
+++ b/src/utils/specialfolder.cpp
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef WIN32
+#ifdef _WIN32
#include "specialfolder.h"
#include <windows.h>
diff --git a/src/utils/specialfolder.h b/src/utils/specialfolder.h
index eef6416b..0c3e999c 100644
--- a/src/utils/specialfolder.h
+++ b/src/utils/specialfolder.h
@@ -21,7 +21,7 @@
#ifndef SPECIALFOLDER_H
#define SPECIALFOLDER_H
-#ifdef WIN32
+#ifdef _WIN32
#include <shlobj.h>
#include <string>
std::string getSpecialFolderLocation(int folderId);