diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-02-21 16:37:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 16:37:04 (GMT) |
commit | c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc (patch) | |
tree | aa6df876c2d6da6f35f531fd025589e60f9e2b8d /tools/src/h5format_convert/h5format_convert.c | |
parent | 1c9f219463e236487a27cee6cb839379d670cda4 (diff) | |
download | hdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.zip hdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.tar.gz hdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.tar.bz2 |
1.12 Fix tools incompatibility (#1448)
* fix tools incompatibility with get_option #1443
* Fix get_option function
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/src/h5format_convert/h5format_convert.c')
-rw-r--r-- | tools/src/h5format_convert/h5format_convert.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index b9572fe..6a2bad1 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -38,11 +38,11 @@ static int verbose_g = 0; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVvd:n"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'}, - {"verbose", no_arg, 'v'}, {"dname", require_arg, 'd'}, - {"noop", no_arg, 'n'}, {"enable-error-stack", no_arg, 'E'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVvd:n"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'}, + {"verbose", no_arg, 'v'}, {"dname", require_arg, 'd'}, + {"noop", no_arg, 'n'}, {"enable-error-stack", no_arg, 'E'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -106,7 +106,7 @@ parse_command_line(int argc, const char *const *argv) } /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -123,11 +123,11 @@ parse_command_line(int argc, const char *const *argv) break; case 'd': /* -d dname */ - if (H5_optarg != NULL && *H5_optarg) - dname_g = HDstrdup(H5_optarg); + if (opt_arg != NULL && *opt_arg) + dname_g = HDstrdup(opt_arg); if (dname_g == NULL) { h5tools_setstatus(EXIT_FAILURE); - error_msg("No dataset name\n", H5_optarg); + error_msg("No dataset name\n", opt_arg); usage(h5tools_getprogname()); goto error; } @@ -150,14 +150,14 @@ parse_command_line(int argc, const char *const *argv) } /* switch */ } /* while */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto error; } - fname_g = HDstrdup(argv[H5_optind]); + fname_g = HDstrdup(argv[opt_ind]); return 0; |