From be832437888f20a4b5fd3788db2a7c06edbdb24d Mon Sep 17 00:00:00 2001 From: kcwu Date: Sun, 19 Jan 2003 16:18:17 +0000 Subject: fix strange syntax informed by gcc -W git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@639 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/edit.c | 4 ++-- pttbbs/mbbsd/read.c | 8 ++++---- pttbbs/mbbsd/talk.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index f585fab8..dd8bb578 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.26 2003/01/19 16:06:06 kcwu Exp $ */ +/* $Id: edit.c,v 1.27 2003/01/19 16:18:17 kcwu Exp $ */ #include "bbs.h" typedef struct textline_t { struct textline_t *prev; @@ -42,7 +42,7 @@ static char fp_bak[] = "bak"; /* 記憶體管理與編輯處理 */ static void -indigestion(i) +indigestion(int i) { fprintf(stderr, "嚴重內傷 %d\n", i); } diff --git a/pttbbs/mbbsd/read.c b/pttbbs/mbbsd/read.c index b926a852..5243a0cd 100644 --- a/pttbbs/mbbsd/read.c +++ b/pttbbs/mbbsd/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.16 2003/01/17 08:16:21 kcwu Exp $ */ +/* $Id: read.c,v 1.17 2003/01/19 16:18:17 kcwu Exp $ */ #include "bbs.h" #define MAXPATHLEN 256 @@ -164,6 +164,7 @@ int TagPruner(int bid) { boardheader_t *bp; + assert(bid>0); bp = getbcache(bid); if (strcmp(bp->brdname, "Security") == 0) return DONOTHING; @@ -172,7 +173,6 @@ TagPruner(int bid) return FULLUPDATE; delete_range(currdirect, 0, 0); TagNum = 0; - if (bid > 0); setbtotal(bid); return NEWDIRECT; } @@ -452,8 +452,8 @@ select_read(keeploc_t * locmem, int sr_mode) register char *tag, *query, *temp; fileheader_t fh; char fpath[80], genbuf[MAXPATHLEN], buf3[5]; - char static t_ans[TTLEN + 1] = ""; - char static a_ans[TTLEN + 1] = ""; + static char t_ans[TTLEN + 1] = ""; + static char a_ans[TTLEN + 1] = ""; int fd, fr, size = sizeof(fileheader_t); struct stat st; /* rocker.011018: make a reference number for process article */ diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c index 2bc1ac53..60f2aa85 100644 --- a/pttbbs/mbbsd/talk.c +++ b/pttbbs/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.99 2003/01/16 11:58:04 kcwu Exp $ */ +/* $Id: talk.c,v 1.100 2003/01/19 16:18:17 kcwu Exp $ */ #include "bbs.h" #define QCAST int (*)(const void *, const void *) @@ -252,7 +252,7 @@ logout_friend_online(userinfo_t * utmp) utmp->friend_online[i] = 0; ui = &SHM->uinfo[j]; if (ui->pid && ui != utmp) { - for (k = 0; k < ui->friendtotal > 0 && k < MAX_FRIEND && + for (k = 0; k < ui->friendtotal && k < MAX_FRIEND && (int)(ui->friend_online[k] & 0xFFFFFF) != offset; k++); if (k < ui->friendtotal) { ui->friendtotal--; -- cgit v1.2.3