From 71a3cce2f6884be6778c740c9bd96fa224f849a0 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Mon, 3 Dec 2001 21:27:45 +0000 Subject: Warns cleanups. --- usr.bin/printf/Makefile | 2 ++ usr.bin/printf/printf.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'usr.bin/printf') diff --git a/usr.bin/printf/Makefile b/usr.bin/printf/Makefile index 52b20f4..1e57f83 100644 --- a/usr.bin/printf/Makefile +++ b/usr.bin/printf/Makefile @@ -1,5 +1,7 @@ +# $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= printf +WARNS?= 2 .include diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 897a063..37b18f1 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -94,7 +94,7 @@ static int getchr __P((void)); static double getdouble __P((void)); static int getint __P((int *)); static int getquad __P((quad_t *)); -static char *getstr __P((void)); +static const char *getstr __P((void)); static char *mklong __P((char *, int)); static void usage __P((void)); @@ -109,7 +109,7 @@ main(argc, argv) int argc; char *argv[]; { - static char *skip1, *skip2; + static const char *skip1, *skip2; int ch, end, fieldwidth, precision; char convch, nextch, *format, *fmt, *start; @@ -217,7 +217,7 @@ next: for (start = fmt;; ++fmt) { break; } case 's': { - char *p; + const char *p; p = getstr(); PF(start, p); @@ -349,7 +349,7 @@ getchr() return ((int)**gargv++); } -static char * +static const char * getstr() { if (!*gargv) @@ -357,7 +357,7 @@ getstr() return (*gargv++); } -static char *Number = "+-.0123456789"; +static const char *Number = "+-.0123456789"; static int getint(ip) int *ip; -- cgit v1.1