|
|
@@ -175,10 +175,7 @@ static char *posixly_correct;
|
|
|
char *getenv ();
|
|
|
|
|
|
static char *
|
|
|
-my_index (str, chr)
|
|
|
- const char *str;
|
|
|
- int chr;
|
|
|
-{
|
|
|
+my_index (const char *str, int chr) {
|
|
|
while (*str)
|
|
|
{
|
|
|
if (*str == chr)
|
|
|
@@ -221,9 +218,7 @@ static int last_nonopt;
|
|
|
the new indices of the non-options in ARGV after they are moved. */
|
|
|
|
|
|
static void
|
|
|
-exchange (argv)
|
|
|
- char **argv;
|
|
|
-{
|
|
|
+exchange (char **argv) {
|
|
|
int bottom = first_nonopt;
|
|
|
int middle = last_nonopt;
|
|
|
int top = optind;
|
|
|
@@ -279,9 +274,7 @@ exchange (argv)
|
|
|
/* Initialize the internal data when the first call is made. */
|
|
|
|
|
|
static const char *
|
|
|
-_getopt_initialize (optstring)
|
|
|
- const char *optstring;
|
|
|
-{
|
|
|
+_getopt_initialize (const char *optstring) {
|
|
|
/* Start processing options with ARGV-element 1 (since ARGV-element 0
|
|
|
is the program name); the sequence of previously skipped
|
|
|
non-option ARGV-elements is empty. */
|
|
|
@@ -369,14 +362,12 @@ _getopt_initialize (optstring)
|
|
|
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;
|
|
|
-{
|
|
|
+_getopt_internal (int argc,
|
|
|
+ char *const *argv,
|
|
|
+ const char *optstring,
|
|
|
+ const struct option *longopts,
|
|
|
+ int *longind,
|
|
|
+ int long_only) {
|
|
|
optarg = NULL;
|
|
|
|
|
|
if (optind == 0)
|
|
|
@@ -477,7 +468,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|
|
const struct option *pfound = NULL;
|
|
|
int exact = 0;
|
|
|
int ambig = 0;
|
|
|
- int indfound;
|
|
|
+ int indfound = 0;
|
|
|
int option_index;
|
|
|
|
|
|
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
|
|
|
@@ -667,11 +658,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|
|
}
|
|
|
|
|
|
int
|
|
|
-getopt (argc, argv, optstring)
|
|
|
- int argc;
|
|
|
- char *const *argv;
|
|
|
- const char *optstring;
|
|
|
-{
|
|
|
+getopt (int argc, char *const *argv, const char *optstring) {
|
|
|
return _getopt_internal (argc, argv, optstring,
|
|
|
(const struct option *) 0,
|
|
|
(int *) 0,
|
|
|
@@ -686,10 +673,7 @@ getopt (argc, argv, optstring)
|
|
|
the above definition of `getopt'. */
|
|
|
|
|
|
int
|
|
|
-main (argc, argv)
|
|
|
- int argc;
|
|
|
- char **argv;
|
|
|
-{
|
|
|
+main (int argc, char **argv) {
|
|
|
int c;
|
|
|
int digit_optind = 0;
|
|
|
|