From f563c2b926445f7a975553bc7742a38f42d3b6f4 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 28 Jul 2023 04:42:41 -0700 Subject: [PATCH] Sync tools with develop (#3301) --- tools/lib/h5diff.c | 12 +- tools/lib/h5diff_array.c | 16 +- tools/lib/h5diff_attr.c | 6 +- tools/lib/h5diff_dset.c | 4 +- tools/lib/h5tools.c | 33 +- tools/lib/h5tools.h | 6 +- tools/lib/h5tools_dump.c | 11 +- tools/lib/h5tools_error.h | 58 +-- tools/lib/h5tools_ref.c | 4 +- tools/lib/h5tools_str.c | 12 +- tools/lib/h5tools_utils.c | 97 +++-- tools/lib/h5tools_utils.h | 12 +- tools/lib/h5trav.c | 6 +- tools/libtest/h5tools_test_utils.c | 338 +++++++++--------- tools/src/h5copy/h5copy.c | 12 +- tools/src/h5diff/h5diff_common.c | 21 +- tools/src/h5diff/ph5diff_main.c | 2 +- tools/src/h5dump/h5dump.c | 33 +- tools/src/h5dump/h5dump_ddl.c | 2 +- tools/src/h5dump/h5dump_defines.h | 4 +- tools/src/h5dump/h5dump_xml.c | 4 +- tools/src/h5format_convert/h5format_convert.c | 3 +- tools/src/h5import/h5import.c | 60 ++-- tools/src/h5import/h5import.h | 30 +- tools/src/h5jam/h5jam.c | 8 +- tools/src/h5jam/h5unjam.c | 11 +- tools/src/h5ls/h5ls.c | 32 +- tools/src/h5perf/pio_perf.c | 6 +- tools/src/h5perf/pio_perf.h | 6 +- tools/src/h5perf/sio_engine.c | 2 +- tools/src/h5perf/sio_perf.c | 18 +- tools/src/h5repack/h5repack.c | 4 +- tools/src/h5repack/h5repack_copy.c | 6 +- tools/src/h5repack/h5repack_main.c | 34 +- tools/src/h5repack/h5repack_parse.c | 26 +- tools/src/h5repack/h5repack_refs.c | 30 +- tools/src/h5repack/h5repack_verify.c | 4 +- tools/src/h5stat/h5stat.c | 27 +- tools/src/misc/h5debug.c | 4 +- tools/src/misc/h5delete.c | 2 +- tools/src/misc/h5mkgrp.c | 9 +- tools/src/misc/h5repart.c | 6 +- tools/test/h5diff/h5diffgentest.c | 12 +- tools/test/h5diff/testfiles/h5diff_10.txt | 3 + tools/test/h5diff/testfiles/h5diff_600.txt | 3 + tools/test/h5diff/testfiles/h5diff_603.txt | 3 + tools/test/h5diff/testfiles/h5diff_606.txt | 3 + tools/test/h5diff/testfiles/h5diff_612.txt | 3 + tools/test/h5diff/testfiles/h5diff_615.txt | 3 + tools/test/h5diff/testfiles/h5diff_621.txt | 3 + tools/test/h5diff/testfiles/h5diff_622.txt | 3 + tools/test/h5diff/testfiles/h5diff_623.txt | 3 + tools/test/h5diff/testfiles/h5diff_624.txt | 3 + tools/test/h5dump/h5dumpgentest.c | 16 +- tools/test/h5format_convert/h5fc_gentest.c | 26 +- tools/test/h5import/h5importtest.c | 48 +-- tools/test/h5jam/getub.c | 2 +- tools/test/h5jam/h5jamgentest.c | 2 +- tools/test/h5repack/dynlib_rpk.c | 2 +- tools/test/h5repack/h5repacktst.c | 96 ++--- tools/test/h5stat/h5stat_gentest.c | 8 +- tools/test/misc/h5clear_gentest.c | 6 +- tools/test/misc/repart_test.c | 8 +- tools/test/misc/talign.c | 2 +- tools/test/misc/testfiles/h5mkgrp_help.txt | 3 + tools/test/perform/chunk.c | 2 +- tools/test/perform/chunk_cache.c | 10 +- tools/test/perform/direct_write_perf.c | 12 +- tools/test/perform/iopipe.c | 32 +- tools/test/perform/perf_meta.c | 30 +- tools/test/perform/zip_perf.c | 4 +- tools/testfiles/h5dump-help.txt | 3 + tools/testfiles/help-1.ls | 3 + tools/testfiles/help-2.ls | 3 + tools/testfiles/help-3.ls | 3 + .../pbits/tnofilename-with-packed-bits.ddl | 3 + tools/testfiles/pbits/tpbitsIncomplete.ddl | 3 + .../testfiles/pbits/tpbitsLengthExceeded.ddl | 3 + .../testfiles/pbits/tpbitsLengthPositive.ddl | 3 + tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 3 + .../testfiles/pbits/tpbitsOffsetExceeded.ddl | 3 + .../testfiles/pbits/tpbitsOffsetNegative.ddl | 3 + tools/testfiles/textlinksrc-nodangle-1.ls | 3 + tools/testfiles/tgroup-1.ls | 3 + 84 files changed, 785 insertions(+), 626 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 7232ed034f6..502b2ec2b29 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char if (HDstrncmp(objname1, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if (HDasprintf(&obj1fullname, "/%s", objname1) < 0) + if (asprintf(&obj1fullname, "/%s", objname1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ @@ -725,7 +725,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char if (HDstrncmp(objname2, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if (HDasprintf(&obj2fullname, "/%s", objname2) < 0) + if (asprintf(&obj2fullname, "/%s", objname2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ @@ -1087,7 +1087,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char if (fapl2_id != H5P_DEFAULT) H5Pclose(fapl2_id); } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); @@ -1182,7 +1182,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if (HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { + if (asprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ @@ -1200,7 +1200,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if (HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { + if (asprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ @@ -1928,7 +1928,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5Gclose(grp2_id); /* enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(": %d - errstat:%d", nfound, opts->err_stat); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 85defbebf38..abb81b91b85 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -83,7 +83,7 @@ static hbool_t not_comparable; #define PER(A, B) \ - { \ + do { \ per = -1; \ not_comparable = FALSE; \ both_zero = FALSE; \ @@ -93,10 +93,10 @@ static hbool_t not_comparable; per = (double)ABS((double)((B) - (A)) / (double)(A)); \ else \ not_comparable = TRUE; \ - } + } while (0) #define PER_UNSIGN(TYPE, A, B) \ - { \ + do { \ per = -1; \ not_comparable = FALSE; \ both_zero = FALSE; \ @@ -106,7 +106,7 @@ static hbool_t not_comparable; per = ABS((double)((TYPE)((B) - (A))) / (double)(A)); \ else \ not_comparable = TRUE; \ - } + } while (0) #define PDIFF(a, b) (((b) > (a)) ? ((b) - (a)) : ((a) - (b))) @@ -684,7 +684,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co } /* enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY } break; @@ -1371,7 +1371,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di npoints1 = H5Sget_select_elem_npoints(region1_id); npoints2 = H5Sget_select_elem_npoints(region2_id); } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_DEBUG("blocks: 1=%" PRIdHSIZE "-2=%" PRIdHSIZE, nblocks1, nblocks2); H5TOOLS_DEBUG("points: 1=%" PRIdHSIZE "-2=%" PRIdHSIZE, npoints1, npoints2); @@ -3117,7 +3117,7 @@ ull2float(unsigned long long ull_value, float *f_value) { H5Pclose(dxpl_id); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -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/h5diff_attr.c b/tools/lib/h5diff_attr.c index 474d83cc77c..0c377afc2eb 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -295,7 +295,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, H5Aclose(attr1_id); H5Aclose(attr2_id); } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); @@ -576,7 +576,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5Sclose(space1_id); H5Sclose(space2_id); } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); @@ -669,7 +669,7 @@ diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, di H5Aclose(attr1_id); H5Aclose(attr2_id); } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); return nfound_total; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index c30532b59a7..78f52bc14eb 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -95,7 +95,7 @@ diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char * H5Dclose(did2); /* enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); return nfound; @@ -931,7 +931,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5Tclose(m_tid2); /* enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY H5TOOLS_ENDDEBUG(": %d with nfound:%d", ret_value, nfound); return nfound; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 58be037babf..0e063c7f432 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 */ @@ -246,7 +245,7 @@ h5tools_set_data_output_file(const char *fname, int is_bin) * so that rawdatastream is changed only when succeeded */ if (rawdatastream && rawdatastream != stdout) { - if (HDfclose(rawdatastream)) + if (fclose(rawdatastream)) HDperror("closing rawdatastream"); else rawdatastream = NULL; @@ -294,7 +293,7 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) * so that rawattrstream is changed only when succeeded */ if (rawattrstream && rawattrstream != stdout) { - if (HDfclose(rawattrstream)) + if (fclose(rawattrstream)) HDperror("closing rawattrstream"); else rawattrstream = NULL; @@ -343,7 +342,7 @@ h5tools_set_input_file(const char *fname, int is_bin) * so that rawinstream is changed only when succeeded */ if (rawinstream && rawinstream != stdin) { - if (HDfclose(rawinstream)) + if (fclose(rawinstream)) HDperror("closing rawinstream"); else rawinstream = NULL; @@ -391,7 +390,7 @@ h5tools_set_output_file(const char *fname, int is_bin) * so that rawoutstream is changed only when succeeded */ if (rawoutstream && rawoutstream != stdout) { - if (HDfclose(rawoutstream)) + if (fclose(rawoutstream)) HDperror("closing rawoutstream"); else rawoutstream = NULL; @@ -438,7 +437,7 @@ h5tools_set_error_file(const char *fname, int is_bin) * so that rawerrorstream is changed only when succeeded */ if (rawerrorstream && rawerrorstream != stderr) { - if (HDfclose(rawerrorstream)) + if (fclose(rawerrorstream)) HDperror("closing rawerrorstream"); else rawerrorstream = NULL; @@ -566,8 +565,12 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) #ifdef H5_HAVE_ROS3_VFD if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); - if (H5Pset_fapl_ros3(fapl_id, (const H5FD_ros3_fapl_t *)vfd_info->info) < 0) + if (H5Pset_fapl_ros3(fapl_id, &((const H5FD_ros3_fapl_ext_t *)vfd_info->info)->fa) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed"); + + if (H5Pset_fapl_ros3_token(fapl_id, ((const H5FD_ros3_fapl_ext_t *)vfd_info->info)->token) < + 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3_token() failed"); #else H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); #endif @@ -975,7 +978,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec { fid = H5Fopen(fname, flags, fapl_id); } - H5E_END_TRY; + H5E_END_TRY } /* If we succeeded in opening the file, we're done. */ @@ -1036,7 +1039,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec { fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) { used_fapl_id = tmp_fapl_id; @@ -1811,9 +1814,9 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t else bytes_in = (size_t)block_index; - bytes_wrote = HDfwrite(mem, 1, bytes_in, stream); + bytes_wrote = fwrite(mem, 1, bytes_in, stream); - if (bytes_wrote != bytes_in || (0 == bytes_wrote && HDferror(stream))) + if (bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(stream))) H5TOOLS_THROW((-1), "fwrite failed"); block_index -= (hsize_t)bytes_wrote; @@ -1844,7 +1847,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { memcpy(&tempuchar, &s[i], sizeof(unsigned char)); - if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream)) + if (1 != fwrite(&tempuchar, sizeof(unsigned char), 1, stream)) H5TOOLS_THROW((-1), "fwrite failed"); } /* i */ } /* for (block_index = 0; block_index < block_nelmts; block_index++) */ @@ -1991,7 +1994,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t H5TOOLS_DEBUG("H5T_OPAQUE"); for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char *)_mem) + block_index * size; - if (size != HDfwrite(mem, sizeof(char), size, stream)) + if (size != fwrite(mem, sizeof(char), size, stream)) H5TOOLS_THROW((-1), "fwrite failed"); } /* end for */ break; @@ -2165,7 +2168,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea if (dtype > 0 && H5Tclose(dtype) < 0) H5TOOLS_ERROR(FALSE, "H5Tclose failed"); - H5_LEAVE(TRUE) + H5_LEAVE(TRUE); CATCH H5TOOLS_ENDDEBUG(" "); @@ -2280,7 +2283,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *strea if (dtype > 0 && H5Tclose(dtype) < 0) H5TOOLS_ERROR(FALSE, "H5Tclose failed"); - H5_LEAVE(ret_value) + H5_LEAVE(ret_value); CATCH H5TOOLS_ENDDEBUG(" "); return ret_value; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 1c63ed0f426..97f56e0c8be 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -30,13 +30,13 @@ /* Stream macros */ #define FLUSHSTREAM(S) \ if (S != NULL) \ - HDfflush(S) + fflush(S) #define PRINTSTREAM(S, F, ...) \ if (S != NULL) \ - HDfprintf(S, F, __VA_ARGS__) + fprintf(S, F, __VA_ARGS__) #define PRINTVALSTREAM(S, V) \ if (S != NULL) \ - HDfprintf(S, V) + fprintf(S, V) #define PUTSTREAM(X, S) \ do { \ if (S != NULL) \ diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 956c41de4b6..6028f920899 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -441,7 +441,7 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region } element end */ - H5_LEAVE(dimension_break) + H5_LEAVE(dimension_break); CATCH @@ -843,7 +843,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region } element end */ - H5_LEAVE(dimension_break) + H5_LEAVE(dimension_break); CATCH @@ -1198,7 +1198,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region } element end */ - H5_LEAVE(dimension_break) + H5_LEAVE(dimension_break); CATCH H5TOOLS_ENDDEBUG(" "); @@ -3485,8 +3485,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0, (hsize_t)0); break; case H5Z_FILTER_SZIP: - szip_options_mask = cd_values[0]; - ; + szip_options_mask = cd_values[0]; szip_pixels_per_block = cd_values[1]; h5tools_str_append(&buffer, "%s %s", SZIP, BEGIN); @@ -3939,7 +3938,7 @@ h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) error_msg("Packed Bit offset+length value(%u) too large. Max is %d\n", packed_data_offset + packed_data_length, packed_bits_size); packed_data_mask = 0; - }; + } h5tools_str_append(buffer, "%s %s=%u %s=%u", PACKED_BITS, PACKED_OFFSET, packed_data_offset, PACKED_LENGTH, packed_data_length); } diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 5417eb90957..8a7414c3596 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -40,27 +40,27 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; \ /* Create new HDF5 error stack for the tools to use */ \ if ((H5tools_ERR_STACK_g = H5Ecreate_stack()) < 0) \ - HDfprintf(stderr, "Failed to create HDF5 tools error stack\n"); \ + fprintf(stderr, "Failed to create HDF5 tools error stack\n"); \ \ /* Register errors from the HDF5 tools as a new error class */ \ if ((H5tools_ERR_CLS_g = H5Eregister_class("H5tools", "HDF5:tools", lib_str)) < 0) \ - HDfprintf(stderr, "Failed to register HDF5 tools error class\n"); \ + fprintf(stderr, "Failed to register HDF5 tools error class\n"); \ \ /* Create a new HDF5 major error message for errors from the tools library */ \ if ((H5E_tools_g = H5Ecreate_msg(H5tools_ERR_CLS_g, H5E_MAJOR, "Failure in tools library")) < 0) \ - HDfprintf(stderr, "Failed to register major error message for tools library errors\n"); \ + fprintf(stderr, "Failed to register major error message for tools library errors\n"); \ \ /* Create a new HDF5 minor error message for errors from the tools library */ \ if ((H5E_tools_min_id_g = H5Ecreate_msg(H5tools_ERR_CLS_g, H5E_MINOR, "error in function")) < 0) \ - HDfprintf(stderr, "Failed to register minor error message for tools library errors\n"); \ + fprintf(stderr, "Failed to register minor error message for tools library errors\n"); \ \ /* Create a new HDF5 minor error message for info messages from the tools library */ \ if ((H5E_tools_min_info_id_g = H5Ecreate_msg(H5tools_ERR_CLS_g, H5E_MINOR, "function info")) < 0) \ - HDfprintf(stderr, "Failed to register minor error message for tools library info messages\n"); \ + fprintf(stderr, "Failed to register minor error message for tools library info messages\n"); \ \ /* Create a new HDF5 minor error message for debug messages from the tools library */ \ if ((H5E_tools_min_dbg_id_g = H5Ecreate_msg(H5tools_ERR_CLS_g, H5E_MINOR, "function debug")) < 0) \ - HDfprintf(stderr, "Failed to register minor error message for tools library debug messages\n"); \ + fprintf(stderr, "Failed to register minor error message for tools library debug messages\n"); \ } while (0) /* @@ -70,21 +70,21 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; do { \ /* Close all error messages created by H5TOOLS_INIT_ERROR() */ \ if (H5Eclose_msg(H5E_tools_min_dbg_id_g) < 0) \ - HDfprintf(stderr, "Failed to close minor error message for tools library debug messages\n"); \ + fprintf(stderr, "Failed to close minor error message for tools library debug messages\n"); \ if (H5Eclose_msg(H5E_tools_min_info_id_g) < 0) \ - HDfprintf(stderr, "Failed to close minor error message for tools library info messages\n"); \ + fprintf(stderr, "Failed to close minor error message for tools library info messages\n"); \ if (H5Eclose_msg(H5E_tools_min_id_g) < 0) \ - HDfprintf(stderr, "Failed to close minor error message for tools library errors\n"); \ + fprintf(stderr, "Failed to close minor error message for tools library errors\n"); \ if (H5Eclose_msg(H5E_tools_g) < 0) \ - HDfprintf(stderr, "Failed to close major error message for tools library errors\n"); \ + fprintf(stderr, "Failed to close major error message for tools library errors\n"); \ \ /* Unregister the HDF5 tools error class */ \ if (H5Eunregister_class(H5tools_ERR_CLS_g) < 0) \ - HDfprintf(stderr, "Failed to unregister the HDF5 tools error class\n"); \ + fprintf(stderr, "Failed to unregister the HDF5 tools error class\n"); \ \ /* Close the tools error stack */ \ if (H5Eclose_stack(H5tools_ERR_STACK_g) < 0) \ - HDfprintf(stderr, "Failed to close HDF5 tools error stack\n"); \ + fprintf(stderr, "Failed to close HDF5 tools error stack\n"); \ } while (0) /* @@ -98,8 +98,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; H5Epush2(estack_id, __FILE__, __func__, __LINE__, err_cls, maj_err_id, min_err_id, \ __VA_ARGS__); \ else { \ - HDfprintf(stderr, __VA_ARGS__); \ - HDfprintf(stderr, "\n"); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ } \ } \ } while (0) @@ -166,27 +166,27 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; #define H5TOOLS_START_DEBUG(...) \ do { \ H5tools_INDENT_g += 2; \ - HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ - HDfprintf(stderr, __VA_ARGS__); \ - HDfprintf(stderr, "\n"); \ - HDfflush(stderr); \ + fprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + fflush(stderr); \ } while (0) #define H5TOOLS_DEBUG(...) \ do { \ - HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ - HDfprintf(stderr, __VA_ARGS__); \ - HDfprintf(stderr, "\n"); \ - HDfflush(stderr); \ + fprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + fflush(stderr); \ } while (0) #define H5TOOLS_ENDDEBUG(...) \ do { \ - HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ - HDfprintf(stderr, __VA_ARGS__); \ - HDfprintf(stderr, "\n"); \ + fprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ H5tools_INDENT_g -= 2; \ - HDfflush(stderr); \ + fflush(stderr); \ } while (0) #else @@ -222,11 +222,11 @@ catch_except:; * it. */ #define H5_LEAVE(v) \ - { \ + do { \ ret_value = v; \ if (!past_catch) \ goto catch_except; \ - } + } while (0) /* * H5TOOLS_THROW macro, used to facilitate error reporting within a function body. @@ -238,7 +238,7 @@ catch_except:; do { \ H5TOOLS_PUSH_ERROR(H5tools_ERR_STACK_g, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, \ __VA_ARGS__); \ - H5_LEAVE(ret_val) \ + H5_LEAVE(ret_val); \ } while (0) #endif /* H5TOOLS_ERROR_H */ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 065fce19592..d89c546741f 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -242,7 +242,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) @@ -256,7 +256,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/h5tools_str.c b/tools/lib/h5tools_str.c index 2906cc54331..ff7fab53e13 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -447,7 +447,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for { snblocks = H5Sget_select_hyper_nblocks(rspace); } - H5E_END_TRY; + H5E_END_TRY /* Print block information */ if (snblocks > 0) { @@ -508,7 +508,7 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for { snpoints = H5Sget_select_elem_npoints(rspace); } - H5E_END_TRY; + H5E_END_TRY /* Print point information */ if (snpoints > 0) { @@ -1548,10 +1548,10 @@ h5tools_escape(char *s /*in,out*/, size_t size) /*would overflow*/ return NULL; - HDmemmove(s + i + esc_size, s + i + 1, n - i); /*make room*/ - memcpy(s + i, escape, esc_size); /*insert*/ - n += esc_size - 1; /* adjust total string size */ - i += esc_size; /* adjust string position */ + memmove(s + i + esc_size, s + i + 1, n - i); /*make room*/ + memcpy(s + i, escape, esc_size); /*insert*/ + n += esc_size - 1; /* adjust total string size */ + i += esc_size; /* adjust string position */ } } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index c5c1f5be391..fc9a6462d69 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -187,7 +187,7 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_START_DEBUG(" - h_list:%s", h_list); /* count how many integers do we have */ for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (HDisdigit(*ptr)) { + if (isdigit(*ptr)) { if (!last_digit) /* the last read character wasn't a digit */ size_count++; @@ -209,11 +209,11 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_INFO("Unable to allocate space for subset data"); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (HDisdigit(*ptr)) { + if (isdigit(*ptr)) { /* we should have an integer now */ - p_list[i++] = (hsize_t)HDstrtoull(ptr, NULL, 0); + p_list[i++] = (hsize_t)strtoull(ptr, NULL, 0); - while (HDisdigit(*ptr)) + while (isdigit(*ptr)) /* scroll to end of integer */ ptr++; } @@ -996,7 +996,7 @@ h5tools_getenv_update_hyperslab_bufsize(void) /* check if environment variable is set for the hyperslab buffer size */ if (NULL != (env_str = HDgetenv("H5TOOLS_BUFSIZE"))) { errno = 0; - hyperslab_bufsize_mb = HDstrtol(env_str, (char **)NULL, 10); + hyperslab_bufsize_mb = strtol(env_str, (char **)NULL, 10); if (errno != 0 || hyperslab_bufsize_mb <= 0) H5TOOLS_GOTO_ERROR(FAIL, "hyperslab buffer size failed"); @@ -1025,9 +1025,9 @@ h5tools_getenv_update_hyperslab_bufsize(void) *---------------------------------------------------------------------------- */ herr_t -h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t *fapl_config_out) +h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_ext_t *fapl_config_out) { - const char *ccred[3]; + const char *ccred[4]; unsigned nelems = 0; char *s3cred_src = NULL; char **s3cred = NULL; @@ -1038,12 +1038,18 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t H5TOOLS_GOTO_ERROR(FAIL, "failed to parse S3 VFD info tuple"); /* Sanity-check tuple count */ - if (nelems != 3) + if (nelems != 3 && nelems != 4) H5TOOLS_GOTO_ERROR(FAIL, "invalid S3 VFD credentials"); ccred[0] = (const char *)s3cred[0]; ccred[1] = (const char *)s3cred[1]; ccred[2] = (const char *)s3cred[2]; + if (nelems == 3) { + ccred[3] = ""; + } + else { + ccred[3] = (const char *)s3cred[3]; + } if (0 == h5tools_populate_ros3_fapl(fapl_config_out, ccred)) H5TOOLS_GOTO_ERROR(FAIL, "failed to populate S3 VFD FAPL config"); @@ -1090,34 +1096,35 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t * * NULL fapl pointer: (NULL, {...} ) * * Warning: In all cases below, fapl will be set as "default" * before error occurs. - * * NULL value strings: (&fa, {NULL?, NULL? NULL?, ...}) + * * NULL value strings: (&fa, {NULL?, NULL? NULL?, NULL?, ...}) * * Incomplete fapl info: - * * empty region, non-empty id, key either way - * * (&fa, {"", "...", "?"}) - * * empty id, non-empty region, key either way - * * (&fa, {"...", "", "?"}) - * * "non-empty key and either id or region empty - * * (&fa, {"", "", "...") - * * (&fa, {"", "...", "...") - * * (&fa, {"...", "", "...") + * * empty region, non-empty id, key either way, token either way + * * (&fa, token, {"", "...", "?", "?"}) + * * empty id, non-empty region, key either way, token either way + * * (&fa, token, {"...", "", "?", "?"}) + * * "non-empty key, token either way and either id or region empty + * * (&fa, token, {"", "", "...", "?") + * * (&fa, token, {"", "...", "...", "?") + * * (&fa, token, {"...", "", "...", "?") * * Any string would overflow allowed space in fapl definition. * or * 1 (success) * * Sets components in fapl_t pointer, copying strings as appropriate. * * "Default" fapl (valid version, authenticate->False, empty strings) * * `values` pointer is NULL - * * (&fa, NULL) - * * first three strings in `values` are empty ("") - * * (&fa, {"", "", "", ...} + * * (&fa, token, NULL) + * * first four strings in `values` are empty ("") + * * (&fa, token, {"", "", "", "", ...}) * * Authenticating fapl - * * region, id, and optional key provided - * * (&fa, {"...", "...", ""}) - * * (&fa, {"...", "...", "..."}) + * * region, id, optional key and option session token provided + * * (&fa, token, {"...", "...", "", ""}) + * * (&fa, token, {"...", "...", "...", ""}) + * * (&fa, token, {"...", "...", "...", "..."}) * *---------------------------------------------------------------------------- */ int -h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) +h5tools_populate_ros3_fapl(H5FD_ros3_fapl_ext_t *fa, const char **values) { int show_progress = 0; /* set to 1 for debugging */ int ret_value = 1; /* 1 for success, 0 for failure */ @@ -1138,11 +1145,12 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) if (show_progress) { printf(" preset fapl with default values\n"); } - fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION; - fa->authenticate = FALSE; - *(fa->aws_region) = '\0'; - *(fa->secret_id) = '\0'; - *(fa->secret_key) = '\0'; + fa->fa.version = H5FD_CURR_ROS3_FAPL_T_VERSION; + fa->fa.authenticate = FALSE; + *(fa->fa.aws_region) = '\0'; + *(fa->fa.secret_id) = '\0'; + *(fa->fa.secret_key) = '\0'; + *(fa->token) = '\0'; /* sanity-check supplied values */ @@ -1168,6 +1176,13 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) ret_value = 0; goto done; } + if (values[3] == NULL) { + if (show_progress) { + printf(" ERROR: token value cannot be NULL\n"); + } + ret_value = 0; + goto done; + } /* if region and ID are supplied (key optional), write to fapl... * fail if value would overflow @@ -1180,7 +1195,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) ret_value = 0; goto done; } - memcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1)); + memcpy(fa->fa.aws_region, values[0], (HDstrlen(values[0]) + 1)); if (show_progress) { printf(" aws_region set\n"); } @@ -1192,7 +1207,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) ret_value = 0; goto done; } - memcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1)); + memcpy(fa->fa.secret_id, values[1], (HDstrlen(values[1]) + 1)); if (show_progress) { printf(" secret_id set\n"); } @@ -1204,17 +1219,29 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) ret_value = 0; goto done; } - memcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1)); + memcpy(fa->fa.secret_key, values[2], (HDstrlen(values[2]) + 1)); if (show_progress) { printf(" secret_key set\n"); } - fa->authenticate = TRUE; + if (HDstrlen(values[3]) > H5FD_ROS3_MAX_SECRET_TOK_LEN) { + if (show_progress) { + printf(" ERROR: token value too long\n"); + } + ret_value = 0; + goto done; + } + memcpy(fa->token, values[3], (HDstrlen(values[3]) + 1)); + if (show_progress) { + printf(" token set\n"); + } + + fa->fa.authenticate = TRUE; if (show_progress) { printf(" set to authenticate\n"); } } - else if (*values[0] != '\0' || *values[1] != '\0' || *values[2] != '\0') { + else if (*values[0] != '\0' || *values[1] != '\0' || *values[2] != '\0' || *values[3] != '\0') { if (show_progress) { printf(" ERROR: invalid assortment of empty/non-empty values\n"); } @@ -1277,7 +1304,7 @@ h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t HDstrncpy(fapl_config_out->user_name, (const char *)props[3], HDstrlen(props[3])); } if (HDstrncmp(props[4], "", 1)) { - k = HDstrtoul((const char *)props[4], NULL, 0); + k = strtoul((const char *)props[4], NULL, 0); if (errno == ERANGE) H5TOOLS_GOTO_ERROR(FAIL, "supposed buffersize number wasn't"); fapl_config_out->stream_buffer_size = (int32_t)k; diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index c721ab47fea..2efa53f3297 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -61,6 +61,14 @@ typedef struct find_objs_t { table_t *dset_table; } find_objs_t; +#ifdef H5_HAVE_ROS3_VFD +/*extended configuration struct for holding the configuration data to the #H5FD_ROS3 driver */ +typedef struct H5FD_ros3_fapl_ext_t { + H5FD_ros3_fapl_t fa; /* ROS3 configuration struct*/ + char token[H5FD_ROS3_MAX_SECRET_TOK_LEN + 1]; /* Session/security token*/ +} H5FD_ros3_fapl_ext_t; +#endif /* H5_HAVE_ROS3_VFD */ + H5TOOLS_DLLVAR unsigned h5tools_nCols; /*max number of columns for outputting */ /* Definitions of useful routines */ @@ -126,8 +134,8 @@ H5TOOLS_DLL void h5tools_setstatus(int d_status); H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void); #ifdef H5_HAVE_ROS3_VFD H5TOOLS_DLL herr_t h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, - H5FD_ros3_fapl_t *fapl_config_out); -H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values); + H5FD_ros3_fapl_ext_t *fapl_config_out); +H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_ext_t *fa, const char **values); #endif /* H5_HAVE_ROS3_VFD */ #ifdef H5_HAVE_LIBHDFS H5TOOLS_DLL herr_t h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 6b3ad0ad6ed..5ae379e6f8f 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -119,7 +119,6 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) /* Allocate space if necessary */ if (visited->nused == visited->nalloc) { visited->nalloc = MAX(1, visited->nalloc * 2); - ; visited->objs = (trav_addr_path_t *)realloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); } /* end if */ @@ -322,8 +321,7 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) /* Allocate space if necessary */ if (info->nused == info->nalloc) { info->nalloc = MAX(1, info->nalloc * 2); - ; - info->paths = (trav_path_t *)realloc(info->paths, info->nalloc * sizeof(trav_path_t)); + info->paths = (trav_path_t *)realloc(info->paths, info->nalloc * sizeof(trav_path_t)); } /* end if */ /* Append it */ @@ -956,7 +954,7 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) printf(" %-10s %s -> %s\n", "link", path, targbuf); free(targbuf); } - } /* end if */ + } else printf(" %-10s %s ->\n", "link", path); break; diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index d1da145c479..87c2ce9b26f 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -22,10 +22,6 @@ #define UTIL_TEST_DEBUG 0 -#ifndef __js_test__ - -#define __js_test__ 1L - /***************************************************************************** * * FILE-LOCAL TESTING MACROS @@ -59,7 +55,6 @@ * * JSVERIFY_EXP_ACT - ifdef flag, configures comparison order * FAIL_IF() - check condition - * FAIL_UNLESS() - check _not_ condition * JSVERIFY() - long-int equality check; prints reason/comparison * JSVERIFY_NOT() - long-int inequality check; prints * JSVERIFY_STR() - string equality check; prints @@ -123,31 +118,6 @@ H5_GCC_CLANG_DIAG_OFF("format") goto error; \ } -/*---------------------------------------------------------------------------- - * - * Macro: FAIL_UNLESS() - * - * Purpose: - * - * TEST_ERROR wrapper to reduce cognitive overhead from "negative tests", - * e.g., "a != b". - * - * Opposite of FAIL_IF; fails if the given condition is _not_ true. - * - * `FAIL_IF( 5 != my_op() )` - * is equivalent to - * `FAIL_UNLESS( 5 == my_op() )` - * However, `JSVERIFY(5, my_op(), "bad return")` may be even clearer. - * (see JSVERIFY) - * - *---------------------------------------------------------------------------- - */ -#define FAIL_UNLESS(condition) \ - if (!(condition)) { \ - JSFAILED_AT() \ - goto error; \ - } - /*---------------------------------------------------------------------------- * * Macro: JSERR_LONG() @@ -314,8 +284,6 @@ H5_GCC_CLANG_DIAG_OFF("format") #endif /* ifdef/else JSVERIFY_EXP_ACT */ -#endif /* __js_test__ */ - /* if > 0, be very verbose when performing tests */ #define H5TOOLS_UTILS_TEST_DEBUG 0 @@ -508,11 +476,11 @@ test_parse_tuple(void) success = parse_tuple(tc.in_str, tc.sep, &cpy, &count, &parsed); JSVERIFY(tc.exp_ret, success, "function returned incorrect value") - JSVERIFY(tc.exp_nelems, count, NULL) + JSVERIFY(tc.exp_nelems, count, (char *)NULL) if (success == SUCCEED) { FAIL_IF(parsed == NULL) for (elem_i = 0; elem_i < count; elem_i++) { - JSVERIFY_STR(tc.exp_elems[elem_i], parsed[elem_i], NULL) + JSVERIFY_STR(tc.exp_elems[elem_i], parsed[elem_i], (char *)NULL) } /* TEARDOWN */ assert(parsed != NULL); @@ -605,104 +573,109 @@ test_populate_ros3_fa(void) /* NULL values pointer yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, TRUE, "u", "v", "w"}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, TRUE, "u", "v", "w"}, "x"}; if (show_progress) { printf("NULL values pointer\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, NULL), "NULL values pointer yields \"default\" fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* all-empty values * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, TRUE, "u", "v", "w"}; - const char *values[] = {"", "", ""}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, TRUE, "u", "v", "w"}, "x"}; + const char *values[] = {"", "", "", ""}; if (show_progress) { printf("all empty values\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "empty values yields \"default\" fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* successfully set fapl with values * excess value is ignored */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "y", "z", "a"}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "y", "z", "a", "b"}; if (show_progress) { printf("successful full set\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "four values") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(TRUE, fa.authenticate, NULL) - JSVERIFY_STR("x", fa.aws_region, NULL) - JSVERIFY_STR("y", fa.secret_id, NULL) - JSVERIFY_STR("z", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(TRUE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("x", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("y", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("z", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("a", fa.token, (char *)NULL) } /* NULL region * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {NULL, "y", "z", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {NULL, "y", "z", ""}; if (show_progress) { printf("NULL region\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* empty region * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"", "y", "z", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"", "y", "z", ""}; if (show_progress) { printf("empty region; non-empty id, key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* region overflow * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"somewhere over the rainbow not too high " - "there is another rainbow bounding some darkened sky", - "y", "z"}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"somewhere over the rainbow not too high " + "there is another rainbow bounding some darkened sky", + "y", "z", ""}; if (show_progress) { printf("region overflow\n"); @@ -711,68 +684,71 @@ test_populate_ros3_fa(void) assert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* NULL id * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", NULL, "z", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", NULL, "z", ""}; if (show_progress) { printf("NULL id\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* empty id (non-empty region, key) * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "", "z", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "", "z", ""}; if (show_progress) { printf("empty id; non-empty region and key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* id overflow * partial set: region */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "Why is it necessary to solve the problem? " - "What benefits will you receive by solving the problem? " - "What is the unknown? " - "What is it you don't yet understand? " - "What is the information you have? " - "What isn't the problem? " - "Is the information insufficient, redundant, or contradictory? " - "Should you draw a diagram or figure of the problem? " - "What are the boundaries of the problem? " - "Can you separate the various parts of the problem?", - "z"}; + "What benefits will you receive by solving the problem? " + "What is the unknown? " + "What is it you don't yet understand? " + "What is the information you have? " + "What isn't the problem? " + "Is the information insufficient, redundant, or contradictory? " + "Should you draw a diagram or figure of the problem? " + "What are the boundaries of the problem? " + "Can you separate the various parts of the problem?", + "z", ""}; if (show_progress) { printf("id overflow\n"); @@ -781,105 +757,131 @@ test_populate_ros3_fa(void) assert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("x", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("x", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* NULL key * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "y", NULL, NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "y", NULL, ""}; if (show_progress) { printf("NULL key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) + } + + /* NULL token + * yields default fapl + */ + { + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "y", "z", NULL}; + + if (show_progress) { + printf("NULL key\n"); + } + + JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill token") + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* empty key (non-empty region, id) * yields authenticating fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "y", "", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "y", "", ""}; if (show_progress) { printf("empty key; non-empty region and id\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(TRUE, fa.authenticate, NULL) - JSVERIFY_STR("x", fa.aws_region, NULL) - JSVERIFY_STR("y", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(TRUE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("x", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("y", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* empty key, region (non-empty id) * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"", "y", "", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"", "y", "", ""}; if (show_progress) { printf("empty key and region; non-empty id\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* empty key, id (non-empty region) * yields default fapl */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "", "", NULL}; + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "", "", ""}; if (show_progress) { printf("empty key and id; non-empty region\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("", fa.aws_region, NULL) - JSVERIFY_STR("", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* key overflow * partial set: region, id */ { - H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"}; - const char *values[] = {"x", "y", + H5FD_ros3_fapl_ext_t fa = {{bad_version, FALSE, "a", "b", "c"}, "d"}; + const char *values[] = {"x", "y", "Why is it necessary to solve the problem? " - "What benefits will you receive by solving the problem? " - "What is the unknown? " - "What is it you don't yet understand? " - "What is the information you have? " - "What isn't the problem? " - "Is the information insufficient, redundant, or contradictory? " - "Should you draw a diagram or figure of the problem? " - "What are the boundaries of the problem? " - "Can you separate the various parts of the problem?"}; + "What benefits will you receive by solving the problem? " + "What is the unknown? " + "What is it you don't yet understand? " + "What is the information you have? " + "What isn't the problem? " + "Is the information insufficient, redundant, or contradictory? " + "Should you draw a diagram or figure of the problem? " + "What are the boundaries of the problem? " + "Can you separate the various parts of the problem?", + ""}; if (show_progress) { printf("key overflow\n"); @@ -888,22 +890,23 @@ test_populate_ros3_fa(void) assert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") - JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) - JSVERIFY(FALSE, fa.authenticate, NULL) - JSVERIFY_STR("x", fa.aws_region, NULL) - JSVERIFY_STR("y", fa.secret_id, NULL) - JSVERIFY_STR("", fa.secret_key, NULL) + JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) + JSVERIFY(FALSE, fa.fa.authenticate, (char *)NULL) + JSVERIFY_STR("x", fa.fa.aws_region, (char *)NULL) + JSVERIFY_STR("y", fa.fa.secret_id, (char *)NULL) + JSVERIFY_STR("", fa.fa.secret_key, (char *)NULL) + JSVERIFY_STR("", fa.token, (char *)NULL) } /* use case */ { - H5FD_ros3_fapl_t fa = {0, 0, "", "", ""}; - const char *values[] = {"us-east-2", "AKIAIMC3D3XLYXLN5COA", - "ugs5aVVnLFCErO/8uW14iWE3K5AgXMpsMlWneO/+"}; + H5FD_ros3_fapl_ext_t fa = {{0, 0, "", "", ""}, ""}; + const char *values[] = {"us-east-2", "AKIAIMC3D3XLYXLN5COA", + "ugs5aVVnLFCErO/8uW14iWE3K5AgXMpsMlWneO/+", ""}; JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "unable to set use case") - JSVERIFY(1, fa.version, "version check") - JSVERIFY(1, fa.authenticate, "should authenticate") + JSVERIFY(1, fa.fa.version, "version check") + JSVERIFY(1, fa.fa.authenticate, "should authenticate") } PASSED(); @@ -962,14 +965,7 @@ test_set_configured_fapl(void) hid_t fapl_id = H5I_INVALID_HID; other_fa_t wrong_fa = {0x432, 0xf82, 0x9093}; #ifdef H5_HAVE_ROS3_VFD - H5FD_ros3_fapl_t ros3_anon_fa = {1, FALSE, "", "", ""}; - H5FD_ros3_fapl_t ros3_auth_fa = { - 1, /* fapl version */ - TRUE, /* authenticate */ - "us-east-1", /* aws region */ - "12345677890abcdef", /* simulate access key ID */ - "oiwnerwe9u0234nJw0-aoj+dsf", /* simulate secret key */ - }; + H5FD_ros3_fapl_ext_t ros3_anon_fa = {{1, FALSE, "", "", ""}, ""}; #endif /* H5_HAVE_ROS3_VFD */ #ifdef H5_HAVE_LIBHDFS H5FD_hdfs_fapl_t hdfs_fa = { @@ -1114,7 +1110,17 @@ test_set_configured_fapl(void) vfd_info.type = VFD_BY_NAME; vfd_info.info = C.conf_fa; vfd_info.u.name = C.vfdname; - result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info); + + if (C.expected == 1) + result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info); + else { + H5E_BEGIN_TRY + { + result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info); + } + H5E_END_TRY; + } + if (C.expected == 0) { JSVERIFY(result, H5I_INVALID_HID, C.message) } diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index e633ce380f1..2b28df3c42a 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 @@ -479,7 +479,7 @@ main(int argc, char *argv[]) H5Fclose(fid_src); H5Fclose(fid_dst); } - H5E_END_TRY; + H5E_END_TRY leave(ret_value); } diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 51bc050e4e5..4854534a951 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -280,7 +280,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const usage(); h5diff_exit(EXIT_FAILURE); } - opts->delta = HDatof(H5_optarg); + opts->delta = atof(H5_optarg); /* do not check against default, the DBL_EPSILON is being replaced by user */ break; @@ -291,7 +291,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const usage(); h5diff_exit(EXIT_FAILURE); } - opts->percent = HDatof(H5_optarg); + opts->percent = atof(H5_optarg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, 0.0)) @@ -305,7 +305,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const usage(); h5diff_exit(EXIT_FAILURE); } - opts->count = HDstrtoull(H5_optarg, NULL, 0); + opts->count = strtoull(H5_optarg, NULL, 0); break; case 'N': @@ -390,7 +390,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const if (opts->vfd_info[0].u.name && !HDstrcmp(opts->vfd_info[0].u.name, "onion")) { if (opts->vfd_info[0].info) { errno = 0; - onion_fa_g_1.revision_num = HDstrtoull(opts->vfd_info[0].info, NULL, 10); + onion_fa_g_1.revision_num = strtoull(opts->vfd_info[0].info, NULL, 10); if (errno == ERANGE) { printf("Invalid onion revision specified for file 1\n"); usage(); @@ -407,7 +407,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const if (opts->vfd_info[1].u.name && !HDstrcmp(opts->vfd_info[1].u.name, "onion")) { if (opts->vfd_info[1].info) { errno = 0; - onion_fa_g_2.revision_num = HDstrtoull(opts->vfd_info[1].info, NULL, 10); + onion_fa_g_2.revision_num = strtoull(opts->vfd_info[1].info, NULL, 10); if (errno == ERANGE) { printf("Invalid onion revision specified for file 2\n"); usage(); @@ -544,7 +544,7 @@ check_p_input(const char *str) if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = HDatof(str); + x = atof(str); if (x < 0) return -1; @@ -571,7 +571,7 @@ check_d_input(const char *str) if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = HDatof(str); + x = atof(str); if (x < 0) return -1; @@ -640,6 +640,13 @@ usage(void) PRINTVALSTREAM(rawoutstream, " --vol-info-2 VOL-specific info to pass to the VOL connector used for\n"); PRINTVALSTREAM(rawoutstream, " opening the second HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " If none of the above options are used to " + "specify a VOL for a file, then\n"); + PRINTVALSTREAM( + rawoutstream, + " the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector,\n"); + PRINTVALSTREAM(rawoutstream, + " if that environment variable is unset) will be used\n"); PRINTVALSTREAM(rawoutstream, " --vfd-value-1 Value (ID) of the VFL driver to use for opening the\n"); PRINTVALSTREAM(rawoutstream, " first HDF5 file specified\n"); diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 884f7882223..efac3cb6447 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -143,7 +143,7 @@ ph5diff_worker(int nID) } /* enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY } /* Check for work */ else if (Status.MPI_TAG == MPI_TAG_ARGS) { diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 73309cd2ca8..1458354319a 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -32,12 +32,15 @@ static hbool_t get_onion_revision_count = FALSE; #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ -static H5FD_ros3_fapl_t ros3_fa_g = { - 1, /* Structure Version */ - FALSE, /* Authenticate? */ - "", /* AWS Region */ - "", /* Access Key ID */ - "", /* Secret Access Key */ +static H5FD_ros3_fapl_ext_t ros3_fa_g = { + { + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ + }, + "", /* Session/security token */ }; #endif /* H5_HAVE_ROS3_VFD */ @@ -219,6 +222,14 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); + PRINTVALSTREAM( + rawoutstream, + " If none of the above options are used to specify a VOL, then\n"); + PRINTVALSTREAM( + rawoutstream, + " the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector,\n"); + PRINTVALSTREAM(rawoutstream, + " if that environment variable is unset) will be used\n"); PRINTVALSTREAM(rawoutstream, " --vfd-value Value (ID) of the VFL driver to use for opening the\n"); PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); @@ -594,7 +605,7 @@ parse_mask_list(const char *h_list) ptr = h_list; while (*ptr) { /* scan for an offset which is an unsigned int */ - if (!HDisdigit(*ptr)) { + if (!isdigit(*ptr)) { error_msg("Bad mask list(%s)\n", h_list); return FAIL; } @@ -607,7 +618,7 @@ parse_mask_list(const char *h_list) } /* skip to end of integer */ - while (HDisdigit(*++ptr)) + while (isdigit(*++ptr)) ; /* Look for the common separator */ if (*ptr++ != ',') { @@ -616,7 +627,7 @@ parse_mask_list(const char *h_list) } /* scan for a length which is a positive int */ - if (!HDisdigit(*ptr)) { + if (!isdigit(*ptr)) { error_msg("Bad mask list(%s)\n", h_list); return FAIL; } @@ -633,7 +644,7 @@ parse_mask_list(const char *h_list) } /* skip to end of int */ - while (HDisdigit(*++ptr)) + while (isdigit(*++ptr)) ; /* store the offset,length pair */ @@ -1230,7 +1241,7 @@ parse_command_line(int argc, const char *const *argv) get_onion_revision_count = TRUE; else { errno = 0; - onion_fa_g.revision_num = HDstrtoull(vfd_info_g.info, NULL, 10); + onion_fa_g.revision_num = strtoull(vfd_info_g.info, NULL, 10); if (errno == ERANGE) { printf("Invalid onion revision specified\n"); goto error; diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index a69aeacdf80..da9093c555f 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -1649,7 +1649,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 H5Oclose(oid); H5Aclose(attr_id); } - H5E_END_TRY; + H5E_END_TRY dump_indent -= COL; } diff --git a/tools/src/h5dump/h5dump_defines.h b/tools/src/h5dump/h5dump_defines.h index bb4236df458..5f891782934 100644 --- a/tools/src/h5dump/h5dump_defines.h +++ b/tools/src/h5dump/h5dump_defines.h @@ -28,7 +28,7 @@ else { \ PRINTSTREAM(rawoutstream, "%s %s", (obj), (begin)); \ } \ - } while (0); + } while (0) #define end_obj(obj, end) \ do { \ @@ -39,7 +39,7 @@ } \ if (HDstrlen(obj)) \ PRINTSTREAM(rawoutstream, "%s", obj); \ - } while (0); + } while (0) /* 3 private values: can't be set, but can be read. Note: these are defined in H5Zprivate, they are diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 95c99f67774..cb279e37342 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -3069,7 +3069,7 @@ xml_print_refs(hid_t did, int source) H5Tclose(type); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -3238,7 +3238,7 @@ xml_print_strs(hid_t did, int source) H5Tclose(type); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 0806840cd80..96aab9b1263 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -158,7 +158,6 @@ parse_command_line(int argc, const char *const *argv) error: return -1; - ; } /* parse_command_line() */ /*------------------------------------------------------------------------- @@ -329,7 +328,7 @@ convert(hid_t fid, const char *dname) H5Pclose(dcpl); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* convert() */ diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 3dba23a6284..2a89bccd773 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -212,7 +212,7 @@ main(int argc, char *argv[]) break; case 14: /* read data size */ - if (getInputSize(in, (int)HDstrtol(argv[i], NULL, BASE_10)) == -1) { + if (getInputSize(in, (int)strtol(argv[i], NULL, BASE_10)) == -1) { (void)fprintf(stderr, err8, argv[i]); goto err; } @@ -457,7 +457,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) error: if (strm) - HDfclose(strm); + fclose(strm); return retval; } @@ -500,7 +500,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) { + if (fread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -531,7 +531,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { + if (fread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -567,7 +567,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -598,13 +598,13 @@ readIntegerData(FILE *strm, struct Input *in) (void)fprintf(stderr, "%s", err1); return (-1); } - *in64 = (H5DT_INT64)HDstrtoll(buffer, NULL, 10); + *in64 = (H5DT_INT64)strtoll(buffer, NULL, 10); } break; case 4: /* IN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -671,7 +671,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) { + if (fread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -698,7 +698,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { + if (fread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -734,7 +734,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -765,13 +765,13 @@ readUIntegerData(FILE *strm, struct Input *in) (void)fprintf(stderr, "%s", err1); return (-1); } - *in64 = (H5DT_UINT64)HDstrtoll(buffer, NULL, 10); + *in64 = (H5DT_UINT64)strtoll(buffer, NULL, 10); } break; case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -851,7 +851,7 @@ readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ bfp32 = (uint32_t *)in->data; for (i = 0; i < len; i++, bfp32++) { - if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { + if (fread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -903,7 +903,7 @@ readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ bfp64 = (uint64_t *)in->data; for (i = 0; i < len; i++, bfp64++) { - if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { + if (fread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1015,7 +1015,7 @@ processStrData(FILE *strm, struct Input *in, hid_t file_id) /*enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY if ((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out; @@ -1141,7 +1141,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) /*enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY #ifdef H5DEBUGIMPORT printf("processStrHDFData DATATYPE STRING groups created\n"); #endif @@ -1243,7 +1243,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) H5Sclose(mspace_id); H5Tclose(type_id); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -1564,7 +1564,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif if (HDstrcmp("H5T_VARIABLE;", temp) != 0) { char *more = temp; - ival = (int)HDstrtol(more, &more, 10); + ival = (int)strtol(more, &more, 10); if (getInputSize(in, ival) == -1) { (void)fprintf(stderr, err5b, infile); goto error; @@ -1663,7 +1663,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif while (get_next_dim) { char *more = temp; - temp_dims[icount] = HDstrtoull(more, &more, 10); + temp_dims[icount] = strtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; @@ -1752,7 +1752,7 @@ processConfigurationFile(char *infile, struct Input *in) } else { char *more = temp; - in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10); + in->maxsizeOfDimension[i] = strtoull(more, &more, 10); } if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ (void)fprintf(stderr, err16c, infile); @@ -1839,7 +1839,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif while (get_next_dim) { char *more = temp; - in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10); + in->sizeOfChunk[icount] = strtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; @@ -2024,7 +2024,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif while (get_next_dim) { char *more = temp; - temp_dims[icount] = HDstrtoull(more, &more, 10); + temp_dims[icount] = strtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; @@ -2080,7 +2080,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif while (get_next_dim) { char *more = temp; - temp_dims[icount] = HDstrtoull(more, &more, 10); + temp_dims[icount] = strtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; @@ -2436,7 +2436,7 @@ processConfigurationFile(char *infile, struct Input *in) error: if (strm) - HDfclose(strm); + fclose(strm); return retval; } @@ -2567,13 +2567,13 @@ parseDimensions(struct Input *in, char *strm) i = 0; HDstrncpy(temp, strm, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; - in->sizeOfDimension[i++] = HDstrtoull(HDstrtok(temp, delimiter), NULL, BASE_10); + in->sizeOfDimension[i++] = strtoull(HDstrtok(temp, delimiter), NULL, BASE_10); while (1) { token = HDstrtok(NULL, delimiter); if (token == NULL) break; - in->sizeOfDimension[i++] = HDstrtoull(token, NULL, BASE_10); + in->sizeOfDimension[i++] = strtoull(token, NULL, BASE_10); } return (0); } @@ -4623,7 +4623,7 @@ process(struct Options *opt) } } } - H5E_END_TRY; + H5E_END_TRY for (k = 0; k < opt->fcount; k++) { in = &(opt->infiles[k].in); @@ -4671,7 +4671,7 @@ process(struct Options *opt) /*enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY /*create data type */ intype = createInputDataType(in); @@ -4701,7 +4701,7 @@ process(struct Options *opt) H5Fclose(file_id); return (-1); } - HDfclose(extfile); + fclose(extfile); H5Pset_external(proplist, in->externFilename, (off_t)0, numOfElements * (hsize_t)in->inputSize / 8); } @@ -4727,7 +4727,7 @@ process(struct Options *opt) /*enable error reporting */ } - H5E_END_TRY; + H5E_END_TRY /* write dataset */ if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) { diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index 5d293174177..46c366caa55 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 4043c738db6..6f318a43823 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/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index d606e949726..d752014b011 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -108,7 +108,6 @@ parse_command_line(int argc, const char *const *argv) if (input_file) h5tools_set_input_file(input_file, 1); break; - ; case 'u': ub_file = HDstrdup(H5_optarg); @@ -335,12 +334,12 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) HDfseek(infid, from, SEEK_SET); /* Read data to buffer */ - bytes_read = HDfread(buf, (size_t)1, bytes_in, infid); - if (0 == bytes_read && HDferror(infid)) { + bytes_read = fread(buf, (size_t)1, bytes_in, infid); + if (0 == bytes_read && ferror(infid)) { ret_value = -1; goto done; } /* end if */ - if (0 == bytes_read && HDfeof(infid)) { + if (0 == bytes_read && feof(infid)) { goto done; } /* end if */ @@ -353,8 +352,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much) to += (off_t)bytes_read; /* Write nchars bytes to output file */ - bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); - if (bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ + bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid); + if (bytes_wrote != bytes_read || (0 == bytes_wrote && ferror(ofid))) { /* error */ ret_value = -1; goto done; } /* end if */ diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 217d8b5cdf3..84567c834f5 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -141,11 +141,11 @@ static struct dispatch_t { } dispatch_g[H5O_TYPE_NTYPES]; #define DISPATCH(TYPE, NAME, LIST1, LIST2) \ - { \ + do { \ dispatch_g[TYPE].name = (NAME); \ dispatch_g[TYPE].list1 = (LIST1); \ dispatch_g[TYPE].list2 = (LIST2); \ - } + } while (0) static void print_type(h5tools_str_t *buffer, hid_t type, int ind); static hbool_t print_int_type(h5tools_str_t *buffer, hid_t type, int ind); @@ -234,6 +234,11 @@ usage(void) PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, + " If none of the above options are used to specify a VOL, then\n"); + PRINTVALSTREAM(rawoutstream, + " the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector,\n"); + PRINTVALSTREAM(rawoutstream, " if that environment variable is unset) will be used\n"); PRINTVALSTREAM(rawoutstream, " --vfd-value Value (ID) of the VFL driver to use for opening the\n"); PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, " --vfd-name Name of the VFL driver to use for opening the\n"); @@ -2525,7 +2530,7 @@ get_width(void) /* Try to get it from the COLUMNS environment variable first since it's * value is sometimes wrong. */ if ((s = HDgetenv("COLUMNS")) && *s && isdigit((int)*s)) - width = (int)HDstrtol(s, NULL, 0); + width = (int)strtol(s, NULL, 0); #if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG) { @@ -2651,12 +2656,15 @@ main(int argc, char *argv[]) #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ - H5FD_ros3_fapl_t ros3_fa = { - 1, /* Structure Version */ - FALSE, /* Authenticate? */ - "", /* AWS Region */ - "", /* Access Key ID */ - "", /* Secret Access Key */ + H5FD_ros3_fapl_ext_t ros3_fa = { + { + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ + }, + "", /* Session/security token */ }; #endif /* H5_HAVE_ROS3_VFD */ @@ -2774,7 +2782,7 @@ main(int argc, char *argv[]) vfd_info.info = (const void *)(argv[argno] + 11); } else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) { - width_g = (int)HDstrtol(argv[argno] + 8, &rest, 0); + width_g = (int)strtol(argv[argno] + 8, &rest, 0); if (0 == width_g) no_line_wrap_g = TRUE; @@ -2791,7 +2799,7 @@ main(int argc, char *argv[]) else { s = argv[++argno]; } - width_g = (int)HDstrtol(s, &rest, 0); + width_g = (int)strtol(s, &rest, 0); if (width_g <= 0 || *rest) { usage(); leave(EXIT_FAILURE); @@ -2818,7 +2826,7 @@ main(int argc, char *argv[]) else { s = argv[++argno]; } - width_g = (int)HDstrtol(s, &rest, 0); + width_g = (int)strtol(s, &rest, 0); if (0 == width_g) { no_line_wrap_g = TRUE; diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index d670002a99c..37e6aeb9b1d 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -1331,10 +1331,10 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { + if (HDstrlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) @@ -1488,7 +1488,7 @@ parse_size_directive(const char *size) off_t s; char *endptr; - s = HDstrtol(size, &endptr, 10); + s = strtol(size, &endptr, 10); if (endptr && *endptr) { while (*endptr != '\0' && (*endptr == ' ' || *endptr == '\t')) diff --git a/tools/src/h5perf/pio_perf.h b/tools/src/h5perf/pio_perf.h index 05f8d5b0afd..54fbb526f0a 100644 --- a/tools/src/h5perf/pio_perf.h +++ b/tools/src/h5perf/pio_perf.h @@ -86,10 +86,10 @@ extern int pio_debug_level; /* The debug level: * 4 - Even More Debugging (timer stuff) */ -#define HDprint_rank(f) /* print rank in MPI_COMM_WORLD */ HDfprintf(f, "%d: ", comm_world_rank_g); -#define HDprint_size(f) /* print size of MPI_COMM_WORLD */ HDfprintf(f, "%d", comm_world_nprocs_g); +#define HDprint_rank(f) /* print rank in MPI_COMM_WORLD */ fprintf(f, "%d: ", comm_world_rank_g); +#define HDprint_size(f) /* print size of MPI_COMM_WORLD */ fprintf(f, "%d", comm_world_nprocs_g); #define HDprint_rank_size(f) /* print rank/size of MPI_COMM_WORLD */ \ - HDfprintf(f, "%d/%d: ", comm_world_rank_g, comm_world_nprocs_g); + fprintf(f, "%d/%d: ", comm_world_rank_g, comm_world_nprocs_g); #ifdef __cplusplus extern "C" { diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index a7f07ee24e7..849238f382c 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -1176,7 +1176,7 @@ set_vfd(parameters *param) /* Family of files, each 1MB and using the default driver */ /* if ((val=HDstrtok(NULL, " \t\n\r"))) - fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); */ + fam_size = (hsize_t)(strtod(val, NULL) * 1024*1024); */ if (H5Pset_fapl_family(my_fapl, fam_size, H5P_DEFAULT) < 0) return -1; } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index ed7b2096408..5ffad71a39a 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -852,7 +852,7 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; if (!HDstrcasecmp(buf, "hdf5")) { @@ -892,7 +892,7 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->chk_size[j] = parse_size_directive(buf); @@ -918,14 +918,14 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { + if (HDstrlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) - if (!HDisdigit(buf[j])) { + if (!isdigit(buf[j])) { fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); exit(EXIT_FAILURE); } @@ -975,7 +975,7 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->dset_size[j] = parse_size_directive(buf); @@ -1044,7 +1044,7 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->buf_size[j] = parse_size_directive(buf); @@ -1071,7 +1071,7 @@ parse_command_line(int argc, const char *const *argv) memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->order[j] = (int)parse_size_directive(buf); @@ -1164,7 +1164,7 @@ parse_size_directive(const char *size) hsize_t s; char *endptr; - s = HDstrtoull(size, &endptr, 10); + s = strtoull(size, &endptr, 10); if (endptr && *endptr) { while (*endptr != '\0' && (*endptr == ' ' || *endptr == '\t')) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 0ced9808166..7849e29b784 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -575,7 +575,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ H5Tclose(ftype_id); H5Aclose(attr_id); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } /* end copy_attr() */ @@ -884,7 +884,7 @@ check_objects(const char *fname, pack_opt_t *options) H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (travt) trav_table_free(travt); return ret_value; diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 172ba26ee87..0f270c56bd3 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -390,7 +390,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) H5Fclose(fidout); H5Fclose(fidin); } - H5E_END_TRY; + H5E_END_TRY } if (travt) trav_table_free(travt); @@ -1455,7 +1455,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti { named_datatype_free(&named_dt_head, 1); } - H5E_END_TRY; + H5E_END_TRY } /* free link info path */ @@ -1480,7 +1480,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5Tclose(type_in); H5Tclose(type_out); } - H5E_END_TRY; + H5E_END_TRY /* free */ if (buf != NULL) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0621c7a4b86..85bc15d7f7e 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 @@ -415,26 +415,26 @@ read_info(const char *filename, pack_opt_t *options) i = 0; c = '0'; while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } - if (HDfeof(fp)) + if (feof(fp)) break; } c = '0'; /* go until end */ while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; goto done; } comp_info[i++] = c; - if (HDfeof(fp)) + if (feof(fp)) break; if (c == 10 /*eol*/) break; @@ -461,7 +461,7 @@ read_info(const char *filename, pack_opt_t *options) done: if (fp) - HDfclose(fp); + fclose(fp); return ret_value; } @@ -597,7 +597,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'm': - options->min_comp = HDstrtoull(H5_optarg, NULL, 0); + options->min_comp = strtoull(H5_optarg, NULL, 0); if ((int)options->min_comp <= 0) { error_msg("invalid minimum compress size <%s>\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); @@ -699,19 +699,19 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'b': - options->ublock_size = (hsize_t)HDatol(H5_optarg); + options->ublock_size = (hsize_t)atol(H5_optarg); break; case 'M': - options->meta_block_size = (hsize_t)HDatol(H5_optarg); + options->meta_block_size = (hsize_t)atol(H5_optarg); break; case 't': - options->threshold = (hsize_t)HDatol(H5_optarg); + options->threshold = (hsize_t)atol(H5_optarg); break; case 'a': - options->alignment = HDstrtoull(H5_optarg, NULL, 0); + options->alignment = strtoull(H5_optarg, NULL, 0); if (options->alignment < 1) { error_msg("invalid alignment size `%s`\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); @@ -751,14 +751,14 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'T': - options->fs_threshold = HDatol(H5_optarg); + options->fs_threshold = atol(H5_optarg); if (options->fs_threshold == 0) /* To distinguish the "specified" zero value */ options->fs_threshold = -1; break; case 'G': - options->fs_pagesize = HDstrtoll(H5_optarg, NULL, 0); + options->fs_pagesize = strtoll(H5_optarg, NULL, 0); if (options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ options->fs_pagesize = -1; @@ -889,7 +889,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) if (in_vfd_info.u.name && !HDstrcmp(in_vfd_info.u.name, "onion")) { if (in_vfd_info.info) { errno = 0; - onion_fa_in_g.revision_num = HDstrtoull(in_vfd_info.info, NULL, 10); + onion_fa_in_g.revision_num = strtoull(in_vfd_info.info, NULL, 10); if (errno == ERANGE) { printf("Invalid onion revision specified for the input file\n"); usage(h5tools_getprogname()); diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index f6c3d71eced..f88ba6f6545 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -132,7 +132,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t u++; /* skip ',' */ } c = str[u]; - if (!HDisdigit(c) && l == -1) { + if (!isdigit(c) && l == -1) { if (obj_list) free(obj_list); error_msg("compression parameter not digit in <%s>\n", str); @@ -182,7 +182,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t u++; /* skip ',' */ } c = str[u]; - if (!HDisdigit(c) && l == -1) { + if (!isdigit(c) && l == -1) { if (obj_list) free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); @@ -228,27 +228,27 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t l = 0; } else if (f == -1) { - filt->filt_flag = (unsigned)HDstrtoul(stype, NULL, 0); + filt->filt_flag = (unsigned)strtoul(stype, NULL, 0); f = 0; } else if (p == -1) { - filt->cd_nelmts = HDstrtoull(stype, NULL, 0); + filt->cd_nelmts = strtoull(stype, NULL, 0); p = 0; } else { - filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0); + filt->cd_values[j++] = (unsigned)strtoul(stype, NULL, 0); } q = 0; u++; /* skip ',' */ } c = str[u]; - if (!HDisdigit(c) && l == -1) { + if (!isdigit(c) && l == -1) { if (obj_list) free(obj_list); error_msg("filter number parameter is not a digit in <%s>\n", str); exit(EXIT_FAILURE); } - else if (!HDisdigit(c) && f == -1) { + else if (!isdigit(c) && f == -1) { if (obj_list) free(obj_list); error_msg("filter flag parameter is not a digit in <%s>\n", str); @@ -267,7 +267,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t /* here we could have 1 or 2 digits */ for (m = 0, u = i + 1; u < len; u++, m++) { c = str[u]; - if (!HDisdigit(c)) { + if (!isdigit(c)) { if (obj_list) free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); @@ -279,7 +279,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t stype[m] = '\0'; } /*if */ - filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0); + filt->cd_values[j++] = (unsigned)strtoul(stype, NULL, 0); if (filt->cd_nelmts == 0) j = 0; i += m; /* jump */ @@ -457,7 +457,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t break; default: break; - }; + } return obj_list; } @@ -581,7 +581,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about sdim[k] = c; k++; /*increment sdim index */ - if (!HDisdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') { + if (!isdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') { if (obj_list) free(obj_list); error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim, str); @@ -592,7 +592,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about if (c == 'x') { sdim[k - 1] = '\0'; k = 0; - pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); + pack->chunk.chunk_lengths[c_index] = strtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) free(obj_list); @@ -608,7 +608,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->chunk.rank = -2; } else { - pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); + pack->chunk.chunk_lengths[c_index] = strtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) free(obj_list); diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 171b335faad..ce4a5cf0e0d 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -156,7 +156,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); @@ -164,7 +164,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (refbuf == NULL) { printf("cannot allocate memory\n"); H5TOOLS_GOTO_ERROR((-1), "calloc failed"); - } /* end if */ + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { @@ -172,7 +172,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5Rdereference2(dset_in, H5P_DEFAULT, H5R_OBJECT, &buf[u])) < 0) continue; } - H5E_END_TRY; + H5E_END_TRY /* get the name. a valid name could only occur * in the second traversal of the file @@ -238,7 +238,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); @@ -251,7 +251,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (refbuf == NULL) { printf("cannot allocate memory\n"); H5TOOLS_GOTO_ERROR((-1), "calloc failed"); - } /* end if */ + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY @@ -260,7 +260,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti &buf[u])) < 0) continue; } - H5E_END_TRY; + H5E_END_TRY /* get the name. a valid name could only occur * in the second traversal of the file @@ -408,7 +408,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5Tclose(type_in); named_datatype_free(&named_dt_head, 1); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } @@ -602,7 +602,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -610,7 +610,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (refbuf == NULL) { printf("cannot allocate memory\n"); H5TOOLS_GOTO_ERROR((-1), "calloc failed"); - } /* end if */ + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, @@ -624,7 +624,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -636,7 +636,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (refbuf == NULL) { printf("cannot allocate memory\n"); H5TOOLS_GOTO_ERROR((-1), "calloc failed"); - } /* end if */ + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, @@ -652,7 +652,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -694,7 +694,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (buf == NULL) { printf("cannot read into memory\n"); H5TOOLS_GOTO_ERROR((-1), "malloc failed"); - } /* end if */ + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -794,7 +794,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / H5Aclose(attr_id); H5Aclose(attr_out); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } @@ -875,7 +875,7 @@ update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, H5Sclose(space_id); H5Oclose(ref_obj_id); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index bccf0347661..572aa489144 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -286,7 +286,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if (travt) trav_table_free(travt); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } /* h5repack_verify() */ @@ -475,7 +475,7 @@ h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t if (trav) trav_table_free(trav); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index a7d93420744..5cfa61d182f 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 { @@ -119,12 +119,15 @@ static const char *drivername = NULL; #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ -static H5FD_ros3_fapl_t ros3_fa = { - 1, /* Structure Version */ - FALSE, /* Authenticate? */ - "", /* AWS Region */ - "", /* Access Key ID */ - "", /* Secret Access Key */ +static H5FD_ros3_fapl_ext_t ros3_fa = { + { + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ + }, + "", /* Session/security token */ }; #endif /* H5_HAVE_ROS3_VFD */ diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index a8ba2a5356b..fa9324494f8 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -307,7 +307,7 @@ main(int argc, char *argv[]) /* Primary data structure to dump */ if (argc > 2) - addr = (haddr_t)HDstrtoll(argv[2], NULL, 0); + addr = (haddr_t)strtoll(argv[2], NULL, 0); /* Extra arguments for primary data structure */ memset(extra, 0, sizeof(extra)); @@ -323,7 +323,7 @@ main(int argc, char *argv[]) } /* end if */ for (u = 0; u < (size_t)extra_count; u++) - extra[u] = (haddr_t)HDstrtoll(argv[u + 3], NULL, 0); + extra[u] = (haddr_t)strtoll(argv[u + 3], NULL, 0); } /* end if */ /* diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index 3684365e2e5..f996d8dc0de 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -57,7 +57,7 @@ main(int argc, char *argv[]) /* Only uses the environment variable at this time */ ret = (int)H5Fdelete(name, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0 && !quiet) fprintf(stderr, "Unable to delete storage at: %s\n", name); diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index b2c9000cfcb..31deb8bf514 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 @@ -101,6 +101,13 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, + " If none of the above options are used to specify a VOL, then\n"); + PRINTVALSTREAM( + rawoutstream, + " the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector,\n"); + PRINTVALSTREAM(rawoutstream, + " if that environment variable is unset) will be used\n"); PRINTVALSTREAM(rawoutstream, " --vfd-value Value (ID) of the VFL driver to use for opening the\n"); PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 5256c5e2438..e7bf0559b5a 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -89,14 +89,14 @@ get_size(const char *progname, int *argno, int argc, char *argv[]) char *suffix = NULL; if (isdigit((int)(argv[*argno][2]))) { - retval = HDstrtol(argv[*argno] + 2, &suffix, 10); + retval = strtol(argv[*argno] + 2, &suffix, 10); (*argno)++; } else if (argv[*argno][2] || *argno + 1 >= argc) { usage(progname); } else { - retval = HDstrtol(argv[*argno + 1], &suffix, 0); + retval = strtol(argv[*argno + 1], &suffix, 0); if (suffix == argv[*argno + 1]) usage(progname); *argno += 2; @@ -472,7 +472,7 @@ main(int argc, char *argv[]) { file = H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file >= 0) { if (H5Fclose(file) < 0) { diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 0661b5a7c25..37c2cc3797a 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -538,7 +538,7 @@ test_onion_1d_dset(const char *fname) H5Sclose(space); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_onion_1d_dset */ @@ -972,7 +972,7 @@ test_onion_dset_extension(const char *fname) H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_onion_dset_extension */ @@ -5656,7 +5656,7 @@ test_objs_nocomparables(const char *fname1, const char *fname2) H5Tclose(tid1); H5Tclose(tid2); } - H5E_END_TRY; + H5E_END_TRY } static hid_t @@ -8649,7 +8649,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -8703,7 +8703,7 @@ test_double_epsilon(const char *fname1, const char *fname2) H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY } /*------------------------------------------------------------------------- @@ -8787,7 +8787,7 @@ write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, v H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end write_dset() */ diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index fe3474c076c..dbd5418e623 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -37,6 +37,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index eaf9c15ac19..46a1c45a109 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -37,6 +37,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index aa0697aa6fd..e930dbe50b4 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index 87d6b012926..02b80ebba54 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index a44d94abc83..4cccecec36c 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index 5dc9cd3716c..3641164ca39 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index d7998b58ba6..05b952c875b 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index badfddd6f37..4d3e9455011 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 6ddd3da1bff..fd992ef71cb 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index 083632a9d84..cc9578f84dc 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -38,6 +38,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] HDF5 file specified --vol-info-2 VOL-specific info to pass to the VOL connector used for opening the second HDF5 file specified + If none of the above options are used to specify a VOL for a file, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value-1 Value (ID) of the VFL driver to use for opening the first HDF5 file specified --vfd-name-1 Name of the VFL driver to use for opening the first diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 52e2d3f77c6..aad1b8dcb93 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -2675,7 +2675,7 @@ gent_bitfields(void) H5Sclose(space); H5Dclose(dset); } - H5E_END_TRY; + H5E_END_TRY } static void @@ -5374,7 +5374,7 @@ make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t tid, hid_t dcpl, void { H5Dclose(dsid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -6545,7 +6545,7 @@ gent_bigdims(void) H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY } /*------------------------------------------------------------------------- @@ -6730,7 +6730,7 @@ gent_group_creation_order(void) H5Pclose(fcpl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY } /*------------------------------------------------------------------------- @@ -6989,7 +6989,7 @@ gent_attr_creation_order(void) H5Pclose(tcpl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY } /*------------------------------------------------------------------------- @@ -11325,7 +11325,7 @@ gent_err_attr_dspace(void) H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY } /* gen_err_attr_dspace() */ /* Structure to collect the onion filepaths in one place. */ @@ -11551,7 +11551,7 @@ gent_onion_1d_dset(void) H5Sclose(space); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* gent_onion_1d_dset */ @@ -11988,7 +11988,7 @@ gent_onion_dset_extension(void) H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* gent_onion_dset_extension */ diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index 56287cfef89..5b8bfce5993 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" @@ -293,7 +293,7 @@ gen_non(const char *fname) H5Fclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY } /* gen_non() */ @@ -373,7 +373,7 @@ gen_edge(const char *fname) H5Fclose(fid); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY } /* gen_edge() */ @@ -518,7 +518,7 @@ gen_err_level(const char *fname) H5Pclose(fapl); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY } /* gen_err_level() */ @@ -774,7 +774,7 @@ gen_ext(const char *fname, unsigned new_format, unsigned what) H5Pclose(fapl); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY } /* end gen_ext() */ diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 1919e5b3dea..003c34372c5 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -167,7 +167,7 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 @@ -182,7 +182,7 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5 @@ -197,7 +197,7 @@ main(void) (void)fprintf(sp, "\n"); } } - (void)HDfclose(sp); + (void)fclose(sp); #endif /*------------------------------------------------------------------------- @@ -209,11 +209,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp); + (void)fwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binin32.conf", "w"); (void)fprintf(sp, "PATH /int/bin/32-bit\n"); @@ -226,7 +226,7 @@ main(void) (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 @@ -237,11 +237,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp); + (void)fwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binuin32.conf", "w"); (void)fprintf(sp, "PATH /int/buin/32-bit\n"); @@ -253,7 +253,7 @@ main(void) (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 @@ -264,11 +264,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp); + (void)fwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binin16.conf", "w"); (void)fprintf(sp, "PATH /int/bin/16-bit\n"); @@ -282,7 +282,7 @@ main(void) (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 @@ -292,11 +292,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp); + (void)fwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binuin16.conf", "w"); (void)fprintf(sp, "PATH /int/buin/16-bit\n"); @@ -310,7 +310,7 @@ main(void) (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 @@ -321,11 +321,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp); + (void)fwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binin8.conf", "w"); (void)fprintf(sp, "PATH /int/bin/8-bit\n"); @@ -342,7 +342,7 @@ main(void) (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); (void)fprintf(sp, "COMPRESSION-PARAM 3\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); #endif /* UNICOS */ @@ -359,11 +359,11 @@ main(void) for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void)HDfwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp); + (void)fwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp); } } } - (void)HDfclose(sp); + (void)fclose(sp); sp = fopen("binfp64.conf", "w"); (void)fprintf(sp, "PATH /fp/bin/64-bit\n"); @@ -378,7 +378,7 @@ main(void) (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); (void)fprintf(sp, "COMPRESSION-PARAM 8\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 @@ -392,10 +392,10 @@ main(void) sp = fopen("binin8w.bin", OPEN_FLAGS); for (i = 0; i < 4; i++) { char c = bin8w[i]; - if (HDfwrite(&c, sizeof(char), 1, sp) != 1) + if (fwrite(&c, sizeof(char), 1, sp) != 1) printf("error writing file\n"); } - HDfclose(sp); + fclose(sp); sp = fopen("binin8w.conf", "w"); (void)fprintf(sp, "INPUT-CLASS IN\n"); @@ -408,7 +408,7 @@ main(void) (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); (void)fprintf(sp, "DIMENSION-SIZES 4\n"); (void)fprintf(sp, "\n"); - (void)HDfclose(sp); + (void)fclose(sp); } return (EXIT_SUCCESS); } diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 96ee5cd93ea..b90ddeb62f6 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/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index 3bb332c130d..d3b7388f1b8 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -353,7 +353,7 @@ gent_ub(const char *filename, size_t ub_size, size_t ub_fill) H5Sclose(space); H5Pclose(create_plist); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c index 739dbe070df..0fc3c42516f 100644 --- a/tools/test/h5repack/dynlib_rpk.c +++ b/tools/test/h5repack/dynlib_rpk.c @@ -23,7 +23,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 5cd6fe38350..00a7ae2c830 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -17,10 +17,10 @@ #include "h5tools_utils.h" #define GOERROR \ - { \ + do { \ H5_FAILED(); \ goto error; \ - } + } while (0) /* fill value test */ #define FNAME0 "h5repack_fill.h5" @@ -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" @@ -2303,7 +2303,7 @@ make_all_objects(hid_t loc_id) H5Tclose(tid); H5Pclose(gcplid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2373,7 +2373,7 @@ make_attributes(hid_t loc_id) H5Gclose(rid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2441,7 +2441,7 @@ make_hlinks(hid_t loc_id) H5Gclose(g2id); H5Gclose(g3id); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2515,7 +2515,7 @@ make_szip(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2600,7 +2600,7 @@ make_deflate(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2670,7 +2670,7 @@ make_shuffle(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2743,7 +2743,7 @@ make_fletcher32(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2851,7 +2851,7 @@ make_nbit(hid_t loc_id) H5Sclose(sid); H5Dclose(dsid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2953,7 +2953,7 @@ make_scaleoffset(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3137,7 +3137,7 @@ make_all_filters(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3235,7 +3235,7 @@ make_early(void) H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3331,7 +3331,7 @@ make_layout(hid_t loc_id) H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3404,7 +3404,7 @@ make_layout2(hid_t loc_id) H5Sclose(s_sid); } - H5E_END_TRY; + H5E_END_TRY free(s_buf); @@ -3547,7 +3547,7 @@ make_layout3(hid_t loc_id) H5Pclose(dcpl2); H5Pclose(dcpl3); } - H5E_END_TRY; + H5E_END_TRY free(buf1); free(buf2); @@ -3604,7 +3604,7 @@ make_fill(hid_t loc_id) H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3686,7 +3686,7 @@ make_big(hid_t loc_id) H5Sclose(m_sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3740,7 +3740,7 @@ make_external(hid_t loc_id) H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3800,7 +3800,7 @@ make_userblock(void) H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (fd >= 0) HDclose(fd); @@ -3870,7 +3870,7 @@ verify_userblock(const char *filename) H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (fd >= 0) HDclose(fd); @@ -4095,9 +4095,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; @@ -4319,9 +4321,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; @@ -4527,9 +4531,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; @@ -4636,7 +4642,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da H5Dclose(did); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -4745,7 +4751,7 @@ make_dset_reg_ref(hid_t loc_id) H5Dclose(did1); H5Dclose(did2); } - H5E_END_TRY; + H5E_END_TRY return retval; } @@ -4982,9 +4988,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; @@ -5285,9 +5293,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; @@ -5729,9 +5739,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; @@ -5880,7 +5892,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da H5Sclose(sid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -5929,7 +5941,7 @@ make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t dcpl, void *buf) { H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -5987,7 +5999,7 @@ write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t t H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -6024,7 +6036,7 @@ make_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, hid_t ti H5Aclose(aid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -6150,7 +6162,7 @@ make_named_dtype(hid_t loc_id) H5Dclose(did); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end make_named_dtype() */ diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index acd3a033d65..44428feb1f7 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -143,7 +143,7 @@ gen_newgrat_file(const char *fname) H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_newgrat_file() */ @@ -348,7 +348,7 @@ gen_threshold_file(const char *fname) H5Sclose(sid4); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -453,7 +453,7 @@ gen_idx_file(const char *fname) H5Dclose(did2); #endif } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -575,7 +575,7 @@ gen_err_refcount(const char *fname) H5Aclose(aid2); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (fd >= 0) HDclose(fd); diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 0b71b232fbe..5cb7aa217df 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 */ @@ -136,7 +136,7 @@ gen_cache_image_file(const char *fname) H5Pclose(fapl); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -309,7 +309,7 @@ gen_enhance_files(hbool_t user) H5Fclose(fid); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* gen_enhance_files() */ diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c index 5951fd2b8f6..3857ee29fee 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); @@ -77,7 +77,7 @@ test_family_h5repart_opens(void) H5Pclose(fapl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -116,7 +116,7 @@ test_single_h5repart_opens(void) { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index f8fe0762840..805b30ba1a8 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -66,7 +66,7 @@ main(void) { (void)H5Ldelete(fil, setname, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY cs6 = H5Tcopy(H5T_C_S1); H5Tset_size(cs6, sizeof(string5)); diff --git a/tools/test/misc/testfiles/h5mkgrp_help.txt b/tools/test/misc/testfiles/h5mkgrp_help.txt index 5d81b347ae4..d01fbeecf7c 100644 --- a/tools/test/misc/testfiles/h5mkgrp_help.txt +++ b/tools/test/misc/testfiles/h5mkgrp_help.txt @@ -11,6 +11,9 @@ usage: h5mkgrp [OPTIONS] FILE GROUP... HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index da09639d641..665c857b9d8 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -72,7 +72,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 289d7c0c96c..3d258ea657d 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 */ @@ -144,7 +144,7 @@ create_dset1(hid_t file) H5Pclose(dcpl); H5Sclose(dataspace); } - H5E_END_TRY; + H5E_END_TRY free(data); return 1; @@ -209,7 +209,7 @@ create_dset2(hid_t file) H5Pclose(dcpl); H5Sclose(dataspace); } - H5E_END_TRY; + H5E_END_TRY free(data); return 1; @@ -285,7 +285,7 @@ check_partial_chunks_perf(hid_t file) H5Sclose(memspace); H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -363,7 +363,7 @@ check_hash_value_perf(hid_t file) H5Sclose(memspace); H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index 777232435f7..be9d58342eb 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -45,7 +45,7 @@ #include #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. @@ -272,7 +272,7 @@ create_file(hid_t fapl_id) H5Pclose(cparms); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -338,7 +338,7 @@ test_direct_write_uncompressed_data(hid_t fapl_id) H5Pclose(dxpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -403,7 +403,7 @@ test_direct_write_compressed_data(hid_t fapl_id) H5Pclose(dxpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -495,7 +495,7 @@ test_compressed_write(hid_t fapl_id) H5Pclose(dxpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -587,7 +587,7 @@ test_no_compress_write(hid_t fapl_id) H5Pclose(dxpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index 02b1350333e..bc15fdff0c5 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -88,10 +88,10 @@ synchronize(void) #else int H5_ATTR_NDEBUG_UNUSED status; - status = HDsystem("sync"); + status = system("sync"); assert(status >= 0); - status = HDsystem("df >/dev/null"); + status = system("df >/dev/null"); assert(status >= 0); #endif } @@ -153,7 +153,7 @@ main(void) /* Fill raw */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "fill raw"); @@ -163,7 +163,7 @@ main(void) memset(the_data, 0xAA, (size_t)(size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -176,7 +176,7 @@ main(void) /* Fill hdf5 */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "fill hdf5"); @@ -187,7 +187,7 @@ main(void) assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -200,7 +200,7 @@ main(void) /* Write the raw dataset */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "out raw"); @@ -213,7 +213,7 @@ main(void) assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -226,7 +226,7 @@ main(void) /* Write the hdf5 dataset */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "out hdf5"); @@ -237,7 +237,7 @@ main(void) assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -250,7 +250,7 @@ main(void) /* Read the raw dataset */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "in raw"); @@ -263,7 +263,7 @@ main(void) assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -276,7 +276,7 @@ main(void) /* Read the hdf5 dataset */ synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "in hdf5"); @@ -287,7 +287,7 @@ main(void) assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); @@ -305,7 +305,7 @@ main(void) assert(status >= 0); synchronize(); #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_start); + getrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); fprintf(stderr, HEADING, "in hdf5 partial"); @@ -316,7 +316,7 @@ main(void) assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE - HDgetrusage(RUSAGE_SELF, &r_stop); + getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); HDputc('\n', stderr); diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 5844126cc80..16df60a2a46 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -25,25 +25,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 { @@ -56,7 +56,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); diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 2a794be4fa4..b8b80e8ccbe 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -274,7 +274,7 @@ parse_size_directive(const char *size) unsigned long s; char *endptr; - s = HDstrtoul(size, &endptr, 10); + s = strtoul(size, &endptr, 10); if (endptr && *endptr) { while (*endptr != '\0' && (*endptr == ' ' || *endptr == '\t')) @@ -488,7 +488,7 @@ main(int argc, char *argv[]) min_buf_size = parse_size_directive(H5_optarg); break; case 'c': - compress_percent = (int)HDstrtol(H5_optarg, NULL, 10); + compress_percent = (int)strtol(H5_optarg, NULL, 10); if (compress_percent < 0) compress_percent = 0; diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls index 6ed1aabd025..1cf733bc3a3 100644 --- a/tools/testfiles/help-1.ls +++ b/tools/testfiles/help-1.ls @@ -52,6 +52,9 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls index 6ed1aabd025..1cf733bc3a3 100644 --- a/tools/testfiles/help-2.ls +++ b/tools/testfiles/help-2.ls @@ -52,6 +52,9 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls index 6ed1aabd025..1cf733bc3a3 100644 --- a/tools/testfiles/help-3.ls +++ b/tools/testfiles/help-3.ls @@ -52,6 +52,9 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index e20df732d31..9274600ce03 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -32,6 +32,9 @@ usage: h5dump [OPTIONS] files HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls index 6ed1aabd025..1cf733bc3a3 100644 --- a/tools/testfiles/textlinksrc-nodangle-1.ls +++ b/tools/testfiles/textlinksrc-nodangle-1.ls @@ -52,6 +52,9 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index 6ed1aabd025..1cf733bc3a3 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -52,6 +52,9 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] HDF5 file specified --vol-info VOL-specific info to pass to the VOL connector used for opening the HDF5 file specified + If none of the above options are used to specify a VOL, then + the VOL named by HDF5_VOL_CONNECTOR (or the native VOL connector, + if that environment variable is unset) will be used --vfd-value Value (ID) of the VFL driver to use for opening the HDF5 file specified --vfd-name Name of the VFL driver to use for opening the