summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-25 13:33:25 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-25 13:33:25 +0800
commitf1d0503c4fd4f103c10c6b609e7e078a586bf6ab (patch)
tree9a546b99209a6822bb648c757adc75972f7f1b59
parentbbb6b692de2cc853deff9702aa95fe323beb2fd8 (diff)
downloadpttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar.gz
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar.bz2
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar.lz
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar.xz
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.tar.zst
pttbbs-f1d0503c4fd4f103c10c6b609e7e078a586bf6ab.zip
eliminate compiler warnings (mostly signed/unsigned)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3082 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c5
-rw-r--r--mbbsd/chat.c8
-rw-r--r--mbbsd/convert.c4
-rw-r--r--mbbsd/edit.c4
-rw-r--r--mbbsd/io.c8
5 files changed, 15 insertions, 14 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 114e4ad0..a142286f 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -338,7 +338,7 @@ readdoent(int num, fileheader_t * ent)
}
if (*p && l <= 0)
- strcpy(p-3, " …");
+ strcpy((char*)p-3, " …");
}
if (!strncmp(title, "[公告]", 6))
@@ -1179,10 +1179,11 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
{
int c = 0;
struct tm *ptime;
+ time_t xt = (time_t)newstat.st_mtime;
fprintf(fp, MSG_SEPERATOR "\n");
fprintf(fp, "以下為被別人修改過的最新內容: ");
- ptime = localtime4(&newstat.st_mtime);
+ ptime = localtime4(&xt);
fprintf(fp,
" (%02d/%02d %02d:%02d)\n",
ptime->tm_mon + 1, ptime->tm_mday,
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index 761965bb..8e4b2af5 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -417,7 +417,7 @@ t_chat(void)
#ifdef DBCSAWARE
if(currchar > 0 &&
ISDBCSAWARE() &&
- getDBCSstatus(inbuf, currchar) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)inbuf, currchar) == DBCS_TRAILING)
currchar --;
#endif
}
@@ -429,7 +429,7 @@ t_chat(void)
#ifdef DBCSAWARE
if(inbuf[currchar] &&
ISDBCSAWARE() &&
- getDBCSstatus(inbuf, currchar) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)inbuf, currchar) == DBCS_TRAILING)
currchar++;
#endif
}
@@ -484,7 +484,7 @@ t_chat(void)
#ifdef DBCSAWARE
int dbcs_off = 1;
if (ISDBCSAWARE() &&
- getDBCSstatus(inbuf, currchar-1) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)inbuf, currchar-1) == DBCS_TRAILING)
dbcs_off = 2;
#endif
currchar -= dbcs_off;
@@ -508,7 +508,7 @@ t_chat(void)
#ifdef DBCSAWARE
int dbcs_off = 1;
if (ISDBCSAWARE() && inbuf[currchar+1] &&
- getDBCSstatus(inbuf, currchar+1) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)inbuf, currchar+1) == DBCS_TRAILING)
dbcs_off = 2;
#endif
inbuf[69] = '\0';
diff --git a/mbbsd/convert.c b/mbbsd/convert.c
index 85fc9eff..ae178f8c 100644
--- a/mbbsd/convert.c
+++ b/mbbsd/convert.c
@@ -32,7 +32,7 @@ static ssize_t
gb_write(int fd, void *buf, size_t count)
{
int icount = (int)count;
- big2gb((char *)buf, &icount, 0);
+ big2gb((unsigned char *)buf, &icount, 0);
if(icount > 0)
return write(fd, buf, (size_t)icount);
else
@@ -62,7 +62,7 @@ static ssize_t
utf8_write(int fd, void *buf, size_t count)
{
int icount = (int)count;
- static char *mybuf = NULL;
+ static unsigned char *mybuf = NULL;
static int cmybuf = 0;
/* utf8 output is a special case because
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index da65ca5b..f5c94154 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -2087,7 +2087,7 @@ display_textline_internal(textline_t *p, int i, int min, int max)
(*output)("");
} else {
int newpnt = curr_buf->edit_margin;
- unsigned char *pdata = &p->data[0] + curr_buf->edit_margin;
+ unsigned char *pdata = (unsigned char*)(&p->data[0] + curr_buf->edit_margin);
if(mbcs_mode)
newpnt = fix_cursor(p->data, newpnt, FC_LEFT);
if(newpnt == curr_buf->edit_margin-1)
@@ -3231,7 +3231,7 @@ vedit(char *fpath, int saveheader, int *islocal)
int w = 1;
if(mbcs_mode)
- w = mchar_len(curr_buf->currline->data + curr_buf->currpnt);
+ w = mchar_len((unsigned char*)(curr_buf->currline->data + curr_buf->currpnt));
for(; w > 0; w --)
delete_char();
diff --git a/mbbsd/io.c b/mbbsd/io.c
index b3188145..b933616a 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -872,7 +872,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
#ifdef DBCSAWARE
if(currchar > 0 &&
ISDBCSAWARE() &&
- getDBCSstatus(buf, currchar) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)buf, currchar) == DBCS_TRAILING)
currchar --;
#endif
}
@@ -884,7 +884,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
#ifdef DBCSAWARE
if(buf[currchar] &&
ISDBCSAWARE() &&
- getDBCSstatus(buf, currchar) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)buf, currchar) == DBCS_TRAILING)
currchar++;
#endif
}
@@ -895,7 +895,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
#ifdef DBCSAWARE
int dbcs_off = 1;
if (ISDBCSAWARE() &&
- getDBCSstatus(buf, currchar-1) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)buf, currchar-1) == DBCS_TRAILING)
dbcs_off = 2;
#endif
currchar -= dbcs_off;
@@ -934,7 +934,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
#ifdef DBCSAWARE
int dbcs_off = 1;
if (ISDBCSAWARE() && buf[currchar+1] &&
- getDBCSstatus(buf, currchar+1) == DBCS_TRAILING)
+ getDBCSstatus((unsigned char*)buf, currchar+1) == DBCS_TRAILING)
dbcs_off = 2;
#endif
clen -= dbcs_off;