summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-21 19:30:40 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-21 19:30:40 +0300
commitf3ac812e2079eac53c1a9db56541d7103bd14a61 (patch)
tree3a9a9e9deebdbbb44da32ad4b1656743c4ff80c1
parentf61f794776fd37223c0977437a6bfcfef6759f84 (diff)
downloadmanaverse-f3ac812e2079eac53c1a9db56541d7103bd14a61.tar.gz
manaverse-f3ac812e2079eac53c1a9db56541d7103bd14a61.tar.bz2
manaverse-f3ac812e2079eac53c1a9db56541d7103bd14a61.tar.xz
manaverse-f3ac812e2079eac53c1a9db56541d7103bd14a61.zip
Fix code style.
-rw-r--r--src/being/being.cpp4
-rw-r--r--src/gui/widgets/dropdown.h3
-rw-r--r--src/gui/windows/chatwindow.cpp7
-rw-r--r--src/input/inputactionsortfunctor.h2
-rw-r--r--src/net/net.cpp2
-rw-r--r--src/resources/chatobject.cpp3
-rw-r--r--src/utils/parameters.cpp3
7 files changed, 12 insertions, 12 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index ce16f9ff4..a1163b1b7 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -851,8 +851,8 @@ int Being::getHitEffect(const Being *restrict const attacker,
int hitEffectId = 0;
if (type == AttackType::SKILL || type == AttackType::SKILLMISS)
{
- const SkillData *restrict const data = skillDialog->getSkillDataByLevel(
- attackId, level);
+ const SkillData *restrict const data =
+ skillDialog->getSkillDataByLevel(attackId, level);
if (!data)
return -1;
if (type == AttackType::SKILL)
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index c3f7c002c..265b69948 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -85,7 +85,8 @@ class DropDown final : public ActionListener,
void drawFrame(Graphics *const graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *const graphics) override final A_NONNULL(2);
+ void safeDrawFrame(Graphics *const graphics) override final
+ A_NONNULL(2);
// Inherited from KeyListener
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index d5c2677ac..6066170d2 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -803,11 +803,12 @@ void ChatWindow::keyPressed(KeyEvent &event)
else if (actionId == InputAction::GUI_INSERT &&
!mChatInput->getText().empty())
{
+ const std::string str = mChatInput->getText();
// Add the current message to the history and clear the text
- if (mHistory.empty() || mChatInput->getText() != mHistory.back())
- mHistory.push_back(mChatInput->getText());
+ if (mHistory.empty() || str != mHistory.back())
+ mHistory.push_back(str);
mCurHist = mHistory.end();
- mChatInput->setText("");
+ mChatInput->setText(std::string());
}
else if (actionId == InputAction::GUI_TAB &&
!mChatInput->getText().empty())
diff --git a/src/input/inputactionsortfunctor.h b/src/input/inputactionsortfunctor.h
index ec556bf39..595d67537 100644
--- a/src/input/inputactionsortfunctor.h
+++ b/src/input/inputactionsortfunctor.h
@@ -21,8 +21,6 @@
#ifndef INPUT_INPUTACTIONSORTFUNCTOR_H
#define INPUT_INPUTACTIONSORTFUNCTOR_H
-#include "logger.h"
-
#include "input/inputactiondata.h"
#include "localconsts.h"
diff --git a/src/net/net.cpp b/src/net/net.cpp
index b88b8659d..f58b624e9 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -167,7 +167,7 @@ void connectToServer(const ServerInfo &server)
void unload()
{
- GeneralHandler *const handler = generalHandler;
+ const GeneralHandler *const handler = generalHandler;
if (handler)
handler->unload();
ignorePackets.clear();
diff --git a/src/resources/chatobject.cpp b/src/resources/chatobject.cpp
index 3a8ac56f8..af5bc5737 100644
--- a/src/resources/chatobject.cpp
+++ b/src/resources/chatobject.cpp
@@ -53,7 +53,8 @@ void ChatObject::update()
ChatObject *ChatObject::findByName(const std::string &name)
{
- const std::map<std::string, ChatObject*>::iterator it = chatNameMap.find(name);
+ const std::map<std::string, ChatObject*>::iterator it =
+ chatNameMap.find(name);
if (it == chatNameMap.end())
return nullptr;
else
diff --git a/src/utils/parameters.cpp b/src/utils/parameters.cpp
index 467c31553..ef8332167 100644
--- a/src/utils/parameters.cpp
+++ b/src/utils/parameters.cpp
@@ -73,11 +73,10 @@ static inline size_t findNextSplit(const std::string &str,
const char quote)
{
size_t pos = 0;
- size_t idx1 = 0;
while (true)
{
// search for next separator
- idx1 = findAny(str, separator, pos);
+ size_t idx1 = findAny(str, separator, pos);
// search for next open quote, skipping escaped quotes
size_t idx2 = findNextQuote(str, quote, pos);
if (idx2 == std::string::npos) // not quotes, return next separator