From 5ef5088ac4e038d0a147a08377ef087fd6edf527 Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 2 Feb 2002 06:50:57 +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. o Change int foo() { ... to int foo(void) { ... --- bin/sh/options.c | 65 +++++++++++++++++++------------------------------------- 1 file changed, 22 insertions(+), 43 deletions(-) (limited to 'bin/sh/options.c') diff --git a/bin/sh/options.c b/bin/sh/options.c index 36f9c5c..5a3ba34 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -73,10 +73,10 @@ char *optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ -STATIC void options __P((int)); -STATIC void minus_o __P((char *, int)); -STATIC void setoption __P((int, int)); -STATIC int getopts __P((char *, char *, char **, char ***, char **)); +STATIC void options(int); +STATIC void minus_o(char *, int); +STATIC void setoption(int, int); +STATIC int getopts(char *, char *, char **, char ***, char **); /* @@ -84,9 +84,7 @@ STATIC int getopts __P((char *, char *, char **, char ***, char **)); */ void -procargs(argc, argv) - int argc; - char **argv; +procargs(int argc, char **argv) { int i; @@ -127,7 +125,7 @@ procargs(argc, argv) void -optschanged() +optschanged(void) { setinteractive(iflag); #ifndef NO_HISTORY @@ -142,8 +140,7 @@ optschanged() */ STATIC void -options(cmdline) - int cmdline; +options(int cmdline) { char *p; int val; @@ -201,9 +198,7 @@ options(cmdline) } STATIC void -minus_o(name, val) - char *name; - int val; +minus_o(char *name, int val) { int i; @@ -228,10 +223,8 @@ minus_o(name, val) STATIC void -setoption(flag, val) - char flag; - int val; - { +setoption(int flag, int val) +{ int i; for (i = 0; i < NOPTS; i++) @@ -270,9 +263,8 @@ SHELLPROC { */ void -setparam(argv) - char **argv; - { +setparam(char **argv) +{ char **newparam; char **ap; int nparam; @@ -296,9 +288,8 @@ setparam(argv) */ void -freeparam(param) - struct shparam *param; - { +freeparam(struct shparam *param) +{ char **ap; if (param->malloc) { @@ -315,9 +306,7 @@ freeparam(param) */ int -shiftcmd(argc, argv) - int argc; - char **argv; +shiftcmd(int argc, char **argv) { int n; char **ap1, **ap2; @@ -347,9 +336,7 @@ shiftcmd(argc, argv) */ int -setcmd(argc, argv) - int argc; - char **argv; +setcmd(int argc, char **argv) { if (argc == 1) return showvarscmd(argc, argv); @@ -365,8 +352,7 @@ setcmd(argc, argv) void -getoptsreset(value) - const char *value; +getoptsreset(const char *value) { if (number(value) == 1) { shellparam.optnext = NULL; @@ -382,9 +368,7 @@ getoptsreset(value) */ int -getoptscmd(argc, argv) - int argc; - char **argv; +getoptscmd(int argc, char **argv) { char **optbase = NULL; @@ -406,12 +390,8 @@ getoptscmd(argc, argv) } STATIC int -getopts(optstr, optvar, optfirst, optnext, optptr) - char *optstr; - char *optvar; - char **optfirst; - char ***optnext; - char **optptr; +getopts(char *optstr, char *optvar, char **optfirst, char ***optnext, + char **optptr) { char *p, *q; char c = '?'; @@ -515,9 +495,8 @@ out: */ int -nextopt(optstring) - char *optstring; - { +nextopt(char *optstring) +{ char *p, *q; char c; -- cgit v1.1