From 61bf3cf5f0a7b897c76f026b0475d6a895b1b780 Mon Sep 17 00:00:00 2001 From: markm Date: Sun, 28 Apr 2002 11:51:03 +0000 Subject: [PATCH] More low hanging warnings fruit; ANSIfy, de-register, constify. --- usr.bin/paste/paste.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c index b066a84cc648..a910a362b45e 100644 --- a/usr.bin/paste/paste.c +++ b/usr.bin/paste/paste.c @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)paste.c 8.1 (Berkeley) 6/6/93"; __FBSDID("$FreeBSD$"); #include + #include #include #include @@ -66,10 +67,10 @@ void sequential(char **); int tr(char *); static void usage(void); +char tab[] = "\t"; + int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int ch, seq; @@ -93,7 +94,7 @@ main(argc, argv) usage(); if (!delim) { delimcnt = 1; - delim = "\t"; + delim = tab; } if (seq) @@ -111,12 +112,11 @@ typedef struct _list { } LIST; void -parallel(argv) - char **argv; +parallel(char **argv) { - register LIST *lp; - register int cnt; - register char ch, *p; + LIST *lp; + int cnt; + char ch, *p; LIST *head, *tmp; int opencnt, output; char buf[_POSIX2_LINE_MAX + 1]; @@ -178,12 +178,11 @@ parallel(argv) } void -sequential(argv) - char **argv; +sequential(char **argv) { - register FILE *fp; - register int cnt; - register char ch, *p, *dp; + FILE *fp; + int cnt; + char ch, *p, *dp; char buf[_POSIX2_LINE_MAX + 1]; for (; (p = *argv); ++argv) { @@ -216,11 +215,10 @@ sequential(argv) } int -tr(arg) - char *arg; +tr(char *arg) { - register int cnt; - register char ch, *p; + int cnt; + char ch, *p; for (p = arg, cnt = 0; (ch = *p++); ++arg, ++cnt) if (ch == '\\') @@ -246,7 +244,7 @@ tr(arg) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: paste [-s] [-d delimiters] file ...\n"); exit(1);