summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-04-29 01:27:47 +0200
committerHaru <haru@dotalux.com>2016-04-29 01:27:47 +0200
commit8ac699f4840bdadfb92326250295e1fed8286183 (patch)
tree09f2e0a63cffc44d33c208c179aeaee497d45419 /src/map
parentf488476193e26615a1d29d56bc3ccf5b52aeffe4 (diff)
parentba9e21984ee191865d11df1bb87f4142bb4cc5ab (diff)
downloadhercules-8ac699f4840bdadfb92326250295e1fed8286183.tar.gz
hercules-8ac699f4840bdadfb92326250295e1fed8286183.tar.bz2
hercules-8ac699f4840bdadfb92326250295e1fed8286183.tar.xz
hercules-8ac699f4840bdadfb92326250295e1fed8286183.zip
Merge pull request #1272 from 4144/gccwarnings
Add some new gcc 6 warnings and fix some error found by it
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c3
-rw-r--r--src/map/script.c1
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c19
4 files changed, 13 insertions, 12 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 4ec58b6bc..1948eecea 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9785,8 +9785,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd)
bool is_fakename = false;
int outlen = 0;
- nullpo_retv(sd);
-
packet = RP2PTR(fd);
message = clif->process_chat_message(sd, packet, full_message, sizeof full_message);
if (message == NULL)
@@ -17801,7 +17799,6 @@ void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd)
{
const struct packet_bgqueue_checkstate *p = RP2PTR(fd);
- nullpo_retv(sd);
if (sd->bg_queue.arena && sd->bg_queue.type) {
clif->bgqueue_update_info(sd,sd->bg_queue.arena->id,bg->id2pos(sd->bg_queue.arena->queue_id,sd->status.account_id));
} else {
diff --git a/src/map/script.c b/src/map/script.c
index e869ddb62..181ff350f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10085,6 +10085,7 @@ int buildin_killmonsterall_sub_strip(struct block_list *bl,va_list ap)
struct mob_data *md;
md = BL_CAST(BL_MOB, bl);
+ nullpo_ret(md);
if (md->npc_event[0])
md->npc_event[0] = 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index d3cb8d0be..3004bf0e9 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9280,7 +9280,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
improv_skill_lv = 4 + skill_lv;
clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
- if (sd == NULL) {
+ if (sd != NULL) {
sd->state.abra_flag = 2;
sd->skillitem = improv_skill_id;
sd->skillitemlv = improv_skill_lv;
diff --git a/src/map/status.c b/src/map/status.c
index a8771c0a5..39bb25737 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -5576,9 +5576,9 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
{
int val = 0;
- if( sd && sc->data[SC_HIDING] && pc->checkskill(sd,RG_TUNNELDRIVE) > 0 )
+ if ( sd && sc->data[SC_HIDING] && pc->checkskill(sd,RG_TUNNELDRIVE) > 0 ) {
val = 120 - 6 * pc->checkskill(sd,RG_TUNNELDRIVE);
- else
+ } else {
if( sd && sc->data[SC_CHASEWALK] && sc->data[SC_CHASEWALK]->val3 < 0 )
val = sc->data[SC_CHASEWALK]->val3;
else
@@ -5648,8 +5648,8 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
if( sd && sd->bonus.speed_rate + sd->bonus.speed_add_rate > 0 ) // permanent item-based speedup
val = max( val, sd->bonus.speed_rate + sd->bonus.speed_add_rate );
}
-
- speed_rate += val;
+ }
+ speed_rate += val;
}
//GetMoveHasteValue1()
@@ -7495,8 +7495,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
break;
case SC_NOEQUIPSHIELD:
- if( val2 == 1 ) val2 = 0; //GX effect. Do not take shield off..
- else
+ if (val2 == 1) {
+ val2 = 0; //GX effect. Do not take shield off..
+ } else {
if (sd && !(flag&SCFLAG_LOADED)) {
int i;
if(sd->bonus.unstripable_equip&EQP_SHIELD)
@@ -7506,8 +7507,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0;
pc->unequipitem(sd, i, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
}
- if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
- break;
+ }
+ if (tick == 1)
+ return 1; //Minimal duration: Only strip without causing the SC
+ break;
case SC_NOEQUIPARMOR:
if (sd && !(flag&SCFLAG_LOADED)) {
int i;