From 93738f50e532c21c03131ba4243ffc37216bc532 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 7 Jun 2002 09:13:43 +0000 Subject: [PATCH] style(9): don't initialise variables in their declaration, remove space after function name, use __unused on unused parameters instead of initialising them to bogus values. --- usr.bin/cut/cut.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c index c22994860e2a..461dc862d9e1 100644 --- a/usr.bin/cut/cut.c +++ b/usr.bin/cut/cut.c @@ -58,12 +58,12 @@ int dflag; int fflag; int sflag; -void c_cut (FILE *, const char *); -void f_cut (FILE *, const char *); -void get_list (char *); -int main (int, char **); +void c_cut(FILE *, const char *); +void f_cut(FILE *, const char *); +void get_list(char *); +int main(int, char **); void needpos(size_t); -static void usage (void); +static void usage(void); int main(argc, argv) @@ -71,12 +71,12 @@ main(argc, argv) char *argv[]; { FILE *fp; - void (*fcn) (FILE *, const char *) = NULL; + void (*fcn)(FILE *, const char *); int ch, rval; - fcn = NULL; - setlocale (LC_ALL, ""); + setlocale(LC_ALL, ""); + fcn = NULL; dchar = '\t'; /* default delimiter is \t */ /* Since we don't support multi-byte characters, the -c and -b @@ -217,15 +217,13 @@ needpos(size_t n) } } -/* ARGSUSED */ void c_cut(fp, fname) FILE *fp; - const char *fname; + const char *fname __unused; { int ch, col; char *pos; - fname = NULL; ch = 0; for (;;) { @@ -257,9 +255,10 @@ f_cut(fp, fname) int ch, field, isdelim; char *pos, *p, sep; int output; - char *lbuf, *mlbuf = NULL; + char *lbuf, *mlbuf; size_t lbuflen; + mlbuf = NULL; for (sep = dchar; (lbuf = fgetln(fp, &lbuflen)) != NULL;) { /* Assert EOL has a newline. */ if (*(lbuf + lbuflen - 1) != '\n') {