summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-23 16:24:39 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-23 19:04:08 +0300
commitecc0dbab411d6f1f741dd19d0bc593ecc36a4941 (patch)
tree3e7cbd083fd2d8e25da0ec76b22e62310f1e42c1 /src
parentbc4c9a33066e26bcdd3c564c90294777a839a5be (diff)
downloadplus-ecc0dbab411d6f1f741dd19d0bc593ecc36a4941.tar.gz
plus-ecc0dbab411d6f1f741dd19d0bc593ecc36a4941.tar.bz2
plus-ecc0dbab411d6f1f741dd19d0bc593ecc36a4941.tar.xz
plus-ecc0dbab411d6f1f741dd19d0bc593ecc36a4941.zip
fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/actorsprite.h3
-rw-r--r--src/filefilter.txt1
-rw-r--r--src/gui/gui.cpp1
-rw-r--r--src/gui/palette.h6
-rw-r--r--src/gui/setup_theme.cpp4
-rw-r--r--src/gui/spellpopup.cpp1
-rw-r--r--src/gui/statuspopup.cpp1
-rw-r--r--src/gui/widgets/window.cpp3
-rw-r--r--src/gui/windowmenu.cpp3
-rw-r--r--src/imageparticle.h3
-rw-r--r--src/localconsts.h7
-rw-r--r--src/net/eathena/guildhandler.cpp2
-rw-r--r--src/net/eathena/guildhandler.h2
-rw-r--r--src/net/guildhandler.h2
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/guildhandler.h2
-rw-r--r--src/particle.h3
-rw-r--r--src/resources/beinginfo.h4
-rw-r--r--src/utils/stringutils.h2
19 files changed, 27 insertions, 25 deletions
diff --git a/src/actorsprite.h b/src/actorsprite.h
index bb48db7df..e9dbdb529 100644
--- a/src/actorsprite.h
+++ b/src/actorsprite.h
@@ -82,7 +82,8 @@ public:
virtual Type getType() const
{ return UNKNOWN; }
- virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override;
+ virtual bool draw(Graphics *graphics,
+ int offsetX, int offsetY) const override;
virtual bool drawSpriteAt(Graphics *const graphics,
const int x, const int y) const;
diff --git a/src/filefilter.txt b/src/filefilter.txt
index 0dde8e90c..0ab18d758 100644
--- a/src/filefilter.txt
+++ b/src/filefilter.txt
@@ -2,7 +2,6 @@
~ RULE_3_2_CD_do_not_use_special_characters_in_filename
~ RULE_3_2_F_use_representitive_classname_for_cpp_filename
~ RULE_3_2_H_do_not_use_uppercase_for_c_filename
-~ RULE_3_3_A_start_function_name_with_lowercase_unix
~ RULE_4_1_A_B_use_space_for_indentation
~ RULE_4_1_B_indent_each_enum_item_in_enum_block
~ RULE_4_1_B_locate_each_enum_item_in_seperate_line
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index ce2fcef98..f52902f4e 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -31,7 +31,6 @@
#include "gui/widgets/mouseevent.h"
#include "gui/widgets/window.h"
-#include "gui/widgets/windowcontainer.h"
#include "configuration.h"
#include "keydata.h"
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 0c3c2dc87..a69a373b9 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -78,10 +78,10 @@ class Palette
*/
inline const gcn::Color &getColor(int type, int alpha = 255)
{
- if (type >= (signed)mColors.size())
+ if (type >= static_cast<signed>(mColors.size()))
{
- logger->log("incorrect color request type: %d from %ld",
- type, mColors.size());
+ logger->log("incorrect color request type: %d from %u",
+ type, static_cast<unsigned int>(mColors.size()));
type = 0;
}
gcn::Color* col = &mColors[type].color;
diff --git a/src/gui/setup_theme.cpp b/src/gui/setup_theme.cpp
index 4a8a1f296..5d34066e1 100644
--- a/src/gui/setup_theme.cpp
+++ b/src/gui/setup_theme.cpp
@@ -146,10 +146,10 @@ public:
virtual ~LangListModel()
{ }
- virtual int getNumberOfElements()
+ virtual int getNumberOfElements() override
{ return langs_count; }
- virtual std::string getElementAt(int i)
+ virtual std::string getElementAt(int i) override
{
if (i >= getNumberOfElements() || i < 0)
return _("???");
diff --git a/src/gui/spellpopup.cpp b/src/gui/spellpopup.cpp
index 49eba7f43..4d9666be4 100644
--- a/src/gui/spellpopup.cpp
+++ b/src/gui/spellpopup.cpp
@@ -30,7 +30,6 @@
#include "gui/widgets/label.h"
-#include "graphics.h"
#include "units.h"
#include "utils/gettext.h"
diff --git a/src/gui/statuspopup.cpp b/src/gui/statuspopup.cpp
index ac222408b..183b7c02e 100644
--- a/src/gui/statuspopup.cpp
+++ b/src/gui/statuspopup.cpp
@@ -32,7 +32,6 @@
#include "gui/widgets/layout.h"
#include "gui/widgets/textbox.h"
-#include "graphics.h"
#include "inputmanager.h"
#include "localplayer.h"
#include "units.h"
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 879190932..95ceee0eb 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -948,7 +948,8 @@ int Window::getResizeHandles(const gcn::MouseEvent &event)
resizeHandles |= (y > mDimension.height - resizeBorderWidth)
? BOTTOM : (y < resizeBorderWidth) ? TOP : 0;
}
- if (x >= (unsigned)mGripRect.x && y >= (unsigned)mGripRect.y)
+ if (x >= static_cast<unsigned>(mGripRect.x)
+ && y >= static_cast<unsigned>(mGripRect.y))
{
mDragOffsetX = x;
mDragOffsetY = y;
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index e0bd1c843..ad4c6970a 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -67,7 +67,8 @@ WindowMenu::WindowMenu() :
mHaveMouse(false),
mAutoHide(1)
{
- int x = 0, h = 0;
+ int x = 0;
+ int h = 0;
setFocusable(false);
diff --git a/src/imageparticle.h b/src/imageparticle.h
index df1f5bdf1..800b30584 100644
--- a/src/imageparticle.h
+++ b/src/imageparticle.h
@@ -52,7 +52,8 @@ class ImageParticle : public Particle
/**
* Draws the particle image
*/
- virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override;
+ virtual bool draw(Graphics *graphics,
+ int offsetX, int offsetY) const override;
static std::map<std::string, int> imageParticleCountByName;
protected:
diff --git a/src/localconsts.h b/src/localconsts.h
index f9cf19a9c..02815d521 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -30,14 +30,13 @@
#ifdef __GNUC__
#define A_UNUSED __attribute__ ((unused))
-# ifdef __clang__
-# define gnu_printf printf
-# endif
#else
#define A_UNUSED
#define gnu_printf printf
#endif
-
+#ifdef __clang__
+#define gnu_printf printf
+#endif
//#define DEBUG_CONFIG 1
//#define DEBUG_BIND_TEXTURE 1
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 74a14f132..000718203 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -215,7 +215,7 @@ void GuildHandler::invite(int guildId A_UNUSED,
}
}
-void GuildHandler::invite(int guildId A_UNUSED, Being *being)
+void GuildHandler::invite(int guildId A_UNUSED, const Being *const being)
{
if (!being)
return;
diff --git a/src/net/eathena/guildhandler.h b/src/net/eathena/guildhandler.h
index ab9ef3c77..7fd318259 100644
--- a/src/net/eathena/guildhandler.h
+++ b/src/net/eathena/guildhandler.h
@@ -44,7 +44,7 @@ class GuildHandler : public Ea::GuildHandler, public MessageHandler
void invite(int guildId, const std::string &name);
- void invite(int guildId, Being *being);
+ void invite(int guildId, const Being *const being);
void inviteResponse(int guildId, bool response);
diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h
index b8af633de..894bc2671 100644
--- a/src/net/guildhandler.h
+++ b/src/net/guildhandler.h
@@ -45,7 +45,7 @@ class GuildHandler
virtual void invite(int guildId, const std::string &name) = 0;
- virtual void invite(int guildId, Being *being) = 0;
+ virtual void invite(int guildId, const Being *const being) = 0;
virtual void inviteResponse(int guildId, bool response) = 0;
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 5ecd9096a..6b97c6020 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -215,7 +215,7 @@ void GuildHandler::invite(int guildId A_UNUSED,
}
}
-void GuildHandler::invite(int guildId A_UNUSED, Being *being)
+void GuildHandler::invite(int guildId A_UNUSED, const Being *const being)
{
if (!being)
return;
diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h
index cb149655c..a2e6a88e3 100644
--- a/src/net/tmwa/guildhandler.h
+++ b/src/net/tmwa/guildhandler.h
@@ -44,7 +44,7 @@ class GuildHandler : public Ea::GuildHandler, public MessageHandler
void invite(int guildId, const std::string &name);
- void invite(int guildId, Being *being);
+ void invite(int guildId, const Being *const being);
void inviteResponse(int guildId, bool response);
diff --git a/src/particle.h b/src/particle.h
index fc0090c61..13d322633 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -105,7 +105,8 @@ class Particle : public Actor
/**
* Draws the particle image.
*/
- virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override;
+ virtual bool draw(Graphics *graphics,
+ int offsetX, int offsetY) const override;
/**
* Necessary for sorting with the other sprites.
diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h
index 8b25b4564..0d3973a5c 100644
--- a/src/resources/beinginfo.h
+++ b/src/resources/beinginfo.h
@@ -151,13 +151,13 @@ class BeingInfo
bool isTargetSelection() const
{ return mTargetSelection; }
- int getSortOffsetY()
+ int getSortOffsetY() const
{ return mSortOffsetY; }
void setSortOffsetY(const int n)
{ mSortOffsetY = n; }
- int getDeadSortOffsetY()
+ int getDeadSortOffsetY() const
{ return mDeadSortOffsetY; }
void setDeadSortOffsetY(const int n)
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 1fb3d9d23..582f7f8ed 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -29,6 +29,8 @@
#include <list>
#include <set>
+#include "localconsts.h"
+
/**
* Trims spaces off the end and the beginning of the given string.
*