From a0753244f71d4a857d97fea80e0fb2a7d461a4f4 Mon Sep 17 00:00:00 2001 From: lighta Date: Fri, 19 Dec 2014 23:55:14 -0500 Subject: [PATCH] Few typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix few typo and change défault optimisation lvl for O3 for gcc. --- configure | 17 ++++++++--------- configure.in | 11 +++++------ src/common/evdp_epoll.c | 14 -------------- src/login/loginclif.c | 2 +- src/map/chrif.c | 13 +++++++------ src/map/script.c | 2 +- 6 files changed, 22 insertions(+), 37 deletions(-) diff --git a/configure b/configure index ac712aadba2..41d08a58769 100755 --- a/configure +++ b/configure @@ -2860,13 +2860,13 @@ if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then - CFLAGS="-g -O2" + CFLAGS="-O3" else - CFLAGS="-g" + CFLAGS= fi else if test "$GCC" = yes; then - CFLAGS="-O2" + CFLAGS="-O3" else CFLAGS= fi @@ -6297,10 +6297,6 @@ fi # Debug # case $enable_debug in - "no") - # default value - CPPFLAGS="$CPPFLAGS" - ;; "yes") if test $ac_cv_prog_cc_g = yes; then CPPFLAGS="$CPPFLAGS -g -DDEBUG" @@ -6313,12 +6309,15 @@ case $enable_debug in "gdb") if test $ac_cv_prog_cc_g = yes; then CPPFLAGS="$CPPFLAGS -ggdb -DDEBUG" - LDFLAGS="$LDFLAGS -g" + LDFLAGS="$LDFLAGS -ggdb" else echo "error: --enable-debug flag=$enable_debug entered but the compiler does not support -g" exit 1 fi ;; + *) # default value + CPPFLAGS="$CPPFLAGS" + ;; esac # @@ -7379,8 +7378,8 @@ else $as_echo "no" >&6; } fi -CFLAGS="$OPT_LTO $CFLAGS" CFLAGS_AR="$OPT_LTO_AR $CFLAGS" +CFLAGS="$OPT_LTO $CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: Configure finish" >&5 diff --git a/configure.in b/configure.in index 3d55d504f0b..80fee172d40 100644 --- a/configure.in +++ b/configure.in @@ -962,10 +962,6 @@ fi # Debug # case $enable_debug in - "no") - # default value - CPPFLAGS="$CPPFLAGS" - ;; "yes") if test $ac_cv_prog_cc_g = yes; then CPPFLAGS="$CPPFLAGS -g -DDEBUG" @@ -978,12 +974,15 @@ case $enable_debug in "gdb") if test $ac_cv_prog_cc_g = yes; then CPPFLAGS="$CPPFLAGS -ggdb -DDEBUG" - LDFLAGS="$LDFLAGS -g" + LDFLAGS="$LDFLAGS -ggdb" else echo "error: --enable-debug flag=$enable_debug entered but the compiler does not support -g" exit 1 fi ;; + *) # default value + CPPFLAGS="$CPPFLAGS" + ;; esac # @@ -1261,8 +1260,8 @@ else AC_MSG_RESULT([no]) fi -CFLAGS="$OPT_LTO $CFLAGS" CFLAGS_AR="$OPT_LTO_AR $CFLAGS" +CFLAGS="$OPT_LTO $CFLAGS" AC_SUBST([CFLAGS_AR]) AC_MSG_NOTICE([Configure finish]) diff --git a/src/common/evdp_epoll.c b/src/common/evdp_epoll.c index 0357dfc6619..cd0cf5dacb0 100644 --- a/src/common/evdp_epoll.c +++ b/src/common/evdp_epoll.c @@ -8,20 +8,6 @@ // // -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "../common/cbasetypes.h" -#include "../common/showmsg.h" -#include "../common/evdp.h" - #define EPOLL_MAX_PER_CYCLE 10 // Max Events to coalesc. per cycle. diff --git a/src/login/loginclif.c b/src/login/loginclif.c index e39227777c0..5a9bb2a3572 100644 --- a/src/login/loginclif.c +++ b/src/login/loginclif.c @@ -430,7 +430,7 @@ static int logclif_parse_reqcharconnec(int fd, struct login_session_data *sd, ch if( runflag == LOGINSERVER_ST_RUNNING && result == -1 && sd->sex == 'S' && - sd->account_id >= 0 && sd->account_id < ARRAYLENGTH(ch_server) && + sd->account_id < ARRAYLENGTH(ch_server) && !session_isValid(ch_server[sd->account_id].fd) ) { ShowStatus("Connection of the char-server '%s' accepted.\n", server_name); diff --git a/src/map/chrif.c b/src/map/chrif.c index 22e66589cd8..6b387ef7289 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1030,20 +1030,21 @@ int chrif_divorceack(uint32 char_id, int partner_id) { *------------------------------------------*/ int chrif_deadopt(int father_id, int mother_id, int child_id) { struct map_session_data* sd; + int idx = skill_get_index(WE_CALLBABY); if( father_id && ( sd = map_charid2sd(father_id) ) != NULL && sd->status.child == child_id ) { sd->status.child = 0; - sd->status.skill[WE_CALLBABY].id = 0; - sd->status.skill[WE_CALLBABY].lv = 0; - sd->status.skill[WE_CALLBABY].flag = SKILL_FLAG_PERMANENT; + sd->status.skill[idx].id = 0; + sd->status.skill[idx].lv = 0; + sd->status.skill[idx].flag = SKILL_FLAG_PERMANENT; clif_deleteskill(sd,WE_CALLBABY); } if( mother_id && ( sd = map_charid2sd(mother_id) ) != NULL && sd->status.child == child_id ) { sd->status.child = 0; - sd->status.skill[WE_CALLBABY].id = 0; - sd->status.skill[WE_CALLBABY].lv = 0; - sd->status.skill[WE_CALLBABY].flag = SKILL_FLAG_PERMANENT; + sd->status.skill[idx].id = 0; + sd->status.skill[idx].lv = 0; + sd->status.skill[idx].flag = SKILL_FLAG_PERMANENT; clif_deleteskill(sd,WE_CALLBABY); } diff --git a/src/map/script.c b/src/map/script.c index c6261bceb4a..7d513f3b961 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10687,7 +10687,7 @@ BUILDIN_FUNC(morphembryo) item_tmp.nameid = ITEMID_STRANGE_EMBRYO; item_tmp.identify = 1; - if( item_tmp.nameid == 0 || (i = pc_additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT)) ) { + if( (i = pc_additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT)) ) { clif_additem(sd, 0, 0, i); clif_emotion(&sd->bl, E_SWT); // Fail to avoid item drop exploit. } else {