diff options
-rw-r--r-- | include/proto.h | 2 | ||||
-rw-r--r-- | innbbsd/inndchannel.c | 10 | ||||
-rw-r--r-- | mbbsd/chat.c | 10 | ||||
-rw-r--r-- | mbbsd/chicken.c | 2 | ||||
-rw-r--r-- | mbbsd/mail.c | 14 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 6 | ||||
-rw-r--r-- | mbbsd/user.c | 2 |
7 files changed, 24 insertions, 22 deletions
diff --git a/include/proto.h b/include/proto.h index cc0e4562..414e8b6c 100644 --- a/include/proto.h +++ b/include/proto.h @@ -5,9 +5,11 @@ #ifdef __GNUC__ #define GCC_CHECK_FORMAT(a,b) __attribute__ ((format (printf, a, b))) #define GCC_NORETURN __attribute__ ((__noreturn__)) +#define GCC_UNUSED __attribute__ ((__unused__)) #else #define GCC_CHECK_FORMAT(a,b) #define GCC_NORETURN +#define GCC_UNUSED #endif /* admin */ diff --git a/innbbsd/inndchannel.c b/innbbsd/inndchannel.c index 8465d4d0..187a7d49 100644 --- a/innbbsd/inndchannel.c +++ b/innbbsd/inndchannel.c @@ -48,7 +48,7 @@ int Junkhistory = 0; char *REMOTEUSERNAME, *REMOTEHOSTNAME; -static fd_set rfd, wfd, efd, orfd, owfd, oefd; +static fd_set rfd, wfd, efd, orfd; int channelreader(ClientType *); @@ -183,7 +183,7 @@ inndchannel(port, path) } time(&now); local = localtime(&now); - if (local != NULL & local->tm_hour == His_Maint_Hour && + if (local != NULL && local->tm_hour == His_Maint_Hour && local->tm_min >= His_Maint_Min) { if (!maint) { bbslog(":Maint: start (%d:%d).\n", local->tm_hour, local->tm_min); @@ -276,7 +276,7 @@ inndchannel(port, path) channelcreate(&client[i]); FD_SET(ns, &rfd); /* FD_SET(ns,&wfd); */ length = sizeof(there); - if (getpeername(ns, (struct sockaddr *) & there, &length) >= 0) { + if (getpeername(ns, (struct sockaddr *) & there, (socklen_t *) &length) >= 0) { name = (char *)my_rfc931_name(ns, (struct sockaddr_in *)&there); strncpy(client[i].username, name, 20); hp = (struct hostent *) gethostbyaddr((char *)&there.sin_addr, sizeof(struct in_addr), there.sin_family); @@ -594,7 +594,7 @@ main(argc, argv) char *port, *path; int c, errflag = 0; - extern INNBBSDhalt(); + extern int INNBBSDhalt(); /* * woju */ @@ -630,7 +630,7 @@ main(argc, argv) struct sockaddr_in there; int len = sizeof(there); int rel; - if ((rel = getsockname(0, (struct sockaddr *) & there, &len)) < 0) { + if ((rel = getsockname(0, (struct sockaddr *) & there, (socklen_t *) &len)) < 0) { fprintf(stdout, "You must run -i from inetd with inetd.conf line: \n"); fprintf(stdout, "service-port stream tcp wait bbs " BBSHOME "/innd/innbbsd innbbsd -i port\n"); fflush(stdout); diff --git a/mbbsd/chat.c b/mbbsd/chat.c index 2904f2d4..e6a78842 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -29,7 +29,7 @@ printchatline(const char *str) } static void -chat_clear(char*unused) +chat_clear(char *unused GCC_UNUSED) { for (chatline = 2; chatline < STOP_LINE; chatline++) { move(chatline, 0); @@ -166,7 +166,7 @@ chat_help(char *arg) } static void -chat_date(char *unused) +chat_date(char *unused GCC_UNUSED) { char genbuf[200]; @@ -176,7 +176,7 @@ chat_date(char *unused) } static void -chat_pager(char *unused) +chat_pager(char *unused GCC_UNUSED) { char genbuf[200]; @@ -252,7 +252,7 @@ chat_cmd_match(const char *buf, const char *str) } static int -chat_cmd(char *buf, int fd) +chat_cmd(char *buf, int fd GCC_UNUSED) { int i; @@ -278,7 +278,7 @@ typedef struct { } ChatCbParam; static int -_vgetcb_peek(int key, VGET_RUNTIME *prt, void *instance) +_vgetcb_peek(int key, VGET_RUNTIME *prt GCC_UNUSED, void *instance) { ChatCbParam *p = (ChatCbParam*) instance; assert(p); diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index a409ce90..12921166 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -766,7 +766,7 @@ ch_changename(chicken_t *mychicken) } static int -select_menu(int age, chicken_t *mychicken) +select_menu(int age GCC_UNUSED, chicken_t *mychicken) { char ch; diff --git a/mbbsd/mail.c b/mbbsd/mail.c index fc7ae823..c006bac6 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -870,7 +870,7 @@ mail_mbox(void) } static int -m_forward(int ent, fileheader_t * fhdr, const char *direct) +m_forward(int ent GCC_UNUSED, fileheader_t * fhdr, const char *direct GCC_UNUSED) { char uid[STRLEN]; @@ -1227,7 +1227,7 @@ mail_read(int ent, fileheader_t * fhdr, const char *direct) } static int -mail_read_all(int ent, fileheader_t * fhdr, const char *direct) +mail_read_all(int ent GCC_UNUSED, fileheader_t * fhdr GCC_UNUSED, const char *direct GCC_UNUSED) { off_t i = 0, num = 0; int fd = 0; @@ -1369,7 +1369,7 @@ mail_reply(int ent, fileheader_t * fhdr, const char *direct) } static int -mail_edit(int ent, fileheader_t * fhdr, const char *direct) +mail_edit(int ent GCC_UNUSED, fileheader_t * fhdr, const char *direct) { char genbuf[PATHLEN]; @@ -1382,7 +1382,7 @@ mail_edit(int ent, fileheader_t * fhdr, const char *direct) } static int -mail_nooutmail(int ent, fileheader_t * fhdr, const char *direct) +mail_nooutmail(int ent GCC_UNUSED, fileheader_t * fhdr GCC_UNUSED, const char *direct GCC_UNUSED) { cuser.uflag2 ^= REJ_OUTTAMAIL; passwd_update(usernum, &cuser); @@ -1597,7 +1597,7 @@ mail_man(void) // XXX BUG mail_cite 有可能會跳進 a_menu, 而 a_menu 會 check // currbid。 一整個糟糕的邏輯錯誤... static int -mail_cite(int ent, fileheader_t * fhdr, const char *direct) +mail_cite(int ent GCC_UNUSED, fileheader_t * fhdr, const char *direct GCC_UNUSED) { char fpath[PATHLEN]; char title[TTLEN + 1]; @@ -1642,7 +1642,7 @@ mail_cite(int ent, fileheader_t * fhdr, const char *direct) } static int -mail_save(int ent, fileheader_t * fhdr, const char *direct) +mail_save(int ent GCC_UNUSED, fileheader_t * fhdr GCC_UNUSED, const char *direct GCC_UNUSED) { char fpath[PATHLEN]; char title[TTLEN + 1]; @@ -1661,7 +1661,7 @@ mail_save(int ent, fileheader_t * fhdr, const char *direct) #ifdef OUTJOBSPOOL static int -mail_waterball(int ent, fileheader_t * fhdr, const char *direct) +mail_waterball(int ent GCC_UNUSED, fileheader_t * fhdr, const char *direct GCC_UNUSED) { static char address[60] = "", cmode = 1; char fname[500], genbuf[200]; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 0b72cae7..1deaee01 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -134,7 +134,7 @@ start_daemon(void) } static void -reapchild(int sig) +reapchild(int sig GCC_UNUSED) { int state, pid; @@ -226,7 +226,7 @@ u_exit(const char *mode) } void -abort_bbs(int sig) +abort_bbs(int sig GCC_UNUSED) { /* ignore normal signals */ Signal(SIGALRM, SIG_IGN); @@ -337,7 +337,7 @@ mysrand(void) } void -talk_request(int sig) +talk_request(int sig GCC_UNUSED) { STATINC(STAT_TALKREQUEST); bell(); diff --git a/mbbsd/user.c b/mbbsd/user.c index 68f79a83..d2778619 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -986,7 +986,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) case '3': { - int tmp = setperms(x.userlevel, str_permid); + unsigned int tmp = setperms(x.userlevel, str_permid); if (tmp == x.userlevel) fail++; else { |