summaryrefslogtreecommitdiff
path: root/src/char/int_storage.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-04-12 04:50:02 +0200
committerHaru <haru@dotalux.com>2014-04-12 04:50:02 +0200
commitf4a566fc7f7bd0e9bbbe01c7341150ba3c12a03f (patch)
tree836b1b59573430c21ea191c4615dbf97cb347bc8 /src/char/int_storage.c
parent6f6a6b3db3b36846f68e6b8ccb59351dced66ab3 (diff)
downloadhercules-f4a566fc7f7bd0e9bbbe01c7341150ba3c12a03f.tar.gz
hercules-f4a566fc7f7bd0e9bbbe01c7341150ba3c12a03f.tar.bz2
hercules-f4a566fc7f7bd0e9bbbe01c7341150ba3c12a03f.tar.xz
hercules-f4a566fc7f7bd0e9bbbe01c7341150ba3c12a03f.zip
Fixed some compiler/analyzer warnings.
- Sanitized some macros (they weren't going to cause problems, but better being safe than sorry) - Parenthesized an incorrect expression in 6f6a6b3. - Inverted an if(foo); else bar; statement in 6f6a6b3 to get rid of the empty expression (for legibility). - Commented out some unnecessary lines as suggested by clang's static analyzer. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_storage.c')
-rw-r--r--src/char/int_storage.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index c01e3619e..8c49c038d 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -332,15 +332,16 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd)
// Removes any view id that was set by an item that was removed
if( bound_qt ) {
- // Verifies equip bitmasks (see item.equip) and handles the sql statement
-#define CHECK_REMOVE(var,mask,token) do {\
- if((var&mask)) {\
- if((var) != mask && s) StrBuf->AppendStr((&buf), ",");\
- StrBuf->AppendStr((&buf),"`"#token"`='0'");\
- var &= ~mask;\
- s++;\
- }\
- } while(0)
+
+#define CHECK_REMOVE(var,mask,token) do { /* Verifies equip bitmasks (see item.equip) and handles the sql statement */ \
+ if ((var)&(mask)) { \
+ if ((var) != (mask) && s) StrBuf->AppendStr(&buf, ","); \
+ StrBuf->AppendStr(&buf,"`"#token"`='0'"); \
+ (var) &= ~(mask); \
+ s++; \
+ } \
+} while(0)
+
StrBuf->Clear(&buf);
StrBuf->Printf(&buf, "UPDATE `%s` SET ", char_db);
for( j = 0; j < bound_qt; j++ ) {