diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-10 22:13:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-10 22:13:05 +0000 |
commit | d0877a918f55402aa46eec91b3309e26a909b67f (patch) | |
tree | c8aad5ab870f3565c2d2f21ecf79402ddd650d5b /Build/source | |
parent | 963b665a04c33ddcfe04234426c8bca1942589bf (diff) |
ansify all fns
git-svn-id: svn://tug.org/texlive/trunk@17795 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/getopt.c | 50 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/getopt1.c | 35 |
3 files changed, 33 insertions, 56 deletions
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 <javier@digi21.eu> + + * getopt.c, getopt1.c: ANSIfy all fns. + 2010-04-10 Karl Berry <karl@tug.org> * 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 <stdlib.h> #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 <stdio.h> -int -main (int argc, char **argv) +int main(int argc, char **argv) { int c; int digit_optind = 0; |