diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-03-24 10:45:54 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-03-24 10:45:54 +0800 |
commit | 503715fd0f5ed1b34a5c40574a13286ba9e1acac (patch) | |
tree | 382df60fc75a53ff5ecc3e2f4010f3994dba98b5 | |
parent | 5926c9effdfd630fadd4b12a02505815e2aa5122 (diff) | |
download | pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar.gz pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar.bz2 pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar.lz pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar.xz pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.tar.zst pttbbs-503715fd0f5ed1b34a5c40574a13286ba9e1acac.zip |
Eliminate warnings
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5822 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/angel.c | 14 | ||||
-rw-r--r-- | pttbbs/mbbsd/cal.c | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/convert.c | 15 | ||||
-rw-r--r-- | pttbbs/mbbsd/vtuikit.c | 2 |
4 files changed, 23 insertions, 12 deletions
diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c index 6899aa49..e1c76e80 100644 --- a/pttbbs/mbbsd/angel.c +++ b/pttbbs/mbbsd/angel.c @@ -343,6 +343,13 @@ do_changeangel(int force) { char bad_master_file[PATHLEN]; setuserfile(bad_master_file, ".bad_master"); is_bad_master = dashf(bad_master_file); + if (is_bad_master && + dasht(bad_master_file) < (now - ANGEL_INACTIVE_DAYS * DAY_SECONDS)) { + log_filef("log/bad_master.log", LOG_CREAT, + "%s %s removed from bad master list (%d)\n", + Cdatelite(&now), cuser.userid, dasht(bad_master_file)); + remove(bad_master_file); + } } if (!(force || HasUserPerm(PERM_ADMIN))) @@ -437,8 +444,9 @@ int angel_check_master(void) { if (xuser.timeplayangel) prints("小主人最後一次成功\呼叫你(hh)的時間是 %s\n", Cdatelite(&xuser.timeplayangel)); - else - prints("但是小主人從來沒有過成功\呼叫你(常見於洗天使或誤按的主人)。\n"); + else if (xuser.timesetangel) + prints("但小主人似乎從來沒成功\呼叫過你" + "(常見於洗天使或誤按的主人)。\n"); } else { prints(ANSI_COLOR(1;31) "%s 不是你的小主人。" ANSI_RESET "\n", xuser.userid); @@ -524,7 +532,7 @@ int a_angelreport() { #endif prints("\n\t 您目前大約有 %d 位活躍小主人。\n", rpt.my_active_masters); if (rpt.last_assigned_master > 0) { - prints("\n\t 最後收到的新小主人是 %s (%s)\n", + prints("\n\t 你最後收到的新小主人是 %s (%s)\n", getuserid(rpt.last_assigned_master), Cdatelite(&rpt.last_assigned)); } diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c index e46b2e86..e5df5dfb 100644 --- a/pttbbs/mbbsd/cal.c +++ b/pttbbs/mbbsd/cal.c @@ -503,7 +503,7 @@ give_money_ui(const char *userid) } else { if (vans("交易已完成,要修改紅包袋嗎?[y/N] ") == 'y') veditfile(fpath); - log_filef(fpath, 0, alert_trade); + log_file(fpath, 0, alert_trade); sendalert(id, ALERT_NEW_MAIL); } } @@ -549,7 +549,7 @@ resolve_over18(void) int p_sysinfo(void) { - char *cpuloadstr; + const char *cpuloadstr; int load; extern char *compile_time; #ifdef DETECT_CLIENT diff --git a/pttbbs/mbbsd/convert.c b/pttbbs/mbbsd/convert.c index 364384ac..0788ca7f 100644 --- a/pttbbs/mbbsd/convert.c +++ b/pttbbs/mbbsd/convert.c @@ -8,16 +8,19 @@ ConvertMode convert_mode = CONV_NORMAL; int convert_write_utf8(VBUF *v, char c) { - static char trail[2] = {0}; static uint8_t utf8[4]; + static union { + char c[2]; + uint16_t u; + } trail = { .u = 0, }; // trail must be little endian. - if (trail[1]) { + if (trail.c[1]) { int len, i; uint16_t ucs; - trail[0] = c; - ucs = b2u_table[*(uint16_t*)trail]; + trail.c[0] = c; + ucs = b2u_table[trail.u]; len = ucs2utf(ucs, utf8); utf8[len] = 0; @@ -26,7 +29,7 @@ convert_write_utf8(VBUF *v, char c) { for (i = 0; i < len; i++) vbuf_add(v, utf8[i]); - trail[1] = 0; + trail.c[1] = 0; return 1; } @@ -35,7 +38,7 @@ convert_write_utf8(VBUF *v, char c) { return 1; } - trail[1] = c; + trail.c[1] = c; return 0; } diff --git a/pttbbs/mbbsd/vtuikit.c b/pttbbs/mbbsd/vtuikit.c index 2ee250db..6487314a 100644 --- a/pttbbs/mbbsd/vtuikit.c +++ b/pttbbs/mbbsd/vtuikit.c @@ -970,7 +970,7 @@ vs_quick_pref(int default_value, const char *title, const char *entry, opt = options; while (*opt) { const char *ptab = strchr(opt, '\t'); - int slen = ptab ? (ptab - opt) : strlen(opt); + int slen = ptab ? (ptab - opt) : (int)strlen(opt); outs(VCLR_QPREF_ENTRY_KEY); prints("%d", cOptions + 1); if (cOptions == index) { |