diff options
author | Sean McBride <sean@rogue-research.com> | 2021-08-25 04:05:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 04:05:23 (GMT) |
commit | 131402a92de9bbd5df60d5859c37c4820c60d6b9 (patch) | |
tree | 06e3f4cd947ece0c9d65e82020a7b993c1ce2848 /src/H5system.c | |
parent | e9765e6c09de2e278e2821faef656b6d61854196 (diff) | |
download | hdf5-131402a92de9bbd5df60d5859c37c4820c60d6b9.zip hdf5-131402a92de9bbd5df60d5859c37c4820c60d6b9.tar.gz hdf5-131402a92de9bbd5df60d5859c37c4820c60d6b9.tar.bz2 |
More various warnings (#958)
* Committing clang-format changes
* Fixed various -Wdouble-promotion warnings
* Fixed -Wshadow warning for `optopt` conflict
On macOS at least, there is a global various named `optopt` in unistd.h.
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5system.c')
-rw-r--r-- | src/H5system.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5system.c b/src/H5system.c index eba8341..fe379ad 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -958,8 +958,8 @@ const char *H5_optarg; /* Flag argument (or value) */ int H5_get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) { - static int sp = 1; /* character index in current token */ - int optopt = '?'; /* option character passed back to user */ + static int sp = 1; /* character index in current token */ + int optchar = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ @@ -990,7 +990,7 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon for (i = 0; l_opts && l_opts[i].name; i++) { if (HDstrcmp(arg, l_opts[i].name) == 0) { /* we've found a matching long command line flag */ - optopt = l_opts[i].shortval; + optchar = l_opts[i].shortval; if (l_opts[i].has_arg != no_arg) { if (H5_optarg == NULL) { @@ -1003,7 +1003,7 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon if (H5_opterr) HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); - optopt = '?'; + optchar = '?'; } } } @@ -1012,7 +1012,7 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon if (H5_opterr) HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); - optopt = '?'; + optchar = '?'; } } break; @@ -1024,7 +1024,7 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon if (H5_opterr) HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); - optopt = '?'; + optchar = '?'; } H5_optind++; @@ -1036,11 +1036,11 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon register char *cp; /* pointer into current token */ /* short command line option */ - optopt = argv[H5_optind][sp]; + optchar = argv[H5_optind][sp]; - if (optopt == ':' || (cp = HDstrchr(opts, optopt)) == 0) { + if (optchar == ':' || (cp = HDstrchr(opts, optchar)) == 0) { if (H5_opterr) - HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], optopt); + HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], optchar); /* if no chars left in this token, move to next token */ if (argv[H5_optind][++sp] == '\0') { @@ -1058,9 +1058,9 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon } else if (++H5_optind >= argc) { if (H5_opterr) - HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], optopt); + HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], optchar); - optopt = '?'; + optchar = '?'; } else { /* flag value is next token */ @@ -1098,5 +1098,5 @@ H5_get_option(int argc, const char **argv, const char *opts, const struct h5_lon } /* return the current flag character found */ - return optopt; + return optchar; } |