summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-12 17:33:51 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-12 17:33:51 +0300
commit37969cb5a1892a05abc84f087213c9903c2c654e (patch)
tree52835ded960d26e227a5ec3f7690c092a6b8a2d5 /src
parentc98d192af4daa48a4c27cfa3225e22e89f329525 (diff)
downloadmanaverse-37969cb5a1892a05abc84f087213c9903c2c654e.tar.gz
manaverse-37969cb5a1892a05abc84f087213c9903c2c654e.tar.bz2
manaverse-37969cb5a1892a05abc84f087213c9903c2c654e.tar.xz
manaverse-37969cb5a1892a05abc84f087213c9903c2c654e.zip
Fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/Makefile.am6
-rw-r--r--src/actormanager.cpp5
-rw-r--r--src/gui/fonts/textchunksmall.cpp3
-rw-r--r--src/gui/fonts/textchunksmall.h3
-rw-r--r--src/gui/windows/inventorywindow.cpp7
-rw-r--r--src/net/serverinfo.h3
-rw-r--r--src/net/tmwa/buyingstorehandler.cpp3
-rw-r--r--src/utils/parameters.cpp (renamed from src/utils/paramerers.cpp)9
-rw-r--r--src/utils/parameters.h (renamed from src/utils/paramerers.h)0
-rw-r--r--src/utils/parameters_unittest.cc (renamed from src/utils/paramerers_unittest.cc)2
-rw-r--r--src/vector.h3
12 files changed, 28 insertions, 20 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fe622c0c0..22d0cbdbc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -790,8 +790,8 @@ SET(SRCS
utils/langs.cpp
utils/langs.h
utils/mathutils.h
- utils/paramerers.cpp
- utils/paramerers.h
+ utils/parameters.cpp
+ utils/parameters.h
utils/paths.cpp
utils/paths.h
utils/perfomance.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 756e695a8..a3a47de58 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -441,8 +441,8 @@ SRC += events/actionevent.h \
utils/mathutils.h \
utils/mkdir.cpp \
utils/mkdir.h \
- utils/paramerers.cpp \
- utils/paramerers.h \
+ utils/parameters.cpp \
+ utils/parameters.h \
utils/paths.cpp \
utils/paths.h \
utils/perfomance.cpp \
@@ -1732,7 +1732,7 @@ manaplustests_SOURCES = ${manaplus_SOURCES} \
utils/mathutils_unittest.cc \
utils/files_unittest.cc \
utils/stringutils_unittest.cc \
- utils/paramerers_unittest.cc \
+ utils/parameters_unittest.cc \
resources/mstack_unittest.cc \
utils/translation/poparser_unittest.cc \
resources/sprite/animatedsprite_unittest.cc \
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index d851864a3..7755edbc3 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1610,8 +1610,11 @@ void ActorManager::getMobNames(StringVect &names) const
}
const Being *const being = static_cast<const Being*>(*it);
- if (being->getType() == ActorType::Monster && !being->getName().empty())
+ if (being->getType() == ActorType::Monster &&
+ !being->getName().empty())
+ {
names.push_back(being->getName());
+ }
}
}
diff --git a/src/gui/fonts/textchunksmall.cpp b/src/gui/fonts/textchunksmall.cpp
index f8c84fdb8..a8012522e 100644
--- a/src/gui/fonts/textchunksmall.cpp
+++ b/src/gui/fonts/textchunksmall.cpp
@@ -40,11 +40,12 @@ TextChunkSmall::TextChunkSmall(const TextChunkSmall &old) :
{
}
-void TextChunkSmall::operator=(const TextChunkSmall &chunk)
+TextChunkSmall &TextChunkSmall::operator=(const TextChunkSmall &chunk)
{
text = chunk.text;
color = chunk.color;
color2 = chunk.color2;
+ return *this;
}
bool TextChunkSmall::operator==(const TextChunkSmall &chunk) const
diff --git a/src/gui/fonts/textchunksmall.h b/src/gui/fonts/textchunksmall.h
index 75c4e6dd7..64a265da4 100644
--- a/src/gui/fonts/textchunksmall.h
+++ b/src/gui/fonts/textchunksmall.h
@@ -38,7 +38,8 @@ class TextChunkSmall final
bool operator==(const TextChunkSmall &restrict chunk) const restrict2;
bool operator<(const TextChunkSmall &restrict chunk) const restrict2;
- void operator=(const TextChunkSmall &restrict chunk) restrict2;
+ TextChunkSmall &operator=(const TextChunkSmall &restrict chunk)
+ restrict2;
std::string text;
Color color;
Color color2;
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 5c6ae3faa..881e10c1a 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -588,7 +588,12 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
const int my = event.getY() + getY();
if (popupMenu)
- popupMenu->showPopup(this, mx, my, item, mInventory->getType());
+ {
+ popupMenu->showPopup(this,
+ mx, my,
+ item,
+ mInventory->getType());
+ }
}
}
else
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index 7df9e0066..efbdf015a 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -89,7 +89,7 @@ class ServerInfo final
version.second = info.version.second;
}
- void operator=(const ServerInfo &info)
+ ServerInfo &operator=(const ServerInfo &info)
{
type = info.type;
name = info.name;
@@ -105,6 +105,7 @@ class ServerInfo final
persistentIp = info.persistentIp;
version.first = info.version.first;
version.second = info.version.second;
+ return *this;
}
bool isValid() const A_WARN_UNUSED
diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp
index 882206761..c31bf5989 100644
--- a/src/net/tmwa/buyingstorehandler.cpp
+++ b/src/net/tmwa/buyingstorehandler.cpp
@@ -35,7 +35,8 @@ BuyingStoreHandler::BuyingStoreHandler()
void BuyingStoreHandler::create(const std::string &name A_UNUSED,
const int maxMoney A_UNUSED,
const bool flag A_UNUSED,
- const std::vector<ShopItem*> &items A_UNUSED) const
+ const std::vector<ShopItem*> &items A_UNUSED)
+ const
{
}
diff --git a/src/utils/paramerers.cpp b/src/utils/parameters.cpp
index aa3ae350f..467c31553 100644
--- a/src/utils/paramerers.cpp
+++ b/src/utils/parameters.cpp
@@ -18,14 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "utils/paramerers.h"
-
-#include "logger.h"
+#include "utils/parameters.h"
#include "utils/stringutils.h"
-#include <sstream>
-
#include "debug.h"
static inline void addToken(StringVect &tokens,
@@ -94,7 +90,7 @@ static inline size_t findNextSplit(const std::string &str,
idx2 = findNextQuote(str, quote, idx2 + 1);
if (idx2 == std::string::npos)
return std::string::npos; // no close quote, here error
- // searching next
+ // set position for next separator or quote
pos = idx2 + 1;
}
else
@@ -102,7 +98,6 @@ static inline size_t findNextSplit(const std::string &str,
return idx1;
}
}
- return idx1;
}
bool splitParameters(StringVect &tokens,
diff --git a/src/utils/paramerers.h b/src/utils/parameters.h
index d93f7a207..d93f7a207 100644
--- a/src/utils/paramerers.h
+++ b/src/utils/parameters.h
diff --git a/src/utils/paramerers_unittest.cc b/src/utils/parameters_unittest.cc
index fbccef0e1..f1c4557ee 100644
--- a/src/utils/paramerers_unittest.cc
+++ b/src/utils/parameters_unittest.cc
@@ -20,7 +20,7 @@
#include "catch.hpp"
-#include "utils/paramerers.h"
+#include "utils/parameters.h"
#include "debug.h"
diff --git a/src/vector.h b/src/vector.h
index 9f3ca47c0..d24e91e9b 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -72,11 +72,12 @@ class Vector final
return x == 0.0F && y == 0.0F && z == 0.0F;
}
- void operator=(const Vector &v)
+ Vector &operator=(const Vector &v)
{
x = v.x;
y = v.y;
z = v.z;
+ return *this;
}
/**