From 50014e35418ca00d25ea852fc4f94acf80be4df3 Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 2 Feb 2002 06:48:10 +0000 Subject: o __P has been reoved o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. --- bin/pax/options.c | 111 ++++++------------------------------------------------ 1 file changed, 11 insertions(+), 100 deletions(-) (limited to 'bin/pax/options.c') diff --git a/bin/pax/options.c b/bin/pax/options.c index 5ce8eb2..9362eb1 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -67,17 +67,17 @@ static char flgch[] = FLGCH; /* list of all possible flags */ static OPLIST *ophead = NULL; /* head for format specific options -x */ static OPLIST *optail = NULL; /* option tail */ -static int no_op __P((void)); -static void printflg __P((unsigned int)); -static int c_frmt __P((const void *, const void *)); -static off_t str_offt __P((char *)); -static char *getline __P((FILE *fp)); -static void pax_options __P((register int, register char **)); -static void pax_usage __P((void)); -static void tar_options __P((register int, register char **)); -static void tar_usage __P((void)); -static void cpio_options __P((register int, register char **)); -static void cpio_usage __P((void)); +static int no_op(void); +static void printflg(unsigned int); +static int c_frmt(const void *, const void *); +static off_t str_offt(char *); +static char *getline(FILE *fp); +static void pax_options(register int, register char **); +static void pax_usage(void); +static void tar_options(register int, register char **); +static void tar_usage(void); +static void cpio_options(register int, register char **); +static void cpio_usage(void); /* errors from getline */ #define GETLINE_FILE_CORRUPT 1 @@ -149,15 +149,8 @@ int ford[] = {5, 4, 3, 2, 1, 0, -1 }; * parser */ -#ifdef __STDC__ void options(register int argc, register char **argv) -#else -void -options(argc, argv) - register int argc; - register char **argv; -#endif { /* @@ -185,15 +178,8 @@ options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void pax_options(register int argc, register char **argv) -#else -static void -pax_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; register int i; @@ -590,15 +576,8 @@ pax_options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void tar_options(register int argc, register char **argv) -#else -static void -tar_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; int fstdin = 0; @@ -1029,15 +1008,8 @@ mkpath(path) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void cpio_options(register int argc, register char **argv) -#else -static void -cpio_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c, i; char *str; @@ -1296,14 +1268,8 @@ cpio_options(argc, argv) * print out those invalid flag sets found to the user */ -#ifdef __STDC__ static void printflg(unsigned int flg) -#else -static void -printflg(flg) - unsigned int flg; -#endif { int nxt; int pos = 0; @@ -1323,15 +1289,8 @@ printflg(flg) * by the user */ -#ifdef __STDC__ static int c_frmt(const void *a, const void *b) -#else -static int -c_frmt(a, b) - void *a; - void *b; -#endif { return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name)); } @@ -1344,13 +1303,8 @@ c_frmt(a, b) * pointer to next OPLIST entry or NULL (end of list). */ -#ifdef __STDC__ OPLIST * opt_next(void) -#else -OPLIST * -opt_next() -#endif { OPLIST *opt; @@ -1365,13 +1319,8 @@ opt_next() * when the format does not support options. */ -#ifdef __STDC__ int bad_opt(void) -#else -int -bad_opt() -#endif { register OPLIST *opt; @@ -1396,14 +1345,8 @@ bad_opt() * 0 if format in name=value format, -1 if -o is passed junk */ -#ifdef __STDC__ int opt_add(register char *str) -#else -int -opt_add(str) - register char *str; -#endif { register OPLIST *opt; register char *frpt; @@ -1471,14 +1414,8 @@ opt_add(str) * 0 for an error, a positive value o.w. */ -#ifdef __STDC__ static off_t str_offt(char *val) -#else -static off_t -str_offt(val) - char *val; -#endif { char *expr; off_t num, t; @@ -1539,14 +1476,8 @@ str_offt(val) return(num); } -#ifdef __STDC__ char * getline(FILE *f) -#else -char * -getline(f) - FILE *f; -#endif { char *name, *temp; size_t len; @@ -1575,13 +1506,8 @@ getline(f) * 0 */ -#ifdef __STDC__ static int no_op(void) -#else -static int -no_op() -#endif { return(0); } @@ -1591,13 +1517,8 @@ no_op() * print the usage summary to the user */ -#ifdef __STDC__ void pax_usage(void) -#else -void -pax_usage() -#endif { (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr); (void)fputs("[-s replstr] ... [-U user] ...", stderr); @@ -1630,13 +1551,8 @@ pax_usage() * print the usage summary to the user */ -#ifdef __STDC__ void tar_usage(void) -#else -void -tar_usage() -#endif { (void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ", stderr); @@ -1650,13 +1566,8 @@ tar_usage() * print the usage summary to the user */ -#ifdef __STDC__ void cpio_usage(void) -#else -void -cpio_usage() -#endif { (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr); (void)fputs(" [-F archive] < name-list [> archive]\n", stderr); -- cgit v1.1