summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/char/int_storage.c19
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/npc.c3
5 files changed, 15 insertions, 17 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++ ) {
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 0458990bb..99a1935fd 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -841,10 +841,8 @@ bool chrif_char_ask_name_answer(int acc, const char* player_name, uint16 type, u
* Request char server to change sex of char (modified by Yor)
*------------------------------------------*/
void chrif_changedsex(int fd) {
- int acc, sex;
-
- acc = RFIFOL(fd,2);
- sex = RFIFOL(fd,6);
+ int acc = RFIFOL(fd,2);
+ //int sex = RFIFOL(fd,6); // Dead store. Uncomment if needed again.
if ( battle_config.etc_log )
ShowNotice("chrif_changedsex %d.\n", acc);
diff --git a/src/map/clif.c b/src/map/clif.c
index 15acfd117..ff8cc9653 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11337,7 +11337,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if( pc_cant_act(sd)
&& skill_id != RK_REFRESH
&& !(skill_id == SR_GENTLETOUCH_CURE && (sd->sc.opt1 == OPT1_STONE || sd->sc.opt1 == OPT1_FREEZE || sd->sc.opt1 == OPT1_STUN))
- && ( sd->state.storage_flag && !tmp&INF_SELF_SKILL ) // SELF skills can be used with the storage open, issue: 8027
+ && ( sd->state.storage_flag && !(tmp&INF_SELF_SKILL) ) // SELF skills can be used with the storage open, issue: 8027
)
return;
diff --git a/src/map/map.c b/src/map/map.c
index 9e41bdca3..a423e6973 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5808,7 +5808,7 @@ int do_init(int argc, char *argv[])
if (load_extras) {
aFree(load_extras);
load_extras = NULL;
- load_extras_count = 0;
+ //load_extras_count = 0; // Dead store. Uncomment if needed again.
}
if( minimal ) {
diff --git a/src/map/npc.c b/src/map/npc.c
index f872a6170..ae374e961 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1155,8 +1155,7 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
// have view ids of mobs to avoid this "issue" [Panikon]
if (sd->npc_id != 0) {
// The player clicked a npc after entering an OnTouch area
- if( sd->areanpc_id == sd->npc_id );
- else
+ if( sd->areanpc_id != sd->npc_id )
ShowError("npc_click: npc_id != 0\n");
return 1;