From 79d93d1661563f3570b2d0128a07bc7d7fc93ea8 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Sun, 30 Jan 2022 23:06:01 -0600 Subject: 1 10 Remove const from the argv tools/tests main sig. #1390 (#1405) --- hl/tools/h5watch/extend_dset.c | 2 +- hl/tools/h5watch/h5watch.c | 10 +++++----- 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 | 4 ++-- tools/src/h5diff/h5diff_common.h | 2 +- tools/src/h5diff/h5diff_main.c | 6 +++--- tools/src/h5diff/ph5diff_main.c | 7 ++++--- tools/src/h5dump/h5dump.c | 8 ++++---- tools/src/h5format_convert/h5format_convert.c | 6 +++--- tools/src/h5import/h5import.c | 12 ++++++------ tools/src/h5jam/h5jam.c | 18 +++++++++--------- tools/src/h5jam/h5unjam.c | 6 +++--- tools/src/h5ls/h5ls.c | 4 ++-- tools/src/h5perf/pio_perf.c | 12 ++++++------ tools/src/h5perf/sio_perf.c | 12 ++++++------ tools/src/h5repack/h5repack_main.c | 10 +++++----- tools/src/h5stat/h5stat.c | 8 ++++---- tools/src/misc/h5clear.c | 6 +++--- tools/src/misc/h5debug.c | 8 ++++---- 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.c | 2 +- tools/test/perform/pio_standalone.h | 3 ++- tools/test/perform/sio_standalone.c | 2 +- tools/test/perform/sio_standalone.h | 3 ++- tools/test/perform/zip_perf.c | 6 +++--- 40 files changed, 107 insertions(+), 103 deletions(-) diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 282f5c2..07a4053 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 afbc31d..bfb0115 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"); @@ -921,7 +921,7 @@ main(int argc, const char *argv[]) } } - /* If everything is fine, start monitoring the datset */ + /* If everything is fine, start monitoring the dataset */ if (h5tools_getstatus() != EXIT_FAILURE) if (monitor_dataset(fid, dname) < 0) h5tools_setstatus(EXIT_FAILURE); diff --git a/src/H5private.h b/src/H5private.h index 4c25b75..5227734 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2561,7 +2561,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 56110ea..66ccbf3 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1078,7 +1078,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 optopt = '?'; /* option character passed back to user */ diff --git a/test/flushrefresh.c b/test/flushrefresh.c index 982145d..0b894ef 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 2bff12c..a455f3f 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 2d25801..3e84dcc 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 b9f64d7..c7060e9 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -194,7 +194,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; @@ -271,7 +271,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char break; case 'q': - /* use quiet mode; supress the message "0 differences found" */ + /* use quiet mode; suppress the message "0 differences found" */ opts->mode_quiet = 1; break; 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 a835953..2a43b56 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -33,7 +33,7 @@ * * Modifications: July 2004 * Introduced the four modes: - * Normal mode: print the number of differences found and where they occured + * Normal mode: print the number of differences found and where they occurred * Report mode: print the above plus the differences * Verbose mode: print the above plus a list of objects and warnings * Quiet mode: do not print output @@ -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 f2a10c2..dfab35d 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -801,7 +801,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; @@ -1267,7 +1267,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; @@ -1287,7 +1287,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; } @@ -1435,7 +1435,7 @@ main(int argc, const char *argv[]) dset_table = table_list.tables[0].dset_table; type_table = table_list.tables[0].type_table; - /* does there exist unamed committed datatype */ + /* does there exist unnamed committed datatype */ for (u = 0; u < type_table->nobjs; u++) if (!type_table->objs[u].recorded) { unamedtype = 1; diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 3923344..479d6d4 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/h5import/h5import.c b/tools/src/h5import/h5import.c index 04e1c35..100eba3 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -2134,7 +2134,7 @@ processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_prop) */ } /* else if(!HDstrcmp("SUBSET", key)) */ - else if (!HDstrcmp("DATA", key)) { /* FINSHED */ + else if (!HDstrcmp("DATA", key)) { /* FINISHED */ #ifdef H5DEBUGIMPORT HDprintf("h5dump DATA key\n"); #endif @@ -2328,7 +2328,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err12a, infile); goto error; } - /* cant appear before dimension sizes have been provided */ + /* can't appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void)HDfprintf(stderr, err12b, infile); goto error; @@ -2395,7 +2395,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err16a, infile); goto error; } - /* cant appear before dimension sizes have been provided */ + /* can't appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void)HDfprintf(stderr, err16b, infile); goto error; @@ -2485,14 +2485,14 @@ validateConfigurationParameters(struct Input *in) } } - /* Arch cant be STD if O/p class is FP */ + /* Arch can't be STD if O/p class is FP */ if (in->outputArchitecture == 1) if (in->outputClass == 1) { (void)HDfprintf(stderr, "%s", err4a); return (-1); } - /* Arch cant be IEEE if O/p class is IN */ + /* Arch can't be IEEE if O/p class is IN */ if (in->outputArchitecture == 2) if (in->outputClass == 0) { (void)HDfprintf(stderr, "%s", err4b); @@ -4706,7 +4706,7 @@ process(struct Options *opt) } if (in->configOptionVector[EXTERNALSTORE] == 1) { - /* creating the external file if it doesnt exist */ + /* creating the external file if it doesn't exist */ if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { (void)HDfprintf(stderr, "%s", err4); H5Pclose(proplist); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index b5df5c6..c3dfa8e 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(); @@ -358,7 +358,7 @@ done: * Purpose: Copy part of the input file to output. * infid: fd of file to read * outfid: fd of file to write - * startin: offset of where to read from infid + * starting: offset of where to read from infid * startout: offset of where to write to outfid * limit: bytes to read/write * @@ -373,7 +373,7 @@ done: *------------------------------------------------------------------------- */ hsize_t -copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssize_t limit) +copy_some_to_file(int infid, int outfid, hsize_t starting, hsize_t startout, ssize_t limit) { char buf[1024]; h5_stat_t sbuf; @@ -386,9 +386,9 @@ copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssiz ssize_t toend; ssize_t fromend; - if (startin > startout) { + if (starting > startout) { /* this case is prohibited */ - error_msg("copy_some_to_file: panic: startin > startout?\n"); + error_msg("copy_some_to_file: panic: starting > startout?\n"); exit(EXIT_FAILURE); } /* end if */ @@ -409,7 +409,7 @@ copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssiz return 0; toend = (ssize_t)startout + howmuch; - fromend = (ssize_t)startin + howmuch; + fromend = (ssize_t)starting + howmuch; if (howmuch > 512) { to = toend - 512; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index fc675ba..38f0a0c 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 bb164a8..14421bf 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -32,7 +32,7 @@ #define NAME_BUF_SIZE 2048 /* - * Alternative formating for data dumped by H5LS + * Alternative formatting for data dumped by H5LS * * This table only affects H5LS output. */ @@ -2614,7 +2614,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 41245d9..560512c 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; @@ -579,7 +579,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts, "Raw Data Write", write_raw_mm_table, parms.num_iters, raw_size); } /* end if */ - /* show mpi write statics */ + /* show mpi write statistics */ if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(3); @@ -645,7 +645,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts, "Raw Data Read", read_raw_mm_table, parms.num_iters, raw_size); } /* end if */ - /* show mpi read statics */ + /* show mpi read statistics */ if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(3); @@ -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 9c7675f..625f313 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; @@ -427,7 +427,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts, "Raw Data Write", write_raw_mm_table, parms.num_iters, raw_size); } /* end if */ - /* show sys write statics */ + /* show sys write statistics */ #if 0 if (sio_debug_level >= 3) { /* output all of the times for all iterations */ @@ -473,7 +473,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts, "Raw Data Read", read_raw_mm_table, parms.num_iters, raw_size); } /* end if */ - /* show mpi read statics */ + /* show mpi read statistics */ #if 0 if (sio_debug_level >= 3) { /* output all of the times for all iterations */ @@ -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 e4fa10d..04a87b9 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 */ @@ -348,7 +348,7 @@ read_info(const char *filename, pack_opt_t *options) goto done; } - /* find begining of info */ + /* find beginning of info */ i = 0; c = '0'; while (c != ' ') { @@ -456,7 +456,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) { int bound, opt; int ret_value = 0; @@ -750,7 +750,7 @@ done: *------------------------------------------------------------------------- */ int -main(int argc, const char **argv) +main(int argc, char **argv) { pack_opt_t options; /*the global options */ int parse_ret; @@ -780,7 +780,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 6e54c78..bb0f0a0 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -33,7 +33,7 @@ #define H5_NFILTERS_IMPL \ 8 /* Number of currently implemented filters + one to \ accommodate for user-define filters + one \ - to accomodate datasets whithout any filters */ + to accommodate datasets without any filters */ /* File space management strategies: see H5Fpublic.h for declarations */ const char *FS_STRATEGY_NAME[] = {"H5F_FSPACE_STRATEGY_FSM_AGGR", @@ -824,7 +824,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; @@ -1671,7 +1671,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; @@ -1687,7 +1687,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/h5debug.c b/tools/src/misc/h5debug.c index 95c81b7..4ea1a18 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -640,7 +640,7 @@ main(int argc, char *argv[]) } else if (!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* - * Debug an extensible aray header. + * Debug an extensible array header. */ const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); @@ -661,7 +661,7 @@ main(int argc, char *argv[]) } else if (!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* - * Debug an extensible aray index block. + * Debug an extensible array index block. */ const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); @@ -682,7 +682,7 @@ main(int argc, char *argv[]) } else if (!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* - * Debug an extensible aray super block. + * Debug an extensible array super block. */ const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); @@ -702,7 +702,7 @@ main(int argc, char *argv[]) } else if (!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* - * Debug an extensible aray data block. + * Debug an extensible array data block. */ const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 6e4f0a6..1942216 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -112,7 +112,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 */ @@ -203,7 +203,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 */ @@ -225,7 +225,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 46e5ae3..5272bd4 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.c b/tools/test/perform/pio_standalone.c index 032bfba..9ea47d6 100644 --- a/tools/test/perform/pio_standalone.c +++ b/tools/test/perform/pio_standalone.c @@ -23,7 +23,7 @@ int nCols = 80; int -get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) +get_option(int argc, char **argv, const char *opts, const struct h5_long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 23cd0e8..5cc9a63 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -483,7 +483,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.c b/tools/test/perform/sio_standalone.c index 7c22b53..ace6b7e 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -23,7 +23,7 @@ int nCols = 80; int -get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) +get_option(int argc, char **argv, const char *opts, const struct h5_long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index bf925f1..2fc644f 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -498,7 +498,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 123fb98..5db97d1 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': @@ -551,7 +551,7 @@ main(int argc, const char *argv[]) } if (min_buf_size > max_buf_size) - error("minmum buffer size (%d) exceeds maximum buffer size (%d)", min_buf_size, max_buf_size); + error("minimum buffer size (%d) exceeds maximum buffer size (%d)", min_buf_size, max_buf_size); HDfprintf(stdout, "Filesize: %ld\n", file_size); -- cgit v0.12