summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-17 22:57:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-17 22:57:42 +0300
commit21f4d82b367750543ebfbc65df23e0863bf48c38 (patch)
tree63dfa3cda72741badf9810b6e215f912a44f5a8f /src
parent3154e878e1f4c937807dfc94d1308049e94f9e65 (diff)
downloadmanaverse-21f4d82b367750543ebfbc65df23e0863bf48c38.tar.gz
manaverse-21f4d82b367750543ebfbc65df23e0863bf48c38.tar.bz2
manaverse-21f4d82b367750543ebfbc65df23e0863bf48c38.tar.xz
manaverse-21f4d82b367750543ebfbc65df23e0863bf48c38.zip
Fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.cpp11
-rw-r--r--src/gui/viewport.cpp3
-rw-r--r--src/localconsts.h8
-rw-r--r--src/resources/db/itemdb.cpp1
-rw-r--r--src/resources/map/mapheights.h3
-rw-r--r--src/utils/translation/poparser.cpp2
6 files changed, 17 insertions, 11 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 50a0a6a28..c4c69afa1 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -1170,12 +1170,12 @@ void Gui::handleMouseWheelMovedDown(const MouseInput& mouseInput)
if (mFocusHandler->getDraggedWidget())
sourceWidget = mFocusHandler->getDraggedWidget();
- int sourceWidgetX = 0;
- int sourceWidgetY = 0;
if (sourceWidget)
{
- sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY);
+ int sourceWidgetX = 0;
+ int sourceWidgetY = 0;
+ sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY);
distributeMouseEvent(sourceWidget,
MouseEventType::WHEEL_MOVED_DOWN,
mouseInput.getButton(),
@@ -1192,10 +1192,11 @@ void Gui::handleMouseWheelMovedUp(const MouseInput& mouseInput)
if (mFocusHandler->getDraggedWidget())
sourceWidget = mFocusHandler->getDraggedWidget();
- int sourceWidgetX;
- int sourceWidgetY;
if (sourceWidget)
{
+ int sourceWidgetX;
+ int sourceWidgetY;
+
sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY);
distributeMouseEvent(sourceWidget,
MouseEventType::WHEEL_MOVED_UP,
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 2ef6b836d..ca301d8e8 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -680,7 +680,8 @@ void Viewport::walkByMouse(const MouseEvent &event)
const int clickY = event.getY() + mPixelViewY - 16;
destY = event.getY() + mPixelViewY;
int newDiffY = 1000000;
- const int heightTiles = mainGraphics->mHeight / mMap->getTileHeight();
+ const int heightTiles = mainGraphics->mHeight
+ / mMap->getTileHeight();
const int tileViewY = mPixelViewY / 32;
for (int f = tileViewY; f < tileViewY + heightTiles; f ++)
{
diff --git a/src/localconsts.h b/src/localconsts.h
index 3620d441f..f54ae5659 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -71,11 +71,15 @@
#define DEPRECATED __attribute__ ((deprecated))
#define restrict __restrict__
+#ifdef __INTEL_COMPILER
+#define RETURNS_NONNULL
+#else // __INTEL_COMPILER
#if GCC_VERSION < 40900
#define RETURNS_NONNULL
-#else
+#else // GCC_VERSION < 40900
#define RETURNS_NONNULL __attribute__((returns_nonnull))
-#endif
+#endif // GCC_VERSION < 40900
+#endif // __INTEL_COMPILER
#ifndef ENABLE_CILKPLUS
#define A_NONNULL(...) __attribute__((nonnull (__VA_ARGS__)))
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index ad6d8f3e9..203858fa8 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -350,6 +350,7 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum)
case ItemType::USABLE:
itemInfo->addTag(mTags["Usable"]);
break;
+ case ItemType::CARD:
case ItemType::UNUSABLE:
itemInfo->addTag(mTags["Unusable"]);
break;
diff --git a/src/resources/map/mapheights.h b/src/resources/map/mapheights.h
index 149645b3d..5a5fa8243 100644
--- a/src/resources/map/mapheights.h
+++ b/src/resources/map/mapheights.h
@@ -37,7 +37,8 @@ class MapHeights final
void setHeight(const int x, const int y, const uint8_t height);
uint8_t getHeight(const int x, const int y) const
- { return x < mWidth && y < mHeight ? mTiles[x + y * mWidth] : 0; }
+ { return x < mWidth && y < mHeight ? mTiles[x + y * mWidth]
+ : static_cast<uint8_t>(0U); }
private:
int mWidth;
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp
index 19f5443e9..3866322f5 100644
--- a/src/utils/translation/poparser.cpp
+++ b/src/utils/translation/poparser.cpp
@@ -20,8 +20,6 @@
#include "utils/translation/poparser.h"
-#include "resources/resourcemanager.h"
-
#include "utils/physfstools.h"
#include "utils/stringutils.h"