summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-09 02:07:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-09 02:07:50 +0300
commit0cec4fa69c575f69015f37686f1e010d09f2ec48 (patch)
tree3ee7de7a6e19f3bc952bd9da5d4aaf274a37795d
parenta85d7ad79ce803adc3469a618bfd8dfe188f2cbf (diff)
downloadplus-0cec4fa69c575f69015f37686f1e010d09f2ec48.tar.gz
plus-0cec4fa69c575f69015f37686f1e010d09f2ec48.tar.bz2
plus-0cec4fa69c575f69015f37686f1e010d09f2ec48.tar.xz
plus-0cec4fa69c575f69015f37686f1e010d09f2ec48.zip
fix code style.
-rw-r--r--src/being.cpp2
-rw-r--r--src/being.h2
-rw-r--r--src/gui/charselectdialog.cpp1
-rw-r--r--src/gui/chatwindow.cpp2
-rw-r--r--src/gui/socialwindow.cpp1
-rw-r--r--src/gui/statuswindow.cpp2
-rw-r--r--src/gui/widgets/button.cpp1
-rw-r--r--src/gui/widgets/guitable.cpp3
-rw-r--r--src/joystick.cpp2
-rw-r--r--src/joystick.h2
-rw-r--r--src/localplayer.cpp4
-rw-r--r--src/localplayer.h4
-rw-r--r--src/utils/physfsrwops.cpp3
13 files changed, 18 insertions, 11 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 4ca664dc6..30541a590 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -974,7 +974,7 @@ std::string Being::getSitAction() const
}
}
-void Being::setAction(const Action action, const int attackType A_UNUSED)
+void Being::setAction(const Action &action, const int attackType A_UNUSED)
{
std::string currentAction = SpriteAction::INVALID;
diff --git a/src/being.h b/src/being.h
index e03607283..d76a70585 100644
--- a/src/being.h
+++ b/src/being.h
@@ -493,7 +493,7 @@ class Being : public ActorSprite, public ConfigListener
/**
* Sets the current action.
*/
- virtual void setAction(const Action action, const int attackType = 0);
+ virtual void setAction(const Action &action, const int attackType = 0);
/**
* Get the being's action currently performed.
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index 6a4de9432..e2f8f652c 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -552,6 +552,7 @@ bool CharSelectDialog::selectByName(const std::string &name,
CharacterDisplay::CharacterDisplay(CharSelectDialog *const charSelectDialog) :
+ Container(),
mCharacter(nullptr),
mPlayerBox(new PlayerBox(nullptr)),
mName(new Label("wwwwwwwwwwwwwwwwwwwwwwww")),
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 7a8c3d63b..9ea0bb383 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -151,7 +151,7 @@ public:
}
};
-static const char *ACTION_COLOR_PICKER = "color picker";
+static const char *const ACTION_COLOR_PICKER = "color picker";
ChatWindow::ChatWindow():
Window(_("Chat"), false, nullptr, "chat.xml"),
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 4bd15f4b0..6a04582b1 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -1193,6 +1193,7 @@ private:
};
SocialWindow::SocialWindow() :
+ ActionListener(),
Window(_("Social"), false, nullptr, "social.xml"),
mGuildInvited(0),
mGuildAcceptDialog(nullptr),
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index cf88bf7ff..295adcd6e 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -731,7 +731,7 @@ void StatusWindow::action(const gcn::ActionEvent &event)
std::string str;
while (it != it_end)
{
- ChangeDisplay *const attr = dynamic_cast<ChangeDisplay*>(
+ const ChangeDisplay *const attr = dynamic_cast<ChangeDisplay*>(
(*it).second);
if (attr)
str += attr->getValue() + " ";
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 5d0a36f32..614ec7313 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -117,6 +117,7 @@ Button::Button(const std::string &caption, const std::string &imageName,
const std::string &actionEventId,
gcn::ActionListener *const listener) :
gcn::Button(caption),
+ WidgetListener(),
mDescription(""),
mClickCount(0),
mTag(0),
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index dc158b95f..088b72db3 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -91,6 +91,9 @@ void GuiTableActionListener::action(const gcn::ActionEvent
GuiTable::GuiTable(TableModel *const initial_model, const bool opacity) :
+ gcn::Widget(),
+ gcn::MouseListener(),
+ gcn::KeyListener(),
mLinewiseMode(false),
mWrappingEnabled(false),
mOpaque(opacity),
diff --git a/src/joystick.cpp b/src/joystick.cpp
index 81b61b85d..d60c7e182 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -51,7 +51,7 @@ void Joystick::init()
}
}
-Joystick::Joystick(int no):
+Joystick::Joystick(const int no):
mDirection(0),
mJoystick(nullptr),
mUpTolerance(0),
diff --git a/src/joystick.h b/src/joystick.h
index e97a900a8..22826e43d 100644
--- a/src/joystick.h
+++ b/src/joystick.h
@@ -67,7 +67,7 @@ class Joystick
* Constructor, pass the number of the joystick the new object
* should access.
*/
- Joystick(int no);
+ Joystick(const int no);
~Joystick();
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 1dc126c52..1d4f75c37 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -355,7 +355,7 @@ void LocalPlayer::slowLogic()
}
}
-void LocalPlayer::setAction(const Action action, const int attackType)
+void LocalPlayer::setAction(const Action &action, const int attackType)
{
if (action == DEAD)
{
@@ -3830,7 +3830,7 @@ void LocalPlayer::imitateEmote(const Being *const being,
}
void LocalPlayer::imitateAction(const Being *const being,
- const Being::Action action)
+ const Being::Action &action)
{
if (!being)
return;
diff --git a/src/localplayer.h b/src/localplayer.h
index bfa74d660..6dce18e8c 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -84,7 +84,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void slowLogic();
- virtual void setAction(const Action action, const int attackType = 0);
+ virtual void setAction(const Action &action, const int attackType = 0);
/**
* Compute the next pathnode location when walking using keyboard.
@@ -360,7 +360,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
const unsigned char emote) const;
void imitateAction(const Being *const being,
- const Being::Action action);
+ const Being::Action &action);
void imitateDirection(const Being *const being,
const unsigned char dir);
diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp
index bc1a571e2..fdf9bc957 100644
--- a/src/utils/physfsrwops.cpp
+++ b/src/utils/physfsrwops.cpp
@@ -128,7 +128,8 @@ static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
static int physfsrwops_close(SDL_RWops *rw)
{
- PHYSFS_file *const handle = static_cast<PHYSFS_file*>(rw->hidden.unknown.data1);
+ PHYSFS_file *const handle = static_cast<PHYSFS_file*>(
+ rw->hidden.unknown.data1);
if (!PHYSFS_close(handle))
{
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());