summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-22 17:35:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-22 20:00:36 +0300
commit6fa671cdc65cd3ad507eca7dbee604418e449aa7 (patch)
tree9090841ed74fbb80427310cd96118759267b2941
parent1b853996cb2616e181e8822f74d79bd258c97c14 (diff)
downloadmv-6fa671cdc65cd3ad507eca7dbee604418e449aa7.tar.gz
mv-6fa671cdc65cd3ad507eca7dbee604418e449aa7.tar.bz2
mv-6fa671cdc65cd3ad507eca7dbee604418e449aa7.tar.xz
mv-6fa671cdc65cd3ad507eca7dbee604418e449aa7.zip
Fix code style.
-rw-r--r--src/actions/actions.cpp2
-rw-r--r--src/actions/move.cpp2
-rw-r--r--src/actions/pets.cpp2
-rw-r--r--src/being/being.cpp1
-rw-r--r--src/being/being.h1
-rw-r--r--src/being/crazymoves.cpp2
-rw-r--r--src/being/localplayer.cpp1
-rw-r--r--src/game.cpp2
-rw-r--r--src/gui/fonts/font.cpp2
-rw-r--r--src/gui/fonts/textchunklist.cpp2
-rw-r--r--src/gui/fonts/textchunklist.h2
-rw-r--r--src/gui/widgets/button.cpp2
-rw-r--r--src/gui/widgets/button.h2
-rw-r--r--src/gui/widgets/tabs/tab.cpp2
-rw-r--r--src/gui/widgets/widget.cpp4
-rw-r--r--src/gui/windows/charcreatedialog.cpp4
-rw-r--r--src/gui/windows/statuswindow.cpp2
-rw-r--r--src/listeners/guitableactionlistener.cpp7
-rw-r--r--src/listeners/guitableactionlistener.h7
-rw-r--r--src/net/eathena/chathandler.cpp5
-rw-r--r--src/resources/map/maplayer.cpp3
21 files changed, 35 insertions, 22 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 938b0c840..2fa4aad48 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -150,7 +150,7 @@ static int uploadUpdate(void *ptr,
Modal_true,
ShowCenter_false,
nullptr,
- 260))->postInit();;
+ 260))->postInit();
}
}
}
diff --git a/src/actions/move.cpp b/src/actions/move.cpp
index 6c32bbfe1..d708b1485 100644
--- a/src/actions/move.cpp
+++ b/src/actions/move.cpp
@@ -28,6 +28,8 @@
#include "being/crazymoves.h"
#include "being/localplayer.h"
+#include "enums/being/beingdirection.h"
+
#include "gui/windows/socialwindow.h"
#include "gui/windows/npcdialog.h"
#include "gui/windows/outfitwindow.h"
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 8f6d8833c..a31e8aadc 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -29,6 +29,8 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
+#include "enums/being/beingdirection.h"
+
#include "gui/chatconsts.h"
#include "listeners/inputactionreplaylistener.h"
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 7bf72b26f..c11da7493 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -40,6 +40,7 @@
#include "being/playerrelations.h"
#include "enums/being/attributes.h"
+#include "enums/being/beingdirection.h"
#include "enums/net/packettypes.h"
diff --git a/src/being/being.h b/src/being/being.h
index 42fd65b86..6fb26b620 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -31,7 +31,6 @@
#include "enums/being/attacktype.h"
#include "enums/being/beingaction.h"
-#include "enums/being/beingdirection.h"
#include "enums/being/gender.h"
#include "listeners/configlistener.h"
diff --git a/src/being/crazymoves.cpp b/src/being/crazymoves.cpp
index bc91feb57..549ffcdba 100644
--- a/src/being/crazymoves.cpp
+++ b/src/being/crazymoves.cpp
@@ -26,6 +26,8 @@
#include "being/localplayer.h"
+#include "enums/being/beingdirection.h"
+
#include "enums/net/packettypes.h"
#include "gui/windows/outfitwindow.h"
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index e3adafc6d..6b8a6e1e9 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -41,6 +41,7 @@
#include "being/playerrelations.h"
#include "enums/being/attributes.h"
+#include "enums/being/beingdirection.h"
#include "enums/net/packettypes.h"
diff --git a/src/game.cpp b/src/game.cpp
index e88fb9c7a..d30eded3a 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -41,6 +41,8 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
+#include "enums/being/beingdirection.h"
+
#include "particle/particle.h"
#include "input/inputmanager.h"
diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp
index 6ba7a2ffb..31ca8552a 100644
--- a/src/gui/fonts/font.cpp
+++ b/src/gui/fonts/font.cpp
@@ -389,7 +389,7 @@ void Font::generate(TextChunk &chunk)
{
TextChunk *const chunk2 = (*i).second;
cache->moveToFirst(chunk2);
- //search.erase(key);
+// search.erase(key);
cache->remove(chunk2);
chunk.img = chunk2->img;
chunk2->img = nullptr;
diff --git a/src/gui/fonts/textchunklist.cpp b/src/gui/fonts/textchunklist.cpp
index 023727282..24b46bea0 100644
--- a/src/gui/fonts/textchunklist.cpp
+++ b/src/gui/fonts/textchunklist.cpp
@@ -70,7 +70,7 @@ void TextChunkList::moveToFirst(TextChunk *const item)
start = item;
}
-void TextChunkList::remove(TextChunk *const item)
+void TextChunkList::remove(const TextChunk *const item)
{
if (!item)
return;
diff --git a/src/gui/fonts/textchunklist.h b/src/gui/fonts/textchunklist.h
index 1f5eff0ea..cbc7b9ebf 100644
--- a/src/gui/fonts/textchunklist.h
+++ b/src/gui/fonts/textchunklist.h
@@ -40,7 +40,7 @@ class TextChunkList final
void moveToFirst(TextChunk *const item);
- void remove(TextChunk *const item);
+ void remove(const TextChunk *const item);
void removeBack();
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 1a8c613ba..446f4756f 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -643,7 +643,7 @@ void Button::draw(Graphics *graphics)
if (image)
graphics->drawImage(image, textX, textY);
- //font->drawString(graphics, mCaption, textX, textY);
+// font->drawString(graphics, mCaption, textX, textY);
BLOCK_END("Button::draw")
}
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index c97741548..153195454 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -206,7 +206,7 @@ class Button final : public Widget,
* @see getCaption, adjustSize
*/
void setCaption(const std::string& caption)
- { mCaption = caption; mTextChanged = true;}
+ { mCaption = caption; mTextChanged = true; }
/**
* Gets the caption of the button.
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index e361c78ff..21b51d79a 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -252,7 +252,7 @@ void Tab::draw(Graphics *graphics)
mLabel->setForegroundColorAll(*mPlayerFlashColor,
*mPlayerFlashOutlineColor);
break;
- case 3: //mTabbedArea->isTabSelected(this)
+ case 3: // mTabbedArea->isTabSelected(this)
mLabel->setForegroundColorAll(*mTabSelectedColor,
*mTabSelectedOutlineColor);
break;
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp
index 70aac5aa2..cbf301b27 100644
--- a/src/gui/widgets/widget.cpp
+++ b/src/gui/widgets/widget.cpp
@@ -187,7 +187,7 @@ bool Widget::isFocused() const
void Widget::setFocusable(const bool focusable)
{
- if (!focusable && isFocused())
+ if (!focusable && isFocused() && mFocusHandler)
mFocusHandler->focusNone();
mFocusable = focusable;
}
@@ -220,7 +220,7 @@ void Widget::requestMoveToBottom()
void Widget::setVisible(bool visible)
{
- if (!visible && isFocused())
+ if (!visible && isFocused() && mFocusHandler)
mFocusHandler->focusNone();
if (visible)
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index d6bc01e95..5ba652072 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -26,6 +26,8 @@
#include "input/inputaction.h"
+#include "enums/being/beingdirection.h"
+
#include "enums/gui/dialogtype.h"
#include "gui/windows/okdialog.h"
@@ -382,7 +384,7 @@ void CharCreateDialog::action(const ActionEvent &event)
Modal_true,
ShowCenter_true,
nullptr,
- 260))->postInit();;
+ 260))->postInit();
}
}
else if (id == "cancel")
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 198df1508..7a1c798ec 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -55,8 +55,6 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
-#include <SDL_timer.h>
-
#include "debug.h"
StatusWindow *statusWindow = nullptr;
diff --git a/src/listeners/guitableactionlistener.cpp b/src/listeners/guitableactionlistener.cpp
index 99b3fb487..e71abb9b1 100644
--- a/src/listeners/guitableactionlistener.cpp
+++ b/src/listeners/guitableactionlistener.cpp
@@ -26,9 +26,10 @@
#include "debug.h"
-GuiTableActionListener::GuiTableActionListener(GuiTable *restrict table,
- Widget *restrict widget,
- int row, int column) :
+GuiTableActionListener::GuiTableActionListener(GuiTable *const restrict table,
+ Widget *const restrict widget,
+ const int row,
+ const int column) :
ActionListener(),
mTable(table),
mRow(row),
diff --git a/src/listeners/guitableactionlistener.h b/src/listeners/guitableactionlistener.h
index abb0367ee..d778f9c59 100644
--- a/src/listeners/guitableactionlistener.h
+++ b/src/listeners/guitableactionlistener.h
@@ -32,9 +32,10 @@ class GuiTable;
class GuiTableActionListener final : public ActionListener
{
public:
- GuiTableActionListener(GuiTable *restrict _table,
- Widget *restrict _widget,
- int _row, int _column);
+ GuiTableActionListener(GuiTable *const restrict table,
+ Widget *const restrict widget,
+ const int row,
+ const int column);
A_DELETE_COPY(GuiTableActionListener)
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 872afe05e..22db67357 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -698,7 +698,10 @@ void ChatHandler::processChatRoomJoinAck(Net::MessageIn &msg)
ChatObject *oldChat = ChatObject::findById(id);
- PlayerInfo::setRoomName(oldChat->title);
+ if (oldChat)
+ PlayerInfo::setRoomName(oldChat->title);
+ else
+ PlayerInfo::setRoomName(std::string());
chatWindow->joinRoom(true);
ChatObject *const obj = new ChatObject;
if (oldChat)
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index 2389de12b..9b73046bd 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -570,12 +570,11 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
{
const int px = x32 + dx;
const int py = py0 - img->mBounds.h;
- int c = 0;
if (mSpecialFlag || img->mBounds.h <= mapTileSize)
{
int width = 0;
// here need not draw over player position
- c = getTileDrawWidth(img, endX - x, width);
+ const int c = getTileDrawWidth(img, endX - x, width);
if (!c)
{