summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-05 01:13:35 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-05 01:13:35 +0800
commit57bb5ce6886b3e2b19a6376e0173a83efc8a1648 (patch)
treed24654c2ca0591ac2967f114e527fc86c29cb8f2
parentacea666b1d2913702055324e5a63f35e18d78250 (diff)
downloadpttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar.gz
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar.bz2
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar.lz
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar.xz
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.tar.zst
pttbbs-57bb5ce6886b3e2b19a6376e0173a83efc8a1648.zip
make compiler happy
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2985 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c9
-rw-r--r--mbbsd/convert.c14
-rw-r--r--mbbsd/stuff.c2
3 files changed, 18 insertions, 7 deletions
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()");