diff options
author | dd <dd@FreeBSD.org> | 2001-05-28 00:55:50 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-05-28 00:55:50 +0000 |
commit | 0c7673b25ee096a478fd4d620df7ae5adee47708 (patch) | |
tree | ee9509d48f627337c00bcd0bb3155ba8b5303c2b | |
parent | f3057f716004cf620c347c39a6ead15f43828661 (diff) | |
download | FreeBSD-src-0c7673b25ee096a478fd4d620df7ae5adee47708.zip FreeBSD-src-0c7673b25ee096a478fd4d620df7ae5adee47708.tar.gz |
Silence warnings and compile with WARNS=2 on i386 and alpha.
-rw-r--r-- | usr.bin/jot/Makefile | 6 | ||||
-rw-r--r-- | 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 8b5e4a5..a7d786c 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 <bsd.prog.mk> diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index 4f92d81..5a7ce25 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) |