From d898d4442cdba7888997640a7e1271b192d73341 Mon Sep 17 00:00:00 2001 From: victor Date: Thu, 7 Jul 2005 03:39:00 +0000 Subject: warning free, make gcc 4.0 happy git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2916 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 5 +++-- mbbsd/edit.c | 8 ++++---- mbbsd/go.c | 2 +- mbbsd/mbbsd.c | 4 ++-- mbbsd/stuff.c | 2 +- mbbsd/user.c | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 09fa49d1..e67c4098 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1740,10 +1740,11 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) { struct tm *ptime = localtime4(&now); char buf[200], msg[53]; -#ifndef OLDRECOMMEND static const char *ctype[3] = { "推", "噓", "→" - }, *ctype_attr[3] = { + }; +#ifndef OLDRECOMMEND + static const char *ctype_attr[3] = { ANSI_COLOR(1;33), ANSI_COLOR(1;31), ANSI_COLOR(1;37), diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 750b404c..8b6932e1 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1269,13 +1269,13 @@ do_quote(void) while (fgets(buf, 256, inf)) { insert_char(':'); insert_char(' '); - quote_strip_ansi_inline(buf); + quote_strip_ansi_inline((unsigned char *)buf); insert_string(buf); } else if (op == 'r') while (fgets(buf, 256, inf)) { /* repost, keep anything */ - // quote_strip_ansi_inline(buf); + // quote_strip_ansi_inline((unsigned char *)buf); insert_string(buf); } else { @@ -1287,7 +1287,7 @@ do_quote(void) if (!garbage_line(buf)) { insert_char(':'); insert_char(' '); - quote_strip_ansi_inline(buf); + quote_strip_ansi_inline((unsigned char *)buf); insert_string(buf); } } @@ -1465,7 +1465,7 @@ browse_sigs: showsignature(fpath, &i, &si); if (si.total > 0){ - unsigned char msg[64]; + char msg[64]; ch = isdigit(cuser.signature) ? cuser.signature : 'x'; sprintf(msg, diff --git a/mbbsd/go.c b/mbbsd/go.c index e3bc0418..f6d87de7 100644 --- a/mbbsd/go.c +++ b/mbbsd/go.c @@ -843,7 +843,7 @@ gochess(int fd) output(buf, n); //move(6, 46); n = sprintf(buf, ANSI_MOVETO(7,47) "%s 方時間:%02d:%02d ", - bw_chess[gd.he - 1], htime / 60, htime % 60); + bw_chess[gd.he - 1], (int)htime / 60, (int)htime % 60); if (hhand <= 25) n += sprintf(buf + n, "%2d 手", 25 - hhand); output(buf, n); diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index d7876382..38fadf81 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -778,7 +778,7 @@ setup_utmp(int mode) strlcpy(uinfo.userid, cuser.userid, sizeof(uinfo.userid)); //strlcpy(uinfo.realname, cuser.realname, sizeof(uinfo.realname)); strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname)); - strip_nonebig5(uinfo.nickname, sizeof(uinfo.nickname)); + strip_nonebig5((unsigned char *)uinfo.nickname, sizeof(uinfo.nickname)); strlcpy(uinfo.from, fromhost, sizeof(uinfo.from)); uinfo.five_win = cuser.five_win; uinfo.five_lose = cuser.five_lose; @@ -797,7 +797,7 @@ setup_utmp(int mode) cuser.withme = 0; uinfo.withme = cuser.withme; memcpy(uinfo.mind, cuser.mind, 4); - strip_nonebig5(uinfo.mind, 4); + strip_nonebig5((unsigned char *)uinfo.mind, 4); #ifdef WHERE uinfo.from_alias = where(fromhost); #endif diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 3b076fca..7d54efcf 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -897,7 +897,7 @@ void FREE(void *ptr) #endif unsigned -StringHash(const unsigned char *s) +StringHash(const char *s) { return fnv1a_32_strcase(s, FNV1_32_INIT); } diff --git a/mbbsd/user.c b/mbbsd/user.c index 81f9f53d..973b0da7 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -394,9 +394,9 @@ void Customize(void) char * -getregcode(unsigned char *buf) +getregcode(char *buf) { - unsigned char *uid = &cuser.userid[0]; + char *uid = &cuser.userid[0]; int i; /* init seed with magic */ -- cgit v1.2.3