summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Kauffmann <johanneskauffmann@hotmail.com>2022-09-18 23:19:16 +0200
committerMartijn van Beurden <mvanb1@gmail.com>2022-09-20 08:19:18 +0200
commite603c26db2a51ef9a4202ae66eae2f3276eb898b (patch)
treee6a969233a73bc8d543045d44db073d84532135f
parentb175971f8087d38c003bac67bbd2c535e807d415 (diff)
downloadflac-e603c26db2a51ef9a4202ae66eae2f3276eb898b.tar.gz
getopt: avoid K&R function definitions
This avoids warnings on clang-16 such as: getopt/getopt.c:315:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] exchange (argv) ^
-rw-r--r--src/share/getopt/getopt.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/share/getopt/getopt.c b/src/share/getopt/getopt.c
index 0f2daf39..39fab80e 100644
--- a/src/share/getopt/getopt.c
+++ b/src/share/getopt/getopt.c
@@ -312,8 +312,7 @@ static void exchange (char **);
#endif
static void
-exchange (argv)
- char **argv;
+exchange (char **argv)
{
int bottom = first_nonopt;
int middle = last_nonopt;
@@ -397,10 +396,7 @@ exchange (argv)
static const char *share___getopt_initialize (int, char *const *, const char *);
#endif
static const char *
-share___getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
+share___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
@@ -521,13 +517,13 @@ share___getopt_initialize (argc, argv, optstring)
long-named options. */
int
-share___getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct share__option *longopts;
- int *longind;
- int long_only;
+share___getopt_internal (
+ int argc,
+ char *const *argv,
+ const char *optstring,
+ const struct share__option *longopts,
+ int *longind,
+ int long_only )
{
share__optarg = NULL;
@@ -976,10 +972,7 @@ share___getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
int
-share__getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
+share__getopt (int argc, char *const *argv, const char *optstring)
{
return share___getopt_internal (argc, argv, optstring,
(const struct share__option *) 0,
@@ -995,9 +988,7 @@ share__getopt (argc, argv, optstring)
the above definition of `share__getopt'. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c;
int digit_optind = 0;