From c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:55:18 -0700 Subject: Reverts PR 906 and 907 due to binary compatibility issues (#918) --- bin/trace | 38 +- c++/test/tarray.cpp | 31 +- c++/test/tattr.cpp | 60 +- config/cmake/H5pubconf.h.in | 47 +- config/cmake_ext_mod/ConfigureChecks.cmake | 35 +- config/cmake_ext_mod/HDFTests.c | 8 + config/cmake_ext_mod/HDFUseCXX.cmake | 11 + config/commence.am | 2 +- config/gnu-cxxflags | 7 +- config/intel-cxxflags | 4 +- config/intel-flags | 3 +- configure.ac | 51 +- fortran/src/CMakeLists.txt | 13 - hl/c++/src/H5PacketTable.cpp | 8 - hl/c++/src/H5PacketTable.h | 7 +- hl/test/test_ds.c | 2 - hl/test/test_packet.c | 8 +- hl/test/test_table.c | 40 +- hl/tools/h5watch/h5watch.c | 60 +- hl/tools/h5watch/h5watchgentest.c | 4 +- release_docs/RELEASE.txt | 23 - src/H5.c | 220 ++--- src/H5Dpublic.h | 12 +- src/H5E.c | 36 +- src/H5ESpublic.h | 12 - src/H5Epublic.h | 2 +- src/H5FDmpio.c | 24 +- src/H5Fpublic.h | 4 +- src/H5Gint.c | 1 - src/H5Gpkg.h | 1 + src/H5HFpkg.h | 1 + src/H5Lpublic.h | 4 +- src/H5Ppublic.h | 2 +- src/H5Spublic.h | 2 +- src/H5Tpublic.h | 4 +- src/H5detect.c | 15 + src/H5mpi.c | 2 +- src/H5private.h | 128 ++- src/H5public.h | 49 +- src/H5system.c | 212 +---- src/H5win32defs.h | 1 + test/CMakeTests.cmake | 2 +- test/cache.c | 1131 +++++++++++++------------ test/cache_common.c | 12 + test/err_compat.c | 16 +- test/error_test.c | 2 +- test/h5test.c | 7 +- test/tarray.c | 53 +- test/testcheck_version.sh.in | 106 +-- tools/lib/h5tools_utils.c | 169 +++- tools/lib/h5tools_utils.h | 52 ++ tools/lib/io_timer.h | 2 +- tools/src/h5copy/h5copy.c | 48 +- tools/src/h5diff/h5diff_common.c | 108 +-- tools/src/h5dump/h5dump.c | 340 ++++---- tools/src/h5format_convert/h5format_convert.c | 60 +- tools/src/h5jam/h5jam.c | 12 +- tools/src/h5jam/h5unjam.c | 12 +- tools/src/h5repack/h5repack_copy.c | 25 +- tools/src/h5repack/h5repack_main.c | 156 ++-- tools/src/h5stat/h5stat.c | 224 ++--- tools/src/misc/h5clear.c | 80 +- tools/src/misc/h5mkgrp.c | 28 +- tools/test/h5jam/getub.c | 16 +- tools/test/h5jam/h5jamgentest.c | 75 ++ tools/test/h5jam/tellub.c | 12 +- tools/test/perform/chunk.c | 2 + tools/test/perform/direct_write_perf.c | 5 +- tools/test/perform/overhead.c | 6 + tools/test/perform/perf.c | 2 + tools/test/perform/pio_engine.c | 2 + tools/test/perform/pio_perf.c | 296 +++---- tools/test/perform/pio_standalone.c | 57 +- tools/test/perform/pio_standalone.h | 28 +- tools/test/perform/sio_engine.c | 10 + tools/test/perform/sio_perf.c | 356 ++++---- tools/test/perform/sio_standalone.c | 57 +- tools/test/perform/sio_standalone.h | 28 +- tools/test/perform/zip_perf.c | 132 +-- 79 files changed, 2509 insertions(+), 2414 deletions(-) diff --git a/bin/trace b/bin/trace index 80eaa5f..2b519e4 100755 --- a/bin/trace +++ b/bin/trace @@ -343,33 +343,10 @@ sub rewrite_func ($$$$$) { # Compose the trace macro $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \""; $trace .= join("", @arg_str) . "\""; - $argtrace .= join("", @arg_str) . "\""; - - # Add 4 for indenting the line - my $len = 4 + length($trace); - - for my $i (0 .. $#arg_name) { - # Handle wrapping - - # Be VERY careful here! clang-format and this script MUST agree - # on which lines get wrapped or there will be churn as each tries - # to undo the other's output. - # - # TWO cases must be handled: - # 1) The argument is that last one and ');' will be appended - # 2) The argument is NOT the last one and ',' will be appended - # - # NB: clang-format does NOT consider terminal newlines when - # counting columns for the ColumnLimit - # - # The extra '2' added after $len includes the ', ' that would be - # added BEFORE the argument. - # - my $adjust = ($i + 1 == scalar(@arg_str)) ? 2 : 1; - my $len_if_added = $len + 2 + length($arg_name[$i]) + $adjust; - - # Wrap lines that will be longer than the limit - if ($len_if_added > $max_trace_macro_line_len) { + my $len = 4 + length $trace; # Add 4, for indenting the line + for (@arg_name) { + # Wrap lines that will be longer than the limit, after ');' is added + if ($len + length >= ($max_trace_macro_line_len - 2)) { # Wrap line, with indention $trace .= ",\n "; $len = 13; # Set to 13, for indention @@ -385,11 +362,8 @@ sub rewrite_func ($$$$$) { } # Append argument - $trace .= "$arg_name[$i]"; - $argtrace .= ", $arg_name[$i]"; - - # Add length of appended argument name - $len += length($arg_name[$i]); + $trace .= "$_"; + $len += length; # Add length of appended argument name } # Append final ');' for macro diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 0edfe0e..7525c5f 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -178,9 +178,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -197,9 +197,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -248,9 +248,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -265,9 +265,8 @@ test_array_compound_array() for (idxi = 0; idxi < SPACE1_DIM1; idxi++) { for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { if (wdata[idxi][idxj].i != rdata[idxi][idxj].i) { - TestErrPrintf("Array data information doesn't match!, wdata[%" PRIuHSIZE "][%" PRIuHSIZE - "].i=%d, " - "rdata[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n", + TestErrPrintf("Array data information doesn't match!, wdata[%lld][%lld].i=%d, " + "rdata[%lld][%lld].i=%d\n", idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); continue; } // end if @@ -458,11 +457,11 @@ test_array_info() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=z%llu\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; - } + } // end if } // Close all diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 6802b3b..adaa237 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -169,8 +169,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Create two more attributes for this dataset, but only write to one. @@ -186,8 +185,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close both attributes @@ -450,8 +448,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Close attribute @@ -475,8 +472,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close attribute @@ -541,8 +537,7 @@ test_attr_basic_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d, read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d, read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); /* @@ -573,9 +568,8 @@ test_attr_basic_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) { - TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE - "]=%d, " - "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); } PASSED(); @@ -778,17 +772,14 @@ test_attr_compound_read() for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) { - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].i=%d, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " + "read_data4[%llu][%llu].i=%d\n", __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].d=%f, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].d=%f\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, " + "read_data4[%llu][%llu].d=%f\n", __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].c=%c, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].c=%c\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, " + "read_data4[%llu][%llu].c=%c\n", __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ @@ -1051,10 +1042,10 @@ test_attr_mult_read() // Get the dims of the dataspace and verify them hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions - (void)space.getSimpleExtentDims(dims); - if (dims[0] != ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %" PRIuHSIZE "\n", - __LINE__, static_cast(dims[0]), ATTR1_DIM1); + int ndims = space.getSimpleExtentDims(dims); + if ((long)dims[0] != (long)ATTR1_DIM1) + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %llu\n", __LINE__, + (int)dims[0], ATTR1_DIM1); /* Verify Datatype */ @@ -1081,8 +1072,7 @@ test_attr_mult_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Verify Name @@ -1105,7 +1095,7 @@ test_attr_mult_read() verify_val(rank, ATTR2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); // Get the dims of the dataspace and verify them - int ndims = space.getSimpleExtentDims(dims); + ndims = space.getSimpleExtentDims(dims); verify_val((long)dims[0], (long)ATTR2_DIM1, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); verify_val((long)dims[1], (long)ATTR2_DIM2, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); @@ -1137,9 +1127,8 @@ test_attr_mult_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) - TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE - "]=%d, " - "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); // Verify Name @@ -1192,10 +1181,9 @@ test_attr_mult_read() for (i = 0; i < ATTR3_DIM1; i++) for (j = 0; j < ATTR3_DIM2; j++) for (k = 0; k < ATTR3_DIM3; k++) - if (abs(attr_data3[i][j][k] - read_data3[i][j][k]) > DBL_EPSILON) - TestErrPrintf("%d: attribute data different: attr_data3[%" PRIuHSIZE "][%" PRIuHSIZE - "][%" PRIuHSIZE "]=%f, " - "read_data3[%" PRIuHSIZE "][%" PRIuHSIZE "][%" PRIuHSIZE "]=%f\n", + if (attr_data3[i][j][k] != read_data3[i][j][k]) + TestErrPrintf("%d: attribute data different: attr_data3[%llu][%llu][%llu]=%f, " + "read_data3[%llu][%llu][%llu]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]); // Verify Name diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f677131..e163d3a 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -35,10 +35,6 @@ /* Define if dev_t is a scalar */ #cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@ -/* Define if your system is IBM ppc64le and cannot convert some long double - values correctly. */ -#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@ - /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #cmakedefine H5_FC_DUMMY_MAIN @H5_FC_DUMMY_MAIN@ @@ -115,7 +111,7 @@ #cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ /* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@ +#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@ /* Define if Darwin or Mac OS X */ #cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@ @@ -202,9 +198,15 @@ optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@ + /* Define to 1 if you have the `ioctl' function. */ #cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ + /* Define to 1 if you have the `crypto' library (-lcrypto). */ #cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@ @@ -356,12 +358,21 @@ /* Define to 1 if you have the `stat64' function. */ #cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@ -/* Define if struct stat has the st_blocks field */ +/* Define if `struct stat' has the `st_blocks' field */ #cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@ + +/* Define to 1 if you have the header file for Cplusplus. */ +#cmakedefine H5_HAVE_STDINT_H_CXX @H5_HAVE_STDINT_H_CXX@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@ @@ -457,6 +468,9 @@ /* Define if your system has window style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ @@ -494,6 +508,9 @@ with special algorithm. */ #cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@ +/* Define if your system is power6 and cannot convert some long double values. */ +#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@ + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ @@ -699,6 +716,9 @@ /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ + /* Define if strict file format checks are enabled */ #cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@ @@ -709,21 +729,18 @@ /* Define to 1 if you can safely include both and . */ #cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@ -/* Define using v1.10 public API symbols by default */ -#cmakedefine H5_USE_110_API_DEFAULT @H5_USE_110_API_DEFAULT@ - -/* Define using v1.12 public API symbols by default */ -#cmakedefine H5_USE_112_API_DEFAULT @H5_USE_112_API_DEFAULT@ - -/* Define using v1.14 public API symbols by default */ -#cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@ - /* Define using v1.6 public API symbols by default */ #cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@ /* Define using v1.8 public API symbols by default */ #cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@ +/* Define using v1.10 public API symbols by default */ +#cmakedefine H5_USE_110_API_DEFAULT @H5_USE_110_API_DEFAULT@ + +/* Define using v1.12 public API symbols by default */ +#cmakedefine H5_USE_112_API_DEFAULT @H5_USE_112_API_DEFAULT@ + /* Define if the library will use file locking */ #cmakedefine H5_USE_FILE_LOCKING @H5_USE_FILE_LOCKING@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 9e704fb..004aded 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -53,6 +53,7 @@ if (MINGW) set (${HDF_PREFIX}_HAVE_MINGW 1) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") + set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) set (__USE_MINGW_ANSI_STDIO 1) endif () @@ -119,8 +120,23 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) +# Windows +CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) +if (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) +endif () + +if (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) +else () + set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +endif () + CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H) @@ -130,9 +146,12 @@ CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H) CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H) CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H) CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H) CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H) +# _Bool type support +CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) ## Check for non-standard extenstion quadmath.h @@ -219,6 +238,11 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) endmacro () #----------------------------------------------------------------------------- +# Check for these functions before the time headers are checked +#----------------------------------------------------------------------------- +HDF_FUNCTION_TEST (STDC_HEADERS) + +#----------------------------------------------------------------------------- # Check for large file support #----------------------------------------------------------------------------- @@ -392,9 +416,13 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T) # Extra C99 types #----------------------------------------------------------------------------- -# Size of bool -set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) -HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) +# _Bool type support +if (HAVE_STDBOOL_H) + set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) + HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) +else () + HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) +endif () if (MINGW OR NOT WINDOWS) #----------------------------------------------------------------------------- @@ -532,6 +560,7 @@ if (MINGW OR NOT WINDOWS) foreach (other_test HAVE_ATTRIBUTE HAVE_C99_FUNC +# STDC_HEADERS HAVE_FUNCTION HAVE_C99_DESIGNATED_INITIALIZER SYSTEM_SCOPE_THREADS diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 0c3b7b7..2d7e1b4 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -88,6 +88,14 @@ int main(void) } #endif +#ifdef STDC_HEADERS +#include +#include +#include +#include +int main() { return 0; } +#endif /* STDC_HEADERS */ + #ifdef HAVE_ATTRIBUTE diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 423f74a..580c409 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -32,6 +32,17 @@ endif () include (CheckIncludeFileCXX) include (TestForSTDNamespace) +# IF the c compiler found stdint, check the C++ as well. On some systems this +# file will be found by C but not C++, only do this test IF the C++ compiler +# has been initialized (e.g. the project also includes some c++) +if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + endif () +endif () + # For other CXX specific tests, use this MACRO. macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) if (NOT DEFINED ${OTHER_TEST}) diff --git a/config/commence.am b/config/commence.am index 3fddc6a..96c2fc2 100644 --- a/config/commence.am +++ b/config/commence.am @@ -45,7 +45,7 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la docdir = $(exec_prefix)/doc # Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by GNU at +# has been removed. According to the official description of DESTDIR by Gnu at # http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is # prepended to the normal and complete install path that it precedes for the # purpose of installing in a temporary directory which is useful for building diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 9dbc2b9..b2ba08d 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -268,13 +268,10 @@ if test "X-g++" = "X-$cxx_vendor"; then fi # gcc >= 9.3 - if test $cc_vers_major -ge 10 -o $cc_vers_major -eq 9 -a $cc_vers_minor -ge 3; then - # do not use C warnings, $(load_gnu_arguments 9.3), no cxx warnings - # H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-9.3)" - fi + # no cxx warnings, do NOT use C warnings # gcc >= 10 - if test $cc_vers_major -ge 10; then + if test $cxx_vers_major -ge 10; then # Use the C warnings as CXX warnings are the same DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)" fi diff --git a/config/intel-cxxflags b/config/intel-cxxflags index 3de51b5..484100f 100644 --- a/config/intel-cxxflags +++ b/config/intel-cxxflags @@ -122,19 +122,19 @@ if test "X-icpc" = "X-$cxx_vendor"; then # Warnings # ############ -# First load the C warnings then add CXX warnings (if needed) - ########### # General # ########### # Add various general warning flags in intel-warnings. + # Use the C warnings as CXX warnings are the same H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general)" ###################### # Developer warnings # ###################### + # Use the C warnings as CXX warnings are the same #NO_DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments no-developer-general) #DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments developer-general) diff --git a/config/intel-flags b/config/intel-flags index 1c26632..f46da0a 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -88,7 +88,7 @@ if test "X-icc" = "X-$cc_vendor"; then ############## # Production # ############## - + PROD_CFLAGS= ######### @@ -179,4 +179,3 @@ if test "X-$cc_flags_set" = "X-"; then cc_vendor= cc_version= fi - diff --git a/configure.ac b/configure.ac index c3c2c5b..b5a8c78 100644 --- a/configure.ac +++ b/configure.ac @@ -1252,6 +1252,8 @@ AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) AC_CHECK_HEADERS([dirent.h]) +AC_CHECK_HEADERS([stdint.h], [C9x=yes]) +AC_CHECK_HEADERS([stdbool.h]) AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h]) ## Darwin @@ -1267,15 +1269,15 @@ esac ## Windows case "`uname`" in CYGWIN*) - AC_CHECK_HEADERS([sys/timeb.h]) + AC_CHECK_HEADERS([io.h sys/timeb.h]) UNAME_CYGWIN="yes" ;; MINGW*) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) AC_HAVE_LIBRARY([ws2_32]) ;; *) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; esac @@ -1366,6 +1368,17 @@ CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" ## Checkpoint the cache AC_CACHE_SAVE +## Posix.1g types (C9x) +cat >>confdefs.h <<\EOF +#include +EOF + +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#include +EOF +fi + AC_CHECK_SIZEOF( [int8_t]) AC_CHECK_SIZEOF( [uint8_t]) AC_CHECK_SIZEOF( [int_least8_t]) @@ -1394,12 +1407,34 @@ AC_CHECK_SIZEOF([uint_least64_t]) AC_CHECK_SIZEOF( [int_fast64_t]) AC_CHECK_SIZEOF( [uint_fast64_t]) -AC_CHECK_SIZEOF([bool], [], [#include ]) -AC_CHECK_SIZEOF([off_t]) -AC_CHECK_SIZEOF([ptrdiff_t]) AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([ssize_t]) -AC_CHECK_SIZEOF([time_t], [], [#include ]) +AC_CHECK_SIZEOF([ptrdiff_t]) + +cat >>confdefs.h <<\EOF +#include /*for off_t definition*/ +EOF +AC_CHECK_SIZEOF([off_t]) + +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#ifdef HAVE_STDBOOL_H +#include /* for bool definition */ +#else +#define bool _Bool +#endif +EOF +AC_CHECK_SIZEOF([bool]) +fi + +AC_CHECK_SIZEOF(time_t, [], [ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif +]) ## Checkpoint the cache AC_CACHE_SAVE @@ -1909,8 +1944,10 @@ if test "X$THREADSAFE" = "Xyes"; then AC_CACHE_VAL([hdf5_cv_system_scope_threads], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([ + #if STDC_HEADERS #include #include + #endif ],[ pthread_attr_t attribute; int ret; diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 316d3c7..e59a829 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -582,17 +582,4 @@ if (NOT WIN32 AND NOT MINGW) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT fortlibraries ) - if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND) - configure_file ( - ${HDF_RESOURCES_DIR}/libh5cc.in - ${HDF5_BINARY_DIR}/CMakeFiles/h5pfc - @ONLY - ) - install ( - FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pfc - DESTINATION ${HDF5_INSTALL_BIN_DIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT fortlibraries - ) - endif () endif () diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index 5f41e26..0f47b0d 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -28,14 +28,6 @@ /* PacketTable superclass */ /********************************/ -/* Null constructor - * Sets table_id to "invalid" - */ -PacketTable::PacketTable() -{ - table_id = H5I_INVALID_HID; -} - /* "Open" Constructor * Opens an existing packet table, which can contain either fixed-length or * variable-length packets. diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index eae66f1..acd0ccf 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -31,9 +31,12 @@ class H5_HLCPPDLL PacketTable { public: /* Null constructor - * Sets table_id to H5I_INVALID_HID + * Sets table_id to "invalid" */ - PacketTable(); + PacketTable() + { + table_id = H5I_INVALID_HID; + } /* "Open" Constructor * Opens an existing packet table, which can contain either fixed-length or diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index cc941cc..ead5c65 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -5205,8 +5205,6 @@ test_attach_detach(void) HL_TESTING2("permutations of attaching and detaching"); - gid = var1_id = var2_id = var3_id = H5I_INVALID_HID; - if ((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 311f36a..1d3a569 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -45,10 +45,10 @@ typedef struct particle_t { * a static array of particles for writing and checking reads *------------------------------------------------------------------------- */ -static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0}, - {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0}, - {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0}, - {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}}; +static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0f}, {"one", 10, 10, 1.0f, 10.0f}, + {"two", 20, 20, 2.0f, 20.0f}, {"three", 30, 30, 3.0f, 30.0f}, + {"four", 40, 40, 4.0f, 40.0f}, {"five", 50, 50, 5.0f, 50.0f}, + {"six", 60, 60, 6.0f, 60.0f}, {"seven", 70, 70, 7.0f, 70.0f}}; /*------------------------------------------------------------------------- * function that compares one particle diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 531f778..0d4a72a 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -199,7 +199,7 @@ test_table(hid_t fid, int do_write) hsize_t chunk_size = 10; int compress = 0; int * fill = NULL; - particle_t fill1[1] = {{"no data", -1, -99.0, -99.0, -1}}; + particle_t fill1[1] = {{"no data", -1, -99.0f, -99.0f, -1}}; int fill1_new[1] = {-100}; hsize_t position; char tname[20]; @@ -227,23 +227,23 @@ test_table(hid_t fid, int do_write) particle2_t rbuf2[NRECORDS]; particle3_t rbuf3[NRECORDS]; particle_t rbufc[NRECORDS * 2]; - particle_t abuf[2] = {{"eight", 80, 8.0, 80.0, 80}, {"nine", 90, 9.0, 90.0, 90}}; - particle_t ibuf[2] = {{"zero", 0, 0.0, 0.0, 0}, {"zero", 0, 0.0, 0.0, 0}}; + particle_t abuf[2] = {{"eight", 80, 8.0f, 80.0f, 80}, {"nine", 90, 9.0f, 90.0f, 90}}; + particle_t ibuf[2] = {{"zero", 0, 0.0f, 0.0f, 0}, {"zero", 0, 0.0f, 0.0f, 0}}; particle_t wbufd[NRECORDS]; particle_t wbuf[NRECORDS] = {{ "zero", 0, - 0.0, - 0.0, + 0.0f, + 0.0f, 0, }, - {"one", 10, 1.0, 10.0, 10}, - {"two", 20, 2.0, 20.0, 20}, - {"three", 30, 3.0, 30.0, 30}, - {"four", 40, 4.0, 40.0, 40}, - {"five", 50, 5.0, 50.0, 50}, - {"six", 60, 6.0, 60.0, 60}, - {"seven", 70, 7.0, 70.0, 70}}; + {"one", 10, 1.0f, 10.0f, 10}, + {"two", 20, 2.0f, 20.0f, 20}, + {"three", 30, 3.0f, 30.0f, 30}, + {"four", 40, 4.0f, 40.0f, 40}, + {"five", 50, 5.0f, 50.0f, 50}, + {"six", 60, 6.0f, 60.0f, 60}, + {"seven", 70, 7.0f, 70.0f, 70}}; /* buffers for the field "Pressure" and "New_field" */ float pressure_in[NRECORDS] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f}; float pressure_out[NRECORDS]; @@ -332,14 +332,14 @@ test_table(hid_t fid, int do_write) HOFFSET(particle4_t, aty), HOFFSET(particle4_t, rro)}; /* Define an array of Particles */ - particle4_t p_data[NRECORDS] = {{12112, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12113, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12114, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12115, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12116, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12117, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12118, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}, - {12119, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}}; + particle4_t p_data[NRECORDS] = {{12112, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12113, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12114, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12115, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12116, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12117, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12118, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}, + {12119, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}}; /*------------------------------------------------------------------------- * initialize table parameters diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index afbc31d..a5e82ca 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -58,27 +58,27 @@ static void parse_command_line(int argc, const char *argv[]); * The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "?"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, - {"dim", no_arg, 'd'}, {"di", no_arg, 'd'}, - {"label", no_arg, 'l'}, {"labe", no_arg, 'l'}, - {"lab", no_arg, 'l'}, {"la", no_arg, 'l'}, - {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'}, - {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'}, - {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'}, - {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'}, - {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'}, - {"width", require_arg, 'w'}, {"widt", require_arg, 'w'}, - {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'}, - {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'}, - {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'}, - {"pol", require_arg, 'p'}, {"po", require_arg, 'p'}, - {"fields", require_arg, 'f'}, {"field", require_arg, 'f'}, - {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'}, - {"fi", require_arg, 'f'}, {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, {NULL, 0, '\0'}}; +static const char * s_opts = "?"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, + {"dim", no_arg, 'd'}, {"di", no_arg, 'd'}, + {"label", no_arg, 'l'}, {"labe", no_arg, 'l'}, + {"lab", no_arg, 'l'}, {"la", no_arg, 'l'}, + {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'}, + {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'}, + {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'}, + {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'}, + {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'}, + {"width", require_arg, 'w'}, {"widt", require_arg, 'w'}, + {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'}, + {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'}, + {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'}, + {"pol", require_arg, 'p'}, {"po", require_arg, 'p'}, + {"fields", require_arg, 'f'}, {"field", require_arg, 'f'}, + {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'}, + {"fi", require_arg, 'f'}, {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: doprint() @@ -677,7 +677,7 @@ parse_command_line(int argc, const char *argv[]) } /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case '?': case 'h': /* --help */ @@ -691,7 +691,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'w': /* --width=N */ - g_display_width = (int)HDstrtol(H5_optarg, NULL, 0); + g_display_width = (int)HDstrtol(opt_arg, NULL, 0); if (g_display_width < 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -711,8 +711,8 @@ parse_command_line(int argc, const char *argv[]) break; case 'p': /* --polling=N */ - /* g_polling_interval = HDstrtod(H5_optarg, NULL); */ - if ((tmp = (int)HDstrtol(H5_optarg, NULL, 10)) <= 0) { + /* g_polling_interval = HDstrtod(opt_arg, NULL); */ + if ((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -721,7 +721,7 @@ parse_command_line(int argc, const char *argv[]) case 'f': /* --fields= */ if (g_list_of_fields == NULL) { - if ((g_list_of_fields = HDstrdup(H5_optarg)) == NULL) { + if ((g_list_of_fields = HDstrdup(opt_arg)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } @@ -729,7 +729,7 @@ parse_command_line(int argc, const char *argv[]) else { char *str; - if ((str = HDstrdup(H5_optarg)) == NULL) { + if ((str = HDstrdup(opt_arg)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } @@ -751,7 +751,7 @@ parse_command_line(int argc, const char *argv[]) } /* check for object to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing dataset name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -821,7 +821,7 @@ main(int argc, const char *argv[]) /* parse command line options */ parse_command_line(argc, argv); - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing dataset name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -845,7 +845,7 @@ main(int argc, const char *argv[]) * then there must have been something wrong with the file (perhaps it * doesn't exist). */ - if ((fname = HDstrdup(argv[H5_optind])) == NULL) { + if ((fname = HDstrdup(argv[opt_ind])) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 44cb0cb..c83e485 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -224,7 +224,7 @@ main(void) one_cbuf[i].field2.b.a = 20; one_cbuf[i].field2.b.b = 40; one_cbuf[i].field2.b.c = 80; - one_cbuf[i].field3 = 3.0; + one_cbuf[i].field3 = 3.0F; one_cbuf[i].field4.a = 4; one_cbuf[i].field4.b = 8; } /* end for */ @@ -313,7 +313,7 @@ main(void) two_cbuf[i].field2.b.a = 20; two_cbuf[i].field2.b.b = 40; two_cbuf[i].field2.b.c = 80; - two_cbuf[i].field3 = 3.0; + two_cbuf[i].field3 = 3.0F; two_cbuf[i].field4.a = 4; two_cbuf[i].field4.b = 8; } /* end for */ diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7f107bb..178e41a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -75,25 +75,6 @@ New Features Library: -------- - - Change how the release part of version, in major.minor.release is checked - for compatibility - - The HDF5 library uses a function, H5check_version, to check that - the version defined in the header files, which is used to compile an - application is compatible with the version codified in the library, which - the application loads at runtime. This previously required an exact match - or the library would print a warning, dump the build settings and then - abort or continue. An environment variable controlled the logic. - - Now the function first checks that the library release version, in - major.minor.release, is not older than the version in the headers. - Secondly, if the release version is different, it checks if either - the library version or the header version is in the exception list, in - which case the release part of version, in major.minor.release, must - be exact. An environment variable still controls the logic. - - (ADB - 2021/07/27) - - H5Gcreate1() now rejects size_hint parameters larger than UINT32_MAX The size_hint value is ultimately stored in a uint32_t struct field, @@ -426,10 +407,6 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== - Setting a variable-length dataset fill value will leak the memory allocated - for the p field of the hvl_t struct. A fix is in progress for this. - HDFFV-10840 - testflushrefresh.sh will fail when run with "make check-passthrough-vol" on centos7, with 3 Errors/Segmentation faults. These will not occur when run with "make check". See https://github.com/HDFGroup/hdf5/issues/673 diff --git a/src/H5.c b/src/H5.c index 1b7407c..5a07b28 100644 --- a/src/H5.c +++ b/src/H5.c @@ -63,10 +63,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Library Private Variables */ /*****************************/ -/* Library incompatible release versions */ -const unsigned VERS_RELEASE_EXCEPTIONS[] = {0}; -const unsigned VERS_RELEASE_EXCEPTIONS_SIZE = 0; - /* statically initialize block for pthread_once call used in initializing */ /* the first global mutex */ #ifdef H5_HAVE_THREADSAFE @@ -268,13 +264,13 @@ done: } /* end H5_init_library() */ /*------------------------------------------------------------------------- - * Function: H5_term_library + * Function: H5_term_library * - * Purpose: Terminate interfaces in a well-defined order due to - * dependencies among the interfaces, then terminate - * library-specific data. + * Purpose: Terminate interfaces in a well-defined order due to + * dependencies among the interfaces, then terminate + * library-specific data. * - * Return: void + * Return: void * *------------------------------------------------------------------------- */ @@ -460,22 +456,22 @@ done: } /* end H5_term_library() */ /*------------------------------------------------------------------------- - * Function: H5dont_atexit + * Function: H5dont_atexit * - * Purpose: Indicates that the library is not to clean up after itself - * when the application exits by calling exit() or returning - * from main(). This function must be called before any other - * HDF5 function or constant is used or it will have no effect. + * Purpose: Indicates that the library is not to clean up after itself + * when the application exits by calling exit() or returning + * from main(). This function must be called before any other + * HDF5 function or constant is used or it will have no effect. * - * If this function is used then certain memory buffers will not - * be de-allocated nor will open files be flushed automatically. - * The application may still call H5close() explicitly to - * accomplish these things. + * If this function is used then certain memory buffers will not + * be de-allocated nor will open files be flushed automatically. + * The application may still call H5close() explicitly to + * accomplish these things. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative if this function is called more than - * once or if it is called too late. + * Failure: negative if this function is called more than + * once or if it is called too late. * *------------------------------------------------------------------------- */ @@ -496,19 +492,19 @@ H5dont_atexit(void) } /* end H5dont_atexit() */ /*------------------------------------------------------------------------- - * Function: H5garbage_collect + * Function: H5garbage_collect * - * Purpose: Walks through all the garbage collection routines for the - * library, which are supposed to free any unused memory they have - * allocated. + * Purpose: Walks through all the garbage collection routines for the + * library, which are supposed to free any unused memory they have + * allocated. * * These should probably be registered dynamically in a linked list of * functions to call, but there aren't that many right now, so we * hard-wire them... * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * *------------------------------------------------------------------------- */ @@ -529,9 +525,9 @@ done: } /* end H5garbage_collect() */ /*------------------------------------------------------------------------- - * Function: H5set_free_list_limits + * Function: H5set_free_list_limits * - * Purpose: Sets limits on the different kinds of free lists. Setting a value + * Purpose: Sets limits on the different kinds of free lists. Setting a value * of -1 for a limit means no limit of that type. These limits are global * for the entire library. Each "global" limit only applies to free lists * of that type, so if an application sets a limit of 1 MB on each of the @@ -549,9 +545,9 @@ done: * int blk_global_lim; IN: The limit on all "block" free list memory used * int blk_list_lim; IN: The limit on memory used in each "block" free list * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * *------------------------------------------------------------------------- */ @@ -575,11 +571,11 @@ done: } /* end H5set_free_list_limits() */ /*------------------------------------------------------------------------- - * Function: H5get_free_list_sizes + * Function: H5get_free_list_sizes * - * Purpose: Gets the current size of the different kinds of free lists that - * the library uses to manage memory. The free list sizes can be set with - * H5set_free_list_limits and garbage collected with H5garbage_collect. + * Purpose: Gets the current size of the different kinds of free lists that + * the library uses to manage memory. The free list sizes can be set with + * H5set_free_list_limits and garbage collected with H5garbage_collect. * These lists are global for the entire library. * * Parameters: @@ -588,8 +584,8 @@ done: * size_t *blk_size; OUT: The current size of all "block" free list memory used * size_t *fac_size; OUT: The current size of all "factory" free list memory used * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * * Programmer: Quincey Koziol * Friday, March 6, 2020 @@ -613,23 +609,23 @@ done: } /* end H5get_free_list_sizes() */ /*------------------------------------------------------------------------- - * Function: H5get_alloc_stats + * Function: H5get_alloc_stats * - * Purpose: Gets the memory allocation statistics for the library, if the - * --enable-memory-alloc-sanity-check option was given when building the + * Purpose: Gets the memory allocation statistics for the library, if the + * --enable-memory-alloc-sanity-check option was given when building the * library. Applications can check whether this option was enabled by - * detecting if the 'H5_MEMORY_ALLOC_SANITY_CHECK' macro is defined. This - * option is enabled by default for debug builds of the library and - * disabled by default for non-debug builds. If the option is not enabled, - * all the values returned with be 0. These statistics are global for the - * entire library, but don't include allocations from chunked dataset I/O - * filters or non-native VOL connectors. + * detecting if the 'H5_MEMORY_ALLOC_SANITY_CHECK' macro is defined. This + * option is enabled by default for debug builds of the library and + * disabled by default for non-debug builds. If the option is not enabled, + * all the values returned with be 0. These statistics are global for the + * entire library, but don't include allocations from chunked dataset I/O + * filters or non-native VOL connectors. * * Parameters: * H5_alloc_stats_t *stats; OUT: Memory allocation statistics * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * * Programmer: Quincey Koziol * Saturday, March 7, 2020 @@ -762,12 +758,12 @@ H5__debug_mask(const char *s) #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5__mpi_delete_cb + * Function: H5__mpi_delete_cb * - * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 + * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. * - * Return: MPI_SUCCESS + * Return: MPI_SUCCESS * *------------------------------------------------------------------------- */ @@ -781,18 +777,18 @@ H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void #endif /*H5_HAVE_PARALLEL*/ /*------------------------------------------------------------------------- - * Function: H5get_libversion + * Function: H5get_libversion * - * Purpose: Returns the library version numbers through arguments. MAJNUM - * will be the major revision number of the library, MINNUM the - * minor revision number, and RELNUM the release revision number. + * Purpose: Returns the library version numbers through arguments. MAJNUM + * will be the major revision number of the library, MINNUM the + * minor revision number, and RELNUM the release revision number. * - * Note: When printing an HDF5 version number it should be printed as + * Note: When printing an HDF5 version number it should be printed as * - * printf("%u.%u.%u", maj, min, rel) or - * printf("version %u.%u release %u", maj, min, rel) + * printf("%u.%u.%u", maj, min, rel) or + * printf("version %u.%u release %u", maj, min, rel) * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -817,20 +813,17 @@ done: } /* end H5get_libversion() */ /*------------------------------------------------------------------------- - * Function: H5check_version + * Function: H5check_version * - * Purpose: Verifies that the arguments match the version numbers - * compiled into the library. This function is intended to be - * called from user to verify that the versions of header files - * compiled into the application match the version of the hdf5 - * library. - * Within major.minor.release version, the expectation - * is that all release versions are compatible, exceptions to - * this rule must be added to the VERS_RELEASE_EXCEPTIONS list. + * Purpose: Verifies that the arguments match the version numbers + * compiled into the library. This function is intended to be + * called from user to verify that the versions of header files + * compiled into the application match the version of the hdf5 + * library. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: abort() + * Failure: abort() * *------------------------------------------------------------------------- */ @@ -843,15 +836,6 @@ done: "linked with a different version of static or shared HDF5 library.\n" \ "You should recompile the application or check your shared library related\n" \ "settings such as 'LD_LIBRARY_PATH'.\n" -#define RELEASE_MISMATCH_WARNING \ - "Warning! ***HDF5 library release mismatched error***\n" \ - "The HDF5 header files used to compile this application are not compatible with\n" \ - "the version used by the HDF5 library to which this application is linked.\n" \ - "Data corruption or segmentation faults may occur if the application continues.\n" \ - "This can happen when an application was compiled by one version of HDF5 but\n" \ - "linked with an incompatible version of static or shared HDF5 library.\n" \ - "You should recompile the application or check your shared library related\n" \ - "settings such as 'LD_LIBRARY_PATH'.\n" herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) @@ -880,11 +864,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) disable_version_check = (unsigned int)HDstrtol(s, NULL, 0); } - /* H5_VERS_MAJOR and H5_VERS_MINOR must match */ - /* Cast relnum to int to avoid warning for unsigned < 0 comparison - * in first release versions */ - if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > (int)relnum) { - + if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE != relnum) { switch (disable_version_check) { case 0: HDfprintf(stderr, "%s%s", version_mismatch_warning, @@ -919,51 +899,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) break; } /* end switch */ - } /* end if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > relnum) */ - - /* H5_VERS_RELEASE should be compatible, we will only add checks for exceptions */ - if (H5_VERS_RELEASE != relnum) { - for (unsigned i = 0; i < VERS_RELEASE_EXCEPTIONS_SIZE; i++) { - /* Check for incompatible headers or incompatible library */ - if (VERS_RELEASE_EXCEPTIONS[i] == relnum || VERS_RELEASE_EXCEPTIONS[i] == H5_VERS_RELEASE) { - switch (disable_version_check) { - case 0: - HDfprintf( - stderr, "%s%s", version_mismatch_warning, - "You can, at your own risk, disable this warning by setting the environment\n" - "variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.\n" - "Setting it to 2 or higher will suppress the warning messages totally.\n"); - /* Mention the versions we are referring to */ - HDfprintf(stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, - relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, - (unsigned)H5_VERS_RELEASE); - - /* Bail out now. */ - HDfputs("Bye...\n", stderr); - HDabort(); - case 1: - /* continue with a warning */ - /* Note that the warning message is embedded in the format string.*/ - HDfprintf(stderr, - "%s'HDF5_DISABLE_VERSION_CHECK' " - "environment variable is set to %d, application will\n" - "continue at your own risk.\n", - version_mismatch_warning, disable_version_check); - /* Mention the versions we are referring to */ - HDfprintf(stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, - relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, - (unsigned)H5_VERS_RELEASE); - break; - default: - /* 2 or higher: continue silently */ - break; - } /* end switch */ - - } /* end if */ - - } /* end for */ - - } /* end if (H5_VERS_RELEASE != relnum) */ + } /* end if */ /* Indicate that the version check has been performed */ checked = 1; @@ -1008,7 +944,7 @@ done: * is failing inexplicably, then try calling this function * first. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1029,9 +965,9 @@ done: /*------------------------------------------------------------------------- * Function: H5close * - * Purpose: Terminate the library and release all resources. + * Purpose: Terminate the library and release all resources. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1052,9 +988,9 @@ H5close(void) } /* end H5close() */ /*------------------------------------------------------------------------- - * Function: H5allocate_memory + * Function: H5allocate_memory * - * Purpose: Allocate a memory buffer with the semantics of malloc(). + * Purpose: Allocate a memory buffer with the semantics of malloc(). * * NOTE: This function is intended for use with filter * plugins so that all allocation and free operations @@ -1092,9 +1028,9 @@ H5allocate_memory(size_t size, hbool_t clear) } /* end H5allocate_memory() */ /*------------------------------------------------------------------------- - * Function: H5resize_memory + * Function: H5resize_memory * - * Purpose: Resize a memory buffer with the semantics of realloc(). + * Purpose: Resize a memory buffer with the semantics of realloc(). * * NOTE: This function is intended for use with filter * plugins so that all allocation and free operations @@ -1129,14 +1065,14 @@ H5resize_memory(void *mem, size_t size) } /* end H5resize_memory() */ /*------------------------------------------------------------------------- - * Function: H5free_memory + * Function: H5free_memory * - * Purpose: Frees memory allocated by the library that it is the user's + * Purpose: Frees memory allocated by the library that it is the user's * responsibility to free. Ensures that the same library * that was used to allocate the memory frees it. Passing * NULL pointers is allowed. * - * Return: SUCCEED/FAIL + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1153,12 +1089,12 @@ H5free_memory(void *mem) } /* end H5free_memory() */ /*------------------------------------------------------------------------- - * Function: H5is_library_threadsafe + * Function: H5is_library_threadsafe * - * Purpose: Checks to see if the library was built with thread-safety + * Purpose: Checks to see if the library was built with thread-safety * enabled. * - * Return: SUCCEED/FAIL + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index f2044d6..b73e62d 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -30,7 +30,7 @@ /* Macros used to "unset" chunk cache configuration parameters */ #define H5D_CHUNK_CACHE_NSLOTS_DEFAULT ((size_t)-1) #define H5D_CHUNK_CACHE_NBYTES_DEFAULT ((size_t)-1) -#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0) +#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0f) /* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */ #define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u) @@ -46,11 +46,11 @@ typedef enum H5D_layout_t { H5D_LAYOUT_ERROR = -1, - H5D_COMPACT = 0, /**< raw data is very small */ - H5D_CONTIGUOUS = 1, /**< the default */ - H5D_CHUNKED = 2, /**< slow and fancy */ - H5D_VIRTUAL = 3, /**< actual data is stored in other datasets */ - H5D_NLAYOUTS = 4 /**< this one must be last! */ + H5D_COMPACT = 0, /**< raw data is very small */ + H5D_CONTIGUOUS = 1, /**< the default */ + H5D_CHUNKED = 2, /**< slow and fancy */ + H5D_VIRTUAL = 3, /**< actual data is stored in other datasets */ + H5D_NLAYOUTS = 4 /**< this one must be last! */ } H5D_layout_t; //! diff --git a/src/H5E.c b/src/H5E.c index 5b6c723..bcadd63 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -85,8 +85,6 @@ static H5E_t * H5E__get_current_stack(void); static herr_t H5E__set_current_stack(H5E_t *estack); static herr_t H5E__close_stack(H5E_t *err_stack); static ssize_t H5E__get_num(const H5E_t *err_stack); -static herr_t H5E__print2(hid_t err_stack, FILE *stream); -static herr_t H5E__append_stack(H5E_t *dst_estack, const H5E_t *src_stack); /*********************/ /* Package Variables */ @@ -327,10 +325,10 @@ H5E__set_default_auto(H5E_t *stk) #endif /* H5_USE_16_API_DEFAULT */ stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1; - stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5E__print2; + stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5Eprint2; stk->auto_op.is_default = TRUE; #else /* H5_NO_DEPRECATED_SYMBOLS */ - stk->auto_op.func2 = (H5E_auto2_t)H5E__print2; + stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2; #endif /* H5_NO_DEPRECATED_SYMBOLS */ stk->auto_data = NULL; @@ -1448,37 +1446,13 @@ done: herr_t H5Eprint2(hid_t err_stack, FILE *stream) { + H5E_t *estack; /* Error stack to operate on */ herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ - /* Print error stack */ - if ((ret_value = H5E__print2(err_stack, stream)) < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Eprint2() */ - -/*------------------------------------------------------------------------- - * Function: H5E__print2 - * - * Purpose: Internal helper routine for H5Eprint2. - * - * Return: Non-negative on success/Negative on failure - * - *------------------------------------------------------------------------- - */ -static herr_t -H5E__print2(hid_t err_stack, FILE *stream) -{ - H5E_t *estack; /* Error stack to operate on */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - /* Need to check for errors */ if (err_stack == H5E_DEFAULT) { if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in @@ -1498,8 +1472,8 @@ H5E__print2(hid_t err_stack, FILE *stream) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5E__print2() */ + FUNC_LEAVE_API(ret_value) +} /* end H5Eprint2() */ /*------------------------------------------------------------------------- * Function: H5Ewalk2 diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h index fb156ac..28b41fa 100644 --- a/src/H5ESpublic.h +++ b/src/H5ESpublic.h @@ -24,18 +24,6 @@ /* Public Macros */ /*****************/ -/* Default value for "no event set" / synchronous execution */ -#define H5ES_NONE 0 /* (hid_t) */ - -/* Special "wait" timeout values */ -#define H5ES_WAIT_FOREVER (UINT64_MAX) /* Wait until all operations complete */ -#define H5ES_WAIT_NONE \ - (0) /* Don't wait for operations to complete, \ - * just check their status. \ - * (this allows H5ESwait to behave \ - * like a 'test' operation) \ - */ - /*******************/ /* Public Typedefs */ /*******************/ diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 1c7055a..2f529b3 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -24,7 +24,7 @@ #include "H5Ipublic.h" /* Value for the default error stack */ -#define H5E_DEFAULT 0 /* (hid_t) */ +#define H5E_DEFAULT (hid_t)0 /** * Different kinds of error information diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 16912cf..c0b14ce 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1193,6 +1193,12 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if ((hsize_t)size_i != size) HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i") +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off, + size_i); +#endif + /* Only look for MPI views for raw data transfers */ if (type == H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */ @@ -1337,12 +1343,6 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (bytes_read < 0 || bytes_read > io_size) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") -#ifdef H5FDmpio_DEBUG - if (H5FD_mpio_debug_r_flag) - HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_read = %lld\n", FUNC, file->mpi_rank, (long)mpi_off, - bytes_read); -#endif - /* * This gives us zeroes beyond end of physical MPI file. */ @@ -1430,6 +1430,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off") size_i = (int)size; +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off, + size_i); +#endif + /* Get the transfer mode from the API context */ if (H5CX_get_io_xfer_mode(&xfer_mode) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") @@ -1554,12 +1560,6 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h if (bytes_written != io_size || bytes_written < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") -#ifdef H5FDmpio_DEBUG - if (H5FD_mpio_debug_w_flag) - HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_written = %lld\n", FUNC, file->mpi_rank, - (long)mpi_off, bytes_written); -#endif - /* Each process will keep track of its perceived EOF value locally, and * ultimately we will reduce this value to the maximum amongst all * processes, but until then keep the actual eof at HADDR_UNDEF just in diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index f25f8f9..89238b6 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -84,7 +84,7 @@ (0x0020u) /**< Restrict search to objects opened through current file ID \ (as opposed to objects opened through any file ID accessing this file) */ -#define H5F_FAMILY_DEFAULT 0 /* (hsize_t) */ +#define H5F_FAMILY_DEFAULT (hsize_t)0 #ifdef H5_HAVE_PARALLEL /** @@ -108,7 +108,7 @@ typedef enum H5F_scope_t { /** * Unlimited file size for H5Pset_external() */ -#define H5F_UNLIMITED HSIZE_UNDEF +#define H5F_UNLIMITED ((hsize_t)(-1L)) /** * How does file close behave? diff --git a/src/H5Gint.c b/src/H5Gint.c index 75b206e..7488357 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -38,7 +38,6 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ -#include "H5SLprivate.h" /* Skip lists */ /****************/ /* Local Macros */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 521f94f..b0adf30 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -35,6 +35,7 @@ #include "H5HFprivate.h" /* Fractal heaps */ #include "H5HLprivate.h" /* Local Heaps */ #include "H5Oprivate.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip lists */ /**************************/ /* Package Private Macros */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 8d189e8..893a65d 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -34,6 +34,7 @@ #include "H5B2private.h" /* v2 B-trees */ #include "H5FLprivate.h" /* Free Lists */ #include "H5FSprivate.h" /* Free space manager */ +#include "H5SLprivate.h" /* Skip lists */ /**************************/ /* Package Private Macros */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index a4f1102..bf1de86 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -39,12 +39,12 @@ * * The maximum length of a link's name is encoded in a 32-bit unsigned integer. */ -#define H5L_MAX_LINK_NAME_LEN UINT32_MAX +#define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */ /** * \brief Macro to indicate operation occurs on same location */ -#define H5L_SAME_LOC 0 /* (hid_t) */ +#define H5L_SAME_LOC (hid_t)0 /** * \brief Current version of the H5L_class_t struct diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 3d6968e..5adb05e 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -100,7 +100,7 @@ #define H5P_CRT_ORDER_INDEXED 0x0002 /* Default value for all property list classes */ -#define H5P_DEFAULT 0 /* (hid_t) */ +#define H5P_DEFAULT (hid_t)0 #ifdef __cplusplus extern "C" { diff --git a/src/H5Spublic.h b/src/H5Spublic.h index cf5abe8..331e5ee 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -22,7 +22,7 @@ #include "H5Ipublic.h" /* Define atomic datatypes */ -#define H5S_ALL 0 /* (hid_t) */ +#define H5S_ALL (hid_t)0 #define H5S_UNLIMITED HSIZE_UNDEF /* Define user-level maximum number of dimensions */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 0791345..b708506 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -245,7 +245,7 @@ typedef struct { * Indicate that a string is variable length (null-terminated in C, instead of * fixed length) */ -#define H5T_VARIABLE ((size_t)-1) +#define H5T_VARIABLE ((size_t)(-1)) /* Opaque information */ /** @@ -3027,4 +3027,4 @@ H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]); #ifdef __cplusplus } #endif -#endif /* H5Tpublic_H */ \ No newline at end of file +#endif /* H5Tpublic_H */ diff --git a/src/H5detect.c b/src/H5detect.c index fd5e980..e4fe453 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1655,6 +1655,21 @@ main(int argc, char *argv[]) if (!rawoutstream) rawoutstream = stdout; +#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) +#if defined(UAC_NOPRINT) && defined(UAC_SIGBUS) + /* + * Make sure unaligned access generates SIGBUS and doesn't print warning + * messages so that we can detect alignment constraints on the DEC Alpha. + */ + int nvpairs[2]; + nvpairs[0] = SSIN_UACPROC; + nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; + if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0) < 0) { + fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", HDstrerror(errno)); + } +#endif +#endif + #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) /* verify the SIGBUS and SIGSEGV handlers work properly */ if (verify_signal_handlers(SIGBUS, sigbus_handler) != 0) { diff --git a/src/H5mpi.c b/src/H5mpi.c index 4a8aa44..9749721 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -523,7 +523,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat MPI_Type_get_extent(old_type, &unused_lb_arg, &old_extent); } - /* Set up the arguments for MPI_Type_create_struct() */ + /* Set up the arguments for MPI_Type_struct constructor */ type[0] = outer_type; type[1] = leftover_type; block_len[0] = 1; diff --git a/src/H5private.h b/src/H5private.h index 1fd95dc..07705e4 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -26,36 +26,64 @@ #include "H5public.h" /* Include Public Definitions */ +/* include the pthread header */ +#ifdef H5_HAVE_THREADSAFE +#ifdef H5_HAVE_WIN32_API +#ifndef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_PTHREAD_H +#include +#endif /* H5_HAVE_PTHREAD_H */ +#endif /* H5_HAVE_WIN_THREADS */ +#else /* H5_HAVE_WIN32_API */ +#ifdef H5_HAVE_PTHREAD_H +#include +#endif /* H5_HAVE_PTHREAD_H */ +#endif /* H5_HAVE_WIN32_API */ +#endif /* H5_HAVE_THREADSAFE */ + +/* + * Include ANSI-C header files. + */ +#ifdef H5_STDC_HEADERS #include #include #include #include #include +#include #include #include #include #include #include - -/* POSIX headers */ -#ifdef H5_HAVE_SYS_TIME_H -#include #endif + +/* + * If _POSIX_VERSION is defined in unistd.h then this system is Posix.1 + * compliant. Otherwise all bets are off. + */ #ifdef H5_HAVE_UNISTD_H -#include +#include #include +#endif +#ifdef _POSIX_VERSION #include +#include #endif -/* Include the Pthreads header, if necessary */ -#if defined(H5_HAVE_THREADSAFE) && defined(H5_HAVE_PTHREAD_H) -#include +/* + * C9x integer types + */ +#ifndef __cplusplus +#ifdef H5_HAVE_STDINT_H +#include +#endif #endif /* - * The `struct stat' data type for stat() and fstat(). This is a POSIX file - * but often apears on non-POSIX systems also. The `struct stat' is required - * for HDF5 to compile, although only a few fields are actually used. + * The `struct stat' data type for stat() and fstat(). This is a Posix file + * but often apears on non-Posix systems also. The `struct stat' is required + * for hdf5 to compile, although only a few fields are actually used. */ #ifdef H5_HAVE_SYS_STAT_H #include @@ -111,6 +139,21 @@ #endif /* + * System information. These are needed on the DEC Alpha to turn off fixing + * of unaligned accesses by the operating system during detection of + * alignment constraints in H5detect.c:main(). + */ +#ifdef H5_HAVE_SYS_SYSINFO_H +#include +#endif +#ifdef H5_HAVE_SYS_PROC_H +#include +#endif +#ifdef H5_HAVE_IO_H +#include +#endif + +/* * Dynamic library handling. These are needed for dynamically loading I/O * filters and VFDs. */ @@ -130,21 +173,21 @@ #define H5_DEFAULT_VOL H5VL_NATIVE #ifdef H5_HAVE_WIN32_API - /* The following two defines must be before any windows headers are included */ #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ #define NOGDI /* Exclude Graphic Display Interface macros */ -#include - -#include /* For _getcwd() */ -#include /* POSIX I/O */ -#include /* For GetUserName() */ +#ifdef H5_HAVE_WINSOCK2_H +#include +#endif #ifdef H5_HAVE_THREADSAFE #include /* For _beginthread() */ #endif +#include +#include /* For _getcwd() */ + #endif /*H5_HAVE_WIN32_API*/ #ifndef F_OK @@ -2523,57 +2566,6 @@ H5_DLL double H5_get_time(void); H5_DLL herr_t H5_build_extpath(const char *name, char **extpath /*out*/); H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/); -/* getopt(3) equivalent that papers over the lack of long options on BSD - * and lack of Windows support. - */ -H5_DLLVAR int H5_opterr; /* get_option prints errors if this is on */ -H5_DLLVAR int H5_optind; /* token pointer */ -H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */ - -enum h5_arg_level { - no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ - optional_arg /* argument is optional */ -}; - -/* - * get_option determines which options are specified on the command line and - * returns a pointer to any arguments possibly associated with the option in - * the ``H5_optarg'' variable. get_option returns the shortname equivalent of - * the option. The long options are specified in the following way: - * - * struct h5_long_options foo[] = { - * { "filename", require_arg, 'f' }, - * { "append", no_arg, 'a' }, - * { "width", require_arg, 'w' }, - * { NULL, 0, 0 } - * }; - * - * Long named options can have arguments specified as either: - * - * ``--param=arg'' or ``--param arg'' - * - * Short named options can have arguments specified as either: - * - * ``-w80'' or ``-w 80'' - * - * and can have more than one short named option specified at one time: - * - * -aw80 - * - * in which case those options which expect an argument need to come at the - * end. - */ -struct h5_long_options { - const char * name; /* Name of the long option */ - enum h5_arg_level has_arg; /* Whether we should look for an arg */ - char shortval; /* The shortname equivalent of long arg - * this gets returned from get_option - */ -}; - -H5_DLL int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); - #ifdef H5_HAVE_PARALLEL /* Generic MPI functions */ H5_DLL hsize_t H5_mpi_set_bigio_count(hsize_t new_count); diff --git a/src/H5public.h b/src/H5public.h index 495af6f..09a2278 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -34,26 +34,28 @@ #ifdef H5_HAVE_FEATURES_H #include /* For setting POSIX, BSD, etc. compatibility */ #endif - -/* C library header files for things that appear in HDF5 public headers */ -#ifdef __cplusplus -#define __STDC_FORMAT_MACROS -#endif -#include -#include -#include -#include -#include -#include - -/* Unlike most sys/ headers, which are POSIX-only, sys/types.h is avaible - * on Windows, though it doesn't necessarily contain all the POSIX types - * we need for HDF5 (e.g. ssize_t). - */ #ifdef H5_HAVE_SYS_TYPES_H #include #endif - +#ifdef H5_STDC_HEADERS +#include /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */ +#include /* For variadic functions in H5VLpublic.h */ +#endif +#ifndef __cplusplus +#ifdef H5_HAVE_STDINT_H +#include /* For C9x types */ +#endif +#else +#ifdef H5_HAVE_STDINT_H_CXX +#include /* For C9x types (when included from C++) */ +#endif +#endif +#ifdef H5_HAVE_INTTYPES_H +#include /* C99/POSIX.1 header for uint64_t, PRIu64 */ +#endif +#ifdef H5_HAVE_STDDEF_H +#include +#endif #ifdef H5_HAVE_PARALLEL /* Don't link against MPI C++ bindings */ #define MPICH_SKIP_MPICXX 1 @@ -215,6 +217,19 @@ typedef int herr_t; * } * \endcode */ +#ifdef H5_HAVE_STDBOOL_H +#include +#else /* H5_HAVE_STDBOOL_H */ +#ifndef __cplusplus +#if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0) +#define bool _Bool +#else +#define bool unsigned int +#endif +#define true 1 +#define false 0 +#endif /* __cplusplus */ +#endif /* H5_HAVE_STDBOOL_H */ typedef bool hbool_t; typedef int htri_t; diff --git a/src/H5system.c b/src/H5system.c index 56110ea..144e0bc 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -487,7 +487,7 @@ Wsetenv(const char *name, const char *value, int overwrite) return (int)_putenv_s(name, value); } /* end Wsetenv() */ -#ifdef H5_HAVE_WIN32_API +#ifdef H5_HAVE_WINSOCK2_H #pragma comment(lib, "advapi32.lib") #endif @@ -572,12 +572,12 @@ char * Wgetlogin(void) { -#ifdef H5_HAVE_WIN32_API +#ifdef H5_HAVE_WINSOCK2_H DWORD bufferCount = WloginBuffer_count; if (GetUserName(Wlogin_buffer, &bufferCount) != 0) return (Wlogin_buffer); else -#endif +#endif /* H5_HAVE_WINSOCK2_H */ return NULL; } @@ -964,7 +964,10 @@ done: * Note that commodity hardware is probably going to have a * resolution of milliseconds, not nanoseconds. * - * Return: void + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * October 01, 2016 *-------------------------------------------------------------------------- */ void @@ -973,40 +976,21 @@ H5_nanosleep(uint64_t nanosec) FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5_HAVE_WIN32_API - DWORD dwMilliseconds = (DWORD)HDceil(nanosec / 1.0e6); - DWORD ignore; - /* Windows can't sleep at a ns resolution. Best we can do is ~1 ms. We - * don't care about the return value since the second parameter - * (bAlertable) is FALSE, so it will always be zero. + /* On Windows, Sleep() is in milliseconds. Passing 0 to Sleep() + * causes the thread to relinquish the rest of its time slice. */ - ignore = SleepEx(dwMilliseconds, FALSE); + Sleep(nanosec / (1000 * 1000)); #else + { + struct timespec sleeptime; /* Struct to hold time to sleep */ - const uint64_t nanosec_per_sec = 1000 * 1000 * 1000; - struct timespec sleeptime; /* Struct to hold time to sleep */ - - /* Set up time to sleep - * - * Assuming ILP32 or LP64 or wider architecture, (long)operand - * satisfies 0 <= operand < nanosec_per_sec < LONG_MAX. - * - * It's harder to be sure that we don't overflow time_t. - */ - sleeptime.tv_sec = (time_t)(nanosec / nanosec_per_sec); - sleeptime.tv_nsec = (long)(nanosec % nanosec_per_sec); + /* Set up time to sleep */ + sleeptime.tv_sec = 0; + sleeptime.tv_nsec = (long)nanosec; - /* Sleep for up to `sleeptime` and, in the event of an interruption, - * save the unslept time back to `sleeptime`. - */ - while (HDnanosleep(&sleeptime, &sleeptime) == -1) { - /* If we were just interrupted, sleep for the remaining time. - * Otherwise, the error was essentially impossible, so just stop - * sleeping. - */ - if (errno != EINTR) - break; + HDnanosleep(&sleeptime, NULL); } #endif @@ -1058,167 +1042,3 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5_expand_windows_env_vars() */ #endif /* H5_HAVE_WIN32_API */ - -/* Global variables */ -int H5_opterr = 1; /* Get_option prints errors if this is on */ -int H5_optind = 1; /* Token pointer */ -const char *H5_optarg; /* Flag argument (or value) */ - -/*------------------------------------------------------------------------- - * Function: H5_get_option - * - * Purpose: Determine the command-line options a user specified. We can - * accept both short and long type command-lines. - * - * Return: Success: The short valued "name" of the command line - * parameter or EOF if there are no more - * parameters to process. - * - * Failure: A question mark. - *------------------------------------------------------------------------- - */ -int -H5_get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) -{ - static int sp = 1; /* character index in current token */ - int optopt = '?'; /* option character passed back to user */ - - if (sp == 1) { - /* check for more flag-like tokens */ - if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { - return EOF; - } - else if (HDstrcmp(argv[H5_optind], "--") == 0) { - H5_optind++; - return EOF; - } - } - - if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { - /* long command line option */ - int i; - const char ch = '='; - char * arg = HDstrdup(&argv[H5_optind][2]); - size_t arg_len = 0; - - H5_optarg = strchr(&argv[H5_optind][2], ch); - arg_len = HDstrlen(&argv[H5_optind][2]); - if (H5_optarg) { - arg_len -= HDstrlen(H5_optarg); - H5_optarg++; /* skip the equal sign */ - } - arg[arg_len] = 0; - - for (i = 0; l_opts && l_opts[i].name; i++) { - if (HDstrcmp(arg, l_opts[i].name) == 0) { - /* we've found a matching long command line flag */ - optopt = l_opts[i].shortval; - - if (l_opts[i].has_arg != no_arg) { - if (H5_optarg == NULL) { - if (l_opts[i].has_arg != optional_arg) { - if (H5_optind < (argc - 1)) - if (argv[H5_optind + 1][0] != '-') - H5_optarg = argv[++H5_optind]; - } - else if (l_opts[i].has_arg == require_arg) { - if (H5_opterr) - HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); - - optopt = '?'; - } - } - } - else { - if (H5_optarg) { - if (H5_opterr) - HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); - - optopt = '?'; - } - } - break; - } - } - - if (l_opts[i].name == NULL) { - /* exhausted all of the l_opts we have and still didn't match */ - if (H5_opterr) - HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); - - optopt = '?'; - } - - H5_optind++; - sp = 1; - - HDfree(arg); - } - else { - register char *cp; /* pointer into current token */ - - /* short command line option */ - optopt = argv[H5_optind][sp]; - - if (optopt == ':' || (cp = HDstrchr(opts, optopt)) == 0) { - if (H5_opterr) - HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], optopt); - - /* if no chars left in this token, move to next token */ - if (argv[H5_optind][++sp] == '\0') { - H5_optind++; - sp = 1; - } - return '?'; - } - - if (*++cp == ':') { - /* if a value is expected, get it */ - if (argv[H5_optind][sp + 1] != '\0') { - /* flag value is rest of current token */ - H5_optarg = &argv[H5_optind++][sp + 1]; - } - else if (++H5_optind >= argc) { - if (H5_opterr) - HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], optopt); - - optopt = '?'; - } - else { - /* flag value is next token */ - H5_optarg = argv[H5_optind++]; - } - - sp = 1; - } - /* wildcard argument */ - else if (*cp == '*') { - /* check the next argument */ - H5_optind++; - /* we do have an extra argument, check if not last */ - if ((H5_optind + 1) < argc) { - if (argv[H5_optind][0] != '-') { - H5_optarg = argv[H5_optind++]; - } - else { - H5_optarg = NULL; - } - } - else { - H5_optarg = NULL; - } - } - else { - /* set up to look at next char in token, next time */ - if (argv[H5_optind][++sp] == '\0') { - /* no more in current token, so setup next token */ - H5_optind++; - sp = 1; - } - H5_optarg = NULL; - } - } - - /* return the current flag character found */ - return optopt; -} diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 0617643..88911b0 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -45,6 +45,7 @@ typedef __int64 h5_stat_size_t; #define HDlseek(F, O, W) _lseeki64(F, O, W) #define HDlstat(S, B) _lstati64(S, B) #define HDmkdir(S, M) _mkdir(S) +#define HDnanosleep(N, O) Wnanosleep(N, O) #define HDoff_t __int64 /* Note that the variadic HDopen macro is using a VC++ extension diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index ea39250..402ade4 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -646,10 +646,10 @@ set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST WILL_FAIL "true" ) -# release + 1 should pass add_test (NAME H5TEST-tcheck_version-release COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ "-tr") set_tests_properties (H5TEST-tcheck_version-release PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + WILL_FAIL "true" ) ############################################################################## diff --git a/test/cache.c b/test/cache.c index 48f03e6..31d6619 100644 --- a/test/cache.c +++ b/test/cache.c @@ -1046,7 +1046,7 @@ smoke_check_5(int express_test, unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), - /* double min_clean_fraction = */ 0.1, + /* double min_clean_fraction = */ 0.1f, /* size_t max_size = */ (32 * 1024 * 1025), /* size_t min_size = */ (512 * 1024), @@ -1055,23 +1055,23 @@ smoke_check_5(int express_test, unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.9, + /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -1079,7 +1079,7 @@ smoke_check_5(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.5 + /* double empty_reserve = */ 0.5f }; if (paged) @@ -1278,7 +1278,7 @@ smoke_check_6(int express_test, unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), - /* double min_clean_fraction = */ 0.1, + /* double min_clean_fraction = */ 0.1f, /* size_t max_size = */ (32 * 1024 * 1025), /* size_t min_size = */ (512 * 1024), @@ -1287,23 +1287,23 @@ smoke_check_6(int express_test, unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.9, + /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -1311,7 +1311,7 @@ smoke_check_6(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05 + /* double empty_reserve = */ 0.05f }; if (paged) @@ -1510,7 +1510,7 @@ smoke_check_7(int express_test, unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), - /* double min_clean_fraction = */ 0.1, + /* double min_clean_fraction = */ 0.1f, /* size_t max_size = */ (32 * 1024 * 1025), /* size_t min_size = */ (512 * 1024), @@ -1519,24 +1519,24 @@ smoke_check_7(int express_test, unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (8 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.9, + /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -1544,7 +1544,7 @@ smoke_check_7(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1 + /* double empty_reserve = */ 0.1f }; if (paged) @@ -1743,7 +1743,7 @@ smoke_check_8(int express_test, unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), - /* double min_clean_fraction = */ 0.1, + /* double min_clean_fraction = */ 0.1f, /* size_t max_size = */ (32 * 1024 * 1025), /* size_t min_size = */ (512 * 1024), @@ -1752,24 +1752,24 @@ smoke_check_8(int express_test, unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.9, + /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -1777,7 +1777,7 @@ smoke_check_8(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1 + /* double empty_reserve = */ 0.1f }; if (paged) @@ -8068,6 +8068,19 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu if ((check[i].entry_num != i) || (check[i].entry_type < 0) || (check[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || (check[i].entry_index < 0) || (check[i].entry_index > max_indices[check[i].entry_type]) || +#ifndef H5_HAVE_STDBOOL_H + /* Check for nonsense values if hbool_t is an integral + * type instead of a real Boolean. + */ + ((check[i].in_cache != TRUE) && (check[i].in_cache != FALSE)) || + ((check[i].at_main_addr != TRUE) && (check[i].at_main_addr != FALSE)) || + ((check[i].is_dirty != TRUE) && (check[i].is_dirty != FALSE)) || + ((check[i].is_protected != TRUE) && (check[i].is_protected != FALSE)) || + ((check[i].is_pinned != TRUE) && (check[i].is_pinned != FALSE)) || + ((check[i].expected_deserialized != TRUE) && (check[i].expected_deserialized != FALSE)) || + ((check[i].expected_serialized != TRUE) && (check[i].expected_serialized != FALSE)) || + ((check[i].expected_destroyed != TRUE) && (check[i].expected_destroyed != FALSE)) || +#endif /* H5_HAVE_STDBOOL_H */ (check[i].expected_size <= (size_t)0)) { pass = FALSE; @@ -16989,7 +17002,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (512 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (14 * 1024 * 1024), /* size_t min_size = */ (512 * 1024), @@ -16998,23 +17011,23 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.1, + /* double decrement = */ 0.1f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -17022,7 +17035,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05}; + /* double empty_reserve = */ 0.05f}; if (paged) TESTING("automatic cache resizing (paged aggregation)") @@ -17346,7 +17359,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1000 * 1000 + 10; - auto_size_ctl.min_clean_fraction = 0.1; + auto_size_ctl.min_clean_fraction = 0.1f; auto_size_ctl.max_size = 8 * 1000 * 1000; auto_size_ctl.min_size = 500 * 1000; @@ -17355,22 +17368,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1000 * 1000); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1000 * 1000); @@ -17378,7 +17391,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -17661,7 +17674,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -17670,22 +17683,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 4.0; + auto_size_ctl.increment = 4.0f; auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.25; + auto_size_ctl.decrement = 0.25f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -17693,7 +17706,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -17837,7 +17850,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -17846,22 +17859,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -17869,7 +17882,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -18205,7 +18218,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -18214,22 +18227,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -18237,7 +18250,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -18687,7 +18700,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -18696,22 +18709,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -18719,7 +18732,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */ result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -19064,7 +19077,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -19073,16 +19086,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; @@ -19091,7 +19104,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) */ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -19099,7 +19112,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -19311,7 +19324,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1000 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1000 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -19320,22 +19333,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1000 * 1024); @@ -19343,7 +19356,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */ result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -19853,7 +19866,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 64 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 1024 * 1024; auto_size_ctl.min_size = 5 * 1024; @@ -19862,22 +19875,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (32 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - auto_size_ctl.flash_multiple = 1.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 1.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1000 * 1024); @@ -19885,7 +19898,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */ result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -20587,7 +20600,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 20 * 1024; auto_size_ctl.min_size = 4 * 1024; @@ -20596,22 +20609,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.4; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.4f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (2 * 1024); @@ -20619,7 +20632,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */ result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if (result != SUCCEED) { @@ -20844,7 +20857,7 @@ check_auto_cache_resize_disable(unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (512 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (14 * 1024 * 1024), /* size_t min_size = */ (512 * 1024), @@ -20853,23 +20866,23 @@ check_auto_cache_resize_disable(unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 1.0, - /* double flash_threshold = */ 0.25, + /* double flash_multiple = */ 1.0f, + /* double flash_threshold = */ 0.25f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.1, + /* double decrement = */ 0.1f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -20877,7 +20890,7 @@ check_auto_cache_resize_disable(unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05}; + /* double empty_reserve = */ 0.05f}; if (paged) TESTING("automatic cache resize disable (paged aggregation)") @@ -20949,7 +20962,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -20958,22 +20971,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 1.0; /* disable size increases */ + auto_size_ctl.increment = 1.0f; /* disable size increases */ auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -20981,7 +20994,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21101,7 +21114,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21110,21 +21123,21 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */ + auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increases */ - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.upper_hr_threshold = 0.995f; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -21132,7 +21145,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21252,7 +21265,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21261,22 +21274,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -21284,7 +21297,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21403,7 +21416,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21412,22 +21425,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 1.0; /* disable size decreases */ + auto_size_ctl.decrement = 1.0f; /* disable size decreases */ auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -21435,7 +21448,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21557,7 +21570,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21566,22 +21579,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */ + auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decreases */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -21589,7 +21602,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21707,7 +21720,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21716,22 +21729,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -21739,7 +21752,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -21859,7 +21872,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -21868,22 +21881,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = 0; /* disable decrement */ @@ -21891,7 +21904,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22076,7 +22089,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -22085,22 +22098,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22108,7 +22121,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 1.0; /* disable decrement */ + auto_size_ctl.empty_reserve = 1.0f; /* disable decrement */ result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22300,7 +22313,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -22309,22 +22322,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 1.0; + auto_size_ctl.upper_hr_threshold = 1.0f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22332,7 +22345,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22526,7 +22539,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 2 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -22535,22 +22548,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */ + auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increases */ - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */ + auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decreases */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22558,7 +22571,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22646,7 +22659,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.25; + auto_size_ctl.min_clean_fraction = 0.25f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -22655,22 +22668,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 1.0; /* disable size increment */ + auto_size_ctl.increment = 1.0f; /* disable size increment */ auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 1.0; /* disable size decrement */ + auto_size_ctl.decrement = 1.0f; /* disable size decrement */ auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22678,7 +22691,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22766,7 +22779,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = FALSE; auto_size_ctl.initial_size = 2 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 6 * 1024 * 1024; /* no resize */ auto_size_ctl.min_size = 6 * 1024 * 1024; /* no resize */ @@ -22775,22 +22788,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22798,7 +22811,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -22886,7 +22899,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.25; + auto_size_ctl.min_clean_fraction = 0.25f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -22895,22 +22908,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 1.0; /* disable size increment */ + auto_size_ctl.increment = 1.0f; /* disable size increment */ auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decrement */ + auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decrement */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -22918,7 +22931,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23006,7 +23019,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -23015,22 +23028,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increment */ + auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increment */ - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 1.0; /* disable size decrement */ + auto_size_ctl.decrement = 1.0f; /* disable size decrement */ auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23038,7 +23051,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23126,7 +23139,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 4 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 16 * 1024 * 1024; auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -23135,22 +23148,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23158,7 +23171,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23273,7 +23286,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 64 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 256 * 1024; auto_size_ctl.min_size = 32 * 1024; @@ -23282,22 +23295,22 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 1.0; - auto_size_ctl.flash_threshold = 0.25; + auto_size_ctl.flash_multiple = 1.0f; + auto_size_ctl.flash_threshold = 0.25f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024); @@ -23305,7 +23318,7 @@ check_auto_cache_resize_disable(unsigned paged) auto_size_ctl.epochs_before_eviction = 3; auto_size_ctl.apply_empty_reserve = TRUE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23443,7 +23456,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (512 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (14 * 1024 * 1024), /* size_t min_size = */ (512 * 1024), @@ -23452,23 +23465,23 @@ check_auto_cache_resize_epoch_markers(unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.1, + /* double decrement = */ 0.1f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -23476,7 +23489,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05}; + /* double empty_reserve = */ 0.05f}; if (paged) TESTING("automatic cache resize epoch marker management (paged aggr)") @@ -23530,7 +23543,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -23539,22 +23552,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23562,7 +23575,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23694,7 +23707,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -23703,22 +23716,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23726,7 +23739,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23812,7 +23825,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -23821,22 +23834,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23844,7 +23857,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23890,7 +23903,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -23899,22 +23912,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -23922,7 +23935,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -23999,7 +24012,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.set_initial_size = TRUE; auto_size_ctl.initial_size = 8 * 1024 * 1024; - auto_size_ctl.min_clean_fraction = 0.5; + auto_size_ctl.min_clean_fraction = 0.5f; auto_size_ctl.max_size = 8 * 1024 * 1024; auto_size_ctl.min_size = 512 * 1024; @@ -24008,22 +24021,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75f; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0f; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - auto_size_ctl.flash_multiple = 2.0; - auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.flash_multiple = 2.0f; + auto_size_ctl.flash_threshold = 0.5f; auto_size_ctl.decr_mode = H5C_decr__off; - auto_size_ctl.upper_hr_threshold = 0.995; + auto_size_ctl.upper_hr_threshold = 0.995f; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5f; auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24031,7 +24044,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -24131,7 +24144,7 @@ check_auto_cache_resize_input_errs(unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (512 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (16 * 1024 * 1024), /* size_t min_size = */ (512 * 1024), @@ -24140,23 +24153,23 @@ check_auto_cache_resize_input_errs(unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.1, + /* double decrement = */ 0.1f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -24164,7 +24177,7 @@ check_auto_cache_resize_input_errs(unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05}; + /* double empty_reserve = */ 0.05f}; H5C_auto_size_ctl_t invalid_auto_size_ctl; H5C_auto_size_ctl_t test_auto_size_ctl; @@ -24234,7 +24247,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24243,22 +24256,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.7; + invalid_auto_size_ctl.lower_hr_threshold = 0.7f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24266,7 +24279,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(NULL, &invalid_auto_size_ctl); @@ -24303,7 +24316,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24312,22 +24325,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.7; + invalid_auto_size_ctl.lower_hr_threshold = 0.7f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24335,7 +24348,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24373,7 +24386,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.initial_size = 16 * 1024 * 1024 + 1; /* INVALID */ - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24382,22 +24395,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24405,7 +24418,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24441,7 +24454,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.initial_size = 1 * 1024 * 1024 - 1; /* INVALID */ - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24450,22 +24463,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24473,7 +24486,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24510,7 +24523,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 1.00001; /* INVALID */ + invalid_auto_size_ctl.min_clean_fraction = 1.00001f; /* INVALID */ invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24519,22 +24532,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24542,7 +24555,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24577,7 +24590,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = -0.00001; /* INVALID */ + invalid_auto_size_ctl.min_clean_fraction = -0.00001f; /* INVALID */ invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24586,22 +24599,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24609,7 +24622,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24646,7 +24659,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = H5C__MAX_MAX_CACHE_SIZE + 1; /* INVALID */ @@ -24656,22 +24669,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24679,7 +24692,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24714,7 +24727,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 1 * 1024 * 1024; /* INVALID */ invalid_auto_size_ctl.min_size = 1 * 1024 * 1024 + 1; /*PAIR */ @@ -24723,22 +24736,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24746,7 +24759,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24781,7 +24794,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = H5C__MIN_MAX_CACHE_SIZE - 1; @@ -24790,22 +24803,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24813,7 +24826,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24850,7 +24863,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24860,22 +24873,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24883,7 +24896,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24918,7 +24931,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24928,22 +24941,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -24951,7 +24964,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -24988,7 +25001,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -24997,22 +25010,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode) - 1; /* INVALID */ - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25020,7 +25033,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25055,7 +25068,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25064,22 +25077,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode)2; /* INVALID */ - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25087,7 +25100,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25124,7 +25137,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25133,22 +25146,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.7; + invalid_auto_size_ctl.lower_hr_threshold = 0.7f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 1.01; /* INVALID */ + invalid_auto_size_ctl.upper_hr_threshold = 1.01f; /* INVALID */ - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25156,7 +25169,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25191,7 +25204,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25200,22 +25213,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.8; /* INVALID */ + invalid_auto_size_ctl.lower_hr_threshold = 0.8f; /* INVALID */ - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.7; /* INVALID */ + invalid_auto_size_ctl.upper_hr_threshold = 0.7f; /* INVALID */ - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25223,7 +25236,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25258,7 +25271,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.5; + invalid_auto_size_ctl.min_clean_fraction = 0.5f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25267,22 +25280,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = -0.0001; /* INVALID */ + invalid_auto_size_ctl.lower_hr_threshold = -0.0001f; /* INVALID */ - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25290,7 +25303,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25327,7 +25340,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25336,22 +25349,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 0.99999; /* INVALID */ + invalid_auto_size_ctl.increment = 0.99999f; /* INVALID */ invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.5; + invalid_auto_size_ctl.decrement = 0.5f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25359,7 +25372,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25396,7 +25409,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25405,22 +25418,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = (enum H5C_cache_flash_incr_mode) - 1; /* INVALID */ - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25428,7 +25441,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25465,7 +25478,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25474,22 +25487,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 0.09; /* INVALID */ - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25497,7 +25510,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25532,7 +25545,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25541,22 +25554,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 10.01; /* INVALID */ - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25564,7 +25577,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25601,7 +25614,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25610,22 +25623,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 1.0; - invalid_auto_size_ctl.flash_threshold = 0.09; /* INVALID */ + invalid_auto_size_ctl.flash_multiple = 1.0f; + invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */ invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25633,7 +25646,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25668,7 +25681,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25677,22 +25690,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space; - invalid_auto_size_ctl.flash_multiple = 1.0; - invalid_auto_size_ctl.flash_threshold = 1.001; /* INVALID */ + invalid_auto_size_ctl.flash_multiple = 1.0f; + invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */ invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25700,7 +25713,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25737,7 +25750,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25746,22 +25759,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode) - 1; /* INVALID */ - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25769,7 +25782,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25804,7 +25817,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25813,22 +25826,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode)4; /* INVALID */ - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25836,7 +25849,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25873,7 +25886,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25882,22 +25895,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 1.000001; /* INVALID */ + invalid_auto_size_ctl.decrement = 1.000001f; /* INVALID */ invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25905,7 +25918,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -25940,7 +25953,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -25949,22 +25962,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = -0.000001; /* INVALID */ + invalid_auto_size_ctl.decrement = -0.000001f; /* INVALID */ invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -25972,7 +25985,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -26009,7 +26022,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -26018,22 +26031,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -26041,7 +26054,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 0; /* INVALID */ invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -26076,7 +26089,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -26085,22 +26098,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -26108,7 +26121,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */ invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -26145,7 +26158,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -26154,22 +26167,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -26177,7 +26190,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = 3; invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */ + invalid_auto_size_ctl.empty_reserve = -0.0000001f; /* INVALID */ result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -26212,7 +26225,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.set_initial_size = TRUE; invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; - invalid_auto_size_ctl.min_clean_fraction = 0.1; + invalid_auto_size_ctl.min_clean_fraction = 0.1f; invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; @@ -26221,22 +26234,22 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; - invalid_auto_size_ctl.lower_hr_threshold = 0.75; + invalid_auto_size_ctl.lower_hr_threshold = 0.75f; - invalid_auto_size_ctl.increment = 2.0; + invalid_auto_size_ctl.increment = 2.0f; invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off; - invalid_auto_size_ctl.flash_multiple = 2.0; - invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.flash_multiple = 2.0f; + invalid_auto_size_ctl.flash_threshold = 0.5f; invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - invalid_auto_size_ctl.upper_hr_threshold = 0.999; + invalid_auto_size_ctl.upper_hr_threshold = 0.999f; - invalid_auto_size_ctl.decrement = 0.9; + invalid_auto_size_ctl.decrement = 0.9f; invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -26244,7 +26257,7 @@ check_auto_cache_resize_input_errs(unsigned paged) invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */ invalid_auto_size_ctl.apply_empty_reserve = TRUE; - invalid_auto_size_ctl.empty_reserve = 0.05; + invalid_auto_size_ctl.empty_reserve = 0.05f; result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); @@ -26372,7 +26385,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (16 * 1024 * 1025), /* size_t min_size = */ (512 * 1024), @@ -26381,23 +26394,23 @@ check_auto_cache_resize_aux_fcns(unsigned paged) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.9, + /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -26405,7 +26418,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.5 + /* double empty_reserve = */ 0.5f }; if (paged) @@ -34298,7 +34311,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), - /* double min_clean_fraction = */ 0.5, + /* double min_clean_fraction = */ 0.5f, /* size_t max_size = */ (8 * 1024 * 1024), /* size_t min_size = */ (1 * 1024 * 1024), @@ -34307,23 +34320,23 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.75, + /* double lower_hr_threshold = */ 0.75f, - /* double increment = */ 2.0, + /* double increment = */ 2.0f, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0, - /* double flash_threshold = */ 0.5, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out, - /* double upper_hr_threshold = */ 0.995, + /* double upper_hr_threshold = */ 0.995f, - /* double decrement = */ 0.5, + /* double decrement = */ 0.5f, /* hbool_t apply_max_decrement = */ FALSE, /* size_t max_decrement = */ (1 * 1024 * 1024), @@ -34331,7 +34344,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* int32_t epochs_before_eviction = */ 1, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05}; + /* double empty_reserve = */ 0.05f}; if (pass) { diff --git a/test/cache_common.c b/test/cache_common.c index e86724f..7269c49 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1487,6 +1487,12 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); HDassert((0 <= idx) && (idx <= max_indices[type])); HDassert(new_size <= VARIABLE_ENTRY_SIZE); +#ifndef H5_HAVE_STDBOOL_H + /* Check for TRUE or FALSE if we're using an integer type instead + * of a real Boolean type. + */ + HDassert((flag == TRUE) || (flag == FALSE)); +#endif /* H5_HAVE_STDBOOL_H */ if (pass) { @@ -1686,6 +1692,12 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o HDassert((0 <= op_ptr->type) && (op_ptr->type < NUMBER_OF_ENTRY_TYPES)); HDassert((0 <= op_ptr->idx) && (op_ptr->idx <= max_indices[op_ptr->type])); HDassert(flags_ptr != NULL); +#ifndef H5_HAVE_STDBOOL_H + /* Check for TRUE or FALSE if we're using an integer type instead + * of a real Boolean type. + */ + HDassert((op_ptr->flag == FALSE) || (op_ptr->flag == TRUE)); +#endif /* H5_HAVE_STDBOOL_H */ if (pass) { diff --git a/test/err_compat.c b/test/err_compat.c index 6ad69d8..6f3cfb3 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -228,14 +228,16 @@ test_error_compat(void) if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; - /* Use H5Eget_auto2 to query the default printing function. */ + /* Use H5Eget_auto2 to query the default printing function. The library + *should indicate H5Eprint2 as the default. */ if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data) < 0) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (old_func2 == NULL) + if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) TEST_ERROR; + /* This function sets the default printing function to be H5Eprint2. */ if (H5Eset_auto2(H5E_DEFAULT, old_func2, old_data) < 0) TEST_ERROR; @@ -280,12 +282,12 @@ test_error_compat(void) if (did >= 0) TEST_ERROR; - /* This function changes the new-style printing function to the original. */ - if (H5Eset_auto2(H5E_DEFAULT, old_func2, NULL) < 0) + /* This function changes the new-style printing function back to the default H5Eprint2. */ + if (H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL) < 0) TEST_ERROR; - /* This call should work because the H5Eset_auto2 above set the default printing - * function to H5Eprint2. It simply returns user_print1. */ + /* This call should work because the H5Eset_auto2 above restored the default printing + * function H5Eprint2. It simply returns user_print1. */ if ((ret = H5Eget_auto1(&old_func1, &old_data)) < 0) TEST_ERROR; if (old_data != NULL) @@ -303,7 +305,7 @@ test_error_compat(void) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (old_func2 == NULL) + if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) TEST_ERROR; /* Try the printing function. Dataset creation should fail because the file diff --git a/test/error_test.c b/test/error_test.c index f470318..c8205ff8 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -129,7 +129,7 @@ test_error(hid_t file) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (old_func == NULL) + if (old_func != (H5E_auto2_t)H5Eprint2) TEST_ERROR; if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) diff --git a/test/h5test.c b/test/h5test.c index 47102d4..b37409a 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1237,10 +1237,9 @@ h5_set_info_object(void) valp++; /* copy key/value pair into temporary buffer */ - len = HDstrcspn(valp, ";"); - next = &valp[len]; - if (NULL == (key_val = (char *)HDcalloc(1, len + 1))) - return -1; + len = strcspn(valp, ";"); + next = &valp[len]; + key_val = (char *)HDcalloc(1, len + 1); /* increment the next pointer past the terminating semicolon */ if (*next == ';') diff --git a/test/tarray.c b/test/tarray.c index af167a7..8b518cf 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -157,9 +157,8 @@ test_array_atomic_1d(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -491,9 +490,8 @@ test_array_array_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims1; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -670,9 +668,8 @@ test_array_compound_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -892,9 +889,8 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -955,9 +951,9 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf( + "Nested array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1214,9 +1210,8 @@ test_array_vlen_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1445,9 +1440,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1478,9 +1472,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2088,9 +2081,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2136,9 +2129,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE - ", tdims1[%d]=%" PRIuHSIZE "\n", - i, rdims1[i], i, tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index 6378ee5..43d1b46 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -15,7 +15,7 @@ # Tests for the H5check_version function. # # Programmer: Albert Cheng -# Sep 28, 2009 +# Sep 28, 2009 srcdir=@srcdir@ @@ -24,7 +24,7 @@ srcdir=@srcdir@ Shared_Lib=@enable_shared@ Static_Lib=@enable_static@ Static_exec=@STATIC_EXEC@ -h5haveexitcode=yes # default is yes +h5haveexitcode=yes # default is yes CMP='cmp -s' DIFF='diff -c' @@ -103,10 +103,10 @@ WarnMesg2(){ # mismatch). # # Expected results: -# Value of $HDF5_DISABLE_VERSION_CHECK -# unset "" -1 0 1 2 3 -# Matched OK OK OK OK OK OK OK -# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK +# Value of $HDF5_DISABLE_VERSION_CHECK +# unset "" -1 0 1 2 3 +# Matched OK OK OK OK OK OK OK +# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK # Result codes: # OK: No warning, exit 0. # W/A: Warning, abort and exit non-0. @@ -130,42 +130,42 @@ TESTING() { xxh5versrelease=$h5versrelease if [ "$h5DisableVersion" = unset ]; then - envcmd="" # noop + envcmd="" # noop else - envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion" + envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion" fi if [ "$wrongversionnumbers" = none ]; then - # OK: No warning, exit 0 - cp /dev/null $expect - expect_code=0 + # OK: No warning, exit 0 + cp /dev/null $expect + expect_code=0 else - arguments=-t"$wrongversionnumbers" - # calculate mismatched version numbers by listing. - case $wrongversionnumbers in - "M") xxh5versmajor=`expr $h5versmajor + 1` - ;; - "m") xxh5versminor=`expr $h5versminor + 1` - ;; - "r") xxh5versrelease=`expr $h5versrelease + 1` - ;; - esac - case "$h5DisableVersion" in - 1) - # W2/OK: Different Warning, exit 0. - WarnMesg2 > $expect - expect_code=0 - ;; - [2-9]|[1-9][0-9]*) - # OK: No warning, exit 0 - cp /dev/null $expect - expect_code=0 - ;; - *) # W/A: Warning, abort and exit non-0. - WarnMesg > $expect - expect_code=6 # Signal Abort exit code (128+6) - ;; - esac + arguments=-t"$wrongversionnumbers" + # calculate mismatched version numbers by listing. + case $wrongversionnumbers in + "M") xxh5versmajor=`expr $h5versmajor + 1` + ;; + "m") xxh5versminor=`expr $h5versminor + 1` + ;; + "r") xxh5versrelease=`expr $h5versrelease + 1` + ;; + esac + case "$h5DisableVersion" in + 1) + # W2/OK: Different Warning, exit 0. + WarnMesg2 > $expect + expect_code=0 + ;; + [2-9]|[1-9][0-9]*) + # OK: No warning, exit 0 + cp /dev/null $expect + expect_code=0 + ;; + *) # W/A: Warning, abort and exit non-0. + WarnMesg > $expect + expect_code=6 # Signal Abort exit code (128+6) + ;; + esac fi # Run test. @@ -177,23 +177,23 @@ TESTING() { cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then - echo "*FAILED*" - echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file. # Also clean the core file generated by H5check_version's abort. if test -z "$HDF5_NOCLEANUP"; then - $RM $expect $actual $actual_err - $RM core + $RM $expect $actual $actual_err + $RM core fi } @@ -201,15 +201,15 @@ TESTING() { # Echo parameters for debugging if verbose mode is on. DEBUGPRINT() { if [ -n "$debugmode" ]; then - echo $* + echo $* fi } # MAIN Body nerrors=0 -verbose=yes # default on -debugmode= # default off +verbose=yes # default on +debugmode= # default off H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h` h5libsettings=../src/libhdf5.settings @@ -240,13 +240,13 @@ fi # Three Categories of tests: # Normal: where the version numbers all matched (wrong_version == none). # Mismatched version numbers (could be Major or minor version -# or release numbers or a combination of all three.) +# or release numbers or a combination of all three.) # Test all the above with different values of the environment variable, # HDF5_DISABLE_VERSION_CHECK, as unset, "", -1, 0, 1, 2, 3 for val_disable_version_check in unset "" -1 0 1 2 3; do - for wrong_version in none M m; do - TESTING "$val_disable_version_check" "$wrong_version" + for wrong_version in none M m r; do + TESTING "$val_disable_version_check" "$wrong_version" done done diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index f2407bf..6aec6b8 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -25,8 +25,12 @@ #include "H5FDros3.h" #endif -/* Global variables */ -unsigned h5tools_nCols = 80; +/* global variables */ +unsigned h5tools_nCols = 80; +/* ``get_option'' variables */ +int opt_err = 1; /*get_option prints errors if this is on */ +int opt_ind = 1; /*token pointer */ +const char * opt_arg; /*flag argument (or value) */ static int h5tools_d_status = 0; static const char *h5tools_progname = "h5tools"; @@ -158,6 +162,167 @@ help_ref_msg(FILE *output) HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname()); } +/*------------------------------------------------------------------------- + * Function: get_option + * + * Purpose: Determine the command-line options a user specified. We can + * accept both short and long type command-lines. + * + * Return: Success: The short valued "name" of the command line + * parameter or EOF if there are no more + * parameters to process. + * + * Failure: A question mark. + *------------------------------------------------------------------------- + */ +int +get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) +{ + static int sp = 1; /* character index in current token */ + int opt_opt = '?'; /* option character passed back to user */ + + if (sp == 1) { + /* check for more flag-like tokens */ + if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { + return EOF; + } + else if (HDstrcmp(argv[opt_ind], "--") == 0) { + opt_ind++; + return EOF; + } + } + + if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { + /* long command line option */ + int i; + const char ch = '='; + char * arg = HDstrdup(&argv[opt_ind][2]); + size_t arg_len = 0; + + opt_arg = strchr(&argv[opt_ind][2], ch); + arg_len = HDstrlen(&argv[opt_ind][2]); + if (opt_arg) { + arg_len -= HDstrlen(opt_arg); + opt_arg++; /* skip the equal sign */ + } + arg[arg_len] = 0; + + for (i = 0; l_opts && l_opts[i].name; i++) { + if (HDstrcmp(arg, l_opts[i].name) == 0) { + /* we've found a matching long command line flag */ + opt_opt = l_opts[i].shortval; + + if (l_opts[i].has_arg != no_arg) { + if (opt_arg == NULL) { + if (l_opts[i].has_arg != optional_arg) { + if (opt_ind < (argc - 1)) + if (argv[opt_ind + 1][0] != '-') + opt_arg = argv[++opt_ind]; + } + else if (l_opts[i].has_arg == require_arg) { + if (opt_err) + HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], + arg); + + opt_opt = '?'; + } + } + } + else { + if (opt_arg) { + if (opt_err) + HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0], + arg); + + opt_opt = '?'; + } + } + break; + } + } + + if (l_opts[i].name == NULL) { + /* exhausted all of the l_opts we have and still didn't match */ + if (opt_err) + HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg); + + opt_opt = '?'; + } + + opt_ind++; + sp = 1; + + HDfree(arg); + } + else { + register char *cp; /* pointer into current token */ + + /* short command line option */ + opt_opt = argv[opt_ind][sp]; + + if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) { + if (opt_err) + HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt); + + /* if no chars left in this token, move to next token */ + if (argv[opt_ind][++sp] == '\0') { + opt_ind++; + sp = 1; + } + return '?'; + } + + if (*++cp == ':') { + /* if a value is expected, get it */ + if (argv[opt_ind][sp + 1] != '\0') { + /* flag value is rest of current token */ + opt_arg = &argv[opt_ind++][sp + 1]; + } + else if (++opt_ind >= argc) { + if (opt_err) + HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); + + opt_opt = '?'; + } + else { + /* flag value is next token */ + opt_arg = argv[opt_ind++]; + } + + sp = 1; + } + /* wildcard argument */ + else if (*cp == '*') { + /* check the next argument */ + opt_ind++; + /* we do have an extra argument, check if not last */ + if ((opt_ind + 1) < argc) { + if (argv[opt_ind][0] != '-') { + opt_arg = argv[opt_ind++]; + } + else { + opt_arg = NULL; + } + } + else { + opt_arg = NULL; + } + } + else { + /* set up to look at next char in token, next time */ + if (argv[opt_ind][++sp] == '\0') { + /* no more in current token, so setup next token */ + opt_ind++; + sp = 1; + } + opt_arg = NULL; + } + } + + /* return the current flag character found */ + return opt_opt; +} + /***************************************************************************** * * Function: parse_tuple() diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 095ad6c..307ce20 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -40,6 +40,58 @@ H5TOOLS_DLLVAR FILE *overflow_file; H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE; /* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE; +/* + * begin get_option section + */ +H5TOOLS_DLLVAR int opt_err; /* getoption prints errors if this is on */ +H5TOOLS_DLLVAR int opt_ind; /* token pointer */ +H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) */ + +enum { + no_arg = 0, /* doesn't take an argument */ + require_arg, /* requires an argument */ + optional_arg /* argument is optional */ +}; + +/* + * get_option determines which options are specified on the command line and + * returns a pointer to any arguments possibly associated with the option in + * the ``opt_arg'' variable. get_option returns the shortname equivalent of + * the option. The long options are specified in the following way: + * + * struct long_options foo[] = { + * { "filename", require_arg, 'f' }, + * { "append", no_arg, 'a' }, + * { "width", require_arg, 'w' }, + * { NULL, 0, 0 } + * }; + * + * Long named options can have arguments specified as either: + * + * ``--param=arg'' or ``--param arg'' + * + * Short named options can have arguments specified as either: + * + * ``-w80'' or ``-w 80'' + * + * and can have more than one short named option specified at one time: + * + * -aw80 + * + * in which case those options which expect an argument need to come at the + * end. + */ +typedef struct long_options { + const char *name; /* name of the long option */ + int has_arg; /* whether we should look for an arg */ + char shortval; /* the shortname equivalent of long arg + * this gets returned from get_option */ +} long_options; + +H5TOOLS_DLL int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); +/* + * end get_option section + */ /*struct taken from the dumper. needed in table struct*/ typedef struct obj_t { diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h index 0976804..0269b93 100644 --- a/tools/lib/io_timer.h +++ b/tools/lib/io_timer.h @@ -25,7 +25,7 @@ #include #endif -#ifdef H5_HAVE_WIN32_API +#ifdef H5_HAVE_WINSOCK2_H #include #endif /* H5_HAVE_WINSOCK2_H */ diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 4e9a25e..f618914 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -19,23 +19,23 @@ #define PROGRAMNAME "h5copy" /* command-line options: short and long-named parameters */ -static const char * s_opts = "d:f:hi:o:ps:vVE"; -static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'}, - {"flag", require_arg, 'f'}, - {"help", no_arg, 'h'}, - {"input", require_arg, 'i'}, - {"output", require_arg, 'o'}, - {"parents", no_arg, 'p'}, - {"source", require_arg, 's'}, - {"verbose", no_arg, 'v'}, - {"version", no_arg, 'V'}, - {"enable-error-stack", no_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 const char * s_opts = "d:f:hi:o:ps:vVE"; +static struct long_options l_opts[] = {{"destination", require_arg, 'd'}, + {"flag", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"input", require_arg, 'i'}, + {"output", require_arg, 'o'}, + {"parents", no_arg, 'p'}, + {"source", require_arg, 's'}, + {"verbose", no_arg, 'v'}, + {"version", no_arg, 'V'}, + {"enable-error-stack", no_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; /*------------------------------------------------------------------------- * Function: leave @@ -242,19 +242,19 @@ main(int argc, const char *argv[]) } /* end if */ /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'd': - oname_dst = HDstrdup(H5_optarg); + oname_dst = HDstrdup(opt_arg); break; case 'f': /* validate flag */ - if (parse_flag(H5_optarg, &flag) < 0) { + if (parse_flag(opt_arg, &flag) < 0) { usage(); leave(EXIT_FAILURE); } - str_flag = HDstrdup(H5_optarg); + str_flag = HDstrdup(opt_arg); break; case 'h': @@ -263,11 +263,11 @@ main(int argc, const char *argv[]) break; case 'i': - fname_src = HDstrdup(H5_optarg); + fname_src = HDstrdup(opt_arg); break; case 'o': - fname_dst = HDstrdup(H5_optarg); + fname_dst = HDstrdup(opt_arg); break; case 'p': @@ -275,7 +275,7 @@ main(int argc, const char *argv[]) break; case 's': - oname_src = HDstrdup(H5_optarg); + oname_src = HDstrdup(opt_arg); break; case 'V': diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index b669087..1b81824 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -25,30 +25,30 @@ static int check_d_input(const char *); * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"report", no_arg, 'r'}, - {"verbose", optional_arg, 'v'}, - {"quiet", no_arg, 'q'}, - {"count", require_arg, 'n'}, - {"delta", require_arg, 'd'}, - {"relative", require_arg, 'p'}, - {"nan", no_arg, 'N'}, - {"compare", no_arg, 'c'}, - {"use-system-epsilon", no_arg, 'e'}, - {"follow-symlinks", no_arg, 'l'}, - {"no-dangling-links", no_arg, 'x'}, - {"exclude-path", require_arg, 'E'}, - {"exclude-attribute", require_arg, 'A'}, - {"enable-error-stack", no_arg, 'S'}, - {"vol-value-1", require_arg, '1'}, - {"vol-name-1", require_arg, '2'}, - {"vol-info-1", require_arg, '3'}, - {"vol-value-2", require_arg, '4'}, - {"vol-name-2", require_arg, '5'}, - {"vol-info-2", require_arg, '6'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"report", no_arg, 'r'}, + {"verbose", optional_arg, 'v'}, + {"quiet", no_arg, 'q'}, + {"count", require_arg, 'n'}, + {"delta", require_arg, 'd'}, + {"relative", require_arg, 'p'}, + {"nan", no_arg, 'N'}, + {"compare", no_arg, 'c'}, + {"use-system-epsilon", no_arg, 'e'}, + {"follow-symlinks", no_arg, 'l'}, + {"no-dangling-links", no_arg, 'x'}, + {"exclude-path", require_arg, 'E'}, + {"exclude-attribute", require_arg, 'A'}, + {"enable-error-stack", no_arg, 'S'}, + {"vol-value-1", require_arg, '1'}, + {"vol-name-1", require_arg, '2'}, + {"vol-info-1", require_arg, '3'}, + {"vol-value-2", require_arg, '4'}, + {"vol-name-2", require_arg, '5'}, + {"vol-info-2", require_arg, '6'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: check_options @@ -232,7 +232,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char exclude_attr_head = NULL; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { default: usage(); @@ -256,20 +256,20 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char * special check for short opt */ if (!strcmp(argv[i], "-v")) { - if (H5_optarg != NULL) - H5_optind--; + if (opt_arg != NULL) + opt_ind--; opts->mode_verbose_level = 0; break; } else if (!strncmp(argv[i], "-v", (size_t)2)) { - if (H5_optarg != NULL) - H5_optind--; + if (opt_arg != NULL) + opt_ind--; opts->mode_verbose_level = atoi(&argv[i][2]); break; } else { - if (H5_optarg != NULL) - opts->mode_verbose_level = HDatoi(H5_optarg); + if (opt_arg != NULL) + opts->mode_verbose_level = HDatoi(opt_arg); else opts->mode_verbose_level = 0; } @@ -308,7 +308,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } /* init */ - exclude_node->obj_path = H5_optarg; + exclude_node->obj_path = opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; @@ -336,7 +336,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } /* init */ - exclude_attr_node->obj_path = H5_optarg; + exclude_attr_node->obj_path = opt_arg; exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_attr_prev = exclude_attr_head; @@ -356,23 +356,23 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case 'd': opts->delta_bool = 1; - if (check_d_input(H5_optarg) == -1) { - HDprintf("<-d %s> is not a valid option\n", H5_optarg); + if (check_d_input(opt_arg) == -1) { + HDprintf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->delta = HDatof(H5_optarg); + opts->delta = HDatof(opt_arg); /* do not check against default, the DBL_EPSILON is being replaced by user */ break; case 'p': opts->percent_bool = 1; - if (check_p_input(H5_optarg) == -1) { - HDprintf("<-p %s> is not a valid option\n", H5_optarg); + if (check_p_input(opt_arg) == -1) { + HDprintf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->percent = HDatof(H5_optarg); + opts->percent = HDatof(opt_arg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, 0.0)) @@ -381,12 +381,12 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case 'n': opts->count_bool = 1; - if (check_n_input(H5_optarg) == -1) { - HDprintf("<-n %s> is not a valid option\n", H5_optarg); + if (check_n_input(opt_arg) == -1) { + HDprintf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->count = HDstrtoull(H5_optarg, NULL, 0); + opts->count = HDstrtoull(opt_arg, NULL, 0); break; case 'N': @@ -403,34 +403,34 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case '1': opts->vol_info[0].type = VOL_BY_VALUE; - opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(opt_arg); opts->custom_vol[0] = TRUE; break; case '2': opts->vol_info[0].type = VOL_BY_NAME; - opts->vol_info[0].u.name = H5_optarg; + opts->vol_info[0].u.name = opt_arg; opts->custom_vol[0] = TRUE; break; case '3': - opts->vol_info[0].info_string = H5_optarg; + opts->vol_info[0].info_string = opt_arg; break; case '4': opts->vol_info[1].type = VOL_BY_VALUE; - opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(opt_arg); opts->custom_vol[1] = TRUE; break; case '5': opts->vol_info[1].type = VOL_BY_NAME; - opts->vol_info[1].u.name = H5_optarg; + opts->vol_info[1].u.name = opt_arg; opts->custom_vol[1] = TRUE; break; case '6': - opts->vol_info[1].info_string = H5_optarg; + opts->vol_info[1].info_string = opt_arg; break; } } @@ -447,15 +447,15 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char opts->exclude_attr = exclude_attr_head; /* check for file names to be processed */ - if (argc <= H5_optind || argv[H5_optind + 1] == NULL) { + if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); } - *fname1 = argv[H5_optind]; - *fname2 = argv[H5_optind + 1]; - *objname1 = argv[H5_optind + 2]; + *fname1 = argv[opt_ind]; + *fname2 = argv[opt_ind + 1]; + *objname1 = argv[opt_ind + 2]; H5TOOLS_DEBUG("file1 = %s", *fname1); H5TOOLS_DEBUG("file2 = %s", *fname2); @@ -466,8 +466,8 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } H5TOOLS_DEBUG("objname1 = %s", *objname1); - if (argv[H5_optind + 3] != NULL) { - *objname2 = argv[H5_optind + 3]; + if (argv[opt_ind + 3] != NULL) { + *objname2 = argv[opt_ind + 3]; } else { *objname2 = *objname1; diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index ca087ea..c9c8185 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -80,132 +80,132 @@ struct handler_t { */ /* The following initialization makes use of C language concatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:"; -static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'}, - {"attribut", require_arg, 'a'}, - {"attribu", require_arg, 'a'}, - {"attrib", require_arg, 'a'}, - {"attri", require_arg, 'a'}, - {"attr", require_arg, 'a'}, - {"att", require_arg, 'a'}, - {"at", require_arg, 'a'}, - {"binary", optional_arg, 'b'}, - {"count", require_arg, 'c'}, - {"coun", require_arg, 'c'}, - {"cou", require_arg, 'c'}, - {"co", require_arg, 'c'}, - {"dataset", require_arg, 'd'}, - {"datase", require_arg, 'd'}, - {"datas", require_arg, 'd'}, - {"escape", no_arg, 'e'}, - {"filedriver", require_arg, 'f'}, - {"filedrive", require_arg, 'f'}, - {"filedriv", require_arg, 'f'}, - {"filedri", require_arg, 'f'}, - {"filedr", require_arg, 'f'}, - {"filed", require_arg, 'f'}, - {"file", require_arg, 'f'}, - {"fil", require_arg, 'f'}, - {"fi", require_arg, 'f'}, - {"group", require_arg, 'g'}, - {"grou", require_arg, 'g'}, - {"gro", require_arg, 'g'}, - {"gr", require_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"object-ids", no_arg, 'i'}, - {"object-id", no_arg, 'i'}, - {"object-i", no_arg, 'i'}, - {"object", no_arg, 'i'}, - {"objec", no_arg, 'i'}, - {"obje", no_arg, 'i'}, - {"obj", no_arg, 'i'}, - {"ob", no_arg, 'i'}, - {"block", require_arg, 'k'}, - {"bloc", require_arg, 'k'}, - {"blo", require_arg, 'k'}, - {"bl", require_arg, 'k'}, - {"soft-link", require_arg, 'l'}, - {"soft-lin", require_arg, 'l'}, - {"soft-li", require_arg, 'l'}, - {"soft-l", require_arg, 'l'}, - {"soft", require_arg, 'l'}, - {"sof", require_arg, 'l'}, - {"format", require_arg, 'm'}, - {"contents", optional_arg, 'n'}, - {"output", optional_arg, 'o'}, - {"outpu", optional_arg, 'o'}, - {"outp", optional_arg, 'o'}, - {"out", optional_arg, 'o'}, - {"ou", optional_arg, 'o'}, - {"properties", no_arg, 'p'}, - {"sort_by", require_arg, 'q'}, - {"string", no_arg, 'r'}, - {"strin", no_arg, 'r'}, - {"start", require_arg, 's'}, - {"star", require_arg, 's'}, - {"sta", require_arg, 's'}, - {"datatype", require_arg, 't'}, - {"datatyp", require_arg, 't'}, - {"dataty", require_arg, 't'}, - {"datat", require_arg, 't'}, - {"use-dtd", no_arg, 'u'}, - {"use-dt", no_arg, 'u'}, - {"use-d", no_arg, 'u'}, - {"use-", no_arg, 'u'}, - {"use", no_arg, 'u'}, - {"us", no_arg, 'u'}, - {"u", no_arg, 'u'}, - {"vds-view-first-missing", no_arg, 'v'}, - {"width", require_arg, 'w'}, - {"widt", require_arg, 'w'}, - {"wid", require_arg, 'w'}, - {"wi", require_arg, 'w'}, - {"xml", no_arg, 'x'}, - {"xm", no_arg, 'x'}, - {"noindex", no_arg, 'y'}, - {"sort_order", require_arg, 'z'}, - {"onlyattr", optional_arg, 'A'}, - {"superblock", no_arg, 'B'}, - {"boot-block", no_arg, 'B'}, - {"boot-bloc", no_arg, 'B'}, - {"boot-blo", no_arg, 'B'}, - {"boot-bl", no_arg, 'B'}, - {"boot-b", no_arg, 'B'}, - {"boot", no_arg, 'B'}, - {"boo", no_arg, 'B'}, - {"bo", no_arg, 'B'}, - {"no-compact-subset", no_arg, 'C'}, - {"xml-dtd", require_arg, 'D'}, - {"xml-dt", require_arg, 'D'}, - {"xml-d", require_arg, 'D'}, - {"enable-error-stack", optional_arg, 'E'}, - {"form", require_arg, 'F'}, - {"vds-gap-size", require_arg, 'G'}, - {"header", no_arg, 'H'}, - {"heade", no_arg, 'H'}, - {"head", no_arg, 'H'}, - {"hea", no_arg, 'H'}, - {"packed-bits", require_arg, 'M'}, - {"any_path", require_arg, 'N'}, - {"ddl", optional_arg, 'O'}, - {"region", no_arg, 'R'}, - {"stride", require_arg, 'S'}, - {"strid", require_arg, 'S'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, - {"xml-ns", require_arg, 'X'}, - {"xml-n", require_arg, 'X'}, - {"s3-cred", require_arg, '$'}, - {"hdfs-attrs", require_arg, '#'}, - {"vol-value", require_arg, '1'}, - {"vol-name", require_arg, '2'}, - {"vol-info", require_arg, '3'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:"; +static struct long_options l_opts[] = {{"attribute", require_arg, 'a'}, + {"attribut", require_arg, 'a'}, + {"attribu", require_arg, 'a'}, + {"attrib", require_arg, 'a'}, + {"attri", require_arg, 'a'}, + {"attr", require_arg, 'a'}, + {"att", require_arg, 'a'}, + {"at", require_arg, 'a'}, + {"binary", optional_arg, 'b'}, + {"count", require_arg, 'c'}, + {"coun", require_arg, 'c'}, + {"cou", require_arg, 'c'}, + {"co", require_arg, 'c'}, + {"dataset", require_arg, 'd'}, + {"datase", require_arg, 'd'}, + {"datas", require_arg, 'd'}, + {"escape", no_arg, 'e'}, + {"filedriver", require_arg, 'f'}, + {"filedrive", require_arg, 'f'}, + {"filedriv", require_arg, 'f'}, + {"filedri", require_arg, 'f'}, + {"filedr", require_arg, 'f'}, + {"filed", require_arg, 'f'}, + {"file", require_arg, 'f'}, + {"fil", require_arg, 'f'}, + {"fi", require_arg, 'f'}, + {"group", require_arg, 'g'}, + {"grou", require_arg, 'g'}, + {"gro", require_arg, 'g'}, + {"gr", require_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"object-ids", no_arg, 'i'}, + {"object-id", no_arg, 'i'}, + {"object-i", no_arg, 'i'}, + {"object", no_arg, 'i'}, + {"objec", no_arg, 'i'}, + {"obje", no_arg, 'i'}, + {"obj", no_arg, 'i'}, + {"ob", no_arg, 'i'}, + {"block", require_arg, 'k'}, + {"bloc", require_arg, 'k'}, + {"blo", require_arg, 'k'}, + {"bl", require_arg, 'k'}, + {"soft-link", require_arg, 'l'}, + {"soft-lin", require_arg, 'l'}, + {"soft-li", require_arg, 'l'}, + {"soft-l", require_arg, 'l'}, + {"soft", require_arg, 'l'}, + {"sof", require_arg, 'l'}, + {"format", require_arg, 'm'}, + {"contents", optional_arg, 'n'}, + {"output", optional_arg, 'o'}, + {"outpu", optional_arg, 'o'}, + {"outp", optional_arg, 'o'}, + {"out", optional_arg, 'o'}, + {"ou", optional_arg, 'o'}, + {"properties", no_arg, 'p'}, + {"sort_by", require_arg, 'q'}, + {"string", no_arg, 'r'}, + {"strin", no_arg, 'r'}, + {"start", require_arg, 's'}, + {"star", require_arg, 's'}, + {"sta", require_arg, 's'}, + {"datatype", require_arg, 't'}, + {"datatyp", require_arg, 't'}, + {"dataty", require_arg, 't'}, + {"datat", require_arg, 't'}, + {"use-dtd", no_arg, 'u'}, + {"use-dt", no_arg, 'u'}, + {"use-d", no_arg, 'u'}, + {"use-", no_arg, 'u'}, + {"use", no_arg, 'u'}, + {"us", no_arg, 'u'}, + {"u", no_arg, 'u'}, + {"vds-view-first-missing", no_arg, 'v'}, + {"width", require_arg, 'w'}, + {"widt", require_arg, 'w'}, + {"wid", require_arg, 'w'}, + {"wi", require_arg, 'w'}, + {"xml", no_arg, 'x'}, + {"xm", no_arg, 'x'}, + {"noindex", no_arg, 'y'}, + {"sort_order", require_arg, 'z'}, + {"onlyattr", optional_arg, 'A'}, + {"superblock", no_arg, 'B'}, + {"boot-block", no_arg, 'B'}, + {"boot-bloc", no_arg, 'B'}, + {"boot-blo", no_arg, 'B'}, + {"boot-bl", no_arg, 'B'}, + {"boot-b", no_arg, 'B'}, + {"boot", no_arg, 'B'}, + {"boo", no_arg, 'B'}, + {"bo", no_arg, 'B'}, + {"no-compact-subset", no_arg, 'C'}, + {"xml-dtd", require_arg, 'D'}, + {"xml-dt", require_arg, 'D'}, + {"xml-d", require_arg, 'D'}, + {"enable-error-stack", optional_arg, 'E'}, + {"form", require_arg, 'F'}, + {"vds-gap-size", require_arg, 'G'}, + {"header", no_arg, 'H'}, + {"heade", no_arg, 'H'}, + {"head", no_arg, 'H'}, + {"hea", no_arg, 'H'}, + {"packed-bits", require_arg, 'M'}, + {"any_path", require_arg, 'N'}, + {"ddl", optional_arg, 'O'}, + {"region", no_arg, 'R'}, + {"stride", require_arg, 'S'}, + {"strid", require_arg, 'S'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, + {"xml-ns", require_arg, 'X'}, + {"xml-n", require_arg, 'X'}, + {"s3-cred", require_arg, '$'}, + {"hdfs-attrs", require_arg, '#'}, + {"vol-value", require_arg, '1'}, + {"vol-name", require_arg, '2'}, + {"vol-info", require_arg, '3'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: leave @@ -917,7 +917,7 @@ parse_command_line(int argc, const char *argv[]) } /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { parse_start: switch ((char)opt) { case 'R': @@ -931,8 +931,8 @@ parse_start: case 'n': dump_opts.display_fi = TRUE; last_was_dset = FALSE; - if (H5_optarg != NULL) - h5trav_set_verbose(HDatoi(H5_optarg)); + if (opt_arg != NULL) + h5trav_set_verbose(HDatoi(opt_arg)); break; case 'p': dump_opts.display_dcpl = TRUE; @@ -949,8 +949,8 @@ parse_start: last_was_dset = FALSE; break; case 'A': - if (H5_optarg != NULL) { - if (0 == HDatoi(H5_optarg)) + if (opt_arg != NULL) { + if (0 == HDatoi(opt_arg)) dump_opts.include_attrs = FALSE; } else { @@ -974,7 +974,7 @@ parse_start: goto done; break; case 'w': { - int sh5tools_nCols = HDatoi(H5_optarg); + int sh5tools_nCols = HDatoi(opt_arg); if (sh5tools_nCols <= 0) h5tools_nCols = 65535; @@ -988,7 +988,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_paths; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); break; } @@ -1000,7 +1000,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_attributes; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); break; } @@ -1012,7 +1012,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datasets; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); hand[i].subset_info = parse_subset_params(hand[i].obj); last_dset = &hand[i]; break; @@ -1021,7 +1021,7 @@ parse_start: last_was_dset = TRUE; break; case 'f': - driver_name_g = H5_optarg; + driver_name_g = opt_arg; break; case 'g': dump_opts.display_all = 0; @@ -1029,7 +1029,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_groups; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); break; } @@ -1041,7 +1041,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_links; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); break; } @@ -1053,7 +1053,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datatypes; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = HDstrdup(opt_arg); break; } @@ -1061,7 +1061,7 @@ parse_start: break; case 'O': - if (h5tools_set_output_file(H5_optarg, 0) < 0) { + if (h5tools_set_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1069,20 +1069,20 @@ parse_start: case 'o': if (bin_output) { - if (h5tools_set_data_output_file(H5_optarg, 1) < 0) { + if (h5tools_set_data_output_file(opt_arg, 1) < 0) { usage(h5tools_getprogname()); goto error; } } else { if (dump_opts.display_attr_data && !dump_opts.display_data) { - if (h5tools_set_attr_output_file(H5_optarg, 0) < 0) { + if (h5tools_set_attr_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } } if (dump_opts.display_data || dump_opts.display_all) { - if (h5tools_set_data_output_file(H5_optarg, 0) < 0) { + if (h5tools_set_data_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1091,12 +1091,12 @@ parse_start: dump_opts.usingdasho = TRUE; last_was_dset = FALSE; - outfname_g = H5_optarg; + outfname_g = opt_arg; break; case 'b': - if (H5_optarg != NULL) { - if ((bin_form = set_binary_form(H5_optarg)) < 0) { + if (opt_arg != NULL) { + if ((bin_form = set_binary_form(opt_arg)) < 0) { /* failed to set binary form */ usage(h5tools_getprogname()); goto error; @@ -1115,7 +1115,7 @@ parse_start: break; case 'q': - if ((sort_by = set_sort_by(H5_optarg)) < 0) { + if ((sort_by = set_sort_by(opt_arg)) < 0) { /* failed to set "sort by" form */ usage(h5tools_getprogname()); goto error; @@ -1123,7 +1123,7 @@ parse_start: break; case 'z': - if ((sort_order = set_sort_order(H5_optarg)) < 0) { + if ((sort_order = set_sort_order(opt_arg)) < 0) { /* failed to set "sort order" form */ usage(h5tools_getprogname()); goto error; @@ -1135,7 +1135,7 @@ parse_start: error_msg("option \"-%c\" can only be used after --dataset option\n", opt); goto error; } - if (parse_mask_list(H5_optarg) != SUCCEED) { + if (parse_mask_list(opt_arg) != SUCCEED) { usage(h5tools_getprogname()); goto error; } @@ -1145,7 +1145,7 @@ parse_start: dump_opts.display_vds_first = TRUE; break; case 'G': - dump_opts.vds_gap_size = HDatoi(H5_optarg); + dump_opts.vds_gap_size = HDatoi(opt_arg); if (dump_opts.vds_gap_size < 0) { usage(h5tools_getprogname()); goto error; @@ -1172,13 +1172,13 @@ parse_start: case 'D': /* specify alternative XML DTD or schema */ /* To Do: check format of this value? */ - xml_dtd_uri_g = H5_optarg; + xml_dtd_uri_g = opt_arg; h5tools_nCols = 0; break; case 'm': /* specify alternative floating point printing format */ - fp_format = H5_optarg; + fp_format = opt_arg; h5tools_nCols = 0; break; @@ -1189,10 +1189,10 @@ parse_start: usage(h5tools_getprogname()); goto error; } - if (HDstrcmp(H5_optarg, ":") == 0) + if (HDstrcmp(opt_arg, ":") == 0) xmlnsprefix = ""; else - xmlnsprefix = H5_optarg; + xmlnsprefix = opt_arg; h5tools_nCols = 0; break; /** end XML parameters **/ @@ -1238,33 +1238,33 @@ parse_start: HDfree(s->start.data); s->start.data = NULL; } - parse_hsize_list(H5_optarg, &s->start); + parse_hsize_list(opt_arg, &s->start); break; case 'S': if (s->stride.data) { HDfree(s->stride.data); s->stride.data = NULL; } - parse_hsize_list(H5_optarg, &s->stride); + parse_hsize_list(opt_arg, &s->stride); break; case 'c': if (s->count.data) { HDfree(s->count.data); s->count.data = NULL; } - parse_hsize_list(H5_optarg, &s->count); + parse_hsize_list(opt_arg, &s->count); break; case 'k': if (s->block.data) { HDfree(s->block.data); s->block.data = NULL; } - parse_hsize_list(H5_optarg, &s->block); + parse_hsize_list(opt_arg, &s->block); break; default: goto end_collect; } - } while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF); + } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF); end_collect: last_was_dset = FALSE; @@ -1277,8 +1277,8 @@ end_collect: /** end subsetting parameters **/ case 'E': - if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); else enable_error_stack = 1; break; @@ -1294,7 +1294,7 @@ end_collect: case '$': #ifdef H5_HAVE_ROS3_VFD - if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa_g) < 0) { + if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) { error_msg("failed to parse S3 VFD credential info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1311,7 +1311,7 @@ end_collect: case '#': #ifdef H5_HAVE_LIBHDFS - if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa_g) < 0) { + if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) { error_msg("failed to parse HDFS VFD configuration info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1328,18 +1328,18 @@ end_collect: case '1': vol_info_g.type = VOL_BY_VALUE; - vol_info_g.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + vol_info_g.u.value = (H5VL_class_value_t)HDatoi(opt_arg); use_custom_vol_g = TRUE; break; case '2': vol_info_g.type = VOL_BY_NAME; - vol_info_g.u.name = H5_optarg; + vol_info_g.u.name = opt_arg; use_custom_vol_g = TRUE; break; case '3': - vol_info_g.info_string = H5_optarg; + vol_info_g.info_string = opt_arg; break; case '?': @@ -1351,7 +1351,7 @@ end_collect: parse_end: /* check for file name to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; @@ -1443,7 +1443,7 @@ main(int argc, const char *argv[]) } } - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -1496,8 +1496,8 @@ main(int argc, const char *argv[]) } } - while (H5_optind < argc) { - fname = HDstrdup(argv[H5_optind++]); + while (opt_ind < argc) { + fname = HDstrdup(argv[opt_ind++]); fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0); diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 3430c55..321f274 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -38,28 +38,28 @@ static int verbose_g = 0; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVvd:n"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"verbose", no_arg, 'v'}, - {"verbos", no_arg, 'v'}, - {"verbo", no_arg, 'v'}, - {"verb", no_arg, 'v'}, - {"dname", require_arg, 'd'}, - {"dnam", require_arg, 'd'}, - {"dna", require_arg, 'd'}, - {"dn", require_arg, 'd'}, - {"noop", no_arg, 'n'}, - {"noo", no_arg, 'n'}, - {"no", no_arg, 'n'}, - {"enable-error-stack", no_arg, 'E'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVvd:n"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"verbose", no_arg, 'v'}, + {"verbos", no_arg, 'v'}, + {"verbo", no_arg, 'v'}, + {"verb", no_arg, 'v'}, + {"dname", require_arg, 'd'}, + {"dnam", require_arg, 'd'}, + {"dna", require_arg, 'd'}, + {"dn", require_arg, 'd'}, + {"noop", no_arg, 'n'}, + {"noo", no_arg, 'n'}, + {"no", no_arg, 'n'}, + {"enable-error-stack", no_arg, 'E'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -123,7 +123,7 @@ parse_command_line(int argc, const char **argv) } /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -140,11 +140,11 @@ parse_command_line(int argc, const char **argv) break; case 'd': /* -d dname */ - if (H5_optarg != NULL && *H5_optarg) - dname_g = HDstrdup(H5_optarg); + if (opt_arg != NULL && *opt_arg) + dname_g = HDstrdup(opt_arg); if (dname_g == NULL) { h5tools_setstatus(EXIT_FAILURE); - error_msg("No dataset name\n", H5_optarg); + error_msg("No dataset name\n", opt_arg); usage(h5tools_getprogname()); goto error; } @@ -167,19 +167,19 @@ parse_command_line(int argc, const char **argv) } /* switch */ } /* while */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto error; } - fname_g = HDstrdup(argv[H5_optind]); + fname_g = HDstrdup(argv[opt_ind]); - return 0; + return (0); error: - return -1; + return (-1); ; } /* parse_command_line() */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 0a2ea5d..5bcbf45 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -34,8 +34,8 @@ char *ub_file = NULL; * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */ -static struct h5_long_options l_opts[] = { +static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */ +static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */ {"u", require_arg, 'u'}, /* user block file */ {"o", require_arg, 'o'}, /* output file */ @@ -113,16 +113,16 @@ parse_command_line(int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(H5_optarg); + output_file = HDstrdup(opt_arg); break; case 'i': - input_file = HDstrdup(H5_optarg); + input_file = HDstrdup(opt_arg); break; case 'u': - ub_file = HDstrdup(H5_optarg); + ub_file = HDstrdup(opt_arg); break; case 'c': do_clobber = TRUE; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 38d1a5e..cde7ec7 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -35,8 +35,8 @@ char *ub_file = NULL; * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "hu:i:o:d:V"; -static struct h5_long_options l_opts[] = { +static const char * s_opts = "hu:i:o:d:V"; +static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */ {"u", require_arg, 'u'}, /* user block file */ {"o", require_arg, 'o'}, /* output file */ @@ -101,23 +101,23 @@ parse_command_line(int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(H5_optarg); + output_file = HDstrdup(opt_arg); if (output_file) h5tools_set_data_output_file(output_file, 1); break; case 'i': - input_file = HDstrdup(H5_optarg); + input_file = HDstrdup(opt_arg); if (input_file) h5tools_set_input_file(input_file, 1); break; ; case 'u': - ub_file = HDstrdup(H5_optarg); + ub_file = HDstrdup(opt_arg); if (ub_file) h5tools_set_output_file(ub_file, 1); else diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 934b4d1..536de69 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -626,7 +626,6 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */ hid_t ocpl_id = H5I_INVALID_HID; /* property to pass copy options */ hid_t lcpl_id = H5I_INVALID_HID; /* link creation property list */ - hid_t dxpl_id = H5I_INVALID_HID; /* dataset transfer property list */ named_dt_t * named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ @@ -996,27 +995,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (need < H5TOOLS_MALLOCSIZE) buf = HDmalloc(need); - /* Set up collective write if using filters in parallel */ - { -#ifdef H5_HAVE_PARALLEL - hbool_t parallel = (H5FD_MPIO == H5Pget_driver(options->fout_fapl)); - - if (parallel && apply_s && apply_f) { - if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed"); - if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Pset_dxpl_mpio failed"); - } - else -#endif - dxpl_id = H5P_DEFAULT; - } - if (buf != NULL) { if (H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); - if (H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) + if (H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < + 0) H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); /* Check if we have VL data in the dataset's @@ -1118,8 +1102,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); - if (H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, dxpl_id, - hslab_buf) < 0) + if (H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, + H5P_DEFAULT, hslab_buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); /* reclaim any VL memory, if necessary */ @@ -1398,7 +1382,6 @@ done: H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); - H5Pclose(dxpl_id); H5Sclose(f_space_id); H5Dclose(dset_in); H5Dclose(dset_out); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 846bd15..1f1b821 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -31,44 +31,44 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; -static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'}, - {"block", require_arg, 'b'}, - {"compact", require_arg, 'c'}, - {"indexed", require_arg, 'd'}, - {"file", require_arg, 'e'}, - {"filter", require_arg, 'f'}, - {"help", no_arg, 'h'}, - {"infile", require_arg, 'i'}, /* for backward compability */ - {"low", require_arg, 'j'}, - {"high", require_arg, 'k'}, - {"layout", require_arg, 'l'}, - {"minimum", require_arg, 'm'}, - {"native", no_arg, 'n'}, - {"outfile", require_arg, 'o'}, /* for backward compability */ - {"sort_by", require_arg, 'q'}, - {"ssize", require_arg, 's'}, - {"threshold", require_arg, 't'}, - {"ublock", require_arg, 'u'}, - {"verbose", no_arg, 'v'}, - {"sort_order", require_arg, 'z'}, - {"enable-error-stack", no_arg, 'E'}, - {"fs_pagesize", require_arg, 'G'}, - {"latest", no_arg, 'L'}, - {"metadata_block_size", require_arg, 'M'}, - {"fs_persist", require_arg, 'P'}, - {"fs_strategy", require_arg, 'S'}, - {"fs_threshold", require_arg, 'T'}, - {"version", no_arg, 'V'}, - {"merge", no_arg, 'X'}, - {"prune", no_arg, 'W'}, - {"src-vol-value", require_arg, '1'}, - {"src-vol-name", require_arg, '2'}, - {"src-vol-info", require_arg, '3'}, - {"dst-vol-value", require_arg, '4'}, - {"dst-vol-name", require_arg, '5'}, - {"dst-vol-info", require_arg, '6'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; +static struct long_options l_opts[] = {{"alignment", require_arg, 'a'}, + {"block", require_arg, 'b'}, + {"compact", require_arg, 'c'}, + {"indexed", require_arg, 'd'}, + {"file", require_arg, 'e'}, + {"filter", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"infile", require_arg, 'i'}, /* for backward compability */ + {"low", require_arg, 'j'}, + {"high", require_arg, 'k'}, + {"layout", require_arg, 'l'}, + {"minimum", require_arg, 'm'}, + {"native", no_arg, 'n'}, + {"outfile", require_arg, 'o'}, /* for backward compability */ + {"sort_by", require_arg, 'q'}, + {"ssize", require_arg, 's'}, + {"threshold", require_arg, 't'}, + {"ublock", require_arg, 'u'}, + {"verbose", no_arg, 'v'}, + {"sort_order", require_arg, 'z'}, + {"enable-error-stack", no_arg, 'E'}, + {"fs_pagesize", require_arg, 'G'}, + {"latest", no_arg, 'L'}, + {"metadata_block_size", require_arg, 'M'}, + {"fs_persist", require_arg, 'P'}, + {"fs_strategy", require_arg, 'S'}, + {"fs_threshold", require_arg, 'T'}, + {"version", no_arg, 'V'}, + {"merge", no_arg, 'X'}, + {"prune", no_arg, 'W'}, + {"src-vol-value", require_arg, '1'}, + {"src-vol-name", require_arg, '2'}, + {"src-vol-info", require_arg, '3'}, + {"dst-vol-value", require_arg, '4'}, + {"dst-vol-name", require_arg, '5'}, + {"dst-vol-info", require_arg, '6'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -497,18 +497,18 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); /* parse command line options */ - while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) { + while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) { switch ((char)opt) { /* -i for backward compatibility */ case 'i': - infile = H5_optarg; + infile = opt_arg; has_i++; break; /* -o for backward compatibility */ case 'o': - outfile = H5_optarg; + outfile = opt_arg; has_o++; break; @@ -530,7 +530,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'f': /* parse the -f filter option */ - if (h5repack_addfilter(H5_optarg, options) < 0) { + if (h5repack_addfilter(opt_arg, options) < 0) { error_msg("in parsing filter\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -540,7 +540,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'l': /* parse the -l layout option */ - if (h5repack_addlayout(H5_optarg, options) < 0) { + if (h5repack_addlayout(opt_arg, options) < 0) { error_msg("in parsing layout\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -549,9 +549,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'm': - options->min_comp = HDstrtoull(H5_optarg, NULL, 0); + options->min_comp = HDstrtoull(opt_arg, NULL, 0); if ((int)options->min_comp <= 0) { - error_msg("invalid minimum compress size <%s>\n", H5_optarg); + error_msg("invalid minimum compress size <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -559,8 +559,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'e': - if ((ret_value = read_info(H5_optarg, options)) < 0) { - error_msg("failed to read from repack options file <%s>\n", H5_optarg); + if ((ret_value = read_info(opt_arg, options)) < 0) { + error_msg("failed to read from repack options file <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -576,7 +576,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'j': - bound = HDatoi(H5_optarg); + bound = HDatoi(opt_arg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing low bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -587,7 +587,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'k': - bound = HDatoi(H5_optarg); + bound = HDatoi(opt_arg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing high bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -606,13 +606,13 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'c': - options->grp_compact = HDatoi(H5_optarg); + options->grp_compact = HDatoi(opt_arg); if (options->grp_compact > 0) options->latest = TRUE; /* must use latest format */ break; case 'd': - options->grp_indexed = HDatoi(H5_optarg); + options->grp_indexed = HDatoi(opt_arg); if (options->grp_indexed > 0) options->latest = TRUE; /* must use latest format */ break; @@ -620,10 +620,10 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 's': { int idx = 0; int ssize = 0; - char *msgPtr = HDstrchr(H5_optarg, ':'); + char *msgPtr = HDstrchr(opt_arg, ':'); options->latest = TRUE; /* must use latest format */ if (msgPtr == NULL) { - ssize = HDatoi(H5_optarg); + ssize = HDatoi(opt_arg); for (idx = 0; idx < 5; idx++) options->msg_size[idx] = ssize; } @@ -632,7 +632,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) HDstrcpy(msgType, msgPtr + 1); msgPtr[0] = '\0'; - ssize = HDatoi(H5_optarg); + ssize = HDatoi(opt_arg); if (!HDstrncmp(msgType, "dspace", 6)) options->msg_size[0] = ssize; else if (!HDstrncmp(msgType, "dtype", 5)) @@ -647,25 +647,25 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) } break; case 'u': - options->ublock_filename = H5_optarg; + options->ublock_filename = opt_arg; break; case 'b': - options->ublock_size = (hsize_t)HDatol(H5_optarg); + options->ublock_size = (hsize_t)HDatol(opt_arg); break; case 'M': - options->meta_block_size = (hsize_t)HDatol(H5_optarg); + options->meta_block_size = (hsize_t)HDatol(opt_arg); break; case 't': - options->threshold = (hsize_t)HDatol(H5_optarg); + options->threshold = (hsize_t)HDatol(opt_arg); break; case 'a': - options->alignment = HDstrtoull(H5_optarg, NULL, 0); + options->alignment = HDstrtoull(opt_arg, NULL, 0); if (options->alignment < 1) { - error_msg("invalid alignment size\n", H5_optarg); + error_msg("invalid alignment size\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -675,7 +675,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'S': { char strategy[MAX_NC_NAME]; - HDstrcpy(strategy, H5_optarg); + HDstrcpy(strategy, opt_arg); if (!HDstrcmp(strategy, "FSM_AGGR")) options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; else if (!HDstrcmp(strategy, "PAGE")) @@ -685,7 +685,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) else if (!HDstrcmp(strategy, "NONE")) options->fs_strategy = H5F_FSPACE_STRATEGY_NONE; else { - error_msg("invalid file space management strategy\n", H5_optarg); + error_msg("invalid file space management strategy\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -696,29 +696,29 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) } break; case 'P': - options->fs_persist = HDatoi(H5_optarg); + options->fs_persist = HDatoi(opt_arg); if (options->fs_persist == 0) /* To distinguish the "specified" zero value */ options->fs_persist = -1; break; case 'T': - options->fs_threshold = HDatol(H5_optarg); + options->fs_threshold = HDatol(opt_arg); 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 = HDstrtoll(opt_arg, NULL, 0); if (options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ options->fs_pagesize = -1; break; case 'q': - if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(H5_optarg))) { - error_msg("failed to set sort by form <%s>\n", H5_optarg); + if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) { + error_msg("failed to set sort by form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -726,8 +726,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'z': - if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(H5_optarg))) { - error_msg("failed to set sort order form <%s>\n", H5_optarg); + if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) { + error_msg("failed to set sort order form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -740,34 +740,34 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case '1': in_vol_info.type = VOL_BY_VALUE; - in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); custom_in_fapl = TRUE; break; case '2': in_vol_info.type = VOL_BY_NAME; - in_vol_info.u.name = H5_optarg; + in_vol_info.u.name = opt_arg; custom_in_fapl = TRUE; break; case '3': - in_vol_info.info_string = H5_optarg; + in_vol_info.info_string = opt_arg; break; case '4': out_vol_info.type = VOL_BY_VALUE; - out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); custom_out_fapl = TRUE; break; case '5': out_vol_info.type = VOL_BY_NAME; - out_vol_info.u.name = H5_optarg; + out_vol_info.u.name = opt_arg; custom_out_fapl = TRUE; break; case '6': - out_vol_info.info_string = H5_optarg; + out_vol_info.info_string = opt_arg; break; default: @@ -777,9 +777,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) /* If neither -i nor -o given, get in and out files positionally */ if (0 == (has_i + has_o)) { - if (argv[H5_optind] != NULL && argv[H5_optind + 1] != NULL) { - infile = argv[H5_optind]; - outfile = argv[H5_optind + 1]; + if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) { + infile = argv[opt_ind]; + outfile = argv[opt_ind + 1]; if (!HDstrcmp(infile, outfile)) { error_msg("file names cannot be the same\n"); diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 665695e..853f3ce 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -171,106 +171,106 @@ struct handler_t { static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:"; /* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */ -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"filemetadata", no_arg, 'F'}, - {"filemetadat", no_arg, 'F'}, - {"filemetada", no_arg, 'F'}, - {"filemetad", no_arg, 'F'}, - {"filemeta", no_arg, 'F'}, - {"filemet", no_arg, 'F'}, - {"fileme", no_arg, 'F'}, - {"filem", no_arg, 'F'}, - {"file", no_arg, 'f'}, - {"fil", no_arg, 'f'}, - {"fi", no_arg, 'f'}, - {"groupmetadata", no_arg, 'G'}, - {"groupmetadat", no_arg, 'G'}, - {"groupmetada", no_arg, 'G'}, - {"groupmetad", no_arg, 'G'}, - {"groupmeta", no_arg, 'G'}, - {"groupmet", no_arg, 'G'}, - {"groupme", no_arg, 'G'}, - {"groupm", no_arg, 'G'}, - {"group", no_arg, 'g'}, - {"grou", no_arg, 'g'}, - {"gro", no_arg, 'g'}, - {"gr", no_arg, 'g'}, - {"links", require_arg, 'l'}, - {"link", require_arg, 'l'}, - {"lin", require_arg, 'l'}, - {"li", require_arg, 'l'}, - {"dsetmetadata", no_arg, 'D'}, - {"dsetmetadat", no_arg, 'D'}, - {"dsetmetada", no_arg, 'D'}, - {"dsetmetad", no_arg, 'D'}, - {"dsetmeta", no_arg, 'D'}, - {"dsetmet", no_arg, 'D'}, - {"dsetme", no_arg, 'D'}, - {"dsetm", no_arg, 'D'}, - {"dset", no_arg, 'd'}, - {"dse", no_arg, 'd'}, - {"ds", no_arg, 'd'}, - {"dims", require_arg, 'm'}, - {"dim", require_arg, 'm'}, - {"di", require_arg, 'm'}, - {"dtypemetadata", no_arg, 'T'}, - {"dtypemetadat", no_arg, 'T'}, - {"dtypemetada", no_arg, 'T'}, - {"dtypemetad", no_arg, 'T'}, - {"dtypemeta", no_arg, 'T'}, - {"dtypemet", no_arg, 'T'}, - {"dtypeme", no_arg, 'T'}, - {"dtypem", no_arg, 'T'}, - {"dtype", no_arg, 'T'}, - {"dtyp", no_arg, 'T'}, - {"dty", no_arg, 'T'}, - {"dt", no_arg, 'T'}, - {"object", require_arg, 'O'}, - {"objec", require_arg, 'O'}, - {"obje", require_arg, 'O'}, - {"obj", require_arg, 'O'}, - {"ob", require_arg, 'O'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, - {"attribute", no_arg, 'A'}, - {"attribut", no_arg, 'A'}, - {"attribu", no_arg, 'A'}, - {"attrib", no_arg, 'A'}, - {"attri", no_arg, 'A'}, - {"attr", no_arg, 'A'}, - {"att", no_arg, 'A'}, - {"at", no_arg, 'A'}, - {"enable-error-stack", no_arg, 'E'}, - {"numattrs", require_arg, 'a'}, - {"numattr", require_arg, 'a'}, - {"numatt", require_arg, 'a'}, - {"numat", require_arg, 'a'}, - {"numa", require_arg, 'a'}, - {"num", require_arg, 'a'}, - {"nu", require_arg, 'a'}, - {"freespace", no_arg, 's'}, - {"freespac", no_arg, 's'}, - {"freespa", no_arg, 's'}, - {"freesp", no_arg, 's'}, - {"frees", no_arg, 's'}, - {"free", no_arg, 's'}, - {"fre", no_arg, 's'}, - {"fr", no_arg, 's'}, - {"summary", no_arg, 'S'}, - {"summar", no_arg, 'S'}, - {"summa", no_arg, 'S'}, - {"summ", no_arg, 'S'}, - {"sum", no_arg, 'S'}, - {"su", no_arg, 'S'}, - {"s3-cred", require_arg, 'w'}, - {"hdfs-attrs", require_arg, 'H'}, - {NULL, 0, '\0'}}; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"filemetadata", no_arg, 'F'}, + {"filemetadat", no_arg, 'F'}, + {"filemetada", no_arg, 'F'}, + {"filemetad", no_arg, 'F'}, + {"filemeta", no_arg, 'F'}, + {"filemet", no_arg, 'F'}, + {"fileme", no_arg, 'F'}, + {"filem", no_arg, 'F'}, + {"file", no_arg, 'f'}, + {"fil", no_arg, 'f'}, + {"fi", no_arg, 'f'}, + {"groupmetadata", no_arg, 'G'}, + {"groupmetadat", no_arg, 'G'}, + {"groupmetada", no_arg, 'G'}, + {"groupmetad", no_arg, 'G'}, + {"groupmeta", no_arg, 'G'}, + {"groupmet", no_arg, 'G'}, + {"groupme", no_arg, 'G'}, + {"groupm", no_arg, 'G'}, + {"group", no_arg, 'g'}, + {"grou", no_arg, 'g'}, + {"gro", no_arg, 'g'}, + {"gr", no_arg, 'g'}, + {"links", require_arg, 'l'}, + {"link", require_arg, 'l'}, + {"lin", require_arg, 'l'}, + {"li", require_arg, 'l'}, + {"dsetmetadata", no_arg, 'D'}, + {"dsetmetadat", no_arg, 'D'}, + {"dsetmetada", no_arg, 'D'}, + {"dsetmetad", no_arg, 'D'}, + {"dsetmeta", no_arg, 'D'}, + {"dsetmet", no_arg, 'D'}, + {"dsetme", no_arg, 'D'}, + {"dsetm", no_arg, 'D'}, + {"dset", no_arg, 'd'}, + {"dse", no_arg, 'd'}, + {"ds", no_arg, 'd'}, + {"dims", require_arg, 'm'}, + {"dim", require_arg, 'm'}, + {"di", require_arg, 'm'}, + {"dtypemetadata", no_arg, 'T'}, + {"dtypemetadat", no_arg, 'T'}, + {"dtypemetada", no_arg, 'T'}, + {"dtypemetad", no_arg, 'T'}, + {"dtypemeta", no_arg, 'T'}, + {"dtypemet", no_arg, 'T'}, + {"dtypeme", no_arg, 'T'}, + {"dtypem", no_arg, 'T'}, + {"dtype", no_arg, 'T'}, + {"dtyp", no_arg, 'T'}, + {"dty", no_arg, 'T'}, + {"dt", no_arg, 'T'}, + {"object", require_arg, 'O'}, + {"objec", require_arg, 'O'}, + {"obje", require_arg, 'O'}, + {"obj", require_arg, 'O'}, + {"ob", require_arg, 'O'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, + {"attribute", no_arg, 'A'}, + {"attribut", no_arg, 'A'}, + {"attribu", no_arg, 'A'}, + {"attrib", no_arg, 'A'}, + {"attri", no_arg, 'A'}, + {"attr", no_arg, 'A'}, + {"att", no_arg, 'A'}, + {"at", no_arg, 'A'}, + {"enable-error-stack", no_arg, 'E'}, + {"numattrs", require_arg, 'a'}, + {"numattr", require_arg, 'a'}, + {"numatt", require_arg, 'a'}, + {"numat", require_arg, 'a'}, + {"numa", require_arg, 'a'}, + {"num", require_arg, 'a'}, + {"nu", require_arg, 'a'}, + {"freespace", no_arg, 's'}, + {"freespac", no_arg, 's'}, + {"freespa", no_arg, 's'}, + {"freesp", no_arg, 's'}, + {"frees", no_arg, 's'}, + {"free", no_arg, 's'}, + {"fre", no_arg, 's'}, + {"fr", no_arg, 's'}, + {"summary", no_arg, 'S'}, + {"summar", no_arg, 'S'}, + {"summa", no_arg, 'S'}, + {"summ", no_arg, 'S'}, + {"sum", no_arg, 'S'}, + {"su", no_arg, 'S'}, + {"s3-cred", require_arg, 'w'}, + {"hdfs-attrs", require_arg, 'H'}, + {NULL, 0, '\0'}}; static void leave(int ret) @@ -920,7 +920,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) struct handler_t *hand = NULL; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -959,8 +959,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'l': - if (H5_optarg) { - sgroups_threshold = HDatoi(H5_optarg); + if (opt_arg) { + sgroups_threshold = HDatoi(opt_arg); if (sgroups_threshold < 1) { error_msg("Invalid threshold for small groups\n"); goto error; @@ -982,8 +982,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'm': - if (H5_optarg) { - sdsets_threshold = HDatoi(H5_optarg); + if (opt_arg) { + sdsets_threshold = HDatoi(opt_arg); if (sdsets_threshold < 1) { error_msg("Invalid threshold for small datasets\n"); goto error; @@ -1005,8 +1005,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'a': - if (H5_optarg) { - sattrs_threshold = HDatoi(H5_optarg); + if (opt_arg) { + sattrs_threshold = HDatoi(opt_arg); if (sattrs_threshold < 1) { error_msg("Invalid threshold for small # of attributes\n"); goto error; @@ -1046,7 +1046,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) /* Store object names */ for (u = 0; u < hand->obj_count; u++) - if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) { + if (NULL == (hand->obj[u] = HDstrdup(opt_arg))) { error_msg("unable to allocate memory for object name\n"); goto error; } /* end if */ @@ -1054,7 +1054,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) case 'w': #ifdef H5_HAVE_ROS3_VFD - if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa) < 0) { + if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) { error_msg("failed to parse S3 VFD credential info\n"); goto error; } @@ -1068,7 +1068,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) case 'H': #ifdef H5_HAVE_LIBHDFS - if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa) < 0) { + if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) { error_msg("failed to parse HDFS VFD configuration info\n"); goto error; } @@ -1087,7 +1087,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) } /* end while */ /* check for file name to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; @@ -1811,7 +1811,7 @@ main(int argc, const char *argv[]) } } - fname = argv[H5_optind]; + fname = argv[opt_ind]; /* Check for filename given */ if (fname) { diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 524ad03..ac7c0ca 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -44,40 +44,40 @@ static hsize_t increment = DEFAULT_INCREMENT; /* * Command-line options: only publicize long options */ -static const char * s_opts = "hVsmzi*"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"status", no_arg, 's'}, - {"statu", no_arg, 's'}, - {"stat", no_arg, 's'}, - {"sta", no_arg, 's'}, - {"st", no_arg, 's'}, - {"image", no_arg, 'm'}, - {"imag", no_arg, 'm'}, - {"ima", no_arg, 'm'}, - {"im", no_arg, 'm'}, - {"filesize", no_arg, 'z'}, - {"filesiz", no_arg, 'z'}, - {"filesi", no_arg, 'z'}, - {"files", no_arg, 'z'}, - {"file", no_arg, 'z'}, - {"fil", no_arg, 'z'}, - {"fi", no_arg, 'z'}, - {"increment", optional_arg, 'i'}, - {"incremen", optional_arg, 'i'}, - {"increme", optional_arg, 'i'}, - {"increm", optional_arg, 'i'}, - {"incre", optional_arg, 'i'}, - {"incr", optional_arg, 'i'}, - {"inc", optional_arg, 'i'}, - {"in", optional_arg, 'i'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVsmzi*"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"status", no_arg, 's'}, + {"statu", no_arg, 's'}, + {"stat", no_arg, 's'}, + {"sta", no_arg, 's'}, + {"st", no_arg, 's'}, + {"image", no_arg, 'm'}, + {"imag", no_arg, 'm'}, + {"ima", no_arg, 'm'}, + {"im", no_arg, 'm'}, + {"filesize", no_arg, 'z'}, + {"filesiz", no_arg, 'z'}, + {"filesi", no_arg, 'z'}, + {"files", no_arg, 'z'}, + {"file", no_arg, 'z'}, + {"fil", no_arg, 'z'}, + {"fi", no_arg, 'z'}, + {"increment", optional_arg, 'i'}, + {"incremen", optional_arg, 'i'}, + {"increme", optional_arg, 'i'}, + {"increm", optional_arg, 'i'}, + {"incre", optional_arg, 'i'}, + {"incr", optional_arg, 'i'}, + {"inc", optional_arg, 'i'}, + {"in", optional_arg, 'i'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -150,7 +150,7 @@ parse_command_line(int argc, const char **argv) } /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -176,12 +176,12 @@ parse_command_line(int argc, const char **argv) case 'i': increment_eoa_eof = TRUE; - if (H5_optarg != NULL) { - if (HDatoi(H5_optarg) < 0) { + if (opt_arg != NULL) { + if (HDatoi(opt_arg) < 0) { usage(h5tools_getprogname()); goto done; } - increment = (hsize_t)HDatoi(H5_optarg); + increment = (hsize_t)HDatoi(opt_arg); } break; @@ -193,14 +193,14 @@ parse_command_line(int argc, const char **argv) } /* end while */ /* check for file name to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto error; } /* end if */ - fname_g = HDstrdup(argv[H5_optind]); + fname_g = HDstrdup(argv[opt_ind]); done: return (0); diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index a85ee4d..516191c 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -22,8 +22,8 @@ int d_status = EXIT_SUCCESS; /* command-line options: short and long-named parameters */ -static const char * s_opts = "hlpvV"; -static struct h5_long_options l_opts[] = { +static const char * s_opts = "hlpvV"; +static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"latest", no_arg, 'l'}, {"parents", no_arg, 'p'}, {"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, {"vol-value", require_arg, '1'}, {"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {NULL, 0, '\0'}}; @@ -140,7 +140,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); /* Parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { /* Display 'help' */ case 'h': @@ -171,18 +171,18 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) case '1': vol_info.type = VOL_BY_VALUE; - vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); custom_fapl = TRUE; break; case '2': vol_info.type = VOL_BY_NAME; - vol_info.u.name = H5_optarg; + vol_info.u.name = opt_arg; custom_fapl = TRUE; break; case '3': - vol_info.info_string = H5_optarg; + vol_info.info_string = opt_arg; break; /* Bad command line argument */ @@ -193,33 +193,33 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) } /* end while */ /* Check for file name to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* Retrieve file name */ - options->fname = HDstrdup(argv[H5_optind]); - H5_optind++; + options->fname = HDstrdup(argv[opt_ind]); + opt_ind++; /* Check for group(s) to be created */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing group name(s)\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* Allocate space for the group name pointers */ - options->ngroups = (size_t)(argc - H5_optind); + options->ngroups = (size_t)(argc - opt_ind); options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; - while (H5_optind < argc) { - options->groups[curr_group] = HDstrdup(argv[H5_optind]); + while (opt_ind < argc) { + options->groups[curr_group] = HDstrdup(argv[opt_ind]); curr_group++; - H5_optind++; + opt_ind++; } /* Setup a custom fapl for file accesses */ diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index eae7f15..a9b4437 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -21,9 +21,9 @@ void parse_command_line(int argc, const char *argv[]); #define PROGRAM_NAME "getub" 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 */ - {NULL, 0, '\0'}}; +static const char * s_opts = "c:"; /* add more later ? */ +static struct long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */ + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -57,10 +57,10 @@ parse_command_line(int argc, const char *argv[]) int opt; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'c': - nbytes = HDstrdup(H5_optarg); + nbytes = HDstrdup(opt_arg); break; case '?': default: @@ -69,7 +69,7 @@ parse_command_line(int argc, const char *argv[]) } /* end switch */ } /* end while */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); HDexit(EXIT_FAILURE); @@ -100,13 +100,13 @@ main(int argc, const char *argv[]) goto error; } /* end if */ - if (argc <= (H5_optind)) { + if (argc <= (opt_ind)) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; } /* end if */ - filename = HDstrdup(argv[H5_optind]); + filename = HDstrdup(argv[opt_ind]); size = 0; if (EOF == (res = sscanf(nbytes, "%u", &size))) { diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index f616c82..1da6b63 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -31,7 +31,24 @@ #define UBTXT3 "u511.txt" #define UBTXT4 "u512.txt" #define UBTXT5 "u513.txt" +/* not used yet +#define UBTXT6 "u1023.txt" +#define UBTXT7 "u1024.txt" +#define UBTXT8 "u1025.txt" +#define UBTXT9 "u2047.txt" +#define UBTXT10 "u2048.txt" +#define UBTXT11 "u2049.txt" +#define UBBIN1 "u0.dat" +#define UBBIN2 "u10.dat" +#define UBBIN3 "u511.dat" +#define UBBIN4 "u512.dat" +#define UBBIN5 "u513.dat" +*/ +/* not used yet +#define FILE1 "tnull.h5" +#define FILE2 "tnullwithub.h5" +*/ /* tall is same as dumper test */ #define FILE7 "tall.h5" #define FILE8 "twithub.h5" @@ -49,6 +66,17 @@ char pattern[11] = "abcdefghij"; #define BUF_SIZE 1024 +/* Element selection information */ + +typedef enum { RED, GREEN, BLUE, WHITE, BLACK } enumtype; + +/* Compound datatype */ +typedef struct s1_t { + unsigned int a; + unsigned int b; + float c; +} s1_t; + /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED cur_group, @@ -280,18 +308,65 @@ create_textfile(const char *name, size_t size) HDclose(fd); } +#ifdef notdef +/* not used yet */ +void +create_binfile(char *name, off_t size) +{ + char *buf; + int fd; + int i; + char *bp; + + fd = creat(name, 0777); + HDassert(fd >= 0); + + buf = HDcalloc(size, 1); + HDassert(buf); + + /* fill buf with pattern */ + bp = buf; + for (i = 0; i < size; i++) + *bp++ = (char)i & 0xff; + + (void)HDwrite(fd, buf, size); + + HDclose(fd); +} +#endif + /*------------------------------------------------------------------------- * Function: main * *------------------------------------------------------------------------- */ + int main(void) { + + /* + create_textfile(UBTXT1, (size_t)0); + */ create_textfile(UBTXT2, (size_t)10); create_textfile(UBTXT3, (size_t)511); create_textfile(UBTXT4, (size_t)512); create_textfile(UBTXT5, (size_t)513); + /* + create_textfile(UBTXT6, (size_t)1023); + create_textfile(UBTXT7, (size_t)1024); + create_textfile(UBTXT8, (size_t)1025); + create_textfile(UBTXT9, (size_t)2047); + create_textfile(UBTXT10, (size_t)2048); + create_textfile(UBTXT11, (size_t)2049); + + create_binfile(UBBIN1, (off_t)0); + create_binfile(UBBIN2, (off_t)10); + create_binfile(UBBIN3, (off_t)511); + create_binfile(UBBIN4, (off_t)512); + create_binfile(UBBIN5, (off_t)513); + + */ gent_ub(FILE7, (size_t)0, (size_t)0); gent_ub(FILE8, (size_t)512, HDstrlen(pattern)); gent_ub(FILE9, (size_t)1024, (size_t)513); diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index e6769ec..45d4af4 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -24,8 +24,8 @@ * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "h"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}}; +static const char * s_opts = "h"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -61,7 +61,7 @@ parse_command_line(int argc, const char *argv[]) int opt; /* parse command line options */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -75,7 +75,7 @@ parse_command_line(int argc, const char *argv[]) } /* check for file name to be processed */ - if (argc <= H5_optind) { + if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -118,14 +118,14 @@ main(int argc, const char *argv[]) /* enable error reporting if command line option */ h5tools_error_report(); - if (argc <= (H5_optind)) { + if (argc <= (opt_ind)) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto done; } - ifname = HDstrdup(argv[H5_optind]); + ifname = HDstrdup(argv[opt_ind]); testval = H5Fis_accessible(ifname, H5P_DEFAULT); diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 1b08e95..1b6793a 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -24,10 +24,12 @@ #undef NDEBUG #include "hdf5.h" +#ifdef H5_STDC_HEADERS #include #include #include #include +#endif /* Solaris Studio defines attribute, but for the attributes we need */ #if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C) diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index 6537215..b3ae54d 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -23,11 +23,14 @@ #if !defined(WIN32) && !defined(__MINGW32__) +#include + +#ifdef H5_STDC_HEADERS #include #include -#include #include #include +#endif #ifdef H5_HAVE_UNISTD_H #include diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 60ec8d8..dba8220 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -23,11 +23,17 @@ #include "hdf5.h" #include "H5private.h" +#ifdef H5_STDC_HEADERS #include #include #include #include #include +#endif + +#ifdef H5_HAVE_IO_H +#include +#endif #ifdef H5_HAVE_UNISTD_H #include diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index a06fb77..bf4b2a9 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -26,11 +26,13 @@ #ifdef H5_HAVE_PARALLEL +#ifdef H5_STDC_HEADERS #include #include #include #include #include +#endif #ifdef H5_HAVE_UNISTD_H #include diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index cac36d7..65194b0 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -16,10 +16,12 @@ #include "hdf5.h" +#ifdef H5_STDC_HEADERS #include #include #include #include +#endif #ifdef H5_HAVE_UNISTD_H #include diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index d38c574..6fb5043 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -123,12 +123,12 @@ static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:"; #else static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:"; #endif /* 1 */ -static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, - {"alig", require_arg, 'a'}, - {"ali", require_arg, 'a'}, - {"al", require_arg, 'a'}, - {"api", require_arg, 'A'}, - {"ap", require_arg, 'A'}, +static struct long_options l_opts[] = {{"align", require_arg, 'a'}, + {"alig", require_arg, 'a'}, + {"ali", require_arg, 'a'}, + {"al", require_arg, 'a'}, + {"api", require_arg, 'A'}, + {"ap", require_arg, 'A'}, #if 0 /* a sighting of the elusive binary option */ { "binary", no_arg, 'b' }, @@ -137,133 +137,133 @@ static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, { "bin", no_arg, 'b' }, { "bi", no_arg, 'b' }, #endif /* 0 */ - {"block-size", require_arg, 'B'}, - {"block-siz", require_arg, 'B'}, - {"block-si", require_arg, 'B'}, - {"block-s", require_arg, 'B'}, - {"block-", require_arg, 'B'}, - {"block", require_arg, 'B'}, - {"bloc", require_arg, 'B'}, - {"blo", require_arg, 'B'}, - {"bl", require_arg, 'B'}, - {"chunk", no_arg, 'c'}, - {"chun", no_arg, 'c'}, - {"chu", no_arg, 'c'}, - {"ch", no_arg, 'c'}, - {"collective", no_arg, 'C'}, - {"collectiv", no_arg, 'C'}, - {"collecti", no_arg, 'C'}, - {"collect", no_arg, 'C'}, - {"collec", no_arg, 'C'}, - {"colle", no_arg, 'C'}, - {"coll", no_arg, 'C'}, - {"col", no_arg, 'C'}, - {"co", no_arg, 'C'}, - {"debug", require_arg, 'D'}, - {"debu", require_arg, 'D'}, - {"deb", require_arg, 'D'}, - {"de", require_arg, 'D'}, - {"geometry", no_arg, 'g'}, - {"geometr", no_arg, 'g'}, - {"geomet", no_arg, 'g'}, - {"geome", no_arg, 'g'}, - {"geom", no_arg, 'g'}, - {"geo", no_arg, 'g'}, - {"ge", no_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"interleaved", require_arg, 'I'}, - {"interleave", require_arg, 'I'}, - {"interleav", require_arg, 'I'}, - {"interlea", require_arg, 'I'}, - {"interle", require_arg, 'I'}, - {"interl", require_arg, 'I'}, - {"inter", require_arg, 'I'}, - {"inte", require_arg, 'I'}, - {"int", require_arg, 'I'}, - {"in", require_arg, 'I'}, - {"max-num-processes", require_arg, 'P'}, - {"max-num-processe", require_arg, 'P'}, - {"max-num-process", require_arg, 'P'}, - {"max-num-proces", require_arg, 'P'}, - {"max-num-proce", require_arg, 'P'}, - {"max-num-proc", require_arg, 'P'}, - {"max-num-pro", require_arg, 'P'}, - {"max-num-pr", require_arg, 'P'}, - {"max-num-p", require_arg, 'P'}, - {"min-num-processes", require_arg, 'p'}, - {"min-num-processe", require_arg, 'p'}, - {"min-num-process", require_arg, 'p'}, - {"min-num-proces", require_arg, 'p'}, - {"min-num-proce", require_arg, 'p'}, - {"min-num-proc", require_arg, 'p'}, - {"min-num-pro", require_arg, 'p'}, - {"min-num-pr", require_arg, 'p'}, - {"min-num-p", require_arg, 'p'}, - {"max-xfer-size", require_arg, 'X'}, - {"max-xfer-siz", require_arg, 'X'}, - {"max-xfer-si", require_arg, 'X'}, - {"max-xfer-s", require_arg, 'X'}, - {"max-xfer", require_arg, 'X'}, - {"max-xfe", require_arg, 'X'}, - {"max-xf", require_arg, 'X'}, - {"max-x", require_arg, 'X'}, - {"min-xfer-size", require_arg, 'x'}, - {"min-xfer-siz", require_arg, 'x'}, - {"min-xfer-si", require_arg, 'x'}, - {"min-xfer-s", require_arg, 'x'}, - {"min-xfer", require_arg, 'x'}, - {"min-xfe", require_arg, 'x'}, - {"min-xf", require_arg, 'x'}, - {"min-x", require_arg, 'x'}, - {"num-bytes", require_arg, 'e'}, - {"num-byte", require_arg, 'e'}, - {"num-byt", require_arg, 'e'}, - {"num-by", require_arg, 'e'}, - {"num-b", require_arg, 'e'}, - {"num-dsets", require_arg, 'd'}, - {"num-dset", require_arg, 'd'}, - {"num-dse", require_arg, 'd'}, - {"num-ds", require_arg, 'd'}, - {"num-d", require_arg, 'd'}, - {"num-files", require_arg, 'F'}, - {"num-file", require_arg, 'F'}, - {"num-fil", require_arg, 'F'}, - {"num-fi", require_arg, 'F'}, - {"num-f", require_arg, 'F'}, - {"num-iterations", require_arg, 'i'}, - {"num-iteration", require_arg, 'i'}, - {"num-iteratio", require_arg, 'i'}, - {"num-iterati", require_arg, 'i'}, - {"num-iterat", require_arg, 'i'}, - {"num-itera", require_arg, 'i'}, - {"num-iter", require_arg, 'i'}, - {"num-ite", require_arg, 'i'}, - {"num-it", require_arg, 'i'}, - {"num-i", require_arg, 'i'}, - {"output", require_arg, 'o'}, - {"outpu", require_arg, 'o'}, - {"outp", require_arg, 'o'}, - {"out", require_arg, 'o'}, - {"ou", require_arg, 'o'}, - {"threshold", require_arg, 'T'}, - {"threshol", require_arg, 'T'}, - {"thresho", require_arg, 'T'}, - {"thresh", require_arg, 'T'}, - {"thres", require_arg, 'T'}, - {"thre", require_arg, 'T'}, - {"thr", require_arg, 'T'}, - {"th", require_arg, 'T'}, - {"write-only", require_arg, 'w'}, - {"write-onl", require_arg, 'w'}, - {"write-on", require_arg, 'w'}, - {"write-o", require_arg, 'w'}, - {"write", require_arg, 'w'}, - {"writ", require_arg, 'w'}, - {"wri", require_arg, 'w'}, - {"wr", require_arg, 'w'}, - {NULL, 0, '\0'}}; + {"block-size", require_arg, 'B'}, + {"block-siz", require_arg, 'B'}, + {"block-si", require_arg, 'B'}, + {"block-s", require_arg, 'B'}, + {"block-", require_arg, 'B'}, + {"block", require_arg, 'B'}, + {"bloc", require_arg, 'B'}, + {"blo", require_arg, 'B'}, + {"bl", require_arg, 'B'}, + {"chunk", no_arg, 'c'}, + {"chun", no_arg, 'c'}, + {"chu", no_arg, 'c'}, + {"ch", no_arg, 'c'}, + {"collective", no_arg, 'C'}, + {"collectiv", no_arg, 'C'}, + {"collecti", no_arg, 'C'}, + {"collect", no_arg, 'C'}, + {"collec", no_arg, 'C'}, + {"colle", no_arg, 'C'}, + {"coll", no_arg, 'C'}, + {"col", no_arg, 'C'}, + {"co", no_arg, 'C'}, + {"debug", require_arg, 'D'}, + {"debu", require_arg, 'D'}, + {"deb", require_arg, 'D'}, + {"de", require_arg, 'D'}, + {"geometry", no_arg, 'g'}, + {"geometr", no_arg, 'g'}, + {"geomet", no_arg, 'g'}, + {"geome", no_arg, 'g'}, + {"geom", no_arg, 'g'}, + {"geo", no_arg, 'g'}, + {"ge", no_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"interleaved", require_arg, 'I'}, + {"interleave", require_arg, 'I'}, + {"interleav", require_arg, 'I'}, + {"interlea", require_arg, 'I'}, + {"interle", require_arg, 'I'}, + {"interl", require_arg, 'I'}, + {"inter", require_arg, 'I'}, + {"inte", require_arg, 'I'}, + {"int", require_arg, 'I'}, + {"in", require_arg, 'I'}, + {"max-num-processes", require_arg, 'P'}, + {"max-num-processe", require_arg, 'P'}, + {"max-num-process", require_arg, 'P'}, + {"max-num-proces", require_arg, 'P'}, + {"max-num-proce", require_arg, 'P'}, + {"max-num-proc", require_arg, 'P'}, + {"max-num-pro", require_arg, 'P'}, + {"max-num-pr", require_arg, 'P'}, + {"max-num-p", require_arg, 'P'}, + {"min-num-processes", require_arg, 'p'}, + {"min-num-processe", require_arg, 'p'}, + {"min-num-process", require_arg, 'p'}, + {"min-num-proces", require_arg, 'p'}, + {"min-num-proce", require_arg, 'p'}, + {"min-num-proc", require_arg, 'p'}, + {"min-num-pro", require_arg, 'p'}, + {"min-num-pr", require_arg, 'p'}, + {"min-num-p", require_arg, 'p'}, + {"max-xfer-size", require_arg, 'X'}, + {"max-xfer-siz", require_arg, 'X'}, + {"max-xfer-si", require_arg, 'X'}, + {"max-xfer-s", require_arg, 'X'}, + {"max-xfer", require_arg, 'X'}, + {"max-xfe", require_arg, 'X'}, + {"max-xf", require_arg, 'X'}, + {"max-x", require_arg, 'X'}, + {"min-xfer-size", require_arg, 'x'}, + {"min-xfer-siz", require_arg, 'x'}, + {"min-xfer-si", require_arg, 'x'}, + {"min-xfer-s", require_arg, 'x'}, + {"min-xfer", require_arg, 'x'}, + {"min-xfe", require_arg, 'x'}, + {"min-xf", require_arg, 'x'}, + {"min-x", require_arg, 'x'}, + {"num-bytes", require_arg, 'e'}, + {"num-byte", require_arg, 'e'}, + {"num-byt", require_arg, 'e'}, + {"num-by", require_arg, 'e'}, + {"num-b", require_arg, 'e'}, + {"num-dsets", require_arg, 'd'}, + {"num-dset", require_arg, 'd'}, + {"num-dse", require_arg, 'd'}, + {"num-ds", require_arg, 'd'}, + {"num-d", require_arg, 'd'}, + {"num-files", require_arg, 'F'}, + {"num-file", require_arg, 'F'}, + {"num-fil", require_arg, 'F'}, + {"num-fi", require_arg, 'F'}, + {"num-f", require_arg, 'F'}, + {"num-iterations", require_arg, 'i'}, + {"num-iteration", require_arg, 'i'}, + {"num-iteratio", require_arg, 'i'}, + {"num-iterati", require_arg, 'i'}, + {"num-iterat", require_arg, 'i'}, + {"num-itera", require_arg, 'i'}, + {"num-iter", require_arg, 'i'}, + {"num-ite", require_arg, 'i'}, + {"num-it", require_arg, 'i'}, + {"num-i", require_arg, 'i'}, + {"output", require_arg, 'o'}, + {"outpu", require_arg, 'o'}, + {"outp", require_arg, 'o'}, + {"out", require_arg, 'o'}, + {"ou", require_arg, 'o'}, + {"threshold", require_arg, 'T'}, + {"threshol", require_arg, 'T'}, + {"thresho", require_arg, 'T'}, + {"thresh", require_arg, 'T'}, + {"thres", require_arg, 'T'}, + {"thre", require_arg, 'T'}, + {"thr", require_arg, 'T'}, + {"th", require_arg, 'T'}, + {"write-only", require_arg, 'w'}, + {"write-onl", require_arg, 'w'}, + {"write-on", require_arg, 'w'}, + {"write-o", require_arg, 'w'}, + {"write", require_arg, 'w'}, + {"writ", require_arg, 'w'}, + {"wri", require_arg, 'w'}, + {"wr", require_arg, 'w'}, + {NULL, 0, '\0'}}; struct options { long io_types; /* bitmask of which I/O types to test */ @@ -1286,13 +1286,13 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': - cl_opts->h5_alignment = parse_size_directive(H5_optarg); + cl_opts->h5_alignment = parse_size_directive(opt_arg); break; case 'A': { - const char *end = H5_optarg; + const char *end = opt_arg; while (end && *end != '\0') { char buf[10]; @@ -1332,7 +1332,7 @@ parse_command_line(int argc, char *argv[]) break; #endif /* 0 */ case 'B': - cl_opts->blk_size = (size_t)parse_size_directive(H5_optarg); + cl_opts->blk_size = (size_t)parse_size_directive(opt_arg); break; case 'c': /* Turn on chunked HDF5 dataset creation */ @@ -1342,10 +1342,10 @@ parse_command_line(int argc, char *argv[]) cl_opts->collective = 1; break; case 'd': - cl_opts->num_dsets = atoi(H5_optarg); + cl_opts->num_dsets = atoi(opt_arg); break; case 'D': { - const char *end = H5_optarg; + const char *end = opt_arg; while (end && *end != '\0') { char buf[10]; @@ -1402,40 +1402,40 @@ parse_command_line(int argc, char *argv[]) break; case 'e': - cl_opts->num_bpp = parse_size_directive(H5_optarg); + cl_opts->num_bpp = parse_size_directive(opt_arg); break; case 'F': - cl_opts->num_files = HDatoi(H5_optarg); + cl_opts->num_files = HDatoi(opt_arg); break; case 'g': cl_opts->dim2d = 1; break; case 'i': - cl_opts->num_iters = HDatoi(H5_optarg); + cl_opts->num_iters = HDatoi(opt_arg); break; case 'I': cl_opts->interleaved = 1; break; case 'o': - cl_opts->output_file = H5_optarg; + cl_opts->output_file = opt_arg; break; case 'p': - cl_opts->min_num_procs = HDatoi(H5_optarg); + cl_opts->min_num_procs = HDatoi(opt_arg); break; case 'P': - cl_opts->max_num_procs = HDatoi(H5_optarg); + cl_opts->max_num_procs = HDatoi(opt_arg); break; case 'T': - cl_opts->h5_threshold = parse_size_directive(H5_optarg); + cl_opts->h5_threshold = parse_size_directive(opt_arg); break; case 'w': cl_opts->h5_write_only = TRUE; break; case 'x': - cl_opts->min_xfer_size = (size_t)parse_size_directive(H5_optarg); + cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg); break; case 'X': - cl_opts->max_xfer_size = (size_t)parse_size_directive(H5_optarg); + cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg); break; case 'h': case '?': diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c index ded15a4..0a9bfc0 100644 --- a/tools/test/perform/pio_standalone.c +++ b/tools/test/perform/pio_standalone.c @@ -26,26 +26,31 @@ MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */ /* global variables */ int nCols = 80; +/* ``get_option'' variables */ +int opt_err = 1; /*get_option prints errors if this is on */ +int opt_ind = 1; /*token pointer */ +const char *opt_arg; /*flag argument (or value) */ + int -get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) +get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ - if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { + if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { return EOF; } - else if (HDstrcmp(argv[H5_optind], "--") == 0) { - H5_optind++; + else if (HDstrcmp(argv[opt_ind], "--") == 0) { + opt_ind++; return EOF; } } - if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { + if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { /* long command line option */ - const char *arg = &argv[H5_optind][2]; + const char *arg = &argv[opt_ind][2]; int i; for (i = 0; l_opts && l_opts[i].name; i++) { @@ -57,13 +62,13 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (l_opts[i].has_arg != no_arg) { if (arg[len] == '=') { - H5_optarg = &arg[len + 1]; + opt_arg = &arg[len + 1]; } - else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') { - H5_optarg = argv[++H5_optind]; + else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { + opt_arg = argv[++opt_ind]; } else if (l_opts[i].has_arg == require_arg) { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; @@ -71,13 +76,13 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o } else { if (arg[len] == '=') { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - H5_optarg = NULL; + opt_arg = NULL; } break; @@ -86,29 +91,29 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } - H5_optind++; + opt_ind++; sp = 1; } else { register char *cp; /* pointer into current token */ /* short command line option */ - opt_opt = argv[H5_optind][sp]; + opt_opt = argv[opt_ind][sp]; if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ - if (argv[H5_optind][++sp] == '\0') { - H5_optind++; + if (argv[opt_ind][++sp] == '\0') { + opt_ind++; sp = 1; } @@ -117,32 +122,32 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (*++cp == ':') { /* if a value is expected, get it */ - if (argv[H5_optind][sp + 1] != '\0') { + if (argv[opt_ind][sp + 1] != '\0') { /* flag value is rest of current token */ - H5_optarg = &argv[H5_optind++][sp + 1]; + opt_arg = &argv[opt_ind++][sp + 1]; } - else if (++H5_optind >= argc) { - if (H5_opterr) + else if (++opt_ind >= argc) { + if (opt_err) HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; } else { /* flag value is next token */ - H5_optarg = argv[H5_optind++]; + opt_arg = argv[opt_ind++]; } sp = 1; } else { /* set up to look at next char in token, next time */ - if (argv[H5_optind][++sp] == '\0') { + if (argv[opt_ind][++sp] == '\0') { /* no more in current token, so setup next token */ - H5_optind++; + opt_ind++; sp = 1; } - H5_optarg = NULL; + opt_arg = NULL; } } diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 813ad2d..35a5217 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -21,6 +21,10 @@ #include "H5public.h" /* Include Public Definitions */ +/* + * Include ANSI-C header files. + */ +#ifdef H5_STDC_HEADERS #include #include #include @@ -33,6 +37,7 @@ #include #include #include +#endif /* * Redefine all the POSIX functions. We should never see a POSIX @@ -471,25 +476,24 @@ void h5_dump_info_object(MPI_Info info); /** From h5tools_utils.h **/ -H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */ -H5_DLLVAR int H5_optind; /* token pointer */ -H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */ +extern int opt_err; /* getoption prints errors if this is on */ +extern int opt_ind; /* token pointer */ +extern const char *opt_arg; /* flag argument (or value) */ -enum h5_arg_level { +enum { no_arg = 0, /* doesn't take an argument */ require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; -struct h5_long_options { - const char * name; /* Name of the long option */ - enum h5_arg_level has_arg; /* Whether we should look for an arg */ - char shortval; /* The shortname equivalent of long arg - * this gets returned from get_option - */ -}; +typedef struct long_options { + const char *name; /* name of the long option */ + int has_arg; /* whether we should look for an arg */ + char shortval; /* the shortname equivalent of long arg + * this gets returned from get_option */ +} long_options; -extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); +extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index 1af2318..e5a0ec8 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -16,10 +16,12 @@ #include "hdf5.h" +#ifdef H5_STDC_HEADERS #include #include #include #include +#endif #ifdef H5_HAVE_UNISTD_H #include @@ -1264,6 +1266,13 @@ done: * Programmer: Albert Cheng 2001/12/12 * Modifications: Support for file drivers. Christian Chilan, April, 2008 */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * 'temp' in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +H5_GCC_DIAG_OFF("format-nonliteral") static void do_cleanupfile(iotype iot, char *filename) { @@ -1326,3 +1335,4 @@ do_cleanupfile(iotype iot, char *filename) } } } +H5_GCC_DIAG_ON("format-nonliteral") diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index 51a7825..fe4e7e7 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -97,13 +97,13 @@ static const char *progname = "h5perf_serial"; * It seems that only the options that accept additional information * such as dataset size (-e) require the colon next to it. */ -static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; -static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, - {"alig", require_arg, 'a'}, - {"ali", require_arg, 'a'}, - {"al", require_arg, 'a'}, - {"api", require_arg, 'A'}, - {"ap", require_arg, 'A'}, +static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; +static struct long_options l_opts[] = {{"align", require_arg, 'a'}, + {"alig", require_arg, 'a'}, + {"ali", require_arg, 'a'}, + {"al", require_arg, 'a'}, + {"api", require_arg, 'A'}, + {"ap", require_arg, 'A'}, #if 0 /* a sighting of the elusive binary option */ { "binary", no_arg, 'b' }, @@ -112,156 +112,156 @@ static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, { "bin", no_arg, 'b' }, { "bi", no_arg, 'b' }, #endif /* 0 */ - {"block-size", require_arg, 'B'}, - {"block-siz", require_arg, 'B'}, - {"block-si", require_arg, 'B'}, - {"block-s", require_arg, 'B'}, - {"block-", require_arg, 'B'}, - {"block", require_arg, 'B'}, - {"bloc", require_arg, 'B'}, - {"blo", require_arg, 'B'}, - {"bl", require_arg, 'B'}, - {"chunk", no_arg, 'c'}, - {"chun", no_arg, 'c'}, - {"chu", no_arg, 'c'}, - {"ch", no_arg, 'c'}, - {"collective", no_arg, 'C'}, - {"collectiv", no_arg, 'C'}, - {"collecti", no_arg, 'C'}, - {"collect", no_arg, 'C'}, - {"collec", no_arg, 'C'}, - {"colle", no_arg, 'C'}, - {"coll", no_arg, 'C'}, - {"col", no_arg, 'C'}, - {"co", no_arg, 'C'}, - {"debug", require_arg, 'D'}, - {"debu", require_arg, 'D'}, - {"deb", require_arg, 'D'}, - {"de", require_arg, 'D'}, - {"file-driver", require_arg, 'v'}, - {"file-drive", require_arg, 'v'}, - {"file-driv", require_arg, 'v'}, - {"file-dri", require_arg, 'v'}, - {"file-dr", require_arg, 'v'}, - {"file-d", require_arg, 'v'}, - {"file-", require_arg, 'v'}, - {"file", require_arg, 'v'}, - {"fil", require_arg, 'v'}, - {"fi", require_arg, 'v'}, - {"geometry", no_arg, 'g'}, - {"geometr", no_arg, 'g'}, - {"geomet", no_arg, 'g'}, - {"geome", no_arg, 'g'}, - {"geom", no_arg, 'g'}, - {"geo", no_arg, 'g'}, - {"ge", no_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"interleaved", require_arg, 'I'}, - {"interleave", require_arg, 'I'}, - {"interleav", require_arg, 'I'}, - {"interlea", require_arg, 'I'}, - {"interle", require_arg, 'I'}, - {"interl", require_arg, 'I'}, - {"inter", require_arg, 'I'}, - {"inte", require_arg, 'I'}, - {"int", require_arg, 'I'}, - {"in", require_arg, 'I'}, - {"max-num-processes", require_arg, 'P'}, - {"max-num-processe", require_arg, 'P'}, - {"max-num-process", require_arg, 'P'}, - {"max-num-proces", require_arg, 'P'}, - {"max-num-proce", require_arg, 'P'}, - {"max-num-proc", require_arg, 'P'}, - {"max-num-pro", require_arg, 'P'}, - {"max-num-pr", require_arg, 'P'}, - {"max-num-p", require_arg, 'P'}, - {"min-num-processes", require_arg, 'p'}, - {"min-num-processe", require_arg, 'p'}, - {"min-num-process", require_arg, 'p'}, - {"min-num-proces", require_arg, 'p'}, - {"min-num-proce", require_arg, 'p'}, - {"min-num-proc", require_arg, 'p'}, - {"min-num-pro", require_arg, 'p'}, - {"min-num-pr", require_arg, 'p'}, - {"min-num-p", require_arg, 'p'}, - {"max-xfer-size", require_arg, 'X'}, - {"max-xfer-siz", require_arg, 'X'}, - {"max-xfer-si", require_arg, 'X'}, - {"max-xfer-s", require_arg, 'X'}, - {"max-xfer", require_arg, 'X'}, - {"max-xfe", require_arg, 'X'}, - {"max-xf", require_arg, 'X'}, - {"max-x", require_arg, 'X'}, - {"min-xfer-size", require_arg, 'x'}, - {"min-xfer-siz", require_arg, 'x'}, - {"min-xfer-si", require_arg, 'x'}, - {"min-xfer-s", require_arg, 'x'}, - {"min-xfer", require_arg, 'x'}, - {"min-xfe", require_arg, 'x'}, - {"min-xf", require_arg, 'x'}, - {"min-x", require_arg, 'x'}, - {"num-bytes", require_arg, 'e'}, - {"num-byte", require_arg, 'e'}, - {"num-byt", require_arg, 'e'}, - {"num-by", require_arg, 'e'}, - {"num-b", require_arg, 'e'}, - {"num-dsets", require_arg, 'd'}, - {"num-dset", require_arg, 'd'}, - {"num-dse", require_arg, 'd'}, - {"num-ds", require_arg, 'd'}, - {"num-d", require_arg, 'd'}, - {"num-files", require_arg, 'F'}, - {"num-file", require_arg, 'F'}, - {"num-fil", require_arg, 'F'}, - {"num-fi", require_arg, 'F'}, - {"num-f", require_arg, 'F'}, - {"num-iterations", require_arg, 'i'}, - {"num-iteration", require_arg, 'i'}, - {"num-iteratio", require_arg, 'i'}, - {"num-iterati", require_arg, 'i'}, - {"num-iterat", require_arg, 'i'}, - {"num-itera", require_arg, 'i'}, - {"num-iter", require_arg, 'i'}, - {"num-ite", require_arg, 'i'}, - {"num-it", require_arg, 'i'}, - {"num-i", require_arg, 'i'}, - {"order", require_arg, 'r'}, - {"orde", require_arg, 'r'}, - {"ord", require_arg, 'r'}, - {"or", require_arg, 'r'}, - {"output", require_arg, 'o'}, - {"outpu", require_arg, 'o'}, - {"outp", require_arg, 'o'}, - {"out", require_arg, 'o'}, - {"ou", require_arg, 'o'}, - {"extendable", no_arg, 't'}, - {"extendabl", no_arg, 't'}, - {"extendab", no_arg, 't'}, - {"extenda", no_arg, 't'}, - {"extend", no_arg, 't'}, - {"exten", no_arg, 't'}, - {"exte", no_arg, 't'}, - {"ext", no_arg, 't'}, - {"ex", no_arg, 't'}, - {"threshold", require_arg, 'T'}, - {"threshol", require_arg, 'T'}, - {"thresho", require_arg, 'T'}, - {"thresh", require_arg, 'T'}, - {"thres", require_arg, 'T'}, - {"thre", require_arg, 'T'}, - {"thr", require_arg, 'T'}, - {"th", require_arg, 'T'}, - {"write-only", require_arg, 'w'}, - {"write-onl", require_arg, 'w'}, - {"write-on", require_arg, 'w'}, - {"write-o", require_arg, 'w'}, - {"write", require_arg, 'w'}, - {"writ", require_arg, 'w'}, - {"wri", require_arg, 'w'}, - {"wr", require_arg, 'w'}, - {NULL, 0, '\0'}}; + {"block-size", require_arg, 'B'}, + {"block-siz", require_arg, 'B'}, + {"block-si", require_arg, 'B'}, + {"block-s", require_arg, 'B'}, + {"block-", require_arg, 'B'}, + {"block", require_arg, 'B'}, + {"bloc", require_arg, 'B'}, + {"blo", require_arg, 'B'}, + {"bl", require_arg, 'B'}, + {"chunk", no_arg, 'c'}, + {"chun", no_arg, 'c'}, + {"chu", no_arg, 'c'}, + {"ch", no_arg, 'c'}, + {"collective", no_arg, 'C'}, + {"collectiv", no_arg, 'C'}, + {"collecti", no_arg, 'C'}, + {"collect", no_arg, 'C'}, + {"collec", no_arg, 'C'}, + {"colle", no_arg, 'C'}, + {"coll", no_arg, 'C'}, + {"col", no_arg, 'C'}, + {"co", no_arg, 'C'}, + {"debug", require_arg, 'D'}, + {"debu", require_arg, 'D'}, + {"deb", require_arg, 'D'}, + {"de", require_arg, 'D'}, + {"file-driver", require_arg, 'v'}, + {"file-drive", require_arg, 'v'}, + {"file-driv", require_arg, 'v'}, + {"file-dri", require_arg, 'v'}, + {"file-dr", require_arg, 'v'}, + {"file-d", require_arg, 'v'}, + {"file-", require_arg, 'v'}, + {"file", require_arg, 'v'}, + {"fil", require_arg, 'v'}, + {"fi", require_arg, 'v'}, + {"geometry", no_arg, 'g'}, + {"geometr", no_arg, 'g'}, + {"geomet", no_arg, 'g'}, + {"geome", no_arg, 'g'}, + {"geom", no_arg, 'g'}, + {"geo", no_arg, 'g'}, + {"ge", no_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"interleaved", require_arg, 'I'}, + {"interleave", require_arg, 'I'}, + {"interleav", require_arg, 'I'}, + {"interlea", require_arg, 'I'}, + {"interle", require_arg, 'I'}, + {"interl", require_arg, 'I'}, + {"inter", require_arg, 'I'}, + {"inte", require_arg, 'I'}, + {"int", require_arg, 'I'}, + {"in", require_arg, 'I'}, + {"max-num-processes", require_arg, 'P'}, + {"max-num-processe", require_arg, 'P'}, + {"max-num-process", require_arg, 'P'}, + {"max-num-proces", require_arg, 'P'}, + {"max-num-proce", require_arg, 'P'}, + {"max-num-proc", require_arg, 'P'}, + {"max-num-pro", require_arg, 'P'}, + {"max-num-pr", require_arg, 'P'}, + {"max-num-p", require_arg, 'P'}, + {"min-num-processes", require_arg, 'p'}, + {"min-num-processe", require_arg, 'p'}, + {"min-num-process", require_arg, 'p'}, + {"min-num-proces", require_arg, 'p'}, + {"min-num-proce", require_arg, 'p'}, + {"min-num-proc", require_arg, 'p'}, + {"min-num-pro", require_arg, 'p'}, + {"min-num-pr", require_arg, 'p'}, + {"min-num-p", require_arg, 'p'}, + {"max-xfer-size", require_arg, 'X'}, + {"max-xfer-siz", require_arg, 'X'}, + {"max-xfer-si", require_arg, 'X'}, + {"max-xfer-s", require_arg, 'X'}, + {"max-xfer", require_arg, 'X'}, + {"max-xfe", require_arg, 'X'}, + {"max-xf", require_arg, 'X'}, + {"max-x", require_arg, 'X'}, + {"min-xfer-size", require_arg, 'x'}, + {"min-xfer-siz", require_arg, 'x'}, + {"min-xfer-si", require_arg, 'x'}, + {"min-xfer-s", require_arg, 'x'}, + {"min-xfer", require_arg, 'x'}, + {"min-xfe", require_arg, 'x'}, + {"min-xf", require_arg, 'x'}, + {"min-x", require_arg, 'x'}, + {"num-bytes", require_arg, 'e'}, + {"num-byte", require_arg, 'e'}, + {"num-byt", require_arg, 'e'}, + {"num-by", require_arg, 'e'}, + {"num-b", require_arg, 'e'}, + {"num-dsets", require_arg, 'd'}, + {"num-dset", require_arg, 'd'}, + {"num-dse", require_arg, 'd'}, + {"num-ds", require_arg, 'd'}, + {"num-d", require_arg, 'd'}, + {"num-files", require_arg, 'F'}, + {"num-file", require_arg, 'F'}, + {"num-fil", require_arg, 'F'}, + {"num-fi", require_arg, 'F'}, + {"num-f", require_arg, 'F'}, + {"num-iterations", require_arg, 'i'}, + {"num-iteration", require_arg, 'i'}, + {"num-iteratio", require_arg, 'i'}, + {"num-iterati", require_arg, 'i'}, + {"num-iterat", require_arg, 'i'}, + {"num-itera", require_arg, 'i'}, + {"num-iter", require_arg, 'i'}, + {"num-ite", require_arg, 'i'}, + {"num-it", require_arg, 'i'}, + {"num-i", require_arg, 'i'}, + {"order", require_arg, 'r'}, + {"orde", require_arg, 'r'}, + {"ord", require_arg, 'r'}, + {"or", require_arg, 'r'}, + {"output", require_arg, 'o'}, + {"outpu", require_arg, 'o'}, + {"outp", require_arg, 'o'}, + {"out", require_arg, 'o'}, + {"ou", require_arg, 'o'}, + {"extendable", no_arg, 't'}, + {"extendabl", no_arg, 't'}, + {"extendab", no_arg, 't'}, + {"extenda", no_arg, 't'}, + {"extend", no_arg, 't'}, + {"exten", no_arg, 't'}, + {"exte", no_arg, 't'}, + {"ext", no_arg, 't'}, + {"ex", no_arg, 't'}, + {"threshold", require_arg, 'T'}, + {"threshol", require_arg, 'T'}, + {"thresho", require_arg, 'T'}, + {"thresh", require_arg, 'T'}, + {"thres", require_arg, 'T'}, + {"thre", require_arg, 'T'}, + {"thr", require_arg, 'T'}, + {"th", require_arg, 'T'}, + {"write-only", require_arg, 'w'}, + {"write-onl", require_arg, 'w'}, + {"write-on", require_arg, 'w'}, + {"write-o", require_arg, 'w'}, + {"write", require_arg, 'w'}, + {"writ", require_arg, 'w'}, + {"wri", require_arg, 'w'}, + {"wr", require_arg, 'w'}, + {NULL, 0, '\0'}}; struct options { long io_types; /* bitmask of which I/O types to test */ @@ -993,19 +993,19 @@ parse_command_line(int argc, const char *argv[]) cl_opts->h5_extendable = FALSE; /* Use extendable dataset */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': - cl_opts->h5_alignment = parse_size_directive(H5_optarg); + cl_opts->h5_alignment = parse_size_directive(opt_arg); break; case 'G': - cl_opts->page_size = parse_size_directive(H5_optarg); + cl_opts->page_size = parse_size_directive(opt_arg); break; case 'b': - cl_opts->page_buffer_size = parse_size_directive(H5_optarg); + cl_opts->page_buffer_size = parse_size_directive(opt_arg); break; case 'A': { - const char *end = H5_optarg; + const char *end = opt_arg; while (end && *end != '\0') { char buf[10]; @@ -1043,7 +1043,7 @@ parse_command_line(int argc, const char *argv[]) /* Turn on chunked HDF5 dataset creation */ cl_opts->h5_use_chunks = 1; { - const char *end = H5_optarg; + const char *end = opt_arg; int j = 0; while (end && *end != '\0') { @@ -1070,7 +1070,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'D': { - const char *end = H5_optarg; + const char *end = opt_arg; while (end && *end != '\0') { char buf[10]; @@ -1126,7 +1126,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'e': { - const char *end = H5_optarg; + const char *end = opt_arg; int j = 0; while (end && *end != '\0') { @@ -1153,38 +1153,38 @@ parse_command_line(int argc, const char *argv[]) break; case 'i': - cl_opts->num_iters = HDatoi(H5_optarg); + cl_opts->num_iters = HDatoi(opt_arg); break; case 'o': - cl_opts->output_file = H5_optarg; + cl_opts->output_file = opt_arg; break; case 'T': - cl_opts->h5_threshold = parse_size_directive(H5_optarg); + cl_opts->h5_threshold = parse_size_directive(opt_arg); break; case 'v': - if (!HDstrcasecmp(H5_optarg, "sec2")) { + if (!HDstrcasecmp(opt_arg, "sec2")) { cl_opts->vfd = sec2; } - else if (!HDstrcasecmp(H5_optarg, "stdio")) { + else if (!HDstrcasecmp(opt_arg, "stdio")) { cl_opts->vfd = stdio; } - else if (!HDstrcasecmp(H5_optarg, "core")) { + else if (!HDstrcasecmp(opt_arg, "core")) { cl_opts->vfd = core; } - else if (!HDstrcasecmp(H5_optarg, "split")) { + else if (!HDstrcasecmp(opt_arg, "split")) { cl_opts->vfd = split; } - else if (!HDstrcasecmp(H5_optarg, "multi")) { + else if (!HDstrcasecmp(opt_arg, "multi")) { cl_opts->vfd = multi; } - else if (!HDstrcasecmp(H5_optarg, "family")) { + else if (!HDstrcasecmp(opt_arg, "family")) { cl_opts->vfd = family; } - else if (!HDstrcasecmp(H5_optarg, "direct")) { + else if (!HDstrcasecmp(opt_arg, "direct")) { cl_opts->vfd = direct; } else { - HDfprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg); + HDfprintf(stderr, "sio_perf: invalid --api option %s\n", opt_arg); HDexit(EXIT_FAILURE); } break; @@ -1195,7 +1195,7 @@ parse_command_line(int argc, const char *argv[]) cl_opts->h5_extendable = TRUE; break; case 'x': { - const char *end = H5_optarg; + const char *end = opt_arg; int j = 0; while (end && *end != '\0') { @@ -1222,7 +1222,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'r': { - const char *end = H5_optarg; + const char *end = opt_arg; int j = 0; while (end && *end != '\0') { diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c index 7c22b53..abc0777 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -22,26 +22,31 @@ /* global variables */ int nCols = 80; +/* ``get_option'' variables */ +int opt_err = 1; /*get_option prints errors if this is on */ +int opt_ind = 1; /*token pointer */ +const char *opt_arg; /*flag argument (or value) */ + int -get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) +get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ - if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { + if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { return EOF; } - else if (HDstrcmp(argv[H5_optind], "--") == 0) { - H5_optind++; + else if (HDstrcmp(argv[opt_ind], "--") == 0) { + opt_ind++; return EOF; } } - if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { + if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { /* long command line option */ - const char *arg = &argv[H5_optind][2]; + const char *arg = &argv[opt_ind][2]; int i; for (i = 0; l_opts && l_opts[i].name; i++) { @@ -53,13 +58,13 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (l_opts[i].has_arg != no_arg) { if (arg[len] == '=') { - H5_optarg = &arg[len + 1]; + opt_arg = &arg[len + 1]; } - else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') { - H5_optarg = argv[++H5_optind]; + else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { + opt_arg = argv[++opt_ind]; } else if (l_opts[i].has_arg == require_arg) { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; @@ -67,13 +72,13 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o } else { if (arg[len] == '=') { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - H5_optarg = NULL; + opt_arg = NULL; } break; @@ -82,29 +87,29 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } - H5_optind++; + opt_ind++; sp = 1; } else { register char *cp; /* pointer into current token */ /* short command line option */ - opt_opt = argv[H5_optind][sp]; + opt_opt = argv[opt_ind][sp]; if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { - if (H5_opterr) + if (opt_err) HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ - if (argv[H5_optind][++sp] == '\0') { - H5_optind++; + if (argv[opt_ind][++sp] == '\0') { + opt_ind++; sp = 1; } @@ -113,32 +118,32 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o if (*++cp == ':') { /* if a value is expected, get it */ - if (argv[H5_optind][sp + 1] != '\0') { + if (argv[opt_ind][sp + 1] != '\0') { /* flag value is rest of current token */ - H5_optarg = &argv[H5_optind++][sp + 1]; + opt_arg = &argv[opt_ind++][sp + 1]; } - else if (++H5_optind >= argc) { - if (H5_opterr) + else if (++opt_ind >= argc) { + if (opt_err) HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; } else { /* flag value is next token */ - H5_optarg = argv[H5_optind++]; + opt_arg = argv[opt_ind++]; } sp = 1; } else { /* set up to look at next char in token, next time */ - if (argv[H5_optind][++sp] == '\0') { + if (argv[opt_ind][++sp] == '\0') { /* no more in current token, so setup next token */ - H5_optind++; + opt_ind++; sp = 1; } - H5_optarg = NULL; + opt_arg = NULL; } } diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 9a2a8c6..d8b6412 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -21,6 +21,10 @@ #include "H5public.h" /* Include Public Definitions */ +/* + * Include ANSI-C header files. + */ +#ifdef H5_STDC_HEADERS #include #include #include @@ -33,6 +37,7 @@ #include #include #include +#endif /* maximum of two, three, or four values */ #undef MAX @@ -486,25 +491,24 @@ void h5_dump_info_object(MPI_Info info); /** From h5tools_utils.h **/ -H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */ -H5_DLLVAR int H5_optind; /* token pointer */ -H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */ +extern int opt_err; /* getoption prints errors if this is on */ +extern int opt_ind; /* token pointer */ +extern const char *opt_arg; /* flag argument (or value) */ -enum h5_arg_level { +enum { no_arg = 0, /* doesn't take an argument */ require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; -struct h5_long_options { - const char * name; /* Name of the long option */ - enum h5_arg_level has_arg; /* Whether we should look for an arg */ - char shortval; /* The shortname equivalent of long arg - * this gets returned from get_option - */ -}; +typedef struct long_options { + const char *name; /* name of the long option */ + int has_arg; /* whether we should look for an arg */ + char shortval; /* the shortname equivalent of long arg + * this gets returned from get_option */ +} long_options; -extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); +extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 6231587..517866b 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -64,66 +64,66 @@ static void error(const char *fmt, ...); static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); /* commandline options : long and short form */ -static const char * s_opts = "hB:b:c:p:rs:0123456789"; -static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, - {"compressability", require_arg, 'c'}, - {"compressabilit", require_arg, 'c'}, - {"compressabili", require_arg, 'c'}, - {"compressabil", require_arg, 'c'}, - {"compressabi", require_arg, 'c'}, - {"compressab", require_arg, 'c'}, - {"compressa", require_arg, 'c'}, - {"compress", require_arg, 'c'}, - {"compres", require_arg, 'c'}, - {"compre", require_arg, 'c'}, - {"compr", require_arg, 'c'}, - {"comp", require_arg, 'c'}, - {"com", require_arg, 'c'}, - {"co", require_arg, 'c'}, - {"file-size", require_arg, 's'}, - {"file-siz", require_arg, 's'}, - {"file-si", require_arg, 's'}, - {"file-s", require_arg, 's'}, - {"file", require_arg, 's'}, - {"fil", require_arg, 's'}, - {"fi", require_arg, 's'}, - {"max-buffer-size", require_arg, 'B'}, - {"max-buffer-siz", require_arg, 'B'}, - {"max-buffer-si", require_arg, 'B'}, - {"max-buffer-s", require_arg, 'B'}, - {"max-buffer", require_arg, 'B'}, - {"max-buffe", require_arg, 'B'}, - {"max-buff", require_arg, 'B'}, - {"max-buf", require_arg, 'B'}, - {"max-bu", require_arg, 'B'}, - {"max-b", require_arg, 'B'}, - {"max", require_arg, 'B'}, - {"min-buffer-size", require_arg, 'b'}, - {"min-buffer-siz", require_arg, 'b'}, - {"min-buffer-si", require_arg, 'b'}, - {"min-buffer-s", require_arg, 'b'}, - {"min-buffer", require_arg, 'b'}, - {"min-buffe", require_arg, 'b'}, - {"min-buff", require_arg, 'b'}, - {"min-buf", require_arg, 'b'}, - {"min-bu", require_arg, 'b'}, - {"min-b", require_arg, 'b'}, - {"min", require_arg, 'b'}, - {"prefix", require_arg, 'p'}, - {"prefi", require_arg, 'p'}, - {"pref", require_arg, 'p'}, - {"pre", require_arg, 'p'}, - {"pr", require_arg, 'p'}, - {"random-test", no_arg, 'r'}, - {"random-tes", no_arg, 'r'}, - {"random-te", no_arg, 'r'}, - {"random-t", no_arg, 'r'}, - {"random", no_arg, 'r'}, - {"rando", no_arg, 'r'}, - {"rand", no_arg, 'r'}, - {"ran", no_arg, 'r'}, - {"ra", no_arg, 'r'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hB:b:c:p:rs:0123456789"; +static struct long_options l_opts[] = {{"help", no_arg, 'h'}, + {"compressability", require_arg, 'c'}, + {"compressabilit", require_arg, 'c'}, + {"compressabili", require_arg, 'c'}, + {"compressabil", require_arg, 'c'}, + {"compressabi", require_arg, 'c'}, + {"compressab", require_arg, 'c'}, + {"compressa", require_arg, 'c'}, + {"compress", require_arg, 'c'}, + {"compres", require_arg, 'c'}, + {"compre", require_arg, 'c'}, + {"compr", require_arg, 'c'}, + {"comp", require_arg, 'c'}, + {"com", require_arg, 'c'}, + {"co", require_arg, 'c'}, + {"file-size", require_arg, 's'}, + {"file-siz", require_arg, 's'}, + {"file-si", require_arg, 's'}, + {"file-s", require_arg, 's'}, + {"file", require_arg, 's'}, + {"fil", require_arg, 's'}, + {"fi", require_arg, 's'}, + {"max-buffer-size", require_arg, 'B'}, + {"max-buffer-siz", require_arg, 'B'}, + {"max-buffer-si", require_arg, 'B'}, + {"max-buffer-s", require_arg, 'B'}, + {"max-buffer", require_arg, 'B'}, + {"max-buffe", require_arg, 'B'}, + {"max-buff", require_arg, 'B'}, + {"max-buf", require_arg, 'B'}, + {"max-bu", require_arg, 'B'}, + {"max-b", require_arg, 'B'}, + {"max", require_arg, 'B'}, + {"min-buffer-size", require_arg, 'b'}, + {"min-buffer-siz", require_arg, 'b'}, + {"min-buffer-si", require_arg, 'b'}, + {"min-buffer-s", require_arg, 'b'}, + {"min-buffer", require_arg, 'b'}, + {"min-buffe", require_arg, 'b'}, + {"min-buff", require_arg, 'b'}, + {"min-buf", require_arg, 'b'}, + {"min-bu", require_arg, 'b'}, + {"min-b", require_arg, 'b'}, + {"min", require_arg, 'b'}, + {"prefix", require_arg, 'p'}, + {"prefi", require_arg, 'p'}, + {"pref", require_arg, 'p'}, + {"pre", require_arg, 'p'}, + {"pr", require_arg, 'p'}, + {"random-test", no_arg, 'r'}, + {"random-tes", no_arg, 'r'}, + {"random-te", no_arg, 'r'}, + {"random-t", no_arg, 'r'}, + {"random", no_arg, 'r'}, + {"rando", no_arg, 'r'}, + {"rand", no_arg, 'r'}, + {"ran", no_arg, 'r'}, + {"ra", no_arg, 'r'}, + {NULL, 0, '\0'}}; /* * Function: error @@ -551,7 +551,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) > 0) { switch ((char)opt) { case '0': case '1': @@ -566,13 +566,13 @@ main(int argc, const char *argv[]) compress_level = opt - '0'; break; case 'B': - max_buf_size = parse_size_directive(H5_optarg); + max_buf_size = parse_size_directive(opt_arg); break; case 'b': - min_buf_size = parse_size_directive(H5_optarg); + min_buf_size = parse_size_directive(opt_arg); break; case 'c': - compress_percent = (int)HDstrtol(H5_optarg, NULL, 10); + compress_percent = (int)HDstrtol(opt_arg, NULL, 10); if (compress_percent < 0) compress_percent = 0; @@ -581,13 +581,13 @@ main(int argc, const char *argv[]) break; case 'p': - option_prefix = H5_optarg; + option_prefix = opt_arg; break; case 'r': random_test = TRUE; break; case 's': - file_size = parse_size_directive(H5_optarg); + file_size = parse_size_directive(opt_arg); break; case '?': usage(); -- cgit v0.12