From 5d212789548346705d8afdff7155a502f992aacd Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 13 Aug 2021 07:54:01 -0500 Subject: Merge2 839 issue PRs to hdf5 1 12 (#906) * Use internal version of H5Eprint2 to avoid possible stack overflow (#661) * Reduces overly-pedantic casting in the public headers (#644) * Committing clang-format changes * Fixes overly pedantic casting in public headers Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix H5FD_mpio_Debug="rw" can report MPI_count instead of bytes (#699) * fixed missed closing of a dataset * fixed missed closing of a dataset * fixed typo in error return * Committing clang-format changes * minor edits * code format * Committing clang-format changes * code format * minor edit * switched from using MPI_count, to actual bytes written for H5FD_mpio_debug rw debugging * Committing clang-format changes * changed size_i in printf to reflect the I/O. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes pre-C99 build and header cruft (#700) * Committing clang-format changes * Removes pre-C99 build and header cruft * Assumes ANSI C headers exist * Assumes stdbool.h, stdint.h, and inttypes.h are present * Assumes the C++ compiler can handle stdint.h * Removes all work-arounds for missing functionality, especially stdbool.h * Formats source Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Clean up type size checks in configure.ac (#702) * Removes some DEC Alpha cruft from H5detect and H5private.h (#708) * Updates bin/trace script to correctly wrap H5TRACE macros near clang-format column limit (#719) * Removes clang-format comments from H5O.c call * Fixes bin/trace to correctly wrap lines near the clang-format limit * Removed unused variable from bin/trace * Adds __STDC_FORMAT_MACROS before including inttypes.h w/ C++ (#726) * Adds __STDC_FORMAT_MACROS before including inttypes.h w/ C++ Allows C++ library to be built on older versions of gcc. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Moves H5PacketTable default ctor inside source file (#731) * Remove private H5_GCC_DIAG_OFF/ON from standalone program (#734) * Organize and align compiler flags (#741) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string * Some Javadoc warning fixes * Updated javadoc fixes * # WARNING: head commit changed in the meantime HDFFV-11229 Fix long double usage in tools and java Changed h5dump and h5ls to just print 128-bit for long double type. Added test and file for dataset and attributes with all three float types. * Committing clang-format changes * HDFFV-11229 Add release note * HDFFV-11229 windows testfile needed * fix typo * Remove non supported message text * HDFFV-11229 - change ldouble test to check both native and general * HDFFV-11229 add second file compare * HDFFV-11229 fix reference file * HDFFV-11229 autotools check two refs * HDFFV-11229 revert back to removal of NATIVE_LDOUBLE in tools output * Committing clang-format changes * Update release note * Update attribute type of ref file * Change source of ninja for macs * try port instead of brew * Recommended is to use brew. * Undo non long double changes * remove unneeded file * Fix perl and doxygen CMake code * Add "option" command for clang options * Rework CMake add_custom to use the BYPRODUCTS argument * Add stamp files to BYPRODUCTS * Only one copy of file exists * Fix custom cmmand depends targets * Fix fortran custom command DEPENDS * Add LD_LIBRARY_PATH to tests * Add custom target for DEPENDS * Add h5detect conditionaly to generated target DEPENDS * Correct DEPENDS targets * Parallel builds need the mpi compiler for pkgconfig scripts. * install only if MPI build * Fortran target depends * Remove incorrect source attribute * doxygen adjustments * doxygen build updates * Correct version * Correct function version - function has been merged to 1.12 * Correct version string for map functions * Cleanup warnings for tools debug builds * TRILAB-227 - fix indexing for h5diff selections * Correct location of pos to index function call * TRILAB-227 Enable test * Quote subset args * Use MATCHES because of AppleClang * if blocks needed for build modes * Update list of DT platforms * VS2019 correctly displays float values * revert VS2019 change * Issue #669 remove version from pkgcfg filename * remove version from h5cc script * Java reference functions updated enabled fortran in cmake gcc action yaml file java reference test changed to correctly test refs jni reference functions that create ids changed to use jni id logging * Correct BYPRODUCTS argument * Correct more genereated files BYPRODUCTS * BYPRODUCTS must have unique locations * Fix typo * Fix fortran configure checks * Rework H5_PAC_C_MAX_REAL_PRECISION setting logic * Add note about fortran configure change * Adds a quick for for some egregious chunk_info badness (#722) * Fixes issue with ccmake that prevents building Fortran (#723) ccmake runs iteratively, and the check_fortran_source_runs macros were clobbering a single output file that did not get updated on further configure iterations * Fix conflicts with merge * Move MAX_PRECISION back to HDF5UseFortran.cmake * Use STREQUAL to test macro argument * Move C language test to ConfigureChecks from HDF5UseFortran * MAX_PRECISION defines must be defined * Organize flags and align autotools and cmake * Fix comment in no-error-general warnings files. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Fixes C++ warnings when passing hsize_t values to printf in test code (#745) * Normalization of H5_nanosleep() with VFD SWMR branch (#746) * Normalization of H5_nanosleep() with VFD SWMR branch * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Correct missing variable declaration. * Fixes some H5SL include statements (#758) * Fixes non-C99 format strings in tarray test code (#766) * Cleans up some POSIX header bits in H5private.h (#783) * Further simplifies Autotools type size checks (#789) Also fixes an issue where clock_gettime and difftime are not detected due to earlier simplifications of this code. * Normalization of CMake H5pubconf.h with Autotools (#791) Mostly just moving things around and changing the comments to keep the delta small. The only symbol change is that for curl/curl.h which I changed to H5_HAVE_CURL_CURL_H to match the Autotools. This symbol is not used in the library and is just an artifact of the checks. Co-authored-by: jhendersonHDF Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Scot Breitenfeld Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> --- bin/trace | 38 +++++++++++++++--- c++/test/tarray.cpp | 31 ++++++++------- c++/test/tattr.cpp | 60 +++++++++++++++++----------- config/cmake/H5pubconf.h.in | 44 +++++++------------- config/cmake_ext_mod/ConfigureChecks.cmake | 29 ++------------ 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 ++++-------------------- hl/c++/src/H5PacketTable.cpp | 8 ++++ hl/c++/src/H5PacketTable.h | 7 +--- src/H5Dpublic.h | 16 ++++---- 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 | 2 +- src/H5detect.c | 15 ------- src/H5private.h | 64 +++++------------------------- src/H5public.h | 31 ++++----------- src/H5system.c | 42 ++++++++++++++------ src/H5win32defs.h | 1 - test/cache.c | 13 ------ test/cache_common.c | 12 ------ test/err_compat.c | 16 ++++---- test/error_test.c | 2 +- test/tarray.c | 53 ++++++++++++++----------- 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_standalone.h | 5 --- tools/test/perform/sio_engine.c | 10 ----- tools/test/perform/sio_standalone.h | 5 --- 45 files changed, 288 insertions(+), 408 deletions(-) diff --git a/bin/trace b/bin/trace index 2b519e4..80eaa5f 100755 --- a/bin/trace +++ b/bin/trace @@ -343,10 +343,33 @@ sub rewrite_func ($$$$$) { # Compose the trace macro $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \""; $trace .= join("", @arg_str) . "\""; - 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)) { + $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) { # Wrap line, with indention $trace .= ",\n "; $len = 13; # Set to 13, for indention @@ -362,8 +385,11 @@ sub rewrite_func ($$$$$) { } # Append argument - $trace .= "$_"; - $len += length; # Add length of appended argument name + $trace .= "$arg_name[$i]"; + $argtrace .= ", $arg_name[$i]"; + + # Add length of appended argument name + $len += length($arg_name[$i]); } # Append final ');' for macro diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 7525c5f..0edfe0e 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]=%lld, tdims1[%d]=%lld\n", ii, - rdims1[ii], ii, tdims1[ii]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\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]=%lld, tdims1[%d]=%lld\n", ii, - rdims1[ii], ii, tdims1[ii]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\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]=%lld, tdims1[%d]=%lld\n", ii, - rdims1[ii], ii, tdims1[ii]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + ii, rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -265,8 +265,9 @@ 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[%lld][%lld].i=%d, " - "rdata[%lld][%lld].i=%d\n", + TestErrPrintf("Array data information doesn't match!, wdata[%" PRIuHSIZE "][%" PRIuHSIZE + "].i=%d, " + "rdata[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n", idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); continue; } // end if @@ -457,11 +458,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]=%llu, tdims1[%d]=z%llu\n", ii, - rdims1[ii], ii, tdims1[ii]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\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 adaa237..6802b3b 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -169,7 +169,8 @@ 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[%llu]=%d,read_data1[%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE + "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Create two more attributes for this dataset, but only write to one. @@ -185,7 +186,8 @@ 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[%llu]=%d,read_data1[%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE + "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close both attributes @@ -448,7 +450,8 @@ 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[%llu]=%d,read_data1[%llu%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE + "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Close attribute @@ -472,7 +475,8 @@ 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[%llu]=%d,read_data1[%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE + "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close attribute @@ -537,7 +541,8 @@ 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[%llu]=%d, read_data1[%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE + "]=%d, read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); /* @@ -568,8 +573,9 @@ 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[%llu][%llu]=%d, " - "read_data2[%llu][%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE + "]=%d, " + "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); } PASSED(); @@ -772,14 +778,17 @@ 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[%llu][%llu].i=%d, " - "read_data4[%llu][%llu].i=%d\n", + TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE + "].i=%d, " + "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].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[%llu][%llu].d=%f, " - "read_data4[%llu][%llu].d=%f\n", + TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE + "].d=%f, " + "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].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[%llu][%llu].c=%c, " - "read_data4[%llu][%llu].c=%c\n", + TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE + "].c=%c, " + "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].c=%c\n", __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ @@ -1042,10 +1051,10 @@ test_attr_mult_read() // Get the dims of the dataspace and verify them hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions - 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); + (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); /* Verify Datatype */ @@ -1072,7 +1081,8 @@ 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[%llu]=%d,read_data1[%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE + "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Verify Name @@ -1095,7 +1105,7 @@ test_attr_mult_read() verify_val(rank, ATTR2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); // Get the dims of the dataspace and verify them - ndims = space.getSimpleExtentDims(dims); + int 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__); @@ -1127,8 +1137,9 @@ 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[%llu][%llu]=%d, " - "read_data2[%llu][%llu]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE + "]=%d, " + "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); // Verify Name @@ -1181,9 +1192,10 @@ 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 (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", + 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", __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 e163d3a..4e5480b 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -35,6 +35,10 @@ /* 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@ @@ -111,7 +115,7 @@ #cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ /* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@ +#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@ /* Define if Darwin or Mac OS X */ #cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@ @@ -198,15 +202,9 @@ 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@ @@ -358,21 +356,12 @@ /* 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@ @@ -508,9 +497,6 @@ 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@ @@ -716,9 +702,6 @@ /* 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@ @@ -729,18 +712,21 @@ /* Define to 1 if you can safely include both and . */ #cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@ -/* 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 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 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 004aded..d44ede7 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -120,23 +120,13 @@ 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) @@ -146,12 +136,9 @@ 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 @@ -238,11 +225,6 @@ 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 #----------------------------------------------------------------------------- @@ -416,13 +398,9 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T) # Extra C99 types #----------------------------------------------------------------------------- -# _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 () +# Size of bool +set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) +HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) if (MINGW OR NOT WINDOWS) #----------------------------------------------------------------------------- @@ -560,7 +538,6 @@ 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 2d7e1b4..0c3b7b7 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -88,14 +88,6 @@ 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 580c409..423f74a 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -32,17 +32,6 @@ 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 96c2fc2..3fddc6a 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 b2ba08d..9dbc2b9 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -268,10 +268,13 @@ if test "X-g++" = "X-$cxx_vendor"; then fi # gcc >= 9.3 - # no cxx warnings, do NOT use C warnings + 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 # gcc >= 10 - if test $cxx_vers_major -ge 10; then + if test $cc_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 484100f..3de51b5 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 f46da0a..1c26632 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,3 +179,4 @@ if test "X-$cc_flags_set" = "X-"; then cc_vendor= cc_version= fi + diff --git a/configure.ac b/configure.ac index b5a8c78..c3c2c5b 100644 --- a/configure.ac +++ b/configure.ac @@ -1252,8 +1252,6 @@ 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 @@ -1269,15 +1267,15 @@ esac ## Windows case "`uname`" in CYGWIN*) - AC_CHECK_HEADERS([io.h sys/timeb.h]) + AC_CHECK_HEADERS([sys/timeb.h]) UNAME_CYGWIN="yes" ;; MINGW*) - AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) AC_HAVE_LIBRARY([ws2_32]) ;; *) - AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) + AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) ;; esac @@ -1368,17 +1366,6 @@ 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]) @@ -1407,34 +1394,12 @@ 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([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 -]) +AC_CHECK_SIZEOF([time_t], [], [#include ]) ## Checkpoint the cache AC_CACHE_SAVE @@ -1944,10 +1909,8 @@ 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/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index 0f47b0d..5f41e26 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -28,6 +28,14 @@ /* 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 acd0ccf..eae66f1 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -31,12 +31,9 @@ class H5_HLCPPDLL PacketTable { public: /* Null constructor - * Sets table_id to "invalid" + * Sets table_id to H5I_INVALID_HID */ - PacketTable() - { - table_id = H5I_INVALID_HID; - } + PacketTable(); /* "Open" Constructor * Opens an existing packet table, which can contain either fixed-length or diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index b73e62d..422359f 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -28,9 +28,9 @@ /*****************/ /* 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.0f) +#define H5D_CHUNK_CACHE_NSLOTS_DEFAULT SIZE_MAX +#define H5D_CHUNK_CACHE_NBYTES_DEFAULT SIZE_MAX +#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0) /* 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 bcadd63..5b6c723 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -85,6 +85,8 @@ 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 */ @@ -325,10 +327,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)H5Eprint2; + stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5E__print2; stk->auto_op.is_default = TRUE; #else /* H5_NO_DEPRECATED_SYMBOLS */ - stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2; + stk->auto_op.func2 = (H5E_auto2_t)H5E__print2; #endif /* H5_NO_DEPRECATED_SYMBOLS */ stk->auto_data = NULL; @@ -1446,13 +1448,37 @@ 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 @@ -1472,8 +1498,8 @@ H5Eprint2(hid_t err_stack, FILE *stream) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") done: - FUNC_LEAVE_API(ret_value) -} /* end H5Eprint2() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5E__print2() */ /*------------------------------------------------------------------------- * Function: H5Ewalk2 diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h index 28b41fa..fb156ac 100644 --- a/src/H5ESpublic.h +++ b/src/H5ESpublic.h @@ -24,6 +24,18 @@ /* 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 2f529b3..1c7055a 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 (hid_t)0 +#define H5E_DEFAULT 0 /* (hid_t) */ /** * Different kinds of error information diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index c0b14ce..16912cf 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1193,12 +1193,6 @@ 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 */ @@ -1343,6 +1337,12 @@ 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,12 +1430,6 @@ 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") @@ -1560,6 +1554,12 @@ 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 89238b6..f25f8f9 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 (hsize_t)0 +#define H5F_FAMILY_DEFAULT 0 /* (hsize_t) */ #ifdef H5_HAVE_PARALLEL /** @@ -108,7 +108,7 @@ typedef enum H5F_scope_t { /** * Unlimited file size for H5Pset_external() */ -#define H5F_UNLIMITED ((hsize_t)(-1L)) +#define H5F_UNLIMITED HSIZE_UNDEF /** * How does file close behave? diff --git a/src/H5Gint.c b/src/H5Gint.c index 7488357..75b206e 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -38,6 +38,7 @@ #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 b0adf30..521f94f 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -35,7 +35,6 @@ #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 893a65d..8d189e8 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -34,7 +34,6 @@ #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 bf1de86..a4f1102 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_t)(-1)) /* (4GB - 1) */ +#define H5L_MAX_LINK_NAME_LEN UINT32_MAX /** * \brief Macro to indicate operation occurs on same location */ -#define H5L_SAME_LOC (hid_t)0 +#define H5L_SAME_LOC 0 /* (hid_t) */ /** * \brief Current version of the H5L_class_t struct diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 5adb05e..3d6968e 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 (hid_t)0 +#define H5P_DEFAULT 0 /* (hid_t) */ #ifdef __cplusplus extern "C" { diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 331e5ee..cf5abe8 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -22,7 +22,7 @@ #include "H5Ipublic.h" /* Define atomic datatypes */ -#define H5S_ALL (hid_t)0 +#define H5S_ALL 0 /* (hid_t) */ #define H5S_UNLIMITED HSIZE_UNDEF /* Define user-level maximum number of dimensions */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index b708506..776769e 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_MAX /* Opaque information */ /** diff --git a/src/H5detect.c b/src/H5detect.c index e4fe453..fd5e980 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1655,21 +1655,6 @@ 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/H5private.h b/src/H5private.h index 07705e4..808c2ce 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -26,25 +26,6 @@ #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 @@ -53,37 +34,28 @@ #include #include #include +#include #include #include #include -#endif -/* - * If _POSIX_VERSION is defined in unistd.h then this system is Posix.1 - * compliant. Otherwise all bets are off. - */ +/* POSIX headers */ #ifdef H5_HAVE_UNISTD_H -#include +#include #include -#endif -#ifdef _POSIX_VERSION +#include #include -#include #endif -/* - * C9x integer types - */ -#ifndef __cplusplus -#ifdef H5_HAVE_STDINT_H -#include -#endif +/* Include the Pthreads header, if necessary */ +#if defined(H5_HAVE_THREADSAFE) && defined(H5_HAVE_PTHREAD_H) +#include #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 @@ -139,21 +111,6 @@ #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. */ @@ -187,6 +144,7 @@ #include #include /* For _getcwd() */ +#include /* POSIX I/O */ #endif /*H5_HAVE_WIN32_API*/ diff --git a/src/H5public.h b/src/H5public.h index 09a2278..30d297e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -34,28 +34,25 @@ #ifdef H5_HAVE_FEATURES_H #include /* For setting POSIX, BSD, etc. compatibility */ #endif + #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 */ + +#ifdef __cplusplus +#define __STDC_FORMAT_MACROS #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 @@ -217,19 +214,7 @@ 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 144e0bc..4aae743 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -964,10 +964,7 @@ done: * Note that commodity hardware is probably going to have a * resolution of milliseconds, not nanoseconds. * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * October 01, 2016 + * Return: void *-------------------------------------------------------------------------- */ void @@ -976,21 +973,40 @@ H5_nanosleep(uint64_t nanosec) FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5_HAVE_WIN32_API + DWORD dwMilliseconds = (DWORD)HDceil(nanosec / 1.0e6); + DWORD ignore; - /* On Windows, Sleep() is in milliseconds. Passing 0 to Sleep() - * causes the thread to relinquish the rest of its time slice. + /* 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. */ - Sleep(nanosec / (1000 * 1000)); + ignore = SleepEx(dwMilliseconds, FALSE); #else - { - struct timespec sleeptime; /* Struct to hold time to sleep */ - /* Set up time to sleep */ - sleeptime.tv_sec = 0; - sleeptime.tv_nsec = (long)nanosec; + const uint64_t nanosec_per_sec = 1000 * 1000 * 1000; + struct timespec sleeptime; /* Struct to hold time to sleep */ - HDnanosleep(&sleeptime, NULL); + /* 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); + + /* 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; } #endif diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 88911b0..0617643 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -45,7 +45,6 @@ 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/cache.c b/test/cache.c index 31d6619..fa73855 100644 --- a/test/cache.c +++ b/test/cache.c @@ -8068,19 +8068,6 @@ 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; diff --git a/test/cache_common.c b/test/cache_common.c index 7269c49..e86724f 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1487,12 +1487,6 @@ 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) { @@ -1692,12 +1686,6 @@ 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 6f3cfb3..6ad69d8 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -228,16 +228,14 @@ test_error_compat(void) if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; - /* Use H5Eget_auto2 to query the default printing function. The library - *should indicate H5Eprint2 as the default. */ + /* Use H5Eget_auto2 to query the default printing function. */ if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data) < 0) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) + if (old_func2 == NULL) TEST_ERROR; - /* This function sets the default printing function to be H5Eprint2. */ if (H5Eset_auto2(H5E_DEFAULT, old_func2, old_data) < 0) TEST_ERROR; @@ -282,12 +280,12 @@ test_error_compat(void) if (did >= 0) TEST_ERROR; - /* This function changes the new-style printing function back to the default H5Eprint2. */ - if (H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL) < 0) + /* This function changes the new-style printing function to the original. */ + if (H5Eset_auto2(H5E_DEFAULT, old_func2, NULL) < 0) TEST_ERROR; - /* This call should work because the H5Eset_auto2 above restored the default printing - * function H5Eprint2. It simply returns user_print1. */ + /* This call should work because the H5Eset_auto2 above set the default printing + * function to H5Eprint2. It simply returns user_print1. */ if ((ret = H5Eget_auto1(&old_func1, &old_data)) < 0) TEST_ERROR; if (old_data != NULL) @@ -305,7 +303,7 @@ test_error_compat(void) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) + if (old_func2 == NULL) 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 c8205ff8..f470318 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 != (H5E_auto2_t)H5Eprint2) + if (old_func == NULL) TEST_ERROR; if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) diff --git a/test/tarray.c b/test/tarray.c index 8b518cf..af167a7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -157,8 +157,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -490,8 +491,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -668,8 +670,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -889,8 +892,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -951,9 +955,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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1210,8 +1214,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1440,8 +1445,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1472,8 +1478,9 @@ 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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2081,9 +2088,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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2129,9 +2136,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]=%llu, tdims1[%d]=%llu\n", i, - rdims1[i], i, tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE + ", tdims1[%d]=%" PRIuHSIZE "\n", + i, rdims1[i], i, tdims1[i]); continue; } /* end if */ diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 1b6793a..1b08e95 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -24,12 +24,10 @@ #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 b3ae54d..6537215 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -23,14 +23,11 @@ #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 dba8220..60ec8d8 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -23,17 +23,11 @@ #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 bf4b2a9..a06fb77 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -26,13 +26,11 @@ #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 65194b0..cac36d7 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -16,12 +16,10 @@ #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_standalone.h b/tools/test/perform/pio_standalone.h index 35a5217..82fabdc 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -21,10 +21,6 @@ #include "H5public.h" /* Include Public Definitions */ -/* - * Include ANSI-C header files. - */ -#ifdef H5_STDC_HEADERS #include #include #include @@ -37,7 +33,6 @@ #include #include #include -#endif /* * Redefine all the POSIX functions. We should never see a POSIX diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index e5a0ec8..1af2318 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -16,12 +16,10 @@ #include "hdf5.h" -#ifdef H5_STDC_HEADERS #include #include #include #include -#endif #ifdef H5_HAVE_UNISTD_H #include @@ -1266,13 +1264,6 @@ 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) { @@ -1335,4 +1326,3 @@ do_cleanupfile(iotype iot, char *filename) } } } -H5_GCC_DIAG_ON("format-nonliteral") diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index d8b6412..54e82fa 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -21,10 +21,6 @@ #include "H5public.h" /* Include Public Definitions */ -/* - * Include ANSI-C header files. - */ -#ifdef H5_STDC_HEADERS #include #include #include @@ -37,7 +33,6 @@ #include #include #include -#endif /* maximum of two, three, or four values */ #undef MAX -- cgit v0.12