diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5diff_array.c | 2 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 1 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.c | 4 | ||||
-rw-r--r-- | tools/lib/io_timer.c | 2 | ||||
-rw-r--r-- | tools/src/h5copy/h5copy.c | 10 | ||||
-rw-r--r-- | tools/src/h5import/h5import.h | 30 | ||||
-rw-r--r-- | tools/src/h5jam/h5jam.c | 8 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_main.c | 8 | ||||
-rw-r--r-- | tools/src/h5stat/h5stat.c | 12 | ||||
-rw-r--r-- | tools/src/misc/h5mkgrp.c | 2 | ||||
-rw-r--r-- | tools/test/h5copy/dynlib_copy.c | 2 | ||||
-rw-r--r-- | tools/test/h5format_convert/h5fc_gentest.c | 18 | ||||
-rw-r--r-- | tools/test/h5jam/getub.c | 2 | ||||
-rw-r--r-- | tools/test/h5repack/dynlib_rpk.c | 2 | ||||
-rw-r--r-- | tools/test/h5repack/h5repacktst.c | 40 | ||||
-rw-r--r-- | tools/test/misc/h5clear_gentest.c | 2 | ||||
-rw-r--r-- | tools/test/misc/repart_test.c | 4 | ||||
-rw-r--r-- | tools/test/perform/chunk.c | 2 | ||||
-rw-r--r-- | tools/test/perform/chunk_cache.c | 2 | ||||
-rw-r--r-- | tools/test/perform/direct_write_perf.c | 2 | ||||
-rw-r--r-- | tools/test/perform/perf_meta.c | 30 |
21 files changed, 98 insertions, 87 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 825ca06..c554160 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -3345,7 +3345,7 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u) int j; hsize_t count; hsize_t block; - hsize_t stride; + hsize_t stride = 0; hsize_t tmp = 0; hsize_t k0 = 0; /* whole location beyond current dimension */ hsize_t k1 = 0; /* partial location within dimension */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 396de54..e752895 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -51,7 +51,6 @@ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ int attr_data_output; /* attribute data output */ -int compound_data; unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 9f12367..33f9dd6 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -254,7 +254,7 @@ ref_path_table_put(const char *path, const H5O_token_t *token) /* * counter used to disambiguate multiple instances of same object. */ -int xid = 1; +static int xid = 1; int get_next_xid(void) @@ -268,7 +268,7 @@ get_next_xid(void) * minimizes the chance of collision with a real object id. * */ -haddr_t fake_xid = HADDR_MAX; +static haddr_t fake_xid = HADDR_MAX; void get_fake_token(H5O_token_t *token) diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 49a4a20..6a8d091 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -33,7 +33,7 @@ #define MICROSECOND 1000000.0F /* global variables */ -io_time_t *timer_g; /* timer: global for stub functions */ +static io_time_t *timer_g; /* timer: global for stub functions */ /* * Function: sub_time diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 72cd88e..43b78b3 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -30,11 +30,11 @@ static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'}, {"version", no_arg, 'V'}, {"enable-error-stack", optional_arg, 'E'}, {NULL, 0, '\0'}}; -char *fname_src = NULL; -char *fname_dst = NULL; -char *oname_src = NULL; -char *oname_dst = NULL; -char *str_flag = NULL; +static char *fname_src = NULL; +static char *fname_dst = NULL; +static char *oname_src = NULL; +static char *oname_dst = NULL; +static char *str_flag = NULL; /*------------------------------------------------------------------------- * Function: leave diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index 5d29317..46c366c 100644 --- a/tools/src/h5import/h5import.h +++ b/tools/src/h5import/h5import.h @@ -110,21 +110,21 @@ struct Options { int fcount; /* number of input files */ }; -char keytable[NUM_KEYS][30] = {"PATH", - "INPUT-CLASS", - "INPUT-SIZE", - "RANK", - "DIMENSION-SIZES", - "OUTPUT-CLASS", - "OUTPUT-SIZE", - "OUTPUT-ARCHITECTURE", - "OUTPUT-BYTE-ORDER", - "CHUNKED-DIMENSION-SIZES", - "COMPRESSION-TYPE", - "COMPRESSION-PARAM", - "EXTERNAL-STORAGE", - "MAXIMUM-DIMENSIONS", - "INPUT-BYTE-ORDER"}; +static char keytable[NUM_KEYS][30] = {"PATH", + "INPUT-CLASS", + "INPUT-SIZE", + "RANK", + "DIMENSION-SIZES", + "OUTPUT-CLASS", + "OUTPUT-SIZE", + "OUTPUT-ARCHITECTURE", + "OUTPUT-BYTE-ORDER", + "CHUNKED-DIMENSION-SIZES", + "COMPRESSION-TYPE", + "COMPRESSION-PARAM", + "EXTERNAL-STORAGE", + "MAXIMUM-DIMENSIONS", + "INPUT-BYTE-ORDER"}; static int state_table[15][8] = { /* token ordering: FILNAME OPT_o OPT_c OPT_h OPT_d OPT_p OPT_t OPT_s */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index c7ede3c..9b3030c 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -23,10 +23,10 @@ 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 *const *); -int do_clobber = FALSE; -char *output_file = NULL; -char *input_file = NULL; -char *ub_file = NULL; +static int do_clobber = FALSE; +static char *output_file = NULL; +static char *input_file = NULL; +static char *ub_file = NULL; /* * Command-line options: The user can specify short or long-named diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 9578f7a..ca122e4 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -21,10 +21,10 @@ static int parse_command_line(int argc, const char *const *argv, pack_opt_t *op static void leave(int ret) H5_ATTR_NORETURN; /* module-scoped variables */ -static int has_i = 0; -static int has_o = 0; -const char *infile = NULL; -const char *outfile = NULL; +static int has_i = 0; +static int has_o = 0; +static const char *infile = NULL; +static const char *outfile = NULL; /* * Command-line options: The user can specify short or long-named diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 05e0be8..495954e 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -35,12 +35,12 @@ 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", - "H5F_FSPACE_STRATEGY_PAGE", - "H5F_FSPACE_STRATEGY_AGGR", - "H5F_FSPACE_STRATEGY_NONE", - "unknown", - NULL}; +static const char *FS_STRATEGY_NAME[] = {"H5F_FSPACE_STRATEGY_FSM_AGGR", + "H5F_FSPACE_STRATEGY_PAGE", + "H5F_FSPACE_STRATEGY_AGGR", + "H5F_FSPACE_STRATEGY_NONE", + "unknown", + NULL}; /* Datatype statistics for datasets */ typedef struct dtype_info_t { diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index fc7d5b6..c183a41 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -39,7 +39,7 @@ typedef struct mkgrp_opt_t { hid_t fapl_id; /* fapl to use when opening the file */ } mkgrp_opt_t; -mkgrp_opt_t params_g; /* Command line parameter settings */ +static mkgrp_opt_t params_g; /* Command line parameter settings */ /*------------------------------------------------------------------------- * Function: leave diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c index e71ca47..2abef79 100644 --- a/tools/test/h5copy/dynlib_copy.c +++ b/tools/test/h5copy/dynlib_copy.c @@ -24,7 +24,7 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ +static const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DYNLIBUD, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index e0402b5..3718964 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -27,15 +27,15 @@ #define EDGE_V3_FILE "h5fc_edge_v3.h5" #define ERR_LEVEL_FILE "h5fc_err_level.h5" -const char *FILENAME[] = {"h5fc_ext1_i.h5", /* 0 */ - "h5fc_ext1_s.h5", /* 1 */ - "h5fc_ext1_f.h5", /* 2 */ - "h5fc_ext2_is.h5", /* 3 */ - "h5fc_ext2_if.h5", /* 4 */ - "h5fc_ext2_sf.h5", /* 5 */ - "h5fc_ext3_isf.h5", /* 6 */ - "h5fc_ext_none.h5", /* 7 */ - NULL}; +static const char *FILENAME[] = {"h5fc_ext1_i.h5", /* 0 */ + "h5fc_ext1_s.h5", /* 1 */ + "h5fc_ext1_f.h5", /* 2 */ + "h5fc_ext2_is.h5", /* 3 */ + "h5fc_ext2_if.h5", /* 4 */ + "h5fc_ext2_sf.h5", /* 5 */ + "h5fc_ext3_isf.h5", /* 6 */ + "h5fc_ext_none.h5", /* 7 */ + NULL}; #define GROUP "GROUP" diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index c01df38..8928ee8 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -18,7 +18,7 @@ void parse_command_line(int argc, const char *const *argv); /* Name of tool */ #define PROGRAM_NAME "getub" -char *nbytes = NULL; +static char *nbytes = NULL; static const char *s_opts = "c:"; /* add more later ? */ static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */ diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c index 225cea8..1feed12 100644 --- a/tools/test/h5repack/dynlib_rpk.c +++ b/tools/test/h5repack/dynlib_rpk.c @@ -26,7 +26,7 @@ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const uns size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB1[1] = {{ +static const H5Z_class2_t H5Z_DYNLIB1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DYNLIB1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index fc0fe54..cbb5f8f 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -82,7 +82,7 @@ /* Files for testing file space paging */ #define FSPACE_OUT "h5repack_fspace_OUT.h5" /* The output file */ #define NELMTS(X) (sizeof(X) / sizeof(X[0])) /* # of elements */ -const char *H5REPACK_FSPACE_FNAMES[] = { +static const char *H5REPACK_FSPACE_FNAMES[] = { "h5repack_latest.h5", /* 0 */ "h5repack_default.h5", /* 1 */ "h5repack_page_persist.h5", /* 2 */ @@ -101,7 +101,7 @@ const char *H5REPACK_FSPACE_FNAMES[] = { /* obj and region references in attr of compound and vlen type */ #define FNAME_ATTR_REF "h5repack_attr_refs.h5" -const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL}; +static const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL}; #define H5REPACK_EXTFILE "h5repack_ext.bin" @@ -4099,9 +4099,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 1, dims, "enum", tid, buf45) < 0) goto out; @@ -4323,9 +4325,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 2, dims2, "enum2D", tid, 0) < 0) goto out; @@ -4531,9 +4535,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 3, dims3, "enum3D", tid, 0) < 0) goto out; @@ -4990,9 +4996,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 1, dims, "enum", tid, buf45) < 0) goto out; @@ -5293,9 +5301,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 2, dims2, "enum2D", tid, buf452) < 0) goto out; @@ -5737,9 +5747,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 3, dims3, "enum3D", tid, buf453) < 0) goto out; diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 3ea6788..31796c1 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -13,7 +13,7 @@ #include "h5test.h" /* The HDF5 test files */ -const char *FILENAME[] = { +static const char *FILENAME[] = { "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */ "h5clear_log_v3.h5", /* 1 -- log file with superblock version 3 */ "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */ diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c index ac05aab..9359015 100644 --- a/tools/test/misc/repart_test.c +++ b/tools/test/misc/repart_test.c @@ -22,8 +22,8 @@ #define FAMILY_H5REPART_SIZE1 20000 #define FAMILY_H5REPART_SIZE2 (5 * KB) -const char *FILENAME[] = {"fst_family%05d.h5", "scd_family%05d.h5", "family_to_single.h5", - "family_to_sec2.h5", NULL}; +static const char *FILENAME[] = {"fst_family%05d.h5", "scd_family%05d.h5", "family_to_single.h5", + "family_to_sec2.h5", NULL}; herr_t test_family_h5repart_opens(void); herr_t test_single_h5repart_opens(void); diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 3f4b3d7..f630cf3 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -75,7 +75,7 @@ static size_t counter(unsigned H5_ATTR_UNUSED flags, size_t cd_nelmts, const uns size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_COUNTER[1] = {{ +static const H5Z_class2_t H5Z_COUNTER[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ FILTER_COUNTER, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 7daeb68..13d7a12 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -53,7 +53,7 @@ static size_t counter(unsigned flags, size_t cd_nelmts, const unsigned *cd_value size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_COUNTER[1] = {{ +static const H5Z_class2_t H5Z_COUNTER[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ FILTER_COUNTER, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index 016c9b7..1308fec 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -45,7 +45,7 @@ #include <unistd.h> #endif -const char *FILENAME[] = {"direct_write", "unix.raw", NULL}; +static const char *FILENAME[] = {"direct_write", "unix.raw", NULL}; /* * Print the current location on the standard output stream. diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 6e62f6a..5fe3631 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -28,25 +28,25 @@ #define FACC_MPIO 0x1 /* MPIO */ /* Which test to run */ -int RUN_TEST = 0x0; /* all tests as default */ -int TEST_1 = 0x1; /* Test 1 */ -int TEST_2 = 0x2; /* Test 2 */ -int TEST_3 = 0x4; /* Test 3 */ +static int RUN_TEST = 0x0; /* all tests as default */ +static int TEST_1 = 0x1; /* Test 1 */ +static int TEST_2 = 0x2; /* Test 2 */ +static int TEST_3 = 0x4; /* Test 3 */ -const char *FILENAME[] = {"meta_perf_1", "meta_perf_2", "meta_perf_3", NULL}; +static const char *FILENAME[] = {"meta_perf_1", "meta_perf_2", "meta_perf_3", NULL}; /* Default values for performance. Can be changed through command line options */ -int NUM_DSETS = 16; -int NUM_ATTRS = 8; -int BATCH_ATTRS = 2; -hbool_t flush_dset = FALSE; -hbool_t flush_attr = FALSE; -int nerrors = 0; /* errors count */ -hid_t fapl; +static int NUM_DSETS = 16; +static int NUM_ATTRS = 8; +static int BATCH_ATTRS = 2; +static hbool_t flush_dset = FALSE; +static hbool_t flush_attr = FALSE; +static int nerrors = 0; /* errors count */ +static hid_t fapl; /* Data space IDs */ -hid_t space; -hid_t small_space; +static hid_t space; +static hid_t small_space; /* Performance data */ typedef struct p_time { @@ -59,7 +59,7 @@ typedef struct p_time { } p_time; /*Test file access type for parallel. MPIO as default */ -int facc_type = FACC_DEFAULT; +static int facc_type = FACC_DEFAULT; double retrieve_time(void); void perf(p_time *perf_t, double start_t, double end_t); |