diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2002-09-04 23:29:10 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2002-09-04 23:29:10 +0000 |
commit | b4339b74aded4c38ebcfe3a2a9b37b900abb8874 (patch) | |
tree | fb230419005f211ecea1e667385bde9886dbf0d8 /usr.bin/printf | |
parent | 228b93ce829543fee06561687a63c17a7e821dfd (diff) | |
download | FreeBSD-src-b4339b74aded4c38ebcfe3a2a9b37b900abb8874.zip FreeBSD-src-b4339b74aded4c38ebcfe3a2a9b37b900abb8874.tar.gz |
ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.
Reviewed by: md5
Diffstat (limited to 'usr.bin/printf')
-rw-r--r-- | usr.bin/printf/printf.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index a63d6cd..cc32e4f 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -103,12 +103,10 @@ static char **gargv; int #ifdef BUILTIN -progprintf(argc, argv) +progprintf(int argc, char *argv[]) #else -main(argc, argv) +main(int argc, char *argv[]) #endif - int argc; - char *argv[]; { static const char *skip1, *skip2; int ch, chopped, end, fieldwidth, haveprec, havewidth, precision, rval; @@ -292,9 +290,7 @@ next: for (start = fmt;; ++fmt) { } static char * -mkquad(str, ch) - char *str; - int ch; +mkquad(char *str, int ch) { static char *copy; static size_t copy_size; @@ -325,12 +321,10 @@ mkquad(str, ch) } static int -escape(fmt, percent) - register char *fmt; - int percent; +escape(char *fmt, int percent) { - register char *store; - register int value, c; + char *store; + int value, c; for (store = fmt; (c = *fmt); ++fmt, ++store) { if (c != '\\') { @@ -395,7 +389,7 @@ escape(fmt, percent) } static int -getchr() +getchr(void) { if (!*gargv) return ('\0'); @@ -403,7 +397,7 @@ getchr() } static const char * -getstr() +getstr(void) { if (!*gargv) return (""); @@ -411,8 +405,7 @@ getstr() } static int -getint(ip) - int *ip; +getint(int *ip) { quad_t val; u_quad_t uval; @@ -430,10 +423,7 @@ getint(ip) } static int -getquads(qp, uqp, signedconv) - quad_t *qp; - u_quad_t *uqp; - int signedconv; +getquads(quad_t *qp, u_quad_t *uqp, int signedconv) { char *ep; int rval; @@ -472,8 +462,7 @@ getquads(qp, uqp, signedconv) } static int -getdouble(dp) - double *dp; +getdouble(double *dp) { char *ep; int rval; @@ -503,9 +492,9 @@ getdouble(dp) } static int -asciicode() +asciicode(void) { - register int ch; + int ch; ch = **gargv; if (ch == '\'' || ch == '"') @@ -515,7 +504,7 @@ asciicode() } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: printf format [arg ...]\n"); } |