From 930082c56637e195645b2eb32dfd1ffbe6dd2d4e Mon Sep 17 00:00:00 2001 From: jesusc Date: Mon, 4 Aug 2003 16:48:50 +0000 Subject: [PATCH] Fixed some warnings when building in MSVC git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2805 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- link/z80/aslink.h | 2 +- link/z80/lkdata.c | 2 +- link/z80/lkeval.c | 2 +- link/z80/lkgb.c | 6 +++--- link/z80/lkihx.c | 2 +- link/z80/lks19.c | 2 +- link/z80/lksym.c | 4 +++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/link/z80/aslink.h b/link/z80/aslink.h index 8a268546..939e7437 100644 --- a/link/z80/aslink.h +++ b/link/z80/aslink.h @@ -448,7 +448,7 @@ extern char *rp; /* pointer into the LST file extern char rb[NINPUT]; /* LST file text line being * address relocated */ -extern char ctype[]; /* array of character types, one per +extern unsigned char ctype[]; /* array of character types, one per * ASCII character */ diff --git a/link/z80/lkdata.c b/link/z80/lkdata.c index 0442ef75..672612af 100644 --- a/link/z80/lkdata.c +++ b/link/z80/lkdata.c @@ -424,7 +424,7 @@ struct lbfile *lbfhead; /* pointer to the first * array of character types, one per * ASCII character */ -char ctype[128] = { +unsigned char ctype[128] = { /*NUL*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, /*BS*/ ILL, SPACE, ILL, ILL, SPACE, ILL, ILL, ILL, /*DLE*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, diff --git a/link/z80/lkeval.c b/link/z80/lkeval.c index 2dff89be..e4bfe1d5 100644 --- a/link/z80/lkeval.c +++ b/link/z80/lkeval.c @@ -227,7 +227,7 @@ term() return(v); } if (c == '-') { - return(-expr(100)); + return(0-expr(100)); } if (c == '~') { return(~expr(100)); diff --git a/link/z80/lkgb.c b/link/z80/lkgb.c index 9ecac07b..9fdeb4e6 100644 --- a/link/z80/lkgb.c +++ b/link/z80/lkgb.c @@ -171,7 +171,7 @@ VOID gb(int in) chk = 0; for(pos = 0x0134; pos < 0x014D; pos++) chk += cart[pos/SEGSIZE][pos%SEGSIZE]; - cart[0x014D/SEGSIZE][0x014D%SEGSIZE] = 0xE7 - (chk&0xFF); + cart[0x014D/SEGSIZE][0x014D%SEGSIZE] = (unsigned char)(0xE7 - (chk&0xFF)); /* Update checksum */ chk = 0; cart[0x014E/SEGSIZE][0x014E%SEGSIZE] = 0; @@ -179,8 +179,8 @@ VOID gb(int in) for(i = 0; i < NBSEG; i++) for(pos = 0; pos < SEGSIZE; pos++) chk += cart[i][pos]; - cart[0x014E/SEGSIZE][0x014E%SEGSIZE] = (chk>>8)&0xFF; - cart[0x014F/SEGSIZE][0x014F%SEGSIZE] = chk&0xFF; + cart[0x014E/SEGSIZE][0x014E%SEGSIZE] = (unsigned char)((chk>>8)&0xFF); + cart[0x014F/SEGSIZE][0x014F%SEGSIZE] = (unsigned char)(chk&0xFF); for(i = 0; i < NBSEG; i++) fwrite(cart[i], 1, SEGSIZE, ofp); diff --git a/link/z80/lkihx.c b/link/z80/lkihx.c index a0e35d99..082a5fc5 100644 --- a/link/z80/lkihx.c +++ b/link/z80/lkihx.c @@ -127,7 +127,7 @@ ihx(i) fprintf(ofp, "00"); } } - fprintf(ofp, "%02X\n", (-chksum) & 0xff); + fprintf(ofp, "%02X\n", (0-chksum) & 0xff); } else { fprintf(ofp, ":00000001FF\n"); } diff --git a/link/z80/lks19.c b/link/z80/lks19.c index 905e7e74..bbca7530 100644 --- a/link/z80/lks19.c +++ b/link/z80/lks19.c @@ -116,7 +116,7 @@ s19(i) chksum += rtval[i]; } } - fprintf(ofp, "%02X\n", (-chksum-1) & 0xff); + fprintf(ofp, "%02X\n", (0-chksum-1) & 0xff); } else { fprintf(ofp, "S9030000FC\n"); } diff --git a/link/z80/lksym.c b/link/z80/lksym.c index 8699da8e..33cc6ffb 100644 --- a/link/z80/lksym.c +++ b/link/z80/lksym.c @@ -123,7 +123,9 @@ syminit() struct sym * newsym() { - register int c, i, nglob; + register unsigned i ; + register unsigned nglob ; + register int c ; struct sym *tsp; struct sym **s; char id[NCPS]; -- 2.30.2