vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| > usr.bin/touch : touch.c > >KNF & cleanup >mostly From: Przemyslaw Nowaczyk <p_nowaczyk@o2.pl> You did it... The fact is that code was perfectly readable. > --- usr.bin/touch/touch.c 2005/04/20 19:16:34 1.12 > +++ usr.bin/touch/touch.c 2006/03/07 11:49:40 1.13 > -#ifndef lint > -static char copyright[] = > -"@(#) Copyright (c) 1993\n\ > - The Regents of the University of California. All rights reserved.\n"; > -#endif /* not lint */ Is it legal to remove copyright notices? gcc may warn whatever it wants but it will strip unused vars from final executable. > -void stime_arg1(char *, struct timeval *); > -void stime_arg2(char *, int, struct timeval *); > -void stime_file(char *, struct timeval *); > -void usage(void); > +void stime_arg1(char *, struct timeval *); > +void stime_arg2(char *, int, struct timeval *); > +void stime_file(char *, struct timeval *); Was perfectly readable. > int > main(int argc, char *argv[]) > { > - struct stat sb; > - struct timeval tv[2]; > - int aflag, cflag, mflag, ch, fd, len, rval, timeset; > - char *p; > + struct stat sb; > + struct timeval tv[2]; > + int aflag, cflag, mflag, ch, fd, len, rval, timeset; > + char *p; Was perfectly readable. Regardless of this, why add tab after "struct"? "sb" is variable name, not "stat sb". > - setlocale(LC_ALL, ""); > + (void)setlocale(LC_ALL, ""); > void > stime_arg1(char *arg, struct timeval *tvp) > { > - struct tm *t; > - time_t tmptime; > - int yearset; > - char *p; > + struct tm *t; > + time_t tmptime; > + int yearset; > + char *p; Was perfectly readable. > void > stime_arg2(char *arg, int year, struct timeval *tvp) > { > - struct tm *t; > - time_t tmptime; > + struct tm *t; > + time_t tmptime; Was perfectly readable. > void > stime_file(char *fname, struct timeval *tvp) > { > - struct stat sb; > + struct stat sb; Was perfectly readable. > (void)fprintf(stderr, > - "usage: touch [-acm] [-r file] [-t time] file ...\n"); > + "usage: %s [-acm] [-r file] [-t time] file ...\n", __progname); The only chunk that should have been applied. |