diff options
author | imp <imp@FreeBSD.org> | 1999-04-25 22:29:30 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1999-04-25 22:29:30 +0000 |
commit | 404ab5f9ba8f886a2b4a3de13ab226213fd976bb (patch) | |
tree | ad323a333603d18cc896ee80fad1f67b354df9de /lib | |
parent | 8b33b875effcc83c5a2de2bd72e2c70b04652373 (diff) | |
download | FreeBSD-src-404ab5f9ba8f886a2b4a3de13ab226213fd976bb.zip FreeBSD-src-404ab5f9ba8f886a2b4a3de13ab226213fd976bb.tar.gz |
More egcs warning fixes:
o use braces to avoid potentially ambiguous else
o don't default to type int (and also remove a useless register
modifier).
o Use parens around assignment values used as truth values.
o Remove unused function.
Reviewed by: obrien and chuckr
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/utf2.c | 2 | ||||
-rw-r--r-- | lib/libc/string/memset.c | 2 | ||||
-rw-r--r-- | lib/libc/string/strcat.c | 2 | ||||
-rw-r--r-- | lib/libc/string/strcpy.c | 2 | ||||
-rw-r--r-- | lib/libdisk/disk.c | 12 | ||||
-rw-r--r-- | lib/libncurses/lib_newterm.c | 3 | ||||
-rw-r--r-- | lib/libstand/dosfs.c | 6 | ||||
-rw-r--r-- | lib/libstand/ether.c | 2 |
8 files changed, 13 insertions, 18 deletions
diff --git a/lib/libc/locale/utf2.c b/lib/libc/locale/utf2.c index c46dd93..52b4cad 100644 --- a/lib/libc/locale/utf2.c +++ b/lib/libc/locale/utf2.c @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)utf2.c 8.1 (Berkeley) 6/4/93"; rune_t _UTF2_sgetrune __P((const char *, size_t, char const **)); int _UTF2_sputrune __P((rune_t, char *, size_t, char **)); -static _utf_count[16] = { +static int _utf_count[16] = { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 0, }; diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index 55cca11..afe5f96 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -68,7 +68,9 @@ memset(dst0, c0, length) #endif { register size_t t; +#ifndef BZERO register u_int c; +#endif register u_char *dst; dst = dst0; diff --git a/lib/libc/string/strcat.c b/lib/libc/string/strcat.c index 3436967..95dcd1d 100644 --- a/lib/libc/string/strcat.c +++ b/lib/libc/string/strcat.c @@ -45,6 +45,6 @@ strcat(s, append) char *save = s; for (; *s; ++s); - while (*s++ = *append++); + while ((*s++ = *append++)); return(save); } diff --git a/lib/libc/string/strcpy.c b/lib/libc/string/strcpy.c index d1791dd..c9b44b1 100644 --- a/lib/libc/string/strcpy.c +++ b/lib/libc/string/strcpy.c @@ -45,6 +45,6 @@ strcpy(to, from) { char *save = to; - for (; *to = *from; ++from, ++to); + for (; (*to = *from); ++from, ++to); return(save); } diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c index 8ac28e2..63d2ebb 100644 --- a/lib/libdisk/disk.c +++ b/lib/libdisk/disk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: disk.c,v 1.39 1998/12/19 18:48:33 phk Exp $ + * $Id: disk.c,v 1.40 1999/01/29 11:39:24 jkh Exp $ * */ @@ -50,16 +50,6 @@ Read_Int32(u_int32_t *p) return bp[0] | (bp[1] << 8) | (bp[2] << 16) | (bp[3] << 24); } -static void -Write_Int32(u_int32_t *p, u_int32_t v) -{ - u_int8_t *bp = (u_int8_t *)p; - bp[0] = (v >> 0) & 0xff; - bp[1] = (v >> 8) & 0xff; - bp[2] = (v >> 16) & 0xff; - bp[3] = (v >> 24) & 0xff; -} - struct disk * Int_Open_Disk(const char *name, u_long size) { diff --git a/lib/libncurses/lib_newterm.c b/lib/libncurses/lib_newterm.c index 95ef1eb..4b49c8d 100644 --- a/lib/libncurses/lib_newterm.c +++ b/lib/libncurses/lib_newterm.c @@ -123,11 +123,12 @@ char *use_it = _ncurses_copyright; stolen = topstolen = 0; for (rsp = rippedoff; rsp->line; rsp++) { - if (rsp->hook) + if (rsp->hook) { if (rsp->line < 0) rsp->hook(newwin(1,COLS, LINES-1,0), COLS); else rsp->hook(newwin(1,COLS, topstolen++,0), COLS); + } --LINES; stolen++; } diff --git a/lib/libstand/dosfs.c b/lib/libstand/dosfs.c index c68b658..2910cb2 100644 --- a/lib/libstand/dosfs.c +++ b/lib/libstand/dosfs.c @@ -461,7 +461,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) for (ent = 0; ent < DEPSEC; ent++) { if (!*dir[ent].de.name) return ENOENT; - if (*dir[ent].de.name != 0xe5) + if (*dir[ent].de.name != 0xe5) { if ((dir[ent].de.attr & FA_MASK) == FA_XDE) { x = dir[ent].xde.seq; if (x & 0x40 || (x + 1 == xdn && @@ -493,6 +493,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) return 0; } } + } xdn = 0; } } @@ -572,7 +573,7 @@ fsize(DOS_FS *fs, DOS_DE *de) u_int c; int n; - if (!(size = cv4(de->size)) && de->attr & FA_DIR) + if (!(size = cv4(de->size)) && de->attr & FA_DIR) { if (!(c = cv2(de->clus))) size = fs->dirents * sizeof(DOS_DE); else { @@ -580,6 +581,7 @@ fsize(DOS_FS *fs, DOS_DE *de) return n; size = blkbyt(fs, n); } + } return size; } diff --git a/lib/libstand/ether.c b/lib/libstand/ether.c index d95f504..871dad4 100644 --- a/lib/libstand/ether.c +++ b/lib/libstand/ether.c @@ -137,7 +137,7 @@ char * ether_sprintf(ap) register u_char *ap; { - register i; + register int i; static char etherbuf[18]; register char *cp = etherbuf; |