From d7d1005304be06c8b9e61169e0fc5e43e1cee133 Mon Sep 17 00:00:00 2001 From: Alexander Langer Date: Mon, 29 Dec 1997 00:09:06 +0000 Subject: [PATCH] -Wall cleanup. --- usr.bin/biff/biff.c | 7 ++++--- usr.bin/chat/chat.c | 4 ++-- usr.bin/cksum/crc32.c | 5 +++-- usr.bin/colcrt/colcrt.c | 14 ++++++++++++-- usr.bin/colrm/colrm.c | 4 ++-- usr.bin/ctags/ctags.c | 2 +- usr.bin/ctags/fortran.c | 2 +- usr.bin/ctags/yacc.c | 2 +- 8 files changed, 26 insertions(+), 14 deletions(-) diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c index a3e450c66412..52f5229ff1a8 100644 --- a/usr.bin/biff/biff.c +++ b/usr.bin/biff/biff.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: biff.c,v 1.3 1997/06/23 06:45:38 charnier Exp $ */ #ifndef lint @@ -54,6 +54,7 @@ static char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93"; static void usage __P((void)); +int main(argc, argv) int argc; char *argv[]; @@ -80,7 +81,7 @@ main(argc, argv) if (*argv == NULL) { (void)printf("is %s\n", sb.st_mode&0100 ? "y" : "n"); - exit(sb.st_mode & 0100 ? 0 : 1); + return(sb.st_mode & 0100 ? 0 : 1); } switch(argv[0][0]) { @@ -95,7 +96,7 @@ main(argc, argv) default: usage(); } - exit(sb.st_mode & 0100 ? 0 : 1); + return(sb.st_mode & 0100 ? 0 : 1); } static void diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c index 300849d58307..568bb48d0a64 100644 --- a/usr.bin/chat/chat.c +++ b/usr.bin/chat/chat.c @@ -70,7 +70,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chat.c,v 1.8 1997/06/24 06:52:33 charnier Exp $"; +static char rcsid[] = "$Id: chat.c,v 1.9 1997/08/22 15:24:36 peter Exp $"; #endif #include @@ -367,7 +367,7 @@ char **argv; void do_file (chat_file) char *chat_file; { - int linect, len, sendflg; + int linect, sendflg; char *sp, *arg, quote; char buf [STR_LEN]; FILE *cfp; diff --git a/usr.bin/cksum/crc32.c b/usr.bin/cksum/crc32.c index ffeacc1151c1..51aff76507cf 100644 --- a/usr.bin/cksum/crc32.c +++ b/usr.bin/cksum/crc32.c @@ -86,9 +86,11 @@ unsigned long crctab[256] = { #include #include +#include u_long crc32_total = 0 ; +int crc32(fd, cval, clen) register int fd; u_long *cval, *clen; @@ -96,11 +98,10 @@ crc32(fd, cval, clen) u_long crc = ~0; char buf[BUFSIZ], *p ; int len, nr ; - FILE *in; len = 0 ; crc32_total = ~crc32_total ; - while (nr = read(fd, buf, sizeof(buf))) + while ((nr = read(fd, buf, sizeof(buf)))) for (len += nr, p = buf; nr--; ++p) { CRC(crc, *p) ; CRC(crc32_total, *p) ; diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c index f3661a8e6daf..40fe5cef49b2 100644 --- a/usr.bin/colcrt/colcrt.c +++ b/usr.bin/colcrt/colcrt.c @@ -41,7 +41,11 @@ static char copyright[] = static char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ +#include +#include #include +#include +#include /* * colcrt - replaces col for crts with new nroff esp. when using tbl. * Bill Joy UCB July 14, 1977 @@ -67,6 +71,9 @@ char printall; FILE *f; static void usage __P((void)); +static void pflush __P((int)); +static int plus __P((char, char)); +static void move __P((int, int)); int main(argc, argv) @@ -186,19 +193,21 @@ usage() exit(1); } +static int plus(c, d) char c, d; { - return (c == '|' && d == '-' || d == '_'); + return ((c == '|' && d == '-') || d == '_'); } int first; +static void pflush(ol) int ol; { - register int i, j; + register int i; register char *cp; char lastomit; int l; @@ -229,6 +238,7 @@ pflush(ol) first = 1; } +static void move(l, m) int l, m; { diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c index 1a50405e5a53..1195300a8d29 100644 --- a/usr.bin/colrm/colrm.c +++ b/usr.bin/colrm/colrm.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: colrm.c,v 1.3 1997/06/26 11:26:20 charnier Exp $ + * $Id: colrm.c,v 1.4 1997/06/30 11:05:42 charnier Exp $ */ #ifndef lint @@ -116,7 +116,7 @@ main(argc, argv) break; } - if ((!start || column < start || stop && column > stop) && + if ((!start || column < start || (stop && column > stop)) && putchar(ch) == EOF) check(stdout); } diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 725dfb58a972..421d819fe311 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -229,7 +229,7 @@ find_entries(file) char *cp; lineno = 0; /* should be 1 ?? KB */ - if (cp = strrchr(file, '.')) { + if ((cp = strrchr(file, '.'))) { if (cp[1] == 'l' && !cp[2]) { int c; diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c index d0db9ed3e5a1..0706b49a0070 100644 --- a/usr.bin/ctags/fortran.c +++ b/usr.bin/ctags/fortran.c @@ -119,7 +119,7 @@ PF_funcs() continue; for (cp = lbp + 1; *cp && intoken(*cp); ++cp) continue; - if (cp = lbp + 1) + if ((cp = lbp + 1)) continue; *cp = EOS; (void)strcpy(tok, lbp); diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c index c013283b10fa..1ed4c7d31038 100644 --- a/usr.bin/ctags/yacc.c +++ b/usr.bin/ctags/yacc.c @@ -91,7 +91,7 @@ y_entries() in_rule = NO; break; default: - if (in_rule || !isalpha(c) && c != '.' && c != '_') + if (in_rule || (!isalpha(c) && c != '.' && c != '_')) break; sp = tok; *sp++ = c;