diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-28 22:06:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-29 01:48:09 +0300 |
commit | f339f824f654aaae39d255466c4e34bda95594fb (patch) | |
tree | 1598e4b5109219baae9827118b26a0aabf2768d2 | |
parent | f488476193e26615a1d29d56bc3ccf5b52aeffe4 (diff) | |
download | hercules-f339f824f654aaae39d255466c4e34bda95594fb.tar.gz hercules-f339f824f654aaae39d255466c4e34bda95594fb.tar.bz2 hercules-f339f824f654aaae39d255466c4e34bda95594fb.tar.xz hercules-f339f824f654aaae39d255466c4e34bda95594fb.zip |
Fix compilation warnings with gcc 6.
-rwxr-xr-x | configure | 52 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/map/clif.c | 3 | ||||
-rw-r--r-- | src/map/status.c | 19 |
4 files changed, 14 insertions, 62 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 8291fd8. +# From configure.in d8c88a7. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -6986,55 +6986,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #AC_CHECK_COMPILER_WFLAG(cast-align) - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wlogical-op" >&5 -$as_echo_n "checking whether $CC supports -Wlogical-op... " >&6; } - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wlogical-op" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wlogical-op" - # Optionally, run a test - if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wlogical-op" >&5 -$as_echo_n "checking whether $CC can actually use -Wlogical-op... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wlogical-op" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wlogical-op" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - +#AC_CHECK_COMPILER_WFLAG(logical-op) # some useless warnings { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnested-externs" >&5 $as_echo_n "checking whether $CC supports -Wnested-externs... " >&6; } diff --git a/configure.in b/configure.in index 3968dc568..b308eab2d 100644 --- a/configure.in +++ b/configure.in @@ -854,7 +854,7 @@ AC_CHECK_COMPILER_WFLAG(missing-include-dirs) AC_CHECK_COMPILER_WFLAG(suggest-attribute=noreturn) AC_CHECK_COMPILER_WFLAG(undef) #AC_CHECK_COMPILER_WFLAG(cast-align) -AC_CHECK_COMPILER_WFLAG(logical-op) +#AC_CHECK_COMPILER_WFLAG(logical-op) # some useless warnings AC_CHECK_COMPILER_WFLAG(nested-externs) AC_CHECK_COMPILER_WFLAG(old-style-definition) AC_CHECK_COMPILER_WFLAG(overlength-strings) 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/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; |