summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-02 04:11:12 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-02 04:11:12 +0300
commit5400a3120742494281f6cce43545657432a08f25 (patch)
treebe843b338f34ef2d6d474121031a7b57f82f677b
parentecae89e342fc07daa816fe7de133968a51745040 (diff)
downloadmanaplus-5400a3120742494281f6cce43545657432a08f25.tar.gz
manaplus-5400a3120742494281f6cce43545657432a08f25.tar.bz2
manaplus-5400a3120742494281f6cce43545657432a08f25.tar.xz
manaplus-5400a3120742494281f6cce43545657432a08f25.zip
Add some missing brackets in macroses.
-rw-r--r--src/configmanager.cpp2
-rw-r--r--src/fs/virtfs/zipreader.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp2
-rw-r--r--src/net/recvpacketdefine.h8
-rw-r--r--src/resources/map/map.cpp4
-rw-r--r--src/resources/sdlgfxblitfunc.cpp4
-rw-r--r--src/spellmanager.cpp4
-rw-r--r--src/utils/buildhex.h6
-rw-r--r--src/utils/checkutils.h8
9 files changed, 20 insertions, 20 deletions
diff --git a/src/configmanager.cpp b/src/configmanager.cpp
index a5d49bc90..ad3a5470a 100644
--- a/src/configmanager.cpp
+++ b/src/configmanager.cpp
@@ -364,7 +364,7 @@ void ConfigManager::storeSafeParameters()
#endif // __native_client__
#define unassignKey(key, value) \
- if (config.getStringValue(prefix + key) == value) \
+ if (config.getStringValue(prefix + (key)) == (value)) \
config.setValue(key, "-1");
void ConfigManager::checkConfigVersion()
diff --git a/src/fs/virtfs/zipreader.cpp b/src/fs/virtfs/zipreader.cpp
index 340ccf352..4900b388c 100644
--- a/src/fs/virtfs/zipreader.cpp
+++ b/src/fs/virtfs/zipreader.cpp
@@ -48,7 +48,7 @@ extern const char *dirSeparator;
#define readVal(val, sz, msg) \
cnt = fread(static_cast<void*>(val), 1, sz, arcFile); \
- if (cnt != sz) \
+ if (cnt != (sz)) \
{ \
reportAlways("Error reading " msg " in file %s", \
archiveName.c_str()); \
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 9dd1ea4c3..a33bb4ec8 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -809,7 +809,7 @@ void ChatWindow::mouseDragged(MouseEvent &event)
}
#define ifKey(key, str) \
- else if (actionId == key) \
+ else if (actionId == (key)) \
{ \
temp = str; \
}
diff --git a/src/net/recvpacketdefine.h b/src/net/recvpacketdefine.h
index e038d3639..3530efa1f 100644
--- a/src/net/recvpacketdefine.h
+++ b/src/net/recvpacketdefine.h
@@ -28,9 +28,9 @@
mPackets[pid].version = ver
#define packet2(pname, pid, sz, pfunc, ver) \
- mPackets[pid + evolPacketOffset].name = #pname; \
- mPackets[pid + evolPacketOffset].len = sz; \
- mPackets[pid + evolPacketOffset].func = pfunc; \
- mPackets[pid + evolPacketOffset].version = ver
+ mPackets[(pid) + (evolPacketOffset)].name = #pname; \
+ mPackets[(pid) + (evolPacketOffset)].len = sz; \
+ mPackets[(pid) + (evolPacketOffset)].func = pfunc; \
+ mPackets[(pid) + (evolPacketOffset)].version = ver
#endif // NET_RECVPACKETDEFINE_H
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index b37e2af9b..810791222 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -539,12 +539,12 @@ void Map::draw(Graphics *restrict const graphics,
}
#define fillCollision(collision, color) \
- if (x < endX && mMetaTiles[tilePtr].blockmask & collision)\
+ if (x < endX && mMetaTiles[tilePtr].blockmask & (collision))\
{\
width = mapTileSize;\
for (int x2 = tilePtr + 1; x < endX; x2 ++)\
{\
- if (!(mMetaTiles[x2].blockmask & collision))\
+ if (!(mMetaTiles[x2].blockmask & (collision)))\
break;\
width += mapTileSize;\
x ++;\
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index 199d8d2bb..c2d66a68f 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -40,8 +40,8 @@ PRAGMA48(GCC diagnostic pop)
#include "debug.h"
#define GFX_DUFFS_LOOP4(pixel_copy_increment, width) \
- int n = (width + 3) / 4; \
- switch (width & 3) \
+ int n = ((width) + 3) / 4; \
+ switch ((width) & 3) \
{ \
case 0: do { \
pixel_copy_increment; \
diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp
index 7de8070ef..34fe739a5 100644
--- a/src/spellmanager.cpp
+++ b/src/spellmanager.cpp
@@ -322,9 +322,9 @@ void SpellManager::load()
#define setOrDel(str, method) \
const std::string var##method = spell->method(); \
if (!var##method.empty()) \
- serverConfig.setValue(str + toString(i), var##method); \
+ serverConfig.setValue((str) + toString(i), var##method); \
else \
- serverConfig.deleteKey(str + toString(i));
+ serverConfig.deleteKey((str) + toString(i));
void SpellManager::save() const
{
diff --git a/src/utils/buildhex.h b/src/utils/buildhex.h
index 49ed4217b..8340acefd 100644
--- a/src/utils/buildhex.h
+++ b/src/utils/buildhex.h
@@ -36,13 +36,13 @@ PRAGMA48(GCC diagnostic pop)
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define buildHex(a, b, c, d) \
- (d) * 16777216U + (c) * 65536U + (b) * 256U + CAST_U32(a)
+ ((d) * 16777216U + (c) * 65536U + (b) * 256U + CAST_U32(a))
#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
#define buildHex(a, b, c, d) \
- (a) * 16777216U + (b) * 65536U + (c) * 256U + CAST_U32(d)
+ ((a) * 16777216U + (b) * 65536U + (c) * 256U + CAST_U32(d))
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
#define buildHexOgl(a, b, c, d) \
- (a) * 16777216U + (b) * 65536U + (c) * 256U + CAST_U32(d)
+ ((a) * 16777216U + (b) * 65536U + (c) * 256U + CAST_U32(d))
#endif // UTILS_BUILDHEX_H
diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h
index d0d74248b..567555f89 100644
--- a/src/utils/checkutils.h
+++ b/src/utils/checkutils.h
@@ -182,7 +182,7 @@ void reportStack();
}
#define returnFalseVReal(val) \
- if (!val) \
+ if (!(val)) \
return;
#define returnTrueVReal(val) \
@@ -190,7 +190,7 @@ void reportStack();
return;
#define returnFalseReal(ret, val) \
- if (!val) \
+ if (!(val)) \
return ret;
#define returnTrueReal(ret, val) \
@@ -209,7 +209,7 @@ void reportStack();
#define failTrue(val) (val)
#define returnFailFalseV(val) \
- if (!val) \
+ if (!(val)) \
return;
#define returnFailTrueV(val) \
@@ -217,7 +217,7 @@ void reportStack();
return;
#define returnFailFalse(ret, val) \
- if (!val) \
+ if (!(val)) \
return ret;
#define returnFailTrue(ret, val) \