From ad71539d30c799c497953c18352df37d83a75310 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:30:33 -0600 Subject: Remove const from the argv tools/tests main sig. (#1390) * Remove const from the argv tools/tests main sig. * also remove const from H5_get_option and parse_command_line. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- hl/tools/h5watch/extend_dset.c | 2 +- hl/tools/h5watch/h5watch.c | 8 ++++---- src/H5private.h | 3 ++- src/H5system.c | 2 +- test/flushrefresh.c | 4 ++-- test/swmr_addrem_writer.c | 2 +- test/swmr_generator.c | 2 +- test/swmr_reader.c | 2 +- test/swmr_remove_reader.c | 2 +- test/swmr_remove_writer.c | 2 +- test/swmr_sparse_reader.c | 2 +- test/swmr_sparse_writer.c | 2 +- test/swmr_start_write.c | 2 +- test/swmr_writer.c | 2 +- tools/src/h5copy/h5copy.c | 4 ++-- tools/src/h5diff/h5diff_common.c | 2 +- tools/src/h5diff/h5diff_common.h | 2 +- tools/src/h5diff/h5diff_main.c | 4 ++-- tools/src/h5diff/ph5diff_main.c | 7 ++++--- tools/src/h5dump/h5dump.c | 6 +++--- tools/src/h5format_convert/h5format_convert.c | 6 +++--- tools/src/h5jam/h5jam.c | 8 ++++---- tools/src/h5jam/h5unjam.c | 6 +++--- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5perf/pio_perf.c | 8 ++++---- tools/src/h5perf/sio_perf.c | 8 ++++---- tools/src/h5repack/h5repack_main.c | 8 ++++---- tools/src/h5stat/h5stat.c | 6 +++--- tools/src/misc/h5clear.c | 6 +++--- tools/src/misc/h5delete.c | 2 +- tools/src/misc/h5mkgrp.c | 6 +++--- tools/test/h5dump/binread.c | 2 +- tools/test/h5jam/getub.c | 8 ++++---- tools/test/h5jam/tellub.c | 6 +++--- tools/test/perform/pio_standalone.h | 3 ++- tools/test/perform/sio_standalone.h | 3 ++- tools/test/perform/zip_perf.c | 4 ++-- utils/tools/h5dwalk/h5dwalk.c | 6 +++--- 38 files changed, 82 insertions(+), 78 deletions(-) diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 624eebc..7756506 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -392,7 +392,7 @@ error: *********************************************************************** */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { char *dname = NULL; char *fname = NULL; diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 94ca4f1..5a6fe6f 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -51,7 +51,7 @@ static herr_t process_cmpd_fields(hid_t fid, char *dsetname); static herr_t check_dataset(hid_t fid, char *dsetname); static void leave(int ret); static void usage(const char *prog); -static void parse_command_line(int argc, const char *argv[]); +static void parse_command_line(int argc, const char *const *argv); /* * Command-line options: The user can only specify long-named parameters. @@ -665,7 +665,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ static void -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt; /* Command line option */ int tmp; @@ -790,7 +790,7 @@ catch_signal(int H5_ATTR_UNUSED signo) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { char drivername[50]; /* VFD name */ char *fname = NULL; /* File name */ @@ -819,7 +819,7 @@ main(int argc, const char *argv[]) } /* parse command line options */ - parse_command_line(argc, argv); + parse_command_line(argc, (const char *const *)argv); if (argc <= H5_optind) { error_msg("missing dataset name\n"); diff --git a/src/H5private.h b/src/H5private.h index fa52e7f..68aabc2 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2602,7 +2602,8 @@ struct h5_long_options { */ }; -H5_DLL int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); +H5_DLL int H5_get_option(int argc, const char *const *argv, const char *opt, + const struct h5_long_options *l_opt); #ifdef H5_HAVE_PARALLEL /* Generic MPI functions */ diff --git a/src/H5system.c b/src/H5system.c index 9a966b0..ee9077e 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -956,7 +956,7 @@ 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) +H5_get_option(int argc, const char *const *argv, const char *opts, const struct h5_long_options *l_opts) { static int sp = 1; /* character index in current token */ int optchar = '?'; /* option character passed back to user */ diff --git a/test/flushrefresh.c b/test/flushrefresh.c index 2757bbf..0c10238 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -93,7 +93,7 @@ FILE *errorfile; /* ===================== */ /* Main */ -int main(int argc, const char *argv[]); +int main(int argc, char *argv[]); /* Flush Test Framework */ herr_t test_flush(void); @@ -137,7 +137,7 @@ herr_t end_verification(void); *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { /* Variables */ const char *envval = NULL; diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index d39a698..c705d6b 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -283,7 +283,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid; /* File ID for file opened */ long nops = 0; /* # of times to grow or shrink the dataset */ diff --git a/test/swmr_generator.c b/test/swmr_generator.c index e1423b6..93cfa0f 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -258,7 +258,7 @@ usage(void) } /* end usage() */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int comp_level = -1; /* Compression level (-1 is no compression) */ hbool_t verbose = TRUE; /* Whether to emit some informational messages */ diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 836e1cc..e849f67 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -387,7 +387,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { long nseconds = 0; /* # of seconds to test */ int poll_time = 1; /* # of seconds between polling */ diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 910bc74..94cb7f8 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -371,7 +371,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { long nseconds = 0; /* # of seconds to test */ int poll_time = 1; /* # of seconds between polling */ diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index e52f4e2..3604935 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -217,7 +217,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid; /* File ID for file opened */ long nshrinks = 0; /* # of times to shrink the dataset */ diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 00eb2e0..15dcb67 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -342,7 +342,7 @@ usage(void) } /* end usage() */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { long nrecords = 0; /* # of records to read */ int poll_time = 1; /* # of seconds to sleep when waiting for writer */ diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index a4fc93e..96eff6c 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -318,7 +318,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid; /* File ID for file opened */ long nrecords = 0; /* # of records to append */ diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index 3ddd57a..d046b40 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -352,7 +352,7 @@ usage(void) *H5Fstart_swmr_write(), add_records(), H5Fclose(). */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid; /* File ID for file opened */ long nrecords = 0; /* # of records to append */ diff --git a/test/swmr_writer.c b/test/swmr_writer.c index de8b054..c4178f0 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -275,7 +275,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid; /* File ID for file opened */ long nrecords = 0; /* # of records to append */ diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 4e9a25e..6f10fee 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -212,7 +212,7 @@ parse_flag(const char *s_flag, unsigned *flag) */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid_src = H5I_INVALID_HID; hid_t fid_dst = H5I_INVALID_HID; @@ -242,7 +242,7 @@ main(int argc, const char *argv[]) } /* end if */ /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'd': oname_dst = HDstrdup(H5_optarg); diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index ec41d21..77a6785 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -206,7 +206,7 @@ parse_subset_params(const char *dset) */ void -parse_command_line(int argc, const char *argv[], const char **fname1, const char **fname2, +parse_command_line(int argc, const char *const *argv, const char **fname1, const char **fname2, const char **objname1, const char **objname2, diff_opt_t *opts) { int i; diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h index 83f4255..35e5dfb 100644 --- a/tools/src/h5diff/h5diff_common.h +++ b/tools/src/h5diff/h5diff_common.h @@ -23,7 +23,7 @@ extern "C" { #endif void usage(void); -void parse_command_line(int argc, const char *argv[], const char **fname1, const char **fname2, +void parse_command_line(int argc, const char *const *argv, const char **fname1, const char **fname2, const char **objname1, const char **objname2, diff_opt_t *opts); void h5diff_exit(int status); void print_info(diff_opt_t *opts); diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 37c215b..2a43b56 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -65,7 +65,7 @@ */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int ret; int i; @@ -86,7 +86,7 @@ main(int argc, const char *argv[]) * process the command-line *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); + parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2, &opts); /* enable error reporting if command line option */ h5tools_error_report(); diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index ec78e49..8e5c3e8 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -44,7 +44,7 @@ static void ph5diff_worker(int); */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int nID = 0; const char *fname1 = NULL; @@ -72,7 +72,7 @@ main(int argc, const char *argv[]) g_Parallel = 0; - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); + parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2, &opts); h5diff(fname1, fname2, objname1, objname2, &opts); @@ -83,7 +83,8 @@ main(int argc, const char *argv[]) /* Have the manager process the command-line */ if (nID == 0) { - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); + parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2, + &opts); h5diff(fname1, fname2, objname1, objname2, &opts); diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index a57b0e3..8c04bc7 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -828,7 +828,7 @@ free_handler(struct handler_t *hand, int len) *------------------------------------------------------------------------- */ static struct handler_t * -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { struct handler_t *hand = NULL; struct handler_t *last_dset = NULL; @@ -1329,7 +1329,7 @@ error: *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; @@ -1349,7 +1349,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - if ((hand = parse_command_line(argc, argv)) == NULL) { + if ((hand = parse_command_line(argc, (const char *const *)argv)) == NULL) { goto done; } diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index ddf129c..b9572fe 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -94,7 +94,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char **argv) +parse_command_line(int argc, const char *const *argv) { int opt; @@ -383,7 +383,7 @@ error: *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid = H5I_INVALID_HID; @@ -394,7 +394,7 @@ main(int argc, const char *argv[]) h5tools_init(); /* Parse command line options */ - if (parse_command_line(argc, argv) < 0) + if (parse_command_line(argc, (const char *const *)argv) < 0) goto done; else if (verbose_g) HDfprintf(stdout, "Process command line options\n"); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 07140b5..45978bb 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -22,7 +22,7 @@ herr_t write_pad(int ofile, hsize_t old_where, hsize_t *new_where); hsize_t compute_user_block_size(hsize_t); hsize_t copy_some_to_file(int, int, hsize_t, hsize_t, ssize_t); -void parse_command_line(int, const char *[]); +void parse_command_line(int, const char *const *); int do_clobber = FALSE; char *output_file = NULL; @@ -104,7 +104,7 @@ leave(int ret) */ void -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt = FALSE; @@ -149,7 +149,7 @@ parse_command_line(int argc, const char *argv[]) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int ufid = -1; int h5fid = -1; @@ -174,7 +174,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - parse_command_line(argc, argv); + parse_command_line(argc, (const char *const *)argv); /* enable error reporting if command line option */ h5tools_error_report(); diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index fa23b06..8ff354e 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -92,7 +92,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt = FALSE; @@ -172,7 +172,7 @@ leave(int ret) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t ifile = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; @@ -189,7 +189,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - if (EXIT_FAILURE == parse_command_line(argc, argv)) + if (EXIT_FAILURE == parse_command_line(argc, (const char *const *)argv)) goto done; /* enable error reporting if command line option */ diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 17abf43..0d34574 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -2646,7 +2646,7 @@ leave(int ret) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t file_id = H5I_INVALID_HID; char * fname = NULL, *oname = NULL, *x = NULL; diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index bf5f62f..c233684 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -188,7 +188,7 @@ typedef struct _minmax { /* local functions */ static off_t parse_size_directive(const char *size); -static struct options *parse_command_line(int argc, char *argv[]); +static struct options *parse_command_line(int argc, const char *const *argv); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); @@ -260,7 +260,7 @@ main(int argc, char *argv[]) pio_comm_g = MPI_COMM_WORLD; h5_set_info_object(); - opts = parse_command_line(argc, argv); + opts = parse_command_line(argc, (const char *const *)argv); if (!opts) { exit_value = EXIT_FAILURE; @@ -1276,7 +1276,7 @@ report_parameters(struct options *opts) * Added 2D testing (Christian Chilan, 10. August 2005) */ static struct options * -parse_command_line(int argc, char *argv[]) +parse_command_line(int argc, const char *const *argv) { register int opt; struct options *cl_opts; @@ -1305,7 +1305,7 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': cl_opts->h5_alignment = parse_size_directive(H5_optarg); diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index 0eb4508..f245b92 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -164,7 +164,7 @@ typedef struct { /* local functions */ static hsize_t parse_size_directive(const char *size); -static struct options *parse_command_line(int argc, const char *argv[]); +static struct options *parse_command_line(int argc, const char *const *argv); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); @@ -185,7 +185,7 @@ static void report_parameters(struct options *opts); * Modifications: */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int exit_value = EXIT_SUCCESS; struct options *opts = NULL; @@ -197,7 +197,7 @@ main(int argc, const char *argv[]) output = stdout; - opts = parse_command_line(argc, argv); + opts = parse_command_line(argc, (const char *const *)argv); if (!opts) { exit_value = EXIT_FAILURE; @@ -817,7 +817,7 @@ report_parameters(struct options *opts) * Added multidimensional testing (Christian Chilan, April, 2008) */ static struct options * -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt; struct options *cl_opts; diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0a26500..68e37fd 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -18,7 +18,7 @@ /* Name of tool */ #define PROGRAMNAME "h5repack" -static int parse_command_line(int argc, const char **argv, pack_opt_t *options); +static int parse_command_line(int argc, const char *const *argv, pack_opt_t *options); static void leave(int ret) H5_ATTR_NORETURN; /* module-scoped variables */ @@ -507,7 +507,7 @@ set_sort_order(const char *form) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char **argv, pack_opt_t *options) +parse_command_line(int argc, const char *const *argv, pack_opt_t *options) { h5tools_vol_info_t in_vol_info; h5tools_vol_info_t out_vol_info; @@ -928,7 +928,7 @@ done: *------------------------------------------------------------------------- */ int -main(int argc, const char **argv) +main(int argc, char **argv) { pack_opt_t options; /*the global options */ int parse_ret; @@ -958,7 +958,7 @@ main(int argc, const char **argv) /* Initialize default indexing options */ sort_by = H5_INDEX_CRT_ORDER; - parse_ret = parse_command_line(argc, argv, &options); + parse_ret = parse_command_line(argc, (const char *const *)argv, &options); if (parse_ret < 0) { HDprintf("Error occurred while parsing command-line options\n"); h5tools_setstatus(EXIT_FAILURE); diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 6b01e49..f1156f0 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -830,7 +830,7 @@ hand_free(struct handler_t *hand) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) +parse_command_line(int argc, const char *const *argv, struct handler_t **hand_ret) { int opt; unsigned u; @@ -1677,7 +1677,7 @@ print_statistics(const char *name, const iter_t *iter) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { iter_t iter; const char * fname = NULL; @@ -1693,7 +1693,7 @@ main(int argc, const char *argv[]) HDmemset(&iter, 0, sizeof(iter)); - if (parse_command_line(argc, argv, &hand) < 0) + if (parse_command_line(argc, (const char *const *)argv, &hand) < 0) goto done; /* enable error reporting if command line option */ diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index face2f0..15c170d 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -109,7 +109,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char **argv) +parse_command_line(int argc, const char *const *argv) { int opt; @@ -224,7 +224,7 @@ leave(int ret) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { char * fname = NULL; /* File name */ hid_t fapl = H5I_INVALID_HID; /* File access property list */ @@ -240,7 +240,7 @@ main(int argc, const char *argv[]) h5tools_init(); /* Parse command line options */ - if (parse_command_line(argc, argv) < 0) + if (parse_command_line(argc, (const char *const *)argv) < 0) goto done; if (fname_g == NULL) diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index 3c4f8d5..20e81a1 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -29,7 +29,7 @@ usage(void) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hbool_t quiet = FALSE; const char *name = NULL; diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 1e66fce..1b8b23d 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -131,7 +131,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) +parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) { int opt; /* Option from command line */ size_t curr_group; /* Current group name to copy */ @@ -281,7 +281,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list ID */ @@ -303,7 +303,7 @@ main(int argc, const char *argv[]) } /* Parse command line */ - if (parse_command_line(argc, argv, ¶ms_g) < 0) { + if (parse_command_line(argc, (const char *const *)argv, ¶ms_g) < 0) { error_msg("unable to parse command line arguments\n"); leave(EXIT_FAILURE); } diff --git a/tools/test/h5dump/binread.c b/tools/test/h5dump/binread.c index d6206ca..341a085 100644 --- a/tools/test/h5dump/binread.c +++ b/tools/test/h5dump/binread.c @@ -59,7 +59,7 @@ usage(void) */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { FILE * stream; size_t numread; diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index fd21d6c..4e67e98 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -15,7 +15,7 @@ #include "h5tools.h" #include "h5tools_utils.h" -void parse_command_line(int argc, const char *argv[]); +void parse_command_line(int argc, const char *const *argv); /* Name of tool */ #define PROGRAM_NAME "getub" @@ -52,7 +52,7 @@ usage(const char *prog) *------------------------------------------------------------------------- */ void -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt; @@ -77,7 +77,7 @@ parse_command_line(int argc, const char *argv[]) } /* end parse_command_line() */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int fd = H5I_INVALID_HID; unsigned size; @@ -91,7 +91,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - parse_command_line(argc, argv); + parse_command_line(argc, (const char *const *)argv); if (NULL == nbytes) { /* missing arg */ diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index e6769ec..f264d9b 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -56,7 +56,7 @@ usage(const char *prog) */ static void -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, const char *const *argv) { int opt; @@ -98,7 +98,7 @@ leave(int ret) *------------------------------------------------------------------------- */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { char * ifname; hid_t ifile = H5I_INVALID_HID; @@ -113,7 +113,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - parse_command_line(argc, argv); + parse_command_line(argc, (const char *const *)argv); /* enable error reporting if command line option */ h5tools_error_report(); diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index f1fb946..e64a765 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -461,7 +461,8 @@ struct h5_long_options { */ }; -extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); +extern int H5_get_option(int argc, const char *const *argv, const char *opt, + const struct h5_long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 99cca75..57180e5 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -476,7 +476,8 @@ struct h5_long_options { */ }; -extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); +extern int H5_get_option(int argc, const char *const *argv, const char *opt, + const struct h5_long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 37e69e2..74b1685 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -489,7 +489,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long * Modifications: */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { unsigned long min_buf_size = 128 * ONE_KB, max_buf_size = ONE_MB; unsigned long file_size = 64 * ONE_MB; @@ -500,7 +500,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) { + while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) > 0) { switch ((char)opt) { case '0': case '1': diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c index a1e66e0..d7e22ba 100644 --- a/utils/tools/h5dwalk/h5dwalk.c +++ b/utils/tools/h5dwalk/h5dwalk.c @@ -1322,7 +1322,7 @@ process_input_file(char *inputname, int myrank, int size) } int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int i; int rc = 0; @@ -1352,7 +1352,7 @@ main(int argc, const char *argv[]) if (env_var) { int enable = HDatoi(env_var); if (enable) { - + } } #endif @@ -1392,7 +1392,7 @@ main(int argc, const char *argv[]) mfu_pred *pred_head = NULL; while (!tool_selected) { - opt = H5_get_option(argc, argv, s_opts, l_opts); + opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts); switch ((char)opt) { default: usage(); -- cgit v0.12