From 57bb5ce6886b3e2b19a6376e0173a83efc8a1648 Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 4 Aug 2005 17:13:35 +0000 Subject: make compiler happy git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2985 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 9 ++++++++- mbbsd/convert.c | 14 +++++++++----- mbbsd/stuff.c | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 2d59ca2e..935de326 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1894,7 +1894,14 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) outs("本人推薦第一次, 使用 → 加註方式\n"); } #ifndef DEBUG - else if (!(currmode & MODE_BOARD)&& now - lastrecommend < 90) + else if (!(currmode & MODE_BOARD) && + (now - lastrecommend) < ( +#if 0 + /* i'm not sure whether this is better or not */ + (bp->brdattr & BRD_NOFASTRECMD) ? + bp->fastrecommend_pause : +#endif + 90)) { // too close type = 2; diff --git a/mbbsd/convert.c b/mbbsd/convert.c index 1c390ac3..85fc9eff 100644 --- a/mbbsd/convert.c +++ b/mbbsd/convert.c @@ -13,8 +13,10 @@ unsigned char *big2uni(unsigned char *, int *, int); static ssize_t gb_input(void *buf, ssize_t icount) { - gb2big((char *)buf, &icount, 0); - return icount; + /* is sizeof(ssize_t) == sizeof(int)? not sure */ + int ic = (int) icount; + gb2big((char *)buf, &ic, 0); + return (ssize_t)ic; } static ssize_t @@ -40,9 +42,11 @@ gb_write(int fd, void *buf, size_t count) static ssize_t utf8_input (void *buf, ssize_t icount) { - utf8_uni(buf, &icount, 0); - uni2big(buf, &icount, 0); - return icount; + /* is sizeof(ssize_t) == sizeof(int)? not sure */ + int ic = (int) icount; + utf8_uni(buf, &ic, 0); + uni2big(buf, &ic, 0); + return (ssize_t)ic; } static ssize_t diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 7d54efcf..090b3704 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -969,7 +969,7 @@ int tobind(const char * host, int port) (char *)&val, sizeof(val)); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; - if (!host || host[0] == NULL) + if (host == NULL || host[0] == 0) servaddr.sin_addr.s_addr = htonl(INADDR_ANY); else if (inet_aton(host, &servaddr.sin_addr) == 0) { perror("inet_aton()"); -- cgit v1.2.3