From 0c7673b25ee096a478fd4d620df7ae5adee47708 Mon Sep 17 00:00:00 2001 From: dd Date: Mon, 28 May 2001 00:55:50 +0000 Subject: [PATCH] Silence warnings and compile with WARNS=2 on i386 and alpha. --- usr.bin/jot/Makefile | 6 +++--- usr.bin/jot/jot.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/usr.bin/jot/Makefile b/usr.bin/jot/Makefile index 8b5e4a578491..a7d786c522d6 100644 --- a/usr.bin/jot/Makefile +++ b/usr.bin/jot/Makefile @@ -1,7 +1,7 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 +# From: @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= jot - -CFLAGS += -Wall -W +WARNS?= 2 .include diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index 4f92d812968d..5a7ce25e9d12 100644 --- a/usr.bin/jot/jot.c +++ b/usr.bin/jot/jot.c @@ -80,9 +80,10 @@ int intdata; int chardata; int nosign; int nofinalnl; -char *sepstring = "\n"; +const char *sepstring = "\n"; char format[BUFSIZ]; +int main __P((int, char *[])); void getformat __P((void)); int getprec __P((char *)); int putdata __P((double, long)); @@ -276,7 +277,7 @@ main(argc, argv) if (randomize) { *x = (ender - begin) * (ender > begin ? 1 : -1); for (*i = 1; *i <= reps || infinity; (*i)++) { - *y = (double) arc4random() / ULONG_MAX; + *y = arc4random() / ULONG_MAX; if (putdata(*y * *x + begin, reps - *i)) errx(1, "range error in conversion"); } @@ -336,13 +337,13 @@ usage() } int -getprec(s) - char *s; +getprec(str) + char *str; { char *p; char *q; - for (p = s; *p; p++) + for (p = str; *p; p++) if (*p == '.') break; if (!*p) @@ -356,10 +357,9 @@ getprec(s) void getformat() { - char *p; + char *p, *p2; int dot, hash, space, sign, numbers = 0; size_t sz; - char *s; if (boring) /* no need to bother */ return; @@ -384,7 +384,7 @@ getformat() * %[#][ ][{+,-}][0-9]*[.[0-9]*]? where ? must be one of * [l]{d,i,o,u,x} or {f,e,g,E,G,d,o,x,D,O,U,X,c,u} */ - s = p++; + p2 = p++; dot = hash = space = sign = numbers = 0; while (!isalpha(*p)) { if (isdigit(*p)) { @@ -439,7 +439,7 @@ getformat() default: fmt_broken: *++p = '\0'; - errx(1, "illegal or unsupported format '%s'", s); + errx(1, "illegal or unsupported format '%s'", p2); /* NOTREACHED */ } while (*++p)