From d0877a918f55402aa46eec91b3309e26a909b67f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Apr 2010 22:13:05 +0000 Subject: ansify all fns git-svn-id: svn://tug.org/texlive/trunk@17795 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 +++ Build/source/texk/kpathsea/getopt.c | 50 ++++++++++-------------------------- Build/source/texk/kpathsea/getopt1.c | 35 ++++++++++++------------- 3 files changed, 33 insertions(+), 56 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 6d16f3eed23..f761e2869a6 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2010-04-11 Javier Mugica + + * getopt.c, getopt1.c: ANSIfy all fns. + 2010-04-10 Karl Berry * progname.c (c-pathmx.h): #include unconditionally. diff --git a/Build/source/texk/kpathsea/getopt.c b/Build/source/texk/kpathsea/getopt.c index 5080a35b233..9fb7116c60e 100644 --- a/Build/source/texk/kpathsea/getopt.c +++ b/Build/source/texk/kpathsea/getopt.c @@ -207,10 +207,7 @@ static char *posixly_correct; char *getenv (); -static char * -my_index (str, chr) - const char *str; - int chr; +static char *my_index(const char *str, int chr) { while (*str) { @@ -278,13 +275,7 @@ text_set_element (__libc_subinit, store_args); `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; +static void exchange(char **argv) { int bottom = first_nonopt; int middle = last_nonopt; @@ -340,14 +331,7 @@ exchange (argv) /* Initialize the internal data when the first call is made. */ -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped @@ -455,15 +439,14 @@ _getopt_initialize (argc, argv, optstring) If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ +int _getopt_internal( + int argc, + char *const *argv, + const char *optstring, + const struct option *longopts, + int *longind, + int long_only +){ optarg = NULL; if (!__getopt_initialized || optind == 0) @@ -910,11 +893,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) } } -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +int getopt(int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, @@ -929,10 +908,7 @@ getopt (argc, argv, optstring) /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ -int -main (argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { int c; int digit_optind = 0; diff --git a/Build/source/texk/kpathsea/getopt1.c b/Build/source/texk/kpathsea/getopt1.c index f5db79b19c3..30cdf9a3506 100644 --- a/Build/source/texk/kpathsea/getopt1.c +++ b/Build/source/texk/kpathsea/getopt1.c @@ -53,18 +53,17 @@ #include #endif -#ifndef NULL +#ifndef NULL #define NULL 0 #endif -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ +int getopt_long( + int argc, + char *const *argv, + const char *options, + const struct option *long_options, + int *opt_index +){ return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } @@ -73,14 +72,13 @@ getopt_long (argc, argv, options, long_options, opt_index) but does match a short option, it is parsed as a short option instead. */ -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ +int getopt_long_only( + int argc, + char *const *argv, + const char *options, + const struct option *long_options, + int *opt_index +){ return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } @@ -91,8 +89,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) #include -int -main (int argc, char **argv) +int main(int argc, char **argv) { int c; int digit_optind = 0; -- cgit v1.2.3