From 3351e403553bcca1d0c7da84d2606a5feaa9c49e Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 7 Nov 2011 15:26:44 +0000 Subject: clean up (eliminate compile warnings) git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5458 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/include/proto.h | 2 +- pttbbs/mbbsd/bbs.c | 38 +++++++++++++++++++++++--------------- pttbbs/mbbsd/cal.c | 4 ++-- pttbbs/mbbsd/captcha.c | 4 ++-- pttbbs/mbbsd/ccw.c | 4 ++-- pttbbs/mbbsd/chess.c | 16 ++++++++-------- pttbbs/mbbsd/edit.c | 2 +- pttbbs/mbbsd/fav.c | 2 +- pttbbs/mbbsd/friend.c | 2 +- pttbbs/mbbsd/mail.c | 34 +++++++++------------------------- pttbbs/mbbsd/more.c | 7 ++++--- pttbbs/mbbsd/pmore.c | 6 +++--- pttbbs/mbbsd/psb.c | 30 +++++++++++++++--------------- pttbbs/mbbsd/stuff.c | 4 ++-- pttbbs/mbbsd/telnet.c | 6 +++--- pttbbs/mbbsd/term.c | 2 +- pttbbs/mbbsd/user.c | 4 ++-- 17 files changed, 80 insertions(+), 87 deletions(-) diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index 97b481ad..51b0daf6 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -588,7 +588,7 @@ typedef uint64_t aidu_t; aidu_t fn2aidu(char *fn); char *aidu2aidc(char *buf, aidu_t aidu); char *aidu2fn(char *buf, aidu_t aidu); -aidu_t aidc2aidu(char *aidc); +aidu_t aidc2aidu(const char *aidc); int search_aidu(char *bfile, aidu_t aidu); /* end of AIDS */ diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index e46215c4..261014d2 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1127,7 +1127,7 @@ do_crosspost(const char *brd, fileheader_t *postfile, const char *fpath, int len = 42-strlen(currboard); fileheader_t fh; int bid = getbnum(brd); - char *title, *prefix = ""; + const char *title, *prefix = ""; int title_type = SUBJECT_NORMAL; if(bid <= 0 || bid > MAX_BOARD) return; @@ -1167,7 +1167,7 @@ do_crosspost(const char *brd, fileheader_t *postfile, const char *fpath, } static int -do_general(int garbage) +do_general(int garbage GCC_UNUSED) { fileheader_t postfile; char fpath[PATHLEN], buf[STRLEN]; @@ -1183,7 +1183,7 @@ do_general(int garbage) boardheader_t *bp; int islocal, posttype=-1, edflags = 0; char save_title[STRLEN]; - char *reason = "無法發文"; + const char *reason = "無法發文"; save_title[0] = '\0'; @@ -1613,7 +1613,8 @@ do_generalboardreply(/*const*/ fileheader_t * fhdr) } int -b_call_in(int ent, const fileheader_t * fhdr, const char *direct) +b_call_in(int ent GCC_UNUSED, const fileheader_t * fhdr, + const char *direct GCC_UNUSED) { userinfo_t *u = search_ulist(searchuser(fhdr->owner, NULL)); if (u) { @@ -1665,7 +1666,8 @@ do_reply(/*const*/ fileheader_t * fhdr) } static int -reply_post(int ent, /*const*/ fileheader_t * fhdr, const char *direct) +reply_post(int ent GCC_UNUSED, fileheader_t * fhdr, + const char *direct GCC_UNUSED) { return do_reply(fhdr); } @@ -1931,7 +1933,8 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) #define UPDATE_USEREC (currmode |= MODE_DIRTY) int -old_cross_post(int ent, fileheader_t * fhdr, const char *direct) +old_cross_post(int e GCC_UNUSED, fileheader_t* g GCC_UNUSED, + const char *d GCC_UNUSED) { vmsg("為了避免您誤按,轉錄按鍵已改為 Ctrl-X"); return PARTUPDATE; @@ -1941,7 +1944,7 @@ static int cross_post(int ent, fileheader_t * fhdr, const char *direct) { char xboard[20], fname[PATHLEN], xfpath[PATHLEN], xtitle[80]; - char genbuf[200], genbuf2[4]; + char genbuf[200]; fileheader_t xfile; FILE *xptr; int xbid, hashPost; @@ -2507,7 +2510,8 @@ stop_gamble(void) return 1; } static int -join_gamble(int ent, const fileheader_t * fhdr, const char *direct) +join_gamble(int eng GCC_UNUSED, const fileheader_t * fhdr GCC_UNUSED, + const char *direct GCC_UNUSED) { if (!HasBasicUserPerm(PERM_LOGINOK)) return DONOTHING; @@ -2643,7 +2647,8 @@ hold_gamble(void) #endif static int -cite_post(int ent, const fileheader_t * fhdr, const char *direct) +cite_post(int ent GCC_UNUSED, const fileheader_t * fhdr, + const char *direct GCC_UNUSED) { char fpath[PATHLEN]; char title[TTLEN + 1]; @@ -3269,8 +3274,8 @@ mark_post(int ent, fileheader_t * fhdr, const char *direct) } int -del_range(int ent, const fileheader_t *fhdr, const char *direct, - const char *backup_direct) +del_range(int ent GCC_UNUSED, const fileheader_t *fhdr GCC_UNUSED, + const char *direct, const char *backup_direct) { char numstr[8]; int num1, num2, num, cdeleted = 0; @@ -3683,7 +3688,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct) } static int // Ptt: 修石頭文 -show_filename(int ent, const fileheader_t * fhdr, const char *direct) +show_filename(int ent GCC_UNUSED, const fileheader_t * fhdr, + const char *direct GCC_UNUSED) { if(!HasUserPerm(PERM_SYSOP)) return DONOTHING; vmsgf("檔案名稱: %s ", fhdr->filename); @@ -3746,7 +3752,8 @@ lock_post(int ent, fileheader_t * fhdr, const char *direct) } static int -view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln) +view_postinfo(int ent GCC_UNUSED, const fileheader_t * fhdr, + const char *direct GCC_UNUSED, int crs_ln) { aidu_t aidu = 0; int l = crs_ln + 3; /* line of cursor */ @@ -3888,7 +3895,7 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln #ifdef USE_TIME_CAPSULE static int -view_posthistory(int ent, const fileheader_t * fhdr, const char *direct) +view_posthistory(int ent GCC_UNUSED, const fileheader_t * fhdr, const char *direct) { char fpath[PATHLEN]; const char *err_no_history = "此篇文章暫無編輯歷史記錄。" @@ -4271,7 +4278,8 @@ b_help(void) } static int -b_mark_read_unread(int ent, const fileheader_t * fhdr, const char *direct) { +b_mark_read_unread(int ent GCC_UNUSED, const fileheader_t * fhdr, + const char *direct GCC_UNUSED) { char ans[3]; time4_t curr; move(b_lines-4, 0); clrtobot(); diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c index 0399085e..29e114c4 100644 --- a/pttbbs/mbbsd/cal.c +++ b/pttbbs/mbbsd/cal.c @@ -96,7 +96,7 @@ unlockutmpmode(void) } static int -do_pay(int uid, int money, const char *item, const char *reason) +do_pay(int uid, int money, const char *item GCC_UNUSED, const char *reason) { int oldm, newm; const char *userid; @@ -300,7 +300,7 @@ cal_after_givetax(int money) } static int -give_money_vget_changecb(int key, VGET_RUNTIME *prt, void *instance) +give_money_vget_changecb(int key GCC_UNUSED, VGET_RUNTIME *prt, void *instance) { int m1 = atoi(prt->buf), m2 = m1; char c1 = ' ', c2 = ' '; diff --git a/pttbbs/mbbsd/captcha.c b/pttbbs/mbbsd/captcha.c index 2d0146ab..b6bffb8d 100644 --- a/pttbbs/mbbsd/captcha.c +++ b/pttbbs/mbbsd/captcha.c @@ -62,7 +62,7 @@ gen_captcha(char *buf, int szbuf, char *fpath) static int -_vgetcb_data_upper(int key, VGET_RUNTIME *prt, void *instance) +_vgetcb_data_upper(int key, VGET_RUNTIME *prt GCC_UNUSED, void *instance GCC_UNUSED) { if (key >= 'a' && key <= 'z') key = toupper(key); @@ -75,7 +75,7 @@ _vgetcb_data_upper(int key, VGET_RUNTIME *prt, void *instance) } static int -_vgetcb_data_change(int key, VGET_RUNTIME *prt, void *instance) +_vgetcb_data_change(int key, VGET_RUNTIME *prt GCC_UNUSED, void *instance GCC_UNUSED) { char *s = prt->buf; while (*s) diff --git a/pttbbs/mbbsd/ccw.c b/pttbbs/mbbsd/ccw.c index c28de951..90e24af4 100644 --- a/pttbbs/mbbsd/ccw.c +++ b/pttbbs/mbbsd/ccw.c @@ -582,7 +582,7 @@ ccw_talk_header(CCW_CTX *ctx) } CCW_PROTO void -ccw_talk_footer(CCW_CTX *ctx) +ccw_talk_footer(CCW_CTX *ctx GCC_UNUSED) { vs_footer(" 【" CCW_CAP_TALK "】 ", " (PgUp/PgDn)回顧訊息記錄\t(Ctrl-C)離開 "); @@ -1033,7 +1033,7 @@ ccw_chat_anti_flood(CCW_CTX *ctx) #endif // EXP_ANTIFLOOD CCW_PROTO int -ccw_chat_peek_cmd(CCW_CTX *ctx, const char *buf, int local) +ccw_chat_peek_cmd(CCW_CTX *ctx, const char *buf, int local GCC_UNUSED) { ccw_chat_check_newmail(ctx); #ifdef EXP_ANTIFLOOD diff --git a/pttbbs/mbbsd/chess.c b/pttbbs/mbbsd/chess.c index adce76aa..907bc5f7 100644 --- a/pttbbs/mbbsd/chess.c +++ b/pttbbs/mbbsd/chess.c @@ -70,7 +70,7 @@ static sigjmp_buf sigjmpEnv; */ static ChessTimeLimit * _current_time_limit; -static void SigjmpEnv(int sig) { siglongjmp(sigjmpEnv, 1); } +static void SigjmpEnv(int sig GCC_UNUSED) { siglongjmp(sigjmpEnv, 1); } #define CHESS_HISTORY_ENTRY(INFO,N) \ ((INFO)->history.body + (N) * (INFO)->constants->step_entry_size) @@ -136,7 +136,7 @@ ChessBroadcastListInsert(ChessBroadcastList* list) static void ChessDrawHelpLine(const ChessInfo* info) { - const static char* const HelpStr[] = + static const char* const HelpStr[] = { /* CHESS_MODE_VERSUS, 對奕 */ ANSI_COLOR(1;33;42) " 下棋 " @@ -427,12 +427,12 @@ ChessAnswerRequest(ChessInfo* info, const char* req_name) ChessGameResult ChessPlayFuncMy(ChessInfo* info) { - int last_time = now; - int endturn = 0; + volatile int last_time = now; + volatile int endturn = 0; ChessGameResult game_result = CHESS_RESULT_CONTINUE; int ch; #ifdef DBCSAWARE - int move_count = 0; + volatile int move_count = 0; #endif info->pass[(int) info->turn] = 0; @@ -632,8 +632,8 @@ ChessPlayFuncMy(ChessInfo* info) static ChessGameResult ChessPlayFuncHis(ChessInfo* info) { - int last_time = now; - int endturn = 0; + volatile int last_time = now; + volatile int endturn = 0; ChessGameResult game_result = CHESS_RESULT_CONTINUE; while (!endturn) { @@ -887,7 +887,7 @@ ChessPlayFuncWatch(ChessInfo* info) } static void -ChessWatchRequest(int sig) +ChessWatchRequest(int sig GCC_UNUSED) { int sock = establish_talk_connection(&SHM->uinfo[currutmp->destuip]); ChessBroadcastListNode* node; diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index 5a2be26a..f872d25a 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -2859,7 +2859,7 @@ edit_outs_attr(const char *text, int attr) } static void -edit_ansi_outs_n(const char *str, int n, int attr) +edit_ansi_outs_n(const char *str, int n, int attr GCC_UNUSED) { char c; while (n-- > 0 && (c = *str++)) { diff --git a/pttbbs/mbbsd/fav.c b/pttbbs/mbbsd/fav.c index fc976d9e..d6e54b07 100644 --- a/pttbbs/mbbsd/fav.c +++ b/pttbbs/mbbsd/fav.c @@ -1090,7 +1090,7 @@ void fav_add_all_tagged_item(void) fav_dosomething_all_tagged_item(fav_add_tagged_item); } -inline static int remove_tag(fav_t *fp, fav_type_t *ft) +inline static int remove_tag(fav_t *fp GCC_UNUSED, fav_type_t *ft) { set_attr(ft, FAVH_TAG, FALSE); return 0; diff --git a/pttbbs/mbbsd/friend.c b/pttbbs/mbbsd/friend.c index 90929443..4feac904 100644 --- a/pttbbs/mbbsd/friend.c +++ b/pttbbs/mbbsd/friend.c @@ -323,7 +323,7 @@ friend_delete(const char *uident, int type) } static void -delete_user_friend(const char *uident, const char *thefriend, int type) +delete_user_friend(const char *uident, const char *thefriend, int type GCC_UNUSED) { char fn[PATHLEN]; // some stupid user simply set themselves and caused recursion here. diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index 7a5f95a0..78b7a779 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -1137,9 +1137,8 @@ mailtitle(void) static void maildoent(int num, fileheader_t * ent) { - char *title, *mark, *color = NULL, type = ' '; - char datepart[6]; - char isonline = 0; + const char *title, *mark, *color = NULL; + char isonline = 0, datepart[6], type = ' '; int title_type = SUBJECT_NORMAL; if (ent->filemode & FILE_MARKED) @@ -1307,22 +1306,6 @@ mail_read_all(int ent GCC_UNUSED, fileheader_t * fhdr GCC_UNUSED, const char *di return DIRCHANGED; } -static int -mail_unread(int ent, fileheader_t * fhdr, const char *direct) -{ - // this function may cause arguments, so please specify - // if you want this to be enabled. -#ifdef USE_USER_MAIL_UNREAD - if (fhdr && fhdr->filemode & FILE_READ) - { - fhdr->filemode &= ~FILE_READ; - substitute_fileheader(direct, fhdr, fhdr, ent); - return FULLUPDATE; - } -#endif // USE_USER_MAIL_UNREAD - return DONOTHING; -} - /* in boards/mail 回信給原作者,轉信站亦可 */ int mail_reply(int ent, fileheader_t * fhdr, const char *direct) @@ -1521,14 +1504,14 @@ m_help(void) } static int -mail_cross_post(int unused_arg, fileheader_t * fhdr, const char *direct) +mail_cross_post(int unused_arg GCC_UNUSED, fileheader_t * fhdr, + const char *direct GCC_UNUSED) { char xboard[20], fname[80], xfpath[80], xtitle[80]; fileheader_t xfile; FILE *xptr; char genbuf[200]; - char genbuf2[4]; - int xbid, ans; + int xbid; // XXX TODO 為避免違法使用者大量對申訴板轉文,限定每次發文量。 if (HasUserPerm(PERM_VIOLATELAW)) @@ -1838,7 +1821,8 @@ mail_waterball(int ent GCC_UNUSED, fileheader_t * fhdr, const char *direct GCC_U #ifdef USE_TIME_CAPSULE static int -mail_recycle_bin(int ent, fileheader_t * fhdr, const char *direct) { +mail_recycle_bin(int ent GCC_UNUSED, fileheader_t * fhdr GCC_UNUSED, + const char *direct) { return psb_recycle_bin(direct, "個人信箱"); } #else // USE_TIME_CAPSULE @@ -1906,7 +1890,7 @@ static const onekey_t mail_comms[] = { { 0, NULL }, // 'S' { 1, edit_title }, // 'T' { 0, NULL }, // 'U' - { 1, mail_unread }, // 'V' + { 0, NULL }, // 'V' { 0, NULL }, // 'W' { 1, old_cross_post }, // 'X' { 0, NULL }, // 'Y' @@ -2091,7 +2075,7 @@ bsmtp(const char *fpath, const char *title, const char *rcpt, const char *from) if (strchr(rcpt, '@')) { strlcpy(hacker, rcpt, sizeof(hacker)); len = ptr - rcpt; - if (0 <= len && len < sizeof(hacker)) + if (0 <= len && (size_t)len < sizeof(hacker)) hacker[len] = '\0'; } else strlcpy(hacker, rcpt, sizeof(hacker)); diff --git a/pttbbs/mbbsd/more.c b/pttbbs/mbbsd/more.c index 254f2611..a36e11ce 100644 --- a/pttbbs/mbbsd/more.c +++ b/pttbbs/mbbsd/more.c @@ -47,7 +47,7 @@ check_sysop_edit_perm(const char *fpath) } static int -common_pager_key_handler(int ch, void *ctx) +common_pager_key_handler(int ch, void *ctx GCC_UNUSED) { switch(ch) { @@ -368,7 +368,7 @@ static const char }; static int -common_pmore_help_handler(int y, void *ctx) +common_pmore_help_handler(int y, void *ctx GCC_UNUSED) { const char ** p[3] = { hlp_nav, hlp_reply, hlp_spc }; const int cols[3] = { 29, 27, 20 }, // columns, to fit pmore built-ins @@ -397,7 +397,8 @@ display_hotkey_footer(const char *caption, const char *kattr, const char *vattr) #define MACROSTRLEN(x) (sizeof(x)-1) static int -common_pmore_footer_handler(int ratio, int width, void *ctx) +common_pmore_footer_handler(int ratio GCC_UNUSED, int width, + void *ctx GCC_UNUSED) { #define FOOTERMSG_MAIL_LONG "(y)回信 (h)說明 (←/q)離開 " #define FOOTERMSG_READ_LONG "(y)回應(X%)推文(h)說明(←)離開 " diff --git a/pttbbs/mbbsd/pmore.c b/pttbbs/mbbsd/pmore.c index f6bdf2bb..9b3f7b28 100644 --- a/pttbbs/mbbsd/pmore.c +++ b/pttbbs/mbbsd/pmore.c @@ -751,7 +751,7 @@ MFPROTO void mf_determinemaxdisps(int, int); #include MFPROTO int -mf_gunzip(const char *fn, int fd) +mf_gunzip(const char *fn GCC_UNUSED, int fd) { char magic[2] = {0}; const char gzip_magic[2] = {0x1f, 0x8b}; @@ -3142,7 +3142,7 @@ mf_str2float(unsigned char *p, unsigned char *end, float *pf) /* process time */ while ( p < end && - cbuf < sizeof(buf)-1 && + cbuf < (int)sizeof(buf)-1 && (isdigit(*p) || *p == '.' || *p == '+' || *p == '-')) buf[cbuf++] = *p++; @@ -3462,7 +3462,7 @@ MFPROTO int mf_movieGotoNamedFrame(const unsigned char *name, const unsigned char *end) { const unsigned char *p = name; - size_t sz = 0; + ssize_t sz = 0; // resolve name first while (p < end && isalnum(*p)) diff --git a/pttbbs/mbbsd/psb.c b/pttbbs/mbbsd/psb.c index c8f47cd7..f220d074 100644 --- a/pttbbs/mbbsd/psb.c +++ b/pttbbs/mbbsd/psb.c @@ -43,26 +43,26 @@ typedef struct { } PSB_CTX; static int -psb_default_header(void *ctx) { +psb_default_header(void *ctx GCC_UNUSED) { vs_hdr2bar("Panty & Stocking Browser", BBSNAME); return 0; } static int -psb_default_footer(void *ctx) { +psb_default_footer(void *ctx GCC_UNUSED) { vs_footer(" PSB 1.0 ", " (↑/↓/PgUp/PgDn/0-9)Move (Enter/→)Select \t(q/←)Quit"); return 0; } static int -psb_default_renderer(int i, int curr, int total, int rows, void *ctx) { +psb_default_renderer(int i, int curr, int total, int rows GCC_UNUSED, void *ctx GCC_UNUSED) { prints(" %s(Demo) %5d / %5d Item\n", (i == curr) ? "*" : " ", i, total); return 0; } static int -psb_default_cursor(int y, int curr, void * ctx) { +psb_default_cursor(int y, int curr GCC_UNUSED, void * ctx GCC_UNUSED) { #ifdef USE_PFTERM outs("●\b"); #else @@ -72,7 +72,7 @@ psb_default_cursor(int y, int curr, void * ctx) { } static int -psb_default_input_processor(int key, int curr, int total, int rows, void *ctx) { +psb_default_input_processor(int key, int curr, int total, int rows, void *ctx GCC_UNUSED) { switch(key) { case 'q': case KEY_LEFT: @@ -224,7 +224,7 @@ pveh_header(void *ctx) { } static int -pveh_footer(void *ctx) { +pveh_footer(void *ctx GCC_UNUSED) { vs_footer(" 編輯歷史 ", " (↑↓)移動 (Enter/r/→)選擇 (x)存入信箱 " "(~)" RECYCLE_BIN_NAME @@ -244,7 +244,7 @@ pveh_solve_rev_filename(int rev, int i, char *fname, size_t sz_fname, } static int -pveh_renderer(int i, int curr, int total, int rows, void *ctx) { +pveh_renderer(int i, int curr, int total, int rows GCC_UNUSED, void *ctx) { const char *subject = ""; char fname[PATHLEN]; time4_t ftime = 0; @@ -278,7 +278,7 @@ pveh_renderer(int i, int curr, int total, int rows, void *ctx) { } static int -pveh_input_processor(int key, int curr, int total, int rows, void *ctx) { +pveh_input_processor(int key, int curr, int total, int rows GCC_UNUSED, void *ctx) { char fname[PATHLEN]; pveh_ctx *cx = (pveh_ctx*) ctx; int rev = total - curr; // see renderer @@ -414,7 +414,7 @@ pvrb_header(void *ctx) { } static int -pvrb_footer(void *ctx) { +pvrb_footer(void *ctx GCC_UNUSED) { vs_footer(" 已刪檔案 ", " (↑/↓/PgUp/PgDn)移動 (Enter/r/→)選擇 (/a#n)搜尋 (x)存入信箱" "\t(q/←)跳出"); @@ -423,7 +423,7 @@ pvrb_footer(void *ctx) { } static int -pvrb_renderer(int i, int curr, int total, int rows, void *ctx) { +pvrb_renderer(int i, int curr, int total, int rows GCC_UNUSED, void *ctx) { pvrb_ctx *cx = (pvrb_ctx*) ctx; fileheader_t *fh = &cx->records[total - i - 1]; @@ -502,7 +502,7 @@ pvrb_search(char key, int curr, int total, pvrb_ctx *cx) { } static int -pvrb_input_processor(int key, int curr, int total, int rows, void *ctx) { +pvrb_input_processor(int key, int curr, int total, int rows GCC_UNUSED, void *ctx) { char fname[PATHLEN]; int maxrev; pvrb_ctx *cx = (pvrb_ctx*) ctx; @@ -660,7 +660,7 @@ typedef struct { } pae_ctx; static int -pae_header(void *ctx) { +pae_header(void *ctx GCC_UNUSED) { vs_hdr2bar(" 【系統檔案】 ", " 編輯系統檔案"); outs("請選取要編輯的檔案後按 Enter 開始修改\n"); vbarf(ANSI_REVERSE @@ -669,7 +669,7 @@ pae_header(void *ctx) { } static int -pae_footer(void *ctx) { +pae_footer(void *ctx GCC_UNUSED) { vs_footer(" 編輯系統檔案 ", " (↑↓/0-9)移動 (Enter/e/r/→)編輯 (DEL/d)刪除 \t(q/←)跳出"); move(b_lines-1, 0); @@ -677,7 +677,7 @@ pae_footer(void *ctx) { } static int -pae_renderer(int i, int curr, int total, int rows, void *ctx) { +pae_renderer(int i, int curr, int total GCC_UNUSED, int rows GCC_UNUSED, void *ctx) { pae_ctx *cx = (pae_ctx*) ctx; prints(" %3d %s%s%-36.36s " ANSI_COLOR(1;37) "%-30.30s" ANSI_RESET "\n", i+1, @@ -688,7 +688,7 @@ pae_renderer(int i, int curr, int total, int rows, void *ctx) { } static int -pae_input_processor(int key, int curr, int total, int rows, void *ctx) { +pae_input_processor(int key, int curr, int total GCC_UNUSED, int rows GCC_UNUSED, void *ctx) { int result; pae_ctx *cx = (pae_ctx*) ctx; diff --git a/pttbbs/mbbsd/stuff.c b/pttbbs/mbbsd/stuff.c index c37abae1..2e14b033 100644 --- a/pttbbs/mbbsd/stuff.c +++ b/pttbbs/mbbsd/stuff.c @@ -515,9 +515,9 @@ char *aidu2fn(char *fn, aidu_t aidu) return fn; } -aidu_t aidc2aidu(char *aidc) +aidu_t aidc2aidu(const char *aidc) { - char *sp = aidc; + const char *sp = aidc; aidu_t aidu = 0; if(aidc == NULL) diff --git a/pttbbs/mbbsd/telnet.c b/pttbbs/mbbsd/telnet.c index 7cf1fee5..ed094abd 100644 --- a/pttbbs/mbbsd/telnet.c +++ b/pttbbs/mbbsd/telnet.c @@ -7,19 +7,19 @@ static char raw_connection = 0; extern void UpdateClientCode(unsigned char c); static void -telnet_cb_update_client_code(void *cc_arg, unsigned char c) +telnet_cb_update_client_code(void *cc_arg GCC_UNUSED, unsigned char c) { UpdateClientCode(c); } #endif static void -telnet_cb_resize_term(void *resize_arg, int w, int h) +telnet_cb_resize_term(void *resize_arg GCC_UNUSED, int w, int h) { term_resize(w, h); } -const static struct TelnetCallback telnet_callback = { +static const struct TelnetCallback telnet_callback = { NULL, telnet_cb_resize_term, #ifdef DETECT_CLIENT diff --git a/pttbbs/mbbsd/term.c b/pttbbs/mbbsd/term.c index 56cc7685..844a219f 100644 --- a/pttbbs/mbbsd/term.c +++ b/pttbbs/mbbsd/term.c @@ -38,7 +38,7 @@ init_tty(void) #define TERMCOMSIZE (40) static void -sig_term_resize(int sig) +sig_term_resize(int sig GCC_UNUSED) { struct winsize newsize; Signal(SIGWINCH, SIG_IGN); /* Don't bother me! */ diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index dd792e0f..6613ad8f 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -295,7 +295,7 @@ user_display(const userec_t * u, int adminmode) if (dashs(buf) > 0) outs("[自動轉寄]"); - for (i = 0; i < sizeof(uflag_mask)/sizeof(uflag_mask[0]); i++) + for (i = 0; (size_t)i < sizeof(uflag_mask)/sizeof(uflag_mask[0]); i++) { if (!(u->uflag & uflag_mask[i])) continue; @@ -888,7 +888,7 @@ uinfo_query(const char *orig_uid, int adminmode, int unum) if (getdata_str(y++, 0, STR_LOGINDAYS ":", buf, 10, DOECHO, genbuf)) if ((tmp = atoi(buf)) >= 0) x.numlogindays = tmp; - if (x.numlogindays > max_days) + if ((int)x.numlogindays > max_days) { x.numlogindays = max_days; vmsgf("根據此使用者最後上線時間,最大值為 %d.", max_days); -- cgit v1.2.3