summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-06-27 15:44:50 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-06-27 15:44:50 (GMT)
commit0fe43fbf2cd56f142ec322daca2a669fac8243ed (patch)
treef01427e9de3133b822475e1aeb3c73ad21a4ec1f
parent7320a66aa7224549c308132a796cef325d377116 (diff)
parenta4dc3ff34d2dec4db339851df381b67970853f2a (diff)
downloadhdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.zip
hdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.tar.gz
hdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.tar.bz2
[svn-r23834] merge from trunk up to r23833.
Fixed several conflicts, mostly because calling API routines internally was removed from several places in the trunk.
-rw-r--r--CMakeLists.txt206
-rw-r--r--MANIFEST8
-rw-r--r--README.txt2
-rw-r--r--UserMacros.cmake17
-rwxr-xr-xbin/checkapi66
-rwxr-xr-xbin/checkposix145
-rw-r--r--c++/examples/CMakeLists.txt1
-rw-r--r--c++/src/CMakeLists.txt1
-rw-r--r--c++/src/Makefile.in2
-rw-r--r--c++/test/CMakeLists.txt1
-rw-r--r--config/cmake/CTestCustom.cmake22
-rw-r--r--config/cmake/ConfigureChecks.cmake22
-rw-r--r--config/cmake/HDFMacros.cmake57
-rw-r--r--config/cmake/UserMacros/Windows_MT.cmake39
-rw-r--r--config/cmake/cacheinit.cmake3
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure30
-rw-r--r--configure.ac6
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--fortran/examples/CMakeLists.txt6
-rw-r--r--fortran/src/CMakeLists.txt3
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--fortran/test/CMakeLists.txt13
-rw-r--r--fortran/testpar/CMakeLists.txt2
-rw-r--r--hl/c++/examples/CMakeLists.txt1
-rw-r--r--hl/c++/src/CMakeLists.txt3
-rw-r--r--hl/c++/src/Makefile.in2
-rw-r--r--hl/c++/test/CMakeLists.txt1
-rw-r--r--hl/examples/CMakeLists.txt1
-rw-r--r--hl/fortran/examples/CMakeLists.txt2
-rw-r--r--hl/fortran/src/CMakeLists.txt3
-rw-r--r--hl/fortran/src/Makefile.in2
-rw-r--r--hl/fortran/test/CMakeLists.txt8
-rw-r--r--hl/src/CMakeLists.txt1
-rw-r--r--hl/src/H5LT.c74
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--hl/test/CMakeLists.txt2
-rw-r--r--hl/test/test_image.c186
-rw-r--r--hl/tools/CMakeLists.txt3
-rw-r--r--perform/CMakeLists.txt10
-rw-r--r--release_docs/RELEASE.txt2
-rw-r--r--release_docs/USING_HDF5_CMake.txt1
-rw-r--r--release_docs/USING_HDF5_VS.txt2
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/H5.c4
-rw-r--r--src/H5C.c10
-rw-r--r--src/H5CS.c14
-rw-r--r--src/H5D.c75
-rw-r--r--src/H5Dchunk.c23
-rw-r--r--src/H5Dint.c20
-rw-r--r--src/H5Dio.c2
-rw-r--r--src/H5Dmpio.c39
-rw-r--r--src/H5Dpkg.h3
-rw-r--r--src/H5F.c11
-rw-r--r--src/H5FD.c10
-rw-r--r--src/H5FDcore.c2
-rw-r--r--src/H5FDdirect.c90
-rw-r--r--src/H5FDfamily.c16
-rw-r--r--src/H5FDint.c2
-rw-r--r--src/H5FDlog.c2
-rw-r--r--src/H5FDmpi.c34
-rw-r--r--src/H5FDmpio.c52
-rw-r--r--src/H5FDmpiposix.c4
-rw-r--r--src/H5FO.c28
-rw-r--r--src/H5Fint.c6
-rw-r--r--src/H5Fmpi.c6
-rw-r--r--src/H5Fpkg.h1
-rw-r--r--src/H5Fprivate.h1
-rw-r--r--src/H5Gname.c14
-rw-r--r--src/H5HG.c8
-rw-r--r--src/H5HP.c134
-rw-r--r--src/H5MM.c4
-rw-r--r--src/H5Ocopy.c27
-rw-r--r--src/H5Oefl.c4
-rw-r--r--src/H5Olayout.c2
-rw-r--r--src/H5Oname.c14
-rw-r--r--src/H5Ostab.c16
-rw-r--r--src/H5PL.c6
-rw-r--r--src/H5Pdcpl.c21
-rw-r--r--src/H5Pfapl.c2
-rw-r--r--src/H5Pint.c2
-rw-r--r--src/H5Pocpl.c2
-rw-r--r--src/H5R.c10
-rw-r--r--src/H5S.c10
-rw-r--r--src/H5SL.c42
-rw-r--r--src/H5Sall.c54
-rw-r--r--src/H5Sselect.c52
-rw-r--r--src/H5T.c74
-rw-r--r--src/H5Tconv.c627
-rw-r--r--src/H5Tenum.c20
-rw-r--r--src/H5Tfields.c12
-rw-r--r--src/H5Tfixed.c2
-rw-r--r--src/H5Tnative.c53
-rw-r--r--src/H5Toffset.c12
-rw-r--r--src/H5Tprecis.c12
-rw-r--r--src/H5Tvlen.c10
-rw-r--r--src/H5V.c146
-rw-r--r--src/H5VLnative.c13
-rw-r--r--src/H5Vprivate.h2
-rw-r--r--src/H5Z.c235
-rw-r--r--src/H5Zfletcher32.c2
-rw-r--r--src/H5Zprivate.h3
-rw-r--r--src/H5Zscaleoffset.c4
-rw-r--r--src/H5Zszip.c20
-rw-r--r--src/H5Ztrans.c68
-rw-r--r--src/H5detect.c98
-rw-r--r--src/H5make_libsettings.c6
-rw-r--r--src/H5private.h9
-rw-r--r--src/H5public.h4
-rw-r--r--src/H5system.c4
-rw-r--r--src/H5timer.c10
-rw-r--r--src/H5trace.c10
-rw-r--r--src/Makefile.in2
-rw-r--r--test/CMakeLists.txt14
-rw-r--r--test/H5srcdir.h11
-rw-r--r--test/h5test.c20
-rw-r--r--test/links.c116
-rw-r--r--test/links_env.c1
-rw-r--r--testpar/CMakeLists.txt2
-rw-r--r--tools/Makefile.am2
-rw-r--r--tools/Makefile.in2
-rw-r--r--tools/h5copy/CMakeLists.txt2
-rw-r--r--tools/h5diff/CMakeLists.txt3
-rw-r--r--tools/h5diff/h5diff_main.c1
-rw-r--r--tools/h5dump/CMakeLists.txt27
-rw-r--r--tools/h5dump/errfiles/tall-2A0.err25
-rw-r--r--tools/h5dump/h5dump.c25
-rw-r--r--tools/h5dump/h5dump.h1
-rw-r--r--tools/h5dump/h5dump_ddl.c27
-rw-r--r--tools/h5dump/h5dump_extern.h1
-rw-r--r--tools/h5dump/testh5dump.sh.in10
-rw-r--r--tools/h5dump/testh5dumppbits.sh.in2
-rw-r--r--tools/h5dump/testh5dumpxml.sh.in2
-rw-r--r--tools/h5import/CMakeLists.txt2
-rw-r--r--tools/h5jam/CMakeLists.txt5
-rw-r--r--tools/h5jam/getub.c2
-rw-r--r--tools/h5ls/CMakeLists.txt1
-rw-r--r--tools/h5repack/CMakeLists.txt3
-rw-r--r--tools/h5stat/CMakeLists.txt2
-rw-r--r--tools/h5stat/h5stat.c337
-rw-r--r--tools/lib/CMakeLists.txt3
-rw-r--r--tools/lib/h5diff_array.c6
-rw-r--r--tools/lib/h5tools.c16
-rw-r--r--tools/lib/h5tools_dump.c103
-rw-r--r--tools/lib/h5tools_str.c20
-rw-r--r--tools/misc/CMakeLists.txt5
-rw-r--r--tools/testfiles/h5dump-help.txt1
-rw-r--r--tools/testfiles/tall-2A.h5.xml2
-rw-r--r--tools/testfiles/tall-2A0.ddl64
-rw-r--r--tools/testfiles/tall.h5.xml2
-rw-r--r--tools/testfiles/tarray1.h5.xml2
-rw-r--r--tools/testfiles/tarray2.h5.xml2
-rw-r--r--tools/testfiles/tarray3.h5.xml2
-rw-r--r--tools/testfiles/tarray6.h5.xml2
-rw-r--r--tools/testfiles/tarray7.h5.xml2
-rw-r--r--tools/testfiles/tattr.h5.xml2
-rw-r--r--tools/testfiles/tbitfields.h5.xml2
-rw-r--r--tools/testfiles/tcompound.h5.xml2
-rw-r--r--tools/testfiles/tcompound2.h5.xml2
-rw-r--r--tools/testfiles/tcompound_complex.h5.xml2
-rw-r--r--tools/testfiles/tdatareg.h5.xml2
-rw-r--r--tools/testfiles/tdset.h5.xml2
-rw-r--r--tools/testfiles/tdset2.h5.xml2
-rw-r--r--tools/testfiles/tempty-dtd-2.h5.xml2
-rw-r--r--tools/testfiles/tempty-dtd.h5.xml2
-rw-r--r--tools/testfiles/tempty-ns-2.h5.xml2
-rw-r--r--tools/testfiles/tempty-ns.h5.xml2
-rw-r--r--tools/testfiles/tempty.h5.xml2
-rw-r--r--tools/testfiles/tenum.h5.xml2
-rw-r--r--tools/testfiles/textlink.h5.xml2
-rw-r--r--tools/testfiles/tfpformat.h5.xml2
-rw-r--r--tools/testfiles/tgroup.h5.xml2
-rw-r--r--tools/testfiles/thlink.h5.xml2
-rw-r--r--tools/testfiles/tloop.h5.xml2
-rw-r--r--tools/testfiles/tloop2.h5.xml2
-rw-r--r--tools/testfiles/tmany.h5.xml2
-rw-r--r--tools/testfiles/tname-amp.h5.xml2
-rw-r--r--tools/testfiles/tname-apos.h5.xml2
-rw-r--r--tools/testfiles/tname-gt.h5.xml2
-rw-r--r--tools/testfiles/tname-lt.h5.xml2
-rw-r--r--tools/testfiles/tname-quot.h5.xml2
-rw-r--r--tools/testfiles/tname-sp.h5.xml2
-rw-r--r--tools/testfiles/tnamed_dtype_attr.h5.xml2
-rw-r--r--tools/testfiles/tnestedcomp.h5.xml2
-rw-r--r--tools/testfiles/tnodata.h5.xml2
-rw-r--r--tools/testfiles/tnofilename-with-packed-bits.ddl1
-rw-r--r--tools/testfiles/tobjref.h5.xml2
-rw-r--r--tools/testfiles/topaque.h5.xml2
-rw-r--r--tools/testfiles/torderattr1.h5.xml2
-rw-r--r--tools/testfiles/torderattr2.h5.xml2
-rw-r--r--tools/testfiles/torderattr3.h5.xml2
-rw-r--r--tools/testfiles/torderattr4.h5.xml2
-rw-r--r--tools/testfiles/tpbitsIncomplete.ddl1
-rw-r--r--tools/testfiles/tpbitsLengthExceeded.ddl1
-rw-r--r--tools/testfiles/tpbitsLengthPositive.ddl1
-rw-r--r--tools/testfiles/tpbitsMaxExceeded.ddl1
-rw-r--r--tools/testfiles/tpbitsOffsetExceeded.ddl1
-rw-r--r--tools/testfiles/tpbitsOffsetNegative.ddl1
-rw-r--r--tools/testfiles/trawssetfile.ddl14
-rw-r--r--tools/testfiles/trawssetfile.exp2
-rw-r--r--tools/testfiles/tref-escapes-at.h5.xml2
-rw-r--r--tools/testfiles/tref-escapes.h5.xml2
-rw-r--r--tools/testfiles/tref.h5.xml2
-rw-r--r--tools/testfiles/tsaf.h5.xml2
-rw-r--r--tools/testfiles/tslink.h5.xml2
-rw-r--r--tools/testfiles/tstr.h5.xml2
-rw-r--r--tools/testfiles/tstr2.h5.xml2
-rw-r--r--tools/testfiles/tstring-at.h5.xml2
-rw-r--r--tools/testfiles/tstring.h5.xml2
-rw-r--r--tools/testfiles/tudlink.h5.xml2
-rw-r--r--tools/testfiles/tvldtypes1.h5.xml2
-rw-r--r--tools/testfiles/tvldtypes2.h5.xml2
-rw-r--r--tools/testfiles/tvldtypes3.h5.xml2
-rw-r--r--tools/testfiles/tvldtypes4.h5.xml2
-rw-r--r--tools/testfiles/tvldtypes5.h5.xml2
-rw-r--r--tools/testfiles/tvlstr.h5.xml2
-rw-r--r--vms/src/h5pubconf.h15
-rw-r--r--vms/src/make.com2
218 files changed, 2576 insertions, 1750 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f7a2fe..eddb4e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -190,7 +190,7 @@ STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents})
STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents})
-MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}")
+MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}")
#-----------------------------------------------------------------------------
# Basic HDF5 stuff here
@@ -205,7 +205,7 @@ IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
-SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}")
+SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}")
SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}")
SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}")
SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org")
@@ -351,6 +351,8 @@ ENDIF (WIN32)
IF (MSVC)
SET (CMAKE_MFC_FLAG 0)
+ SET (WIN_COMPILE_FLAGS "")
+ SET (WIN_LINK_FLAGS "")
ENDIF (MSVC)
SET (MAKE_SYSTEM)
@@ -454,6 +456,155 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS)
ENDIF (HDF5_DISABLE_COMPILER_WARNINGS)
#-----------------------------------------------------------------------------
+# CDash is configured to only allow 3000 warnings, so
+# break into groups (from the config/gnu-flags file)
+#-----------------------------------------------------------------------------
+IF (NOT MSVC)
+ # Append warning flags
+ # Don't use the '-Wtraditional' flag, we're way past having K&R C code
+ # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional")
+ # Don't use the '-Wtraditional-conversion' flag, there's too many warnings
+ # from GCC's assert macro
+ # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion")
+
+ # Append warning flags from gcc-3* case
+ # (don't use -Wpadded flag for normal builds, many of the warnings its
+ # issuing can't be fixed and they are making it hard to detect other,
+ # more important warnings)
+ #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded")
+ SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute")
+
+ # Append warning flags from gcc-3.2* case
+ SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization")
+
+ # Enable more format checking flags, beyond the basic -Wformat included
+ # in -Wall
+ SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2")
+
+ # The "unreachable code" warning appears to be reliable now...
+ # (this warning was removed in gcc 4.5+)
+ #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code")
+
+ # Append warning flags from gcc-3.3* case
+ SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels")
+
+ # Append warning flags from gcc-3.4* case
+ SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch")
+
+ # Append more extra warning flags that only gcc4.0+ know about
+ SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros")
+
+ # Append more extra warning flags that only gcc 4.1+ know about
+ SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat")
+
+ # Append more extra warning flags that only gcc 4.2+ know about
+ SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow")
+
+ # Append more extra warning flags that only gcc 4.3+ know about
+ #
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... -QAK
+ SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla")
+
+ # Append more extra warning flags that only gcc 4.4+ know about
+ SET (H5_CFLAGS3 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
+
+ # Append more extra warning flags that only gcc 4.5+ know about
+ SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
+
+ # Append more extra warning flags that only gcc 4.6+ know about
+ SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines")
+
+ # Append more extra warning flags that only gcc 4.7+ know about
+ SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
+ENDIF (NOT MSVC)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable all warnings
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
+IF (HDF5_ENABLE_ALL_WARNINGS)
+ IF (MSVC)
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall")
+ ELSE (MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}")
+ ENDIF (MSVC)
+ENDIF (HDF5_ENABLE_ALL_WARNINGS)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
+IF (HDF5_ENABLE_GROUPZERO_WARNINGS)
+ IF (MSVC)
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1")
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1")
+ ELSE (MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
+ ENDIF (MSVC)
+ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
+IF (HDF5_ENABLE_GROUPONE_WARNINGS)
+ IF (MSVC)
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
+ ELSE (MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}")
+ ENDIF (MSVC)
+ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
+IF (HDF5_ENABLE_GROUPTWO_WARNINGS)
+ IF (MSVC)
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
+ ELSE (MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}")
+ ENDIF (MSVC)
+ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
+IF (HDF5_ENABLE_GROUPTHREE_WARNINGS)
+ IF (MSVC)
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
+ STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+ ELSE (MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}")
+ ENDIF (MSVC)
+ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS)
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
+IF (HDF5_ENABLE_GROUPFOUR_WARNINGS)
+ IF (NOT MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}")
+ ENDIF (NOT MSVC)
+ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS)
+
+#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
@@ -522,6 +673,11 @@ IF (HDF5_USE_18_API_DEFAULT)
ENDIF (HDF5_USE_18_API_DEFAULT)
#-----------------------------------------------------------------------------
+# Include user macros
+#-----------------------------------------------------------------------------
+INCLUDE (UserMacros.cmake)
+
+#-----------------------------------------------------------------------------
# Options for HDF5 Filters
#-----------------------------------------------------------------------------
MACRO (HDF5_SETUP_FILTERS FILTER)
@@ -539,12 +695,10 @@ HDF5_SETUP_FILTERS (NBIT)
HDF5_SETUP_FILTERS (SCALEOFFSET)
INCLUDE (ExternalProject)
-OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO")
-OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0)
-OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0)
+OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO")
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- SET (ZLIB_USE_EXTERNAL 1)
- SET (SZIP_USE_EXTERNAL 1)
+ OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
+ OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
SET (ZLIB_URL ${ZLIB_SVN_URL})
SET (SZIP_URL ${SZIP_SVN_URL})
@@ -554,6 +708,9 @@ IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
ENDIF (NOT TGZ_PATH)
SET (ZLIB_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME})
SET (SZIP_URL ${TGZ_PATH}/${SZIP_TGZ_NAME})
+ ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
+ SET (ZLIB_USE_EXTERNAL 0)
+ SET (SZIP_USE_EXTERNAL 0)
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
@@ -958,7 +1115,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED)
FILES
${HDF5_SOURCE_DIR}/ACKNOWLEDGMENTS
${HDF5_SOURCE_DIR}/COPYING
- ${HDF5_SOURCE_DIR}/README.txt
DESTINATION ${HDF5_INSTALL_DATA_DIR}
COMPONENT hdfdocuments
)
@@ -981,29 +1137,31 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED)
${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt
${HDF5_SOURCE_DIR}/release_docs/INSTALL
)
- IF (WIN32 AND NOT CYGWIN)
- SET (release_files
- ${release_files}
- ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
- )
- ELSE (WIN32 AND NOT CYGWIN)
- SET (release_files
- ${release_files}
- ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt
- )
- ENDIF (WIN32 AND NOT CYGWIN)
+ IF (WIN32)
+ IF (NOT CYGWIN)
+ SET (release_files
+ ${release_files}
+ ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
+ )
+ ELSE (NOT CYGWIN)
+ SET (release_files
+ ${release_files}
+ ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt
+ )
+ ENDIF (NOT CYGWIN)
+ ENDIF (WIN32)
IF (HDF5_ENABLE_PARALLEL)
SET (release_files
${release_files}
${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel
)
ENDIF (HDF5_ENABLE_PARALLEL)
- INSTALL (
- FILES ${release_files}
- DESTINATION ${HDF5_INSTALL_DATA_DIR}/release_docs
- COMPONENT hdfdocuments
- )
ENDIF (HDF5_PACK_INSTALL_DOCS)
+ INSTALL (
+ FILES ${release_files}
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}
+ COMPONENT hdfdocuments
+ )
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs")
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
diff --git a/MANIFEST b/MANIFEST
index 95e907d..6e3e50a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1520,6 +1520,8 @@
./tools/testfiles/topaque.h5
./tools/testfiles/trawdatafile.ddl
./tools/testfiles/trawdatafile.exp
+./tools/testfiles/trawssetfile.ddl
+./tools/testfiles/trawssetfile.exp
./tools/testfiles/tsaf.ddl
./tools/testfiles/tsaf.h5
./tools/testfiles/tscalarattrintsize.ddl
@@ -1560,6 +1562,7 @@
./tools/testfiles/tudlink-2.ddl
./tools/testfiles/tattr2.h5
./tools/testfiles/tall-2A.ddl
+./tools/testfiles/tall-2A0.ddl
./tools/testfiles/tall-2B.ddl
./tools/testfiles/tattrcontents1.ddl
./tools/testfiles/tattrcontents2.ddl
@@ -1619,6 +1622,7 @@
./tools/h5dump/errfiles/filter_fail.err
./tools/h5dump/errfiles/tall-1.err
./tools/h5dump/errfiles/tall-2A.err
+./tools/h5dump/errfiles/tall-2A0.err
./tools/h5dump/errfiles/tall-2B.err
./tools/h5dump/errfiles/tarray1_big.err
./tools/h5dump/errfiles/tattr-3.err
@@ -2403,8 +2407,12 @@
./config/cmake/NSIS.template.in
./config/cmake/NSIS.InstallOptions.ini.in
+# CMake-specific User Files
+./config/cmake/UserMacros/Windows_MT.cmake
+
./CMakeLists.txt
./CTestConfig.cmake
+./UserMacros.cmake
./c++/CMakeLists.txt
./c++/examples/CMakeLists.txt
./c++/src/CMakeLists.txt
diff --git a/README.txt b/README.txt
index bb77343..c417d3b 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.151 currently under development
+HDF5 version 1.9.156 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------
diff --git a/UserMacros.cmake b/UserMacros.cmake
new file mode 100644
index 0000000..d7d3ef9
--- /dev/null
+++ b/UserMacros.cmake
@@ -0,0 +1,17 @@
+########################################################
+# Include file for user options
+########################################################
+
+#-----------------------------------------------------------------------------
+# Option to Build with User Defined Values
+#-----------------------------------------------------------------------------
+MACRO (MACRO_USER_DEFINED_LIBS)
+ SET (USER_DEFINED_VALUE "FALSE")
+ENDMACRO (MACRO_USER_DEFINED_LIBS)
+
+#-------------------------------------------------------------------------------
+OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF)
+IF (BUILD_USER_DEFINED_LIBS)
+ MACRO_USER_DEFINED_LIBS ()
+ENDIF (BUILD_USER_DEFINED_LIBS)
+ \ No newline at end of file
diff --git a/bin/checkapi b/bin/checkapi
index d21863b..b4a08e8 100755
--- a/bin/checkapi
+++ b/bin/checkapi
@@ -17,33 +17,51 @@ require 5.003;
# Purpose: insures that API functions aren't called internally.
# Usage: checkapi H5*.c
-my $comment = 0;
-while (<>) {
+my $filename = "";
+my $lastname = "";
- # Remove comments within the line.
- s/\/\*.*?\*\///g;
+if(<>) {
+ while (<>) {
+ if($ARGV =~ /\//) {
+ ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
+ } else {
+ ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
+ }
- # Process comment begin and end tokens on this line.
- $comment-- if /\*\//; # count comment ends
- next if $comment; # skip line if in comment
- $comment++ if /\/\*/; # count comment starts
- s/(.*)\/\*.*/$1/; # remove comments that begin on this line
+ if($filename =~ /H5FDmulti|H5FDstdio/) {
+ if($filename ne $lastname) {
+ print "$ARGV is exempt from checking\n";
+ $lastname = $filename;
+ }
+ } else {
+ # Get rid of comments by removing the inside part.
+ s|/\*.*?\*/||g;
+ if ($in_comment) {
+ if (/\*\//) {
+ s|.*?\*/||;
+ $in_comment = 0;
+ } else {
+ $_="\n";
+ }
+ } elsif (m|/\*|) {
+ s|/\*.*||;
+ $in_comment = 1;
+ }
- # Remove character strings
- s/\\.//g; # remove escaped characters
- s/\".*?\"//g; # remove string constants
+ # Remove character strings
+ s/\\.//g; # remove escaped characters
+ s/\".*?\"//g; # remove string constants
- # Disregard the following hits
- next if /^H5/;
- next if /^\#/;
- next if /FUNC_ENTER(_NOINIT)*/;
+ # Disregard the following hits
+ next if /^H5/;
+ next if /^\#/;
+ next if /FUNC_ENTER(_NOINIT)*/;
- next unless /(H5[A-Z]{1,2}[a-z]\w*)/;
- print "$ARGV:$.: $1\n";
-} continue {
- if (eof) {
- print "$ARGV:$.: bad comment nesting\n" if $comment;
- $comment = 0;
- close ARGV; # reset line number
- }
+ next unless /(H5[A-Z]{1,2}[a-z]\w*)/;
+ print "$ARGV:$.: $1\n";
+ }
+ } continue {
+ close ARGV if eof; # reset line number
+ }
}
+
diff --git a/bin/checkposix b/bin/checkposix
index b295d7d..e3617e5 100755
--- a/bin/checkposix
+++ b/bin/checkposix
@@ -27,60 +27,93 @@ require 5.003;
# use `next-error' (usually bound to M-`) to find each name
# violation.
-while (<>) {
-
- # Get rid of comments by removing the inside part.
- s|/\*.*?\*/||g;
- if ($in_comment) {
- if (/\*\//) {
- s|.*?\*/||;
- $in_comment = 0;
- } else {
- $_="\n";
- }
- } elsif (m|/\*|) {
- s|/\*.*||;
- $in_comment = 1;
- }
-
- # Get rid of string constants if they begin and end on this line.
- s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g;
-
- # Get rid of preprocessor directives
- s/^\#.*//;
-
- # Now find all function calls on this line
- while (($name)=/\b([a-gi-z_A-GI-Z]\w*)\s*\(/) {
- $_ = $';
-
- # Ignore C statements that look sort of like function
- # calls.
- next if $name =~ /^(if|for|return|sizeof|switch|while|void)$/;
-
- # Ignore things that get misdetected because of the simplified
- # parsing that takes place here.
- next if $name =~ /^int$/;
-
- # These are really HDF5 functions/macros even though they don't
- # start with `h' or `H'.
- next if $name =~ /^FUNC_(ENTER|LEAVE)(_INIT)?$/;
- next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)$/;
- next if $name =~ /^(MIN3?|MAX3?|NELMTS|BOUND|CONSTR)$/;
- next if $name =~ /^IS_H5FD_MPIO$/;
- next if $name =~ /^addr_defined$/;
-
- # These functions/macros are exempt.
- next if $name =~ /^(assert|main|[fs]?printf|va_(start|arg|end))$/;
-
- # These are MPI function calls. Ignore them.
- next if $name =~ /^MPI_/;
-
- # These are POSIX threads function calls. Ignore them.
- next if $name =~ /^pthread_/;
-
- print "$ARGV:$.: $name\n";
- }
-
-} continue {
- close ARGV if eof;
+if(<>) {
+ if($ARGV =~ /\//) {
+ ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
+ } else {
+ ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
+ }
+
+ if($filename =~ /H5FDmulti|H5FDstdio/) {
+ print "$ARGV is exempt from using Standard library macro wrappers\n";
+ } else {
+ while (<>) {
+
+ # Get rid of comments by removing the inside part.
+ s|/\*.*?\*/||g;
+ if ($in_comment) {
+ if (/\*\//) {
+ s|.*?\*/||;
+ $in_comment = 0;
+ } else {
+ $_="\n";
+ }
+ } elsif (m|/\*|) {
+ s|/\*.*||;
+ $in_comment = 1;
+ }
+
+ # Get rid of string constants if they begin and end on this line.
+ s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g;
+
+ # Get rid of preprocessor directives
+ s/^\#.*//;
+
+ # Skip callbacks invoked as methods in a struct
+ next if $_ =~ /\b(\)?->|\.)\(?([a-z_A-Z]\w*)\s*\(/;
+
+ # Now find all function calls on this line which don't start with 'H'
+ while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) {
+ $_ = $';
+
+ # Ignore C statements that look sort of like function
+ # calls.
+ next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/;
+
+ # Ignore things that get misdetected because of the simplified
+ # parsing that takes place here.
+ next if $name =~ /^(int|herr_t|_term_interface)$/;
+
+ # These are really HDF5 functions/macros even though they don't
+ # start with `h' or `H'.
+ next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/;
+ next if $name =~ /^(BEGIN|END)_FUNC$/;
+ next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/;
+ next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/;
+ next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/;
+ next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/;
+ next if $name =~ /^(UNIQUE_MEMBERS)$/;
+ next if $name =~ /^(IS_H5FD_MPIO|IS_H5FD_MPIPOSIX)$/;
+ next if $name =~ /^addr_defined$/;
+
+ # These functions/macros are exempt.
+ next if $name =~ /^(main|[fs]?printf|va_(start|arg|end))$/;
+
+ # These are Windows system calls. Ignore them.
+ next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/;
+ next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/;
+
+ # These are GPFS function calls. Ignore them.
+ next if $name =~ /^gpfs_fcntl$/;
+
+ # These are MPI function calls. Ignore them.
+ next if $name =~ /^(MPI_|MPE_)/;
+
+ # These are POSIX threads function calls. Ignore them.
+ next if $name =~ /^pthread_/;
+
+ # These are Windows threads function calls. Ignore them.
+ next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/;
+
+ # These are zlib & szlib function calls. Ignore them.
+ next if $name =~ /^(inflate|SZ_)/;
+ next if $name =~ /^compress2$/;
+
+ print "$ARGV:$.: $name\n";
+ }
+
+ } continue {
+ close ARGV if eof; # reset line number
+ }
+ }
}
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index f45251b..dd8e45d 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -23,6 +23,7 @@ SET (examples
FOREACH (example ${examples})
ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (cpp_ex_${example} " " " ")
TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
ENDFOREACH (example ${examples})
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index cf5bd07..e7ae371 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -84,6 +84,7 @@ SET (CPP_HDRS
)
ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
+TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 44499f4..90b4c62 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -459,7 +459,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
# Include src directory
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 124edb9..b31185e 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} )
ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} )
TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE})
+TARGET_C_PROPERTIES (cpp_testhdf5 " " " ")
TARGET_LINK_LIBRARIES (cpp_testhdf5
${HDF5_CPP_LIB_TARGET}
${HDF5_LIB_TARGET}
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index ec7b10e..c16f9a6 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -1,19 +1,19 @@
-SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500)
+SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
SET (CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
- "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:"
- "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument"
- "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument"
- "note.*expected.*void.*but argument is of type.*volatile"
- "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type"
- "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244"
- "SZIP.src.*:[ \t]*warning"
- "POSIX name for this item is deprecated"
+# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:"
+# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument"
+# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument"
+# "note.*expected.*void.*but argument is of type.*volatile"
+# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type"
+# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244"
+# "SZIP.src.*:[ \t]*warning"
+# "POSIX name for this item is deprecated"
"disabling jobserver mode"
"config.cmake.xlatefile.c"
- "warning.*implicit declaration of function"
- "note: expanded from macro"
+# "warning.*implicit declaration of function"
+# "note: expanded from macro"
# "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro"
)
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 3af0b48..78fcd7a 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -184,14 +184,14 @@ IF (WINDOWS)
ENDIF (MINGW)
SET (H5_HAVE_LIBWS2_32 1)
SET (H5_HAVE_LIBWSOCK32 1)
-ENDIF (WINDOWS)
-#-----------------------------------------------------------------------------
-# These tests need to be manually SET for windows since there is currently
-# something not quite correct with the actual test implementation. This affects
-# the 'dt_arith' test and most likely lots of other code
-# ----------------------------------------------------------------------------
-SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "")
+ #-----------------------------------------------------------------------------
+ # These tests need to be manually SET for windows since there is currently
+ # something not quite correct with the actual test implementation. This affects
+ # the 'dt_arith' test and most likely lots of other code
+ # ----------------------------------------------------------------------------
+ SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "")
+ENDIF (WINDOWS)
# ----------------------------------------------------------------------
# END of WINDOWS Hard code Values
@@ -1030,7 +1030,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec
# integers except 'unsigned long long'. Other HP-UX systems are unknown
# yet. (1/8/05 - SLU)
#
-H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works")
+IF (NOT MSVC)
+ H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works")
+ENDIF (NOT MSVC)
# -----------------------------------------------------------------------
# Set flag to indicate that the machine can handle conversion from
# integers to long double. (This flag should be set "yes" for all
@@ -1104,7 +1106,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$)
# where the last 2 bytes of mantissa are lost when compiler tries to do
# the conversion, and Cygwin where compiler doesn't do rounding correctly.)
#
-H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision")
+IF (NOT MSVC)
+ H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision")
+ENDIF (NOT MSVC)
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can handle overflow converting
# all floating-point to all integer types.
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index 099b97f..b0788f2 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -121,20 +121,67 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype)
ENDMACRO (HDF_SET_LIB_OPTIONS)
#-------------------------------------------------------------------------------
-MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addlinkflags)
- IF (WIN32 AND MSVC)
+MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags)
+ IF (MSVC)
+ TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
+ ELSE (MSVC)
+ IF (BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (${wintarget}
+ PROPERTIES
+ COMPILE_FLAGS "${addcompileflags}"
+ LINK_FLAGS "${addlinkflags}"
+ )
+ ELSE (BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (${wintarget}
+ PROPERTIES
+ COMPILE_FLAGS "${addcompileflags}"
+ LINK_FLAGS "${addlinkflags}"
+ )
+ ENDIF (BUILD_SHARED_LIBS)
+ ENDIF (MSVC)
+ENDMACRO (TARGET_C_PROPERTIES)
+
+#-------------------------------------------------------------------------------
+MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags)
+ IF (MSVC)
+ IF (BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (${wintarget}
+ PROPERTIES
+ COMPILE_FLAGS "${addcompileflags}"
+ LINK_FLAGS "${addlinkflags}"
+ )
+ ELSE (BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (${wintarget}
+ PROPERTIES
+ COMPILE_FLAGS "${addcompileflags}"
+ LINK_FLAGS "${addlinkflags}"
+ )
+ ENDIF (BUILD_SHARED_LIBS)
+ ENDIF (MSVC)
+ENDMACRO (TARGET_MSVC_PROPERTIES)
+
+#-------------------------------------------------------------------------------
+MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags)
+ IF (WIN32)
+ TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
+ ENDIF (WIN32)
+ENDMACRO (TARGET_FORTRAN_PROPERTIES)
+
+#-------------------------------------------------------------------------------
+MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags)
+ IF (MSVC)
IF (BUILD_SHARED_LIBS)
SET_TARGET_PROPERTIES (${forttarget}
PROPERTIES
- COMPILE_FLAGS "/dll"
+ COMPILE_FLAGS "/dll ${addcompileflags}"
LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}"
)
ELSE (BUILD_SHARED_LIBS)
SET_TARGET_PROPERTIES (${forttarget}
PROPERTIES
- COMPILE_FLAGS "/MD"
+ COMPILE_FLAGS "${addcompileflags}"
LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}"
)
ENDIF (BUILD_SHARED_LIBS)
- ENDIF (WIN32 AND MSVC)
+ ENDIF (MSVC)
ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES)
diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake
new file mode 100644
index 0000000..9be5404
--- /dev/null
+++ b/config/cmake/UserMacros/Windows_MT.cmake
@@ -0,0 +1,39 @@
+########################################################
+# Include file for user options
+########################################################
+
+# To use this option, copy both the macro and option code
+# into the root UserMacros.cmake file.
+
+#-----------------------------------------------------------------------------
+# Option to Build with Static CRT libraries on Windows
+#-------------------------------------------------------------------------------
+MACRO (TARGET_STATIC_CRT_FLAGS)
+ IF (MSVC AND NOT BUILD_SHARED_LIBS)
+ FOREACH (flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ IF (${flag_var} MATCHES "/MD")
+ STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+ ENDIF (${flag_var} MATCHES "/MD")
+ ENDFOREACH (flag_var)
+ FOREACH (flag_var
+ CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE
+ CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
+ IF (${flag_var} MATCHES "/libs:dll")
+ STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}")
+ ENDIF (${flag_var} MATCHES "/libs:dll")
+ ENDFOREACH (flag_var)
+ SET (WIN_COMPILE_FLAGS "")
+ SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT")
+ ENDIF (MSVC AND NOT BUILD_SHARED_LIBS)
+ENDMACRO (TARGET_STATIC_CRT_FLAGS)
+
+#-----------------------------------------------------------------------------
+OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF)
+IF (BUILD_STATIC_CRT_LIBS)
+ TARGET_STATIC_CRT_FLAGS ()
+ENDIF (BUILD_STATIC_CRT_LIBS)
+ \ No newline at end of file
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index d45ef9e..43ba754 100644
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -62,7 +62,8 @@ SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libr
SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
+SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
+SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
diff --git a/config/lt_vers.am b/config/lt_vers.am
index ac9fc70..c3ec683 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -17,7 +17,7 @@
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index 40a4f83..f27c7ca 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for HDF5 1.9.151.
+# Generated by GNU Autoconf 2.69 for HDF5 1.9.156.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.151'
-PACKAGE_STRING='HDF5 1.9.151'
+PACKAGE_VERSION='1.9.156'
+PACKAGE_STRING='HDF5 1.9.156'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.9.151 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.156 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1556,7 +1556,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.151:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.156:";;
esac
cat <<\_ACEOF
@@ -1752,7 +1752,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.151
+HDF5 configure 1.9.156
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.9.151, which was
+It was created by HDF5 $as_me 1.9.156, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3684,7 +3684,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.151'
+ VERSION='1.9.156'
cat >>confdefs.h <<_ACEOF
@@ -30992,8 +30992,8 @@ fi
## Enable strict file format checks
##
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to perform strict file format checks" >&5
-$as_echo_n "checking Whether to perform strict file format checks... " >&6; };
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to perform strict file format checks" >&5
+$as_echo_n "checking whether to perform strict file format checks... " >&6; };
# Check whether --enable-strict-format-checks was given.
if test "${enable_strict_format_checks+set}" = set; then :
enableval=$enable_strict_format_checks; STRICT_CHECKS=$enableval
@@ -31029,8 +31029,8 @@ esac
## ----------------------------------------------------------------------
## Enable embedded library information
##
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to have library information embedded in the executables" >&5
-$as_echo_n "checking Whether to have library information embedded in the executables... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to have library information embedded in the executables" >&5
+$as_echo_n "checking whether to have library information embedded in the executables... " >&6; }
# Check whether --enable-embedded-libinfo was given.
if test "${enable_embedded_libinfo+set}" = set; then :
enableval=$enable_embedded_libinfo; enable_embedded_libinfo=$enableval
@@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.9.151
+HDF5 config.lt 1.9.156
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.9.151, which was
+This file was extended by HDF5 $as_me 1.9.156, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -33828,7 +33828,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.9.151
+HDF5 config.status 1.9.156
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 87e1cea..0a4d854 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
-AC_INIT([HDF5], [1.9.151], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.156], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])
@@ -4276,7 +4276,7 @@ fi
## Enable strict file format checks
##
AC_SUBST([STRICT_FORMAT_CHECKS])
-AC_MSG_CHECKING([Whether to perform strict file format checks]);
+AC_MSG_CHECKING([whether to perform strict file format checks]);
AC_ARG_ENABLE([strict-format-checks],
[AS_HELP_STRING([--enable-strict-format-checks],
[Enable strict file format checks, default=yes if
@@ -4309,7 +4309,7 @@ esac
## ----------------------------------------------------------------------
## Enable embedded library information
##
-AC_MSG_CHECKING([Whether to have library information embedded in the executables])
+AC_MSG_CHECKING([whether to have library information embedded in the executables])
AC_ARG_ENABLE([embedded-libinfo],
[AS_HELP_STRING([--enable-embedded-libinfo],
[Enable embedded library information [default=yes]])],
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index bae2c71..60752ec 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -40,6 +40,7 @@ SET (examples
FOREACH (example ${examples})
ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
TARGET_NAMING (${example} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (${example} " " " ")
TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples)
ENDFOREACH (example ${examples})
@@ -47,6 +48,7 @@ ENDFOREACH (example ${examples})
IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
TARGET_NAMING (ph5example ${LIB_TYPE})
+ TARGET_C_PROPERTIES (ph5example " " " ")
TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples)
ENDIF (H5_HAVE_PARALLEL)
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index 0536183..e514a6e 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -41,7 +41,7 @@ SET (F2003_examples
FOREACH (example ${examples})
ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
TARGET_NAMING (f90_ex_${example} ${LIB_TYPE})
- TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example} "")
+ TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ")
IF (WIN32 AND NOT CYGWIN)
SET_PROPERTY (TARGET f90_ex_${example}
APPEND PROPERTY COMPILE_DEFINITIONS
@@ -69,7 +69,7 @@ IF (HDF5_ENABLE_F2003)
FOREACH (example ${F2003_examples})
ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
TARGET_NAMING (f03_ex_${example} ${LIB_TYPE})
- TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "")
+ TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ")
IF (WIN32 AND NOT CYGWIN)
SET_PROPERTY (TARGET f03_ex_${example}
APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS
@@ -95,7 +95,7 @@ ENDIF (HDF5_ENABLE_F2003)
IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE})
- TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "")
+ TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ")
IF (WIN32 AND NOT CYGWIN)
SET_PROPERTY (TARGET f90_ex_ph5example
APPEND PROPERTY COMPILE_DEFINITIONS
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 1bddc56..5d8c2d5 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -133,6 +133,7 @@ SET (f90CStub_C_HDRS
)
ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS})
+TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE})
@@ -233,7 +234,7 @@ IF (WIN32 AND NOT CYGWIN)
HDF5F90_WINDOWS
)
ENDIF (WIN32 AND NOT CYGWIN)
-TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
+TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 63368dc..a12c58f 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -508,7 +508,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
# Include src directory in both Fortran and C flags (C compiler is used
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 5b9ca11..72f239e 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${
# Add Test Lib
#-----------------------------------------------------------------------------
ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c)
+TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_C_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
@@ -28,7 +29,7 @@ IF (WIN32 AND NOT CYGWIN)
ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS)
ENDIF (WIN32 AND NOT CYGWIN)
-TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS})
+TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_C_TEST_LIB_TARGET}
@@ -60,7 +61,7 @@ ADD_EXECUTABLE (testhdf5_fortran
tH5Z.f90
)
TARGET_NAMING (testhdf5_fortran ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran "")
+TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ")
TARGET_LINK_LIBRARIES (testhdf5_fortran
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -84,7 +85,7 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8
tH5G_1_8.f90
)
TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran_1_8 "")
+TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ")
TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -112,7 +113,7 @@ IF (HDF5_ENABLE_F2003)
tH5T_F03.f90
)
TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE})
- TARGET_FORTRAN_WIN_PROPERTIES (fortranlib_test_F03 "")
+ TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ")
TARGET_LINK_LIBRARIES (fortranlib_test_F03
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@@ -131,7 +132,7 @@ ENDIF (HDF5_ENABLE_F2003)
#-- Adding test for fflush1
ADD_EXECUTABLE (fflush1 fflush1.f90)
TARGET_NAMING (fflush1 ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (fflush1 "")
+TARGET_FORTRAN_PROPERTIES (fflush1 " " " ")
TARGET_LINK_LIBRARIES (fflush1
${HDF5_F90_LIB_TARGET}
${HDF5_F90_TEST_LIB_TARGET}
@@ -148,7 +149,7 @@ ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>)
#-- Adding test for fflush2
ADD_EXECUTABLE (fflush2 fflush2.f90)
TARGET_NAMING (fflush2 ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (fflush2 "")
+TARGET_FORTRAN_PROPERTIES (fflush2 " " " ")
TARGET_LINK_LIBRARIES (fflush2
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt
index 1c7248c..76b6023 100644
--- a/fortran/testpar/CMakeLists.txt
+++ b/fortran/testpar/CMakeLists.txt
@@ -17,7 +17,7 @@ ADD_EXECUTABLE (parallel_test
mdset.f90
)
TARGET_NAMING (parallel_test ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (parallel_test "")
+TARGET_FORTRAN_PROPERTIES (parallel_test " " " ")
TARGET_LINK_LIBRARIES (parallel_test
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index 4c60165..aa4221f 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src)
# --------------------------------------------------------------------
ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp)
TARGET_NAMING (ptExampleFL ${LIB_TYPE})
+TARGET_C_PROPERTIES (ptExampleFL " " " ")
TARGET_LINK_LIBRARIES (
ptExampleFL
${HDF5_HL_CPP_LIB_TARGET}
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 89de4ca..aa54889 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -10,7 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR})
SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp)
SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h)
-ADD_LIBRARY ( ${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS})
+ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS})
+TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (
${HDF5_HL_CPP_LIB_TARGET}
${HDF5_HL_LIB_TARGET}
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index 6b51803..a5d80ed 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -450,7 +450,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
# Include src directory
diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt
index 0f82748..6633426 100644
--- a/hl/c++/test/CMakeLists.txt
+++ b/hl/c++/test/CMakeLists.txt
@@ -17,6 +17,7 @@ IF (BUILD_TESTING)
INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src)
ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp)
+ TARGET_C_PROPERTIES (hl_ptableTest " " " ")
TARGET_NAMING (hl_ptableTest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (
hl_ptableTest
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index 1f4807a..b702754 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -43,6 +43,7 @@ SET (examples
FOREACH (example ${examples})
ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c)
TARGET_NAMING (hl_ex_${example} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (hl_ex_${example} " " " ")
TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl)
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 03b9e9b..df7fd24 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -18,7 +18,7 @@ SET (examples
FOREACH (example ${examples})
ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE})
- TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_ex_${example} "")
+ TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ")
TARGET_LINK_LIBRARIES (hl_f90_ex_${example}
${HDF5_HL_F90_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 9ab0fb2..22353f8 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -26,6 +26,7 @@ SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C)
SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h)
ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS})
+TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE})
@@ -61,7 +62,7 @@ IF (WIN32 AND NOT CYGWIN)
HDF5F90_WINDOWS
)
ENDIF (WIN32 AND NOT CYGWIN)
-TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
+TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index 4a90558..82e2f99 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -464,7 +464,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \
-I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index d76e7f2..7e7aa1d 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -23,7 +23,7 @@ ADD_TEST (
#-- Adding test for hl_f90_tstds
ADD_EXECUTABLE (hl_f90_tstds tstds.f90)
TARGET_NAMING (hl_f90_tstds ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstds "")
+TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ")
TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran)
SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran)
@@ -33,7 +33,7 @@ ADD_TEST (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>)
#-- Adding test for hl_f90_tstlite
ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90)
TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "")
+TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ")
TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran)
SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran)
@@ -43,7 +43,7 @@ ADD_TEST (NAME hl_f90_tstlite COMMAND $<TARGET_FILE:hl_f90_tstlite>)
#-- Adding test for hl_f90_tstimage
ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90)
TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "")
+TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ")
TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran)
SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran)
@@ -53,7 +53,7 @@ ADD_TEST (NAME hl_f90_tstimage COMMAND $<TARGET_FILE:hl_f90_tstimage>)
#-- Adding test for hl_f90_tsttable
ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90)
TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE})
-TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "")
+TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ")
TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran)
SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran)
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index edba042..5904d05 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -36,6 +36,7 @@ SET (HL_HEADERS
)
ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS})
+TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE})
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index eed2721..88f8de4 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -803,7 +803,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id,
if((tid = H5Tcopy(H5T_C_S1)) < 0 )
goto out;
- size = strlen(buf) + 1; /* extra null term */
+ size = HDstrlen(buf) + 1; /* extra null term */
if(H5Tset_size(tid, size) < 0)
goto out;
@@ -1354,7 +1354,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
- if(strcmp(name, (char *)op_data) == 0)
+ if(HDstrcmp(name, (char *)op_data) == 0)
ret = 1;
return ret;
@@ -1437,7 +1437,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 )
goto out;
- attr_size = strlen( attr_data ) + 1; /* extra null term */
+ attr_size = HDstrlen( attr_data ) + 1; /* extra null term */
if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 )
goto out;
@@ -1936,7 +1936,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
- if(strcmp(name, (char *)op_data) == 0)
+ if(HDstrcmp(name, (char *)op_data) == 0)
ret = H5_ITER_STOP;
return ret;
@@ -2168,17 +2168,17 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
goto out;
if(lang_type != H5LT_DDL) {
- fprintf(stderr, "only DDL is supported for now.\n");
+ HDfprintf(stderr, "only DDL is supported for now.\n");
goto out;
}
- input_len = strlen(text);
- myinput = strdup(text);
+ input_len = HDstrlen(text);
+ myinput = HDstrdup(text);
if((type_id = H5LTyyparse()) < 0)
goto out;
- free(myinput);
+ HDfree(myinput);
input_len = 0;
return type_id;
@@ -2207,12 +2207,12 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad
{
if(_no_user_buf) {
/* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */
- if(str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) {
- *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;
- buf = (char*)realloc(buf, *len);
- } else if(!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) {
+ if(str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) {
+ *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;
+ buf = (char*)HDrealloc(buf, *len);
+ } else if(!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) {
*len += INCREMENT;
- buf = (char*)realloc(buf, *len);
+ buf = (char*)HDrealloc(buf, *len);
}
}
@@ -2220,7 +2220,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad
goto out;
if(str_to_add)
- strcat(buf, str_to_add);
+ HDstrcat(buf, str_to_add);
return buf;
@@ -2249,7 +2249,7 @@ indentation(size_t x, char* str, hbool_t no_u_buf, size_t *s_len)
char tmp_str[TMP_LEN];
if (x < 80) {
- memset(tmp_str, ' ', x);
+ HDmemset(tmp_str, ' ', x);
tmp_str[x]='\0';
} else
HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols.");
@@ -2310,8 +2310,8 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt)
dst_size = H5Tget_size(native);
/* Get the names and raw values of all members */
- name = (char**)calloc((size_t)nmembs, sizeof(char *));
- value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size));
+ name = (char**)HDcalloc((size_t)nmembs, sizeof(char *));
+ value = (unsigned char*)HDcalloc((size_t)nmembs, MAX(dst_size, super_size));
for (i = 0; i < nmembs; i++) {
if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL)
@@ -2359,10 +2359,10 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt)
/* Release resources */
for(i = 0; i < nmembs; i++)
- free(name[i]);
+ HDfree(name[i]);
- free(name);
- free(value);
+ HDfree(name);
+ HDfree(value);
H5Tclose(super);
return str;
@@ -2378,12 +2378,12 @@ out:
if(name) {
for(i = 0; i < nmembs; i++)
if(name[i])
- free(name[i]);
- free(name);
+ HDfree(name[i]);
+ HDfree(name);
} /* end if */
if(value)
- free(value);
+ HDfree(value);
if(super >= 0)
H5Tclose(super);
@@ -2418,13 +2418,13 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *
goto out;
if(len && !str) {
- text_str = (char*)calloc(str_len, sizeof(char));
+ text_str = (char*)HDcalloc(str_len, sizeof(char));
text_str[0]='\0';
if(!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1)))
goto out;
- *len = strlen(text_str) + 1;
+ *len = HDstrlen(text_str) + 1;
if(text_str)
- free(text_str);
+ HDfree(text_str);
text_str = NULL;
} else if(len && str) {
if(!(H5LT_dtype_to_text(dtype, str, lang_type, len, 0)))
@@ -2744,7 +2744,7 @@ next:
if(tag) {
HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag);
if(tag)
- free(tag);
+ HDfree(tag);
tag = NULL;
} else
HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n");
@@ -2777,14 +2777,14 @@ next:
goto out;
if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char*)calloc(super_len, sizeof(char));
+ stmp = (char*)HDcalloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
goto out;
if(stmp)
- free(stmp);
+ HDfree(stmp);
stmp = NULL;
HDsnprintf(tmp_str, TMP_LEN, ";\n");
@@ -2821,14 +2821,14 @@ next:
goto out;
if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char*)calloc(super_len, sizeof(char));
+ stmp = (char*)HDcalloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
goto out;
if(stmp)
- free(stmp);
+ HDfree(stmp);
stmp = NULL;
HDsnprintf(tmp_str, TMP_LEN, "\n");
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
@@ -2879,13 +2879,13 @@ next:
goto out;
if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char*)calloc(super_len, sizeof(char));
+ stmp = (char*)HDcalloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
goto out;
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
goto out;
if(stmp)
- free(stmp);
+ HDfree(stmp);
stmp = NULL;
HDsnprintf(tmp_str, TMP_LEN, "\n");
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
@@ -2934,13 +2934,13 @@ next:
if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0)
goto out;
- mtmp = (char*)calloc(mlen, sizeof(char));
+ mtmp = (char*)HDcalloc(mlen, sizeof(char));
if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0)
goto out;
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp)))
goto out;
if(mtmp)
- free(mtmp);
+ HDfree(mtmp);
mtmp = NULL;
if (H5T_COMPOUND == mclass)
@@ -2950,7 +2950,7 @@ next:
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
if(mname)
- free(mname);
+ HDfree(mname);
mname = NULL;
HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset);
@@ -3560,7 +3560,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id,
if((tid = H5Tcopy(H5T_C_S1)) < 0)
return FAIL;
- size = strlen(buf) + 1; /* extra null term */
+ size = HDstrlen(buf) + 1; /* extra null term */
if(H5Tset_size(tid,(size_t)size) < 0)
goto out;
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 7cbeb1b..fb41f58 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -449,7 +449,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
# This library is our main target.
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index c5b6f6e..9cb61e0 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR})
MACRO (HL_ADD_TEST hl_name files)
ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c)
TARGET_NAMING (hl_${hl_name} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (hl_${hl_name} " " " ")
TARGET_LINK_LIBRARIES (hl_${hl_name}
${HDF5_HL_LIB_TARGET}
${HDF5_LIB_TARGET}
@@ -97,6 +98,7 @@ HL_ADD_TEST (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5")
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c)
TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE})
+ TARGET_C_PROPERTIES (hl_gen_test_ds " " " ")
TARGET_LINK_LIBRARIES (hl_gen_test_ds
${HDF5_HL_LIB_TARGET}
${HDF5_LIB_TARGET}
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index a4a10e4..38f1830 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -100,24 +100,34 @@ static int test_simple(void)
hssize_t npals;
/* 8-bit image */
- unsigned char buf1 [ WIDTH*HEIGHT ];
+ unsigned char *buf1 = NULL;
unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */
hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */
/* 24-bit image */
- unsigned char buf2 [ WIDTH*HEIGHT*3 ];
+ unsigned char *buf2 = NULL;
/* read data */
- unsigned char buf1_out [ WIDTH*HEIGHT ];
- unsigned char buf2_out [ WIDTH*HEIGHT*3 ];
+ unsigned char *buf1_out = NULL;
+ unsigned char *buf2_out = NULL;
unsigned char pal_out[ PAL_ENTRIES * 3 ]; /* palette array */
hsize_t pal_dims_out[2]; /* palette dimensions */
+ /* Allocate image buffers */
+ buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
+ HDassert(buf1);
+ buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
+ HDassert(buf2);
+ buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
+ HDassert(buf1_out);
+ buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
+ HDassert(buf2_out);
+
/* create an image */
space = WIDTH*HEIGHT / PAL_ENTRIES;
for (i=0, j=0, n=0; i < WIDTH*HEIGHT; i++, j++ )
{
- buf1[i] = n;
+ buf1[i] = (unsigned char)n;
if ( j > space )
{
n++;
@@ -126,17 +136,13 @@ static int test_simple(void)
}
-
/* create an image */
space = WIDTH*HEIGHT / 256;
for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i+=3, j++ )
{
- unsigned char r, g, b;
-
- r = n; g = 0; b = 255-n;
- buf2[i] = r;
- buf2[i+1] = g;
- buf2[i+2] = b;
+ buf2[i] = (unsigned char)n;
+ buf2[i+1] = 0;
+ buf2[i+2] = (unsigned char)(255 - n);
if ( j > space )
{
n++;
@@ -150,9 +156,9 @@ static int test_simple(void)
*/
for ( i=0, n=0; i<PAL_ENTRIES*3; i+=3, n++)
{
- pal[i] =n; /* red */
+ pal[i] =(unsigned char)n; /* red */
pal[i+1]=0; /* green */
- pal[i+2]=255-n; /* blue */
+ pal[i+2]=(unsigned char)(255 - n); /* blue */
}
/* Create a new HDF5 file using default properties. */
@@ -283,6 +289,15 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
+ if(buf1)
+ HDfree(buf1);
+ if(buf2)
+ HDfree(buf2);
+ if(buf1_out)
+ HDfree(buf1_out);
+ if(buf2_out)
+ HDfree(buf2_out);
+
/* Close the file. */
if(H5Fclose( fid ) < 0)
goto out;
@@ -294,6 +309,14 @@ static int test_simple(void)
/* error zone, gracefully close */
out:
+ if(buf1)
+ HDfree(buf1);
+ if(buf2)
+ HDfree(buf2);
+ if(buf1_out)
+ HDfree(buf1_out);
+ if(buf2_out)
+ HDfree(buf2_out);
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
@@ -367,7 +390,7 @@ static int test_data(void)
*/
/* read a PAL file */
- if (read_palette(PAL2_FILE, rgb, sizeof(rgb))<0)
+ if (read_palette(PAL2_FILE, rgb, (sizeof(rgb) / sizeof(rgb[0]))) < 0)
goto out;
/* transfer to the HDF5 buffer */
@@ -393,7 +416,7 @@ static int test_data(void)
*/
/* read a PAL file */
- if (read_palette(PAL3_FILE, rgb, sizeof(rgb))<0)
+ if (read_palette(PAL3_FILE, rgb, (sizeof(rgb) / sizeof(rgb[0]))) < 0)
goto out;
/* transfer to the HDF5 buffer */
@@ -422,9 +445,9 @@ static int test_data(void)
*/
for ( i=0, n=0; i<256*3; i+=3, n++)
{
- pal[i] =n;
+ pal[i] =(unsigned char)n;
pal[i+1]=0;
- pal[i+2]=255-n;
+ pal[i+2]=(unsigned char)(255 - n);
}
/* make a palette */
@@ -478,13 +501,21 @@ static int test_data(void)
if (H5Fclose(fid)<0)
goto out;
+ /* Release memory buffer */
+ HDfree(image_data);
+
return 0;
/* error zone, gracefully close */
out:
+ /* Release memory buffer */
+ if(image_data)
+ HDfree(image_data);
+
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
+
H5_FAILED();
return FAIL;
}
@@ -509,6 +540,7 @@ static int test_generate(void)
hsize_t pal_dims[2] = { 256, 3 };
float *data;
int imax, jmax, kmax;
+ int n_elements;
float valex, xmin, xmax, value;
FILE *f;
const char *data_file = H5_get_srcdir_filename(DATA_FILE4);
@@ -530,8 +562,7 @@ static int test_generate(void)
if ( f == NULL )
{
printf( "Could not find file %s. Try set $srcdir \n", data_file );
- H5Fclose(fid);
- return -1;
+ goto out;
}
/*
@@ -573,10 +604,30 @@ static int test_generate(void)
fscanf( f, "%d %d %d", &imax, &jmax, &kmax );
fscanf( f, "%f %f %f", &valex, &xmin, &xmax );
- data = (float*) HDmalloc ( imax * jmax * kmax * sizeof( float ));
- image_data = (unsigned char*) HDmalloc ( imax * jmax * kmax * sizeof( unsigned char ));
+ /* Sanity check on scanned-in values */
+ if(imax < 1 || jmax < 1 || kmax < 1)
+ goto out;
- for ( i = 0; i < imax * jmax * kmax; i++ )
+ /* Test product for integer overflow */
+ if(imax > INT_MAX / jmax)
+ goto out;
+ if(imax * jmax > INT_MAX / kmax)
+ goto out;
+
+ n_elements = imax * jmax * kmax;
+
+ /* Test buffer sizes for overflow */
+ if(n_elements > INT_MAX / (int)sizeof(unsigned char))
+ goto out;
+ if(n_elements > INT_MAX / (int)sizeof(float))
+ goto out;
+
+ data = (float *)HDmalloc((size_t)n_elements * sizeof( float ));
+ HDassert(data);
+ image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof( unsigned char ));
+ HDassert(image_data);
+
+ for ( i = 0; i < n_elements; i++ )
{
fscanf( f, "%f ", &value );
data[i] = value;
@@ -591,10 +642,8 @@ static int test_generate(void)
TESTING2("make indexed image from all the data");
- for ( i = 0; i < imax * jmax * kmax; i++ )
- {
+ for ( i = 0; i < n_elements; i++ )
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
- }
/* Make the image */
if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0)
@@ -610,7 +659,7 @@ static int test_generate(void)
TESTING2("make indexed image from land data");
- for ( i = 0; i < imax * jmax * kmax; i++ )
+ for ( i = 0; i < n_elements; i++ )
{
if ( data[i] < 0 )
image_data[i] = 0;
@@ -632,7 +681,7 @@ static int test_generate(void)
TESTING2("make indexed image from sea data");
- for ( i = 0; i < imax * jmax * kmax; i++ )
+ for ( i = 0; i < n_elements; i++ )
{
if ( data[i] > 0 )
image_data[i] = 0;
@@ -675,12 +724,21 @@ static int test_generate(void)
if (H5Fclose(fid)<0)
goto out;
+ /* Release memory buffers */
+ HDfree(data);
+ HDfree(image_data);
+
/* Indicate success */
return 0;
/* error zone, gracefully close */
out:
- HDfree(data);
+ /* Release memory buffers */
+ if(data)
+ HDfree(data);
+ if(image_data)
+ HDfree(image_data);
+
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
@@ -713,51 +771,71 @@ static int read_data( const char* fname, /*IN*/
int i, n;
int color_planes;
char str[20];
- FILE *f;
+ FILE *f = NULL;
int w, h;
+ int n_elements;
const char *data_file = H5_get_srcdir_filename(fname);
+ int ret_val = -1;
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
- f = HDfopen(data_file, "r");
- if ( f == NULL )
- {
+ if(NULL == (f = HDfopen(data_file, "r"))) {
printf( "Could not open file %s. Try set $srcdir \n", data_file );
- return -1;
+ goto out;
}
- fscanf( f, "%s", str );
- fscanf( f, "%d", &color_planes );
- fscanf( f, "%s", str );
- fscanf( f, "%d", &h);
- fscanf( f, "%s", str );
- fscanf( f, "%d", &w);
+ fscanf(f, "%s", str);
+ fscanf(f, "%d", &color_planes);
+ fscanf(f, "%s", str);
+ fscanf(f, "%d", &h);
+ fscanf(f, "%s", str);
+ fscanf(f, "%d", &w);
*width = (hsize_t)w;
*height = (hsize_t)h;
- if ( image_data )
- {
- HDfree( image_data );
- image_data=NULL;
- }
+ /* Check product for overflow */
+ if(w < 1 || h < 1 || color_planes < 1)
+ goto out;
+ if(w > INT_MAX / h)
+ goto out;
+ if(w * h > INT_MAX / color_planes)
+ goto out;
- image_data = (unsigned char*) HDmalloc (w * h * color_planes * sizeof( unsigned char ));
+ /* Compute buffer size */
+ n_elements = w * h * color_planes;
- for (i = 0; i < h * w * color_planes ; i++)
- {
- fscanf( f, "%d",&n );
+ /* Check buffer size for overflow */
+ if(n_elements > INT_MAX / (int)sizeof(unsigned char))
+ goto out;
+
+ /* Release the buffer, if it was previously allocated */
+ if(image_data) {
+ HDfree(image_data);
+ image_data = NULL;
+ } /* end if */
+
+ /* Allocate the image data buffer */
+ image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char));
+
+ /* Read data elements */
+ for(i = 0; i < n_elements; i++) {
+ fscanf(f, "%d",&n);
image_data[i] = (unsigned char)n;
- }
- HDfclose(f);
+ } /* end for */
- return 1;
+ /* Indicate success */
+ ret_val = 1;
-}
+out:
+ if(f)
+ HDfclose(f);
+ return ret_val;
+} /* end read_data() */
/*-------------------------------------------------------------------------
@@ -882,6 +960,6 @@ static int read_palette(const char* fname,
/* close file */
HDfclose(file);
- return nentries;
+ return (int)nentries;
}
diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt
index 4887b6c..1deff23 100644
--- a/hl/tools/CMakeLists.txt
+++ b/hl/tools/CMakeLists.txt
@@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5)
ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS})
TARGET_NAMING (gif2h5 ${LIB_TYPE})
+TARGET_C_PROPERTIES (gif2h5 " " " ")
TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl)
@@ -29,6 +30,7 @@ SET (hdf2gif_SRCS
)
ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS})
TARGET_NAMING (h52gif ${LIB_TYPE})
+TARGET_C_PROPERTIES (h52gif " " " ")
TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl)
@@ -40,6 +42,7 @@ SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c)
TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (hl_h52gifgentest " " " ")
TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl)
diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt
index 3f8b9b7..f3aed76 100644
--- a/perform/CMakeLists.txt
+++ b/perform/CMakeLists.txt
@@ -23,6 +23,7 @@ SET (h5perf_serial_SRCS
)
ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS})
TARGET_NAMING (h5perf_serial ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5perf_serial " " " ")
TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform)
@@ -38,6 +39,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE)
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
)
TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5perf_serial_alone " " " ")
TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform)
ENDIF (HDF5_BUILD_PERFORM_STANDALONE)
@@ -48,6 +50,7 @@ SET (chunk_SRCS
)
ADD_EXECUTABLE(chunk ${chunk_SRCS})
TARGET_NAMING (chunk ${LIB_TYPE})
+TARGET_C_PROPERTIES (chunk " " " ")
TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform)
@@ -57,6 +60,7 @@ SET (iopipe_SRCS
)
ADD_EXECUTABLE (iopipe ${iopipe_SRCS})
TARGET_NAMING (iopipe ${LIB_TYPE})
+TARGET_C_PROPERTIES (iopipe " " " ")
TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform)
@@ -66,6 +70,7 @@ SET (overhead_SRCS
)
ADD_EXECUTABLE (overhead ${overhead_SRCS})
TARGET_NAMING (overhead ${LIB_TYPE})
+TARGET_C_PROPERTIES (overhead " " " ")
TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform)
@@ -75,6 +80,7 @@ SET (perf_meta_SRCS
)
ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS})
TARGET_NAMING (perf_meta ${LIB_TYPE})
+TARGET_C_PROPERTIES (perf_meta " " " ")
TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform)
@@ -84,6 +90,7 @@ SET (zip_perf_SRCS
)
ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS})
TARGET_NAMING (zip_perf ${LIB_TYPE})
+TARGET_C_PROPERTIES (zip_perf " " " ")
TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform)
@@ -96,6 +103,7 @@ IF (H5_HAVE_PARALLEL)
)
ADD_EXECUTABLE (h5perf ${h5perf_SRCS})
TARGET_NAMING (h5perf ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5perf " " " ")
TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform)
@@ -111,6 +119,7 @@ IF (H5_HAVE_PARALLEL)
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
)
TARGET_NAMING (h5perf_alone ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5perf_alone " " " ")
TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform)
ENDIF (HDF5_BUILD_PERFORM_STANDALONE)
@@ -122,6 +131,7 @@ IF (H5_HAVE_PARALLEL)
)
ADD_EXECUTABLE (benchpar ${benchpar_SRCS})
TARGET_NAMING (benchpar ${LIB_TYPE})
+ TARGET_C_PROPERTIES (benchpar " " " ")
TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform)
ENDIF (HDF5_BUILD_PARALLEL_ALL)
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 9961c55..ed3ec6b 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.151 currently under development
+HDF5 version 1.9.156 currently under development
================================================================================
diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt
index 2b3c02b..3c04f36 100644
--- a/release_docs/USING_HDF5_CMake.txt
+++ b/release_docs/USING_HDF5_CMake.txt
@@ -197,6 +197,7 @@ SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
SET (example hdf_example)
ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c)
+TARGET_C_PROPERTIES (${example} " " " ")
TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS})
ENABLE_TESTING ()
diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt
index bd928bc..bbfc501 100644
--- a/release_docs/USING_HDF5_VS.txt
+++ b/release_docs/USING_HDF5_VS.txt
@@ -78,7 +78,7 @@ Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008
Many other common questions and hints are located online and being updated
in the HDF5 FAQ. For Windows-specific questions, please see:
- http://www.hdfgroup.org/windows/faq.html
+ http://www.hdfgroup.org/HDF5/faq/windows.html
For all other general questions, you can look in the general FAQ:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d04197e..9b36482 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -789,6 +789,7 @@ INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR})
# specific type checks inside
#-----------------------------------------------------------------------------
ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+TARGET_C_PROPERTIES (H5detect " " " ")
IF (MSVC)
TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")
ENDIF (MSVC)
@@ -802,6 +803,7 @@ ADD_CUSTOM_COMMAND (
)
ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
+TARGET_C_PROPERTIES (H5make_libsettings " " " ")
IF (MSVC)
TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib")
ENDIF (MSVC)
@@ -851,6 +853,7 @@ SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h)
SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED)
ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS})
+TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS})
IF (NOT WIN32)
TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl)
diff --git a/src/H5.c b/src/H5.c
index 88dd17f..fe3a0ff 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -145,7 +145,7 @@ H5_init_library(void)
MPI_Initialized(&mpi_initialized);
if (mpi_initialized){
mpe_code = MPE_Init_log();
- assert(mpe_code >=0);
+ HDassert(mpe_code >=0);
H5_MPEinit_g = TRUE;
}
}
@@ -312,7 +312,7 @@ H5_term_library(void)
MPI_Initialized(&mpi_initialized);
if(mpi_initialized) {
mpe_code = MPE_Finish_log("h5log");
- assert(mpe_code >=0);
+ HDassert(mpe_code >=0);
} /* end if */
H5_MPEinit_g = FALSE; /* turn it off no matter what */
} /* end if */
diff --git a/src/H5C.c b/src/H5C.c
index fa385fa..0946af9 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -479,10 +479,10 @@ H5C_apply_candidate_list(H5F_t * f,
sprintf(&(tbl_buf[0]), "candidate list = ");
for ( i = 0; i < num_candidates; i++ )
{
- sprintf(&(tbl_buf[strlen(tbl_buf)]), " 0x%llx",
+ sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx",
(long long)(*(candidates_list_ptr + i)));
}
- sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n");
+ sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
@@ -539,8 +539,8 @@ H5C_apply_candidate_list(H5F_t * f,
tbl_buf[i] = '\0';
sprintf(&(tbl_buf[0]), "candidate assignment table = ");
for(i = 0; i <= mpi_size; i++)
- sprintf(&(tbl_buf[strlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
- sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n");
+ sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
+ sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n",
@@ -814,7 +814,7 @@ H5C_apply_candidate_list(H5F_t * f,
entries_cleared, entries_flushed);
HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank);
- fsync(stdout);
+ HDfsync(stdout);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
/* ====================================================================== *
diff --git a/src/H5CS.c b/src/H5CS.c
index c2ca49b..4ccd0f8 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -173,7 +173,7 @@ H5CS_print(FILE *stream)
FUNC_ENTER_NOAPI_NOERR_NOFS
/* Sanity check */
- assert(fstack);
+ HDassert(fstack);
H5CS_print_stack(fstack, stream);
@@ -205,8 +205,8 @@ H5CS_push(const char *func_name)
FUNC_ENTER_NOAPI_NOERR_NOFS
/* Sanity check */
- assert (fstack);
- assert (func_name);
+ HDassert(fstack);
+ HDassert(func_name);
/*
* Push the function if there's room. Otherwise just increment count
@@ -242,8 +242,8 @@ H5CS_pop(void)
FUNC_ENTER_NOAPI_NOERR_NOFS
/* Sanity check */
- assert (fstack);
- assert (fstack->nused>0);
+ HDassert(fstack);
+ HDassert(fstack->nused>0);
/* Pop the function. */
fstack->nused--;
@@ -276,7 +276,7 @@ H5CS_copy_stack(H5CS_t *new_stack)
FUNC_ENTER_NOAPI_NOERR_NOFS
/* Sanity check */
- HDassert (old_stack);
+ HDassert(old_stack);
/* Copy old stack to new one, duplicating the strings */
for(u = 0; u < old_stack->nused; u++)
@@ -310,7 +310,7 @@ H5CS_close_stack(H5CS_t *stack)
FUNC_ENTER_NOAPI_NOERR_NOFS
/* Sanity check */
- HDassert (stack);
+ HDassert(stack);
/* Free strings on stack */
for(u = 0; u < stack->nused; u++)
diff --git a/src/H5D.c b/src/H5D.c
index 6c34bec..2f4341b 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -115,7 +115,7 @@ done:
* properties (DCPL_ID).
*
* All arguments are copied into the dataset, so the caller is
- * allowed to derive new types, data spaces, and creation
+ * allowed to derive new types, dataspaces, and creation
* parameters from the old ones and reuse them in calls to
* create other datasets.
*
@@ -221,7 +221,7 @@ done:
* properties (DCPL_ID).
*
* All arguments are copied into the dataset, so the caller is
- * allowed to derive new types, data spaces, and creation
+ * allowed to derive new types, dataspaces, and creation
* parameters from the old ones and reuse them in calls to
* create other datasets.
*
@@ -428,9 +428,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Dget_space
*
- * Purpose: Returns a copy of the file data space for a dataset.
+ * Purpose: Returns a copy of the file dataspace for a dataset.
*
- * Return: Success: ID for a copy of the data space. The data
+ * Return: Success: ID for a copy of the dataspace. The data
* space should be released by calling
* H5Sclose().
*
@@ -459,8 +459,10 @@ H5Dget_space(hid_t dset_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
/* get the dataspace through the VOL */
- if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, &ret_value) < 0)
+ if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id,
+ H5_EVENT_QUEUE_NULL, &ret_value) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get data space")
+
done:
FUNC_LEAVE_API(ret_value)
}
@@ -469,7 +471,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Dget_space_status
*
- * Purpose: Returns the status of data space allocation.
+ * Purpose: Returns the status of dataspace allocation.
*
* Return:
* Success: Non-negative
@@ -498,7 +500,8 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
/* Read data space address through the VOL and return */
- if((ret_value=H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE_STATUS, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, allocation)) < 0)
+ if((ret_value=H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE_STATUS,
+ H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, allocation)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get space status")
done:
@@ -895,7 +898,10 @@ herr_t
H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
hsize_t *size)
{
- H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0};
+ H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0, 0};
+ H5VL_t *vol_plugin; /* VOL plugin this object belongs to */
+ void *dset; /* Dataset for operation */
+ H5S_t *mspace = NULL; /* Memory dataspace */
char bogus; /* bogus value to pass to H5Diterate() */
H5S_t *space; /* Dataspace for iteration */
H5P_genclass_t *pclass; /* Property class */
@@ -909,35 +915,35 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
if(H5I_DATASET != H5I_get_type(dataset_id) ||
(H5I_DATATYPE != H5I_get_type(type_id)) || size == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument")
+ /* get the plugin pointer */
+ if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dataset_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
+ /* get the dataset object */
+ if(NULL == (dset = (void *)H5I_object(dataset_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace")
if(!(H5S_has_extent(space)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set")
- /* Save the dataset ID */
- vlen_bufsize.dataset_id = dataset_id;
+ /* Save the dataset & VOL plugin */
+ vlen_bufsize.dset = dset;
+ vlen_bufsize.vol_plugin = vol_plugin;
+
+ vlen_bufsize.fspace_id = FAIL;
+ vlen_bufsize.mspace_id = FAIL;
- if((vlen_bufsize.fspace_id = H5Dget_space(dataset_id)) < 0)
+ /* Get a copy of the dataspace ID */
+ if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id,
+ H5_EVENT_QUEUE_NULL, &vlen_bufsize.fspace_id) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace")
-#if 0
- {
- H5VL_t *vol_plugin;
- void *dset;
- /* get the plugin pointer */
- if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dataset_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
- /* get the dataset object */
- if(NULL == (dset = (void *)H5I_object(dataset_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
- /* Get a copy of the dataspace ID */
- if(H5VL_dataset_get(dset, vol_plugin, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, &(vlen_bufsize.fspace_id)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace")
- }
-#endif
/* Create a scalar for the memory dataspace */
- if((vlen_bufsize.mspace_id = H5Screate(H5S_SCALAR)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace")
+ if(NULL == (mspace = H5S_create(H5S_SCALAR)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace")
+ /* Atomize */
+ if((vlen_bufsize.mspace_id = H5I_register (H5I_DATASPACE, mspace, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
/* Grab the temporary buffers required */
if(NULL == (vlen_bufsize.fl_tbuf = H5FL_BLK_MALLOC(vlen_fl_buf, (size_t)1)))
@@ -972,10 +978,15 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
*size = vlen_bufsize.size;
done:
- if(vlen_bufsize.fspace_id > 0 && H5I_dec_ref(vlen_bufsize.fspace_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
- if(vlen_bufsize.mspace_id > 0 && H5I_dec_ref(vlen_bufsize.mspace_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
+ if(ret_value < 0) {
+ if(mspace && H5S_close(mspace) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
+ } /* end if */
+
+ if(vlen_bufsize.fspace_id && H5I_dec_app_ref(vlen_bufsize.fspace_id) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id")
+ if(vlen_bufsize.mspace_id && H5I_dec_app_ref(vlen_bufsize.mspace_id) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id")
if(vlen_bufsize.fl_tbuf != NULL)
vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf);
if(vlen_bufsize.vl_tbuf != NULL)
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 31e3179..dd1860f 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -1206,7 +1206,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
FUNC_ENTER_STATIC
/* Sanity check */
- assert(fm->f_ndims>0);
+ HDassert(fm->f_ndims>0);
/* Get number of elements selected in file */
sel_points = fm->nelmts;
@@ -1383,7 +1383,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
FUNC_ENTER_STATIC
/* Sanity check */
- assert(fm->f_ndims>0);
+ HDassert(fm->f_ndims>0);
/* Check for all I/O going to a single chunk */
if(H5SL_count(fm->sel_chunks)==1) {
@@ -1394,7 +1394,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
/* Get pointer to chunk's information */
chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node);
- assert(chunk_info);
+ HDassert(chunk_info);
/* Just point at the memory dataspace & selection */
/* (Casting away const OK -QAK) */
@@ -1413,7 +1413,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info")
/* Calculate the adjustment for memory selection from file selection */
- assert(fm->m_ndims==fm->f_ndims);
+ HDassert(fm->m_ndims==fm->f_ndims);
for(u=0; u<fm->f_ndims; u++) {
H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t);
H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t);
@@ -1427,7 +1427,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
/* Get pointer to chunk's information */
chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node);
- assert(chunk_info);
+ HDassert(chunk_info);
/* Copy the information */
@@ -1797,8 +1797,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
* but they aren't set, set the flag to skip missing chunks.
*/
if(fill->fill_time == H5D_FILL_TIME_NEVER ||
- (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED &&
- fill_status != H5D_FILL_VALUE_DEFAULT))
+ (fill->fill_time == H5D_FILL_TIME_IFSET &&
+ fill_status != H5D_FILL_VALUE_USER_DEFINED &&
+ fill_status != H5D_FILL_VALUE_DEFAULT))
skip_missing_chunks = TRUE;
}
@@ -2889,7 +2890,9 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined")
if(fill->fill_time == H5D_FILL_TIME_ALLOC ||
- (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) {
+ (fill->fill_time == H5D_FILL_TIME_IFSET &&
+ (fill_status == H5D_FILL_VALUE_USER_DEFINED ||
+ fill_status == H5D_FILL_VALUE_DEFAULT))) {
/*
* The chunk doesn't exist in the file. Replicate the fill
* value throughout the chunk, if the fill value is defined.
@@ -3314,7 +3317,9 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
* set the "should fill" flag
*/
if((!full_overwrite && (fill->fill_time == H5D_FILL_TIME_ALLOC ||
- (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)))
+ (fill->fill_time == H5D_FILL_TIME_IFSET &&
+ (fill_status == H5D_FILL_VALUE_USER_DEFINED ||
+ fill_status == H5D_FILL_VALUE_DEFAULT))))
|| pline->nused > 0)
should_fill = TRUE;
diff --git a/src/H5Dint.c b/src/H5Dint.c
index ee7cc83..f2b70e7 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -379,7 +379,7 @@ H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache)
FUNC_ENTER_PACKAGE
/* Check args */
- assert(cache);
+ HDassert(cache);
/* Check for the default DXPL */
if(dxpl_id==H5P_DATASET_XFER_DEFAULT)
@@ -2052,6 +2052,7 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c
{
H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data;
H5T_t *dt; /* Datatype for operation */
+ H5S_t *fspace; /* File dataspace for operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2061,19 +2062,24 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object(type_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a datatype")
/* Make certain there is enough fixed-length buffer available */
if(NULL == (vlen_bufsize->fl_tbuf = H5FL_BLK_REALLOC(vlen_fl_buf, vlen_bufsize->fl_tbuf, H5T_get_size(dt))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf")
+ HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't resize tbuf")
/* Select point to read in */
- if(H5Sselect_elements(vlen_bufsize->fspace_id, H5S_SELECT_SET, (size_t)1, point) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point")
+ if(NULL == (fspace = (H5S_t *)H5I_object_verify(vlen_bufsize->fspace_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(H5S_select_elements(fspace, H5S_SELECT_SET, (size_t)1, point) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point")
/* Read in the point (with the custom VL memory allocator) */
- if(H5Dread(vlen_bufsize->dataset_id, type_id, vlen_bufsize->mspace_id, vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read point")
+ if(H5VL_dataset_read(vlen_bufsize->dset, vlen_bufsize->vol_plugin,
+ type_id, vlen_bufsize->mspace_id,
+ vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid,
+ vlen_bufsize->fl_tbuf, H5_EVENT_QUEUE_NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 25af0f5..f67a40f 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -359,7 +359,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL)
+ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL)
/* check args */
HDassert(dataset && dataset->oloc.file);
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 900ad6a..4d4c2bf 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -648,42 +648,49 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
} /* end else */
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+{
+ H5P_genplist_t *plist; /* Property list pointer */
htri_t check_prop;
int new_value;
+ /* Get the dataset transfer property list */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id)))
+ HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
+
/*** Test collective chunk user-input optimization APIs. ***/
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME);
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME);
if(check_prop > 0) {
if(H5D_ONE_LINK_CHUNK_IO == io_option) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value")
} /* end if */
} /* end if */
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME);
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME);
if(check_prop > 0) {
if(H5D_MULTI_CHUNK_IO == io_option) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value")
} /* end if */
} /* end if */
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME);
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME);
if(check_prop > 0) {
if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value")
} /* end if */
} /* end if */
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME);
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME);
if(check_prop > 0) {
if(temp_not_link_io) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value")
} /* end if */
} /* end if */
+}
#endif
/* step 2: Go ahead to do IO.*/
@@ -1713,19 +1720,26 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
HDmemcpy(chunk_addr, tempbuf, sizeof(haddr_t) * total_chunks);
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME);
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+
+ /* Get the dataset transfer property list */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id)))
+ HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
+
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME);
if(check_prop > 0) {
for(ic = 0; ic < total_chunks; ic++) {
if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value")
break;
} /* end if */
} /* end for */
} /* end if */
- check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME);
+ check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME);
if(check_prop > 0) {
int temp_count = 0;
@@ -1737,10 +1751,11 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
} /* end for */
if(temp_count == 0) {
new_value = 0;
- if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0)
+ if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value")
} /* end if */
} /* end if */
+}
#endif
done:
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index ed6da8f..bc862dd 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -479,7 +479,8 @@ typedef struct H5D_fill_buf_info_t {
/* Internal data structure for computing variable-length dataset's total size */
typedef struct {
- hid_t dataset_id; /* ID of the dataset we are working on */
+ void *dset; /* Dataset for operation */
+ H5VL_t *vol_plugin; /* VOL plugin the dataset belongs to */
hid_t fspace_id; /* ID of the file dataset's dataspace we are working on */
hid_t mspace_id; /* ID of the memory dataset's dataspace we are working on */
void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */
diff --git a/src/H5F.c b/src/H5F.c
index 2c86184..a22c7c7 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -916,15 +916,13 @@ done:
* david.pitt@bigpond.com
* Apr 27, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Fget_filesize(hid_t file_id, hsize_t *size)
{
H5VL_t *vol_plugin;
- void *obj;
+ void *file;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -935,10 +933,11 @@ H5Fget_filesize(hid_t file_id, hsize_t *size)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
/* get the file object */
- if(NULL == (obj = (void *)H5I_object(file_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
- if((ret_value = H5VL_file_optional(obj, vol_plugin, H5VL_FILE_GET_SIZE, H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, size)) < 0)
+ if((ret_value = H5VL_file_optional(file, vol_plugin, H5VL_FILE_GET_SIZE,
+ H5AC_dxpl_id, H5_EVENT_QUEUE_NULL, size)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file size")
done:
diff --git a/src/H5FD.c b/src/H5FD.c
index 0c375ed..bedbf0d 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -491,7 +491,7 @@ H5FD_sb_size(H5FD_t *file)
FUNC_ENTER_NOAPI(0)
- assert(file && file->cls);
+ HDassert(file && file->cls);
if(file->cls->sb_size)
ret_value = (file->cls->sb_size)(file);
@@ -529,7 +529,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf)
FUNC_ENTER_NOAPI(FAIL)
- assert(file && file->cls);
+ HDassert(file && file->cls);
if(file->cls->sb_encode &&
(file->cls->sb_encode)(file, name/*out*/, buf/*out*/) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed")
@@ -691,7 +691,7 @@ H5FD_fapl_get(H5FD_t *file)
FUNC_ENTER_NOAPI(NULL)
- assert(file);
+ HDassert(file);
if(file->cls->fapl_get)
ret_value = (file->cls->fapl_get)(file);
@@ -1198,8 +1198,8 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/)
FUNC_ENTER_API(FAIL)
H5TRACE2("Is", "*xx", f, flags);
- assert(f);
- assert(flags);
+ HDassert(f);
+ HDassert(flags);
ret_value = H5FD_query(f, flags);
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 43c8945..74aeed3 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -211,7 +211,7 @@ H5FD_core_init(void)
FUNC_ENTER_NOAPI(FAIL)
- if(H5I_VFL != H5Iget_type(H5FD_CORE_g))
+ if(H5I_VFL != H5I_get_type(H5FD_CORE_g))
H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE);
/* Set return value */
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 9715bc1..079554d 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -104,36 +104,8 @@ typedef struct H5FD_direct_t {
} H5FD_direct_t;
/*
- * This driver supports systems that have the lseek64() function by defining
- * some macros here so we don't have to have conditional compilations later
- * throughout the code.
- *
- * file_offset_t: The datatype for file offsets, the second argument of
- * the lseek() or lseek64() call.
- *
- * file_seek: The function which adjusts the current file position,
- * either lseek() or lseek64().
- */
-/* adding for windows NT file system support. */
-
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-# define file_truncate ftruncate64
-#elif defined (H5_HAVE_WIN32_API)
-# /*MSVC*/
-# define file_offset_t __int64
-# define file_seek _lseeki64
-# define file_truncate _chsize
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-# define file_truncate HDftruncate
-#endif
-
-/*
* These macros check for overflow of various quantities. These macros
- * assume that file_offset_t is signed and haddr_t and size_t are unsigned.
+ * assume that HDoff_t is signed and haddr_t and size_t are unsigned.
*
* ADDR_OVERFLOW: Checks whether a file address of type `haddr_t'
* is too large to be represented by the second argument
@@ -146,13 +118,13 @@ typedef struct H5FD_direct_t {
* which can be addressed entirely by the second
* argument of the file seek function.
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1)
+#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \
((A) & ~(haddr_t)MAXADDR))
#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR)
#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
HADDR_UNDEF==(A)+(Z) || \
- (file_offset_t)((A)+(Z))<(file_offset_t)(A))
+ (HDoff_t)((A)+(Z))<(HDoff_t)(A))
/* Prototypes */
static herr_t H5FD_direct_term(void);
@@ -454,7 +426,7 @@ H5FD_direct_fapl_copy(const void *_old_fa)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(new_fa);
+ HDassert(new_fa);
/* Copy the general information */
HDmemcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t));
@@ -500,7 +472,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
FUNC_ENTER_NOAPI_NOINIT
/* Sanity check on file offsets */
- assert(sizeof(file_offset_t)>=sizeof(size_t));
+ HDassert(sizeof(HDoff_t)>=sizeof(size_t));
/* Check arguments */
if (!name || !*name)
@@ -568,26 +540,26 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
if(o_flags & O_CREAT) {
- if(write(file->fd, (void*)buf1, sizeof(int))<0) {
- if(write(file->fd, (void*)buf2, file->fa.fbsize)<0)
+ if(HDwrite(file->fd, (void*)buf1, sizeof(int))<0) {
+ if(HDwrite(file->fd, (void*)buf2, file->fa.fbsize)<0)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O")
else
file->fa.must_align = TRUE;
} else {
file->fa.must_align = FALSE;
- file_truncate(file->fd, (file_offset_t)0);
+ HDftruncate(file->fd, (HDoff_t)0);
}
} else {
- if(read(file->fd, (void*)buf1, sizeof(int))<0) {
- if(read(file->fd, (void*)buf2, file->fa.fbsize)<0)
+ if(HDread(file->fd, (void*)buf1, sizeof(int))<0) {
+ if(HDread(file->fd, (void*)buf2, file->fa.fbsize)<0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O")
else
file->fa.must_align = TRUE;
} else {
if(o_flags & O_RDWR) {
- if(file_seek(file->fd, (file_offset_t)0, SEEK_SET) < 0)
+ if(HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position")
- if(write(file->fd, (void *)buf1, sizeof(int))<0)
+ if(HDwrite(file->fd, (void *)buf1, sizeof(int))<0)
file->fa.must_align = TRUE;
else
file->fa.must_align = FALSE;
@@ -911,8 +883,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
FUNC_ENTER_NOAPI_NOINIT
- assert(file && file->pub.cls);
- assert(buf);
+ HDassert(file && file->pub.cls);
+ HDassert(buf);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
@@ -941,7 +913,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) {
/* Seek to the correct location */
if ((addr!=file->pos || OP_READ!=file->op) &&
- file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
+ HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
/* Read the aligned data in file first, being careful of interrupted
* system calls and partial results. */
@@ -956,8 +928,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
HDmemset(buf, 0, size);
break;
}
- assert(nbytes>=0);
- assert((size_t)nbytes<=size);
+ HDassert(nbytes>=0);
+ HDassert((size_t)nbytes<=size);
H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t);
size -= (size_t)nbytes;
H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t);
@@ -980,7 +952,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
/* look for the aligned position for reading the data */
HDassert(!(((addr / _fbsize) * _fbsize) % _fbsize));
- if(file_seek(file->fd, (file_offset_t)((addr / _fbsize) * _fbsize),
+ if(HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize),
SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
@@ -1099,8 +1071,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
FUNC_ENTER_NOAPI_NOINIT
- assert(file && file->pub.cls);
- assert(buf);
+ HDassert(file && file->pub.cls);
+ HDassert(buf);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
@@ -1129,7 +1101,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) {
/* Seek to the correct location */
if ((addr!=file->pos || OP_WRITE!=file->op) &&
- file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
+ HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
while (size>0) {
@@ -1138,8 +1110,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) /* error */
HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
- assert(nbytes>0);
- assert((size_t)nbytes<=size);
+ HDassert(nbytes>0);
+ HDassert((size_t)nbytes<=size);
H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t);
size -= (size_t)nbytes;
H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t);
@@ -1165,7 +1137,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed")
/* look for the right position for reading or writing the data */
- if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0)
+ if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
p3 = buf;
@@ -1207,8 +1179,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
/* Seek to the last block, for reading */
HDassert(!((write_addr + write_size - _fbsize) % _fbsize));
- if(file_seek(file->fd,
- (file_offset_t)(write_addr + write_size - _fbsize),
+ if(HDlseek(file->fd,
+ (HDoff_t)(write_addr + write_size - _fbsize),
SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
} /* end if */
@@ -1218,7 +1190,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
if(p1) {
HDassert(!(read_size % _fbsize));
do {
- nbytes = read(file->fd, p1, read_size);
+ nbytes = HDread(file->fd, p1, read_size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) /* error */
@@ -1245,7 +1217,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
/*look for the aligned position for writing the data*/
HDassert(!(write_addr % _fbsize));
- if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0)
+ if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
/*
@@ -1317,7 +1289,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing
FUNC_ENTER_NOAPI_NOINIT
- assert(file);
+ HDassert(file);
/* Extend the file to make sure it's large enough */
if (file->eoa!=file->eof) {
@@ -1335,7 +1307,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing
if(SetEndOfFile((HANDLE)filehandle)==0)
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#else /* H5_HAVE_WIN32_API */
- if (-1==file_truncate(file->fd, (file_offset_t)file->eoa))
+ if (-1==HDftruncate(file->fd, (HDoff_t)file->eoa))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* H5_HAVE_WIN32_API */
@@ -1350,7 +1322,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing
/*Even though eof is equal to eoa, file is still truncated because Direct I/O
*write introduces some extra data for alignment.
*/
- if (-1==file_truncate(file->fd, (file_offset_t)file->eof))
+ if (-1==HDftruncate(file->fd, (HDoff_t)file->eof))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
}
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index dc535a2..75c75ad 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -187,19 +187,19 @@ H5FD_family_init_interface(void)
hid_t
H5FD_family_init(void)
{
- hid_t ret_value=H5FD_FAMILY_g; /* Return value */
+ hid_t ret_value = H5FD_FAMILY_g; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if (H5I_VFL!=H5Iget_type(H5FD_FAMILY_g))
- H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t),FALSE);
+ if(H5I_VFL != H5I_get_type(H5FD_FAMILY_g))
+ H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE);
/* Set return value */
- ret_value=H5FD_FAMILY_g;
+ ret_value = H5FD_FAMILY_g;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* H5FD_family_init() */
/*---------------------------------------------------------------------------
@@ -416,7 +416,7 @@ H5FD_family_fapl_copy(const void *_old_fa)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the fields of the structure */
- memcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t));
+ HDmemcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t));
/* Deep copy the property list objects in the structure */
if(old_fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) {
@@ -1176,7 +1176,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
tempreq = SIZET_MAX;
req = MIN(size, (size_t)tempreq);
- assert(u<file->nmembs);
+ HDassert(u<file->nmembs);
if (H5FDread(file->memb[u], type, dxpl_id, sub, req, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "member file read failed")
@@ -1245,7 +1245,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
tempreq = SIZET_MAX;
req = MIN(size, (size_t)tempreq);
- assert(u<file->nmembs);
+ HDassert(u<file->nmembs);
if (H5FDwrite(file->memb[u], type, dxpl_id, sub, req, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed")
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 09af4ed..c9e9a67 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -298,7 +298,7 @@ H5FD_get_eof(const H5FD_t *file)
/* Dispatch to driver */
if(file->cls->get_eof) {
if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file)))
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eof request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed")
} /* end if */
else
ret_value = file->maxaddr;
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 81d050d..cb04b80 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -795,7 +795,7 @@ H5FD_log_close(H5FD_t *_file)
if(file->fa.flags & H5FD_LOG_FLAVOR)
file->flavor = (unsigned char *)H5MM_xfree(file->flavor);
if(file->logfp != stderr)
- fclose(file->logfp);
+ HDfclose(file->logfp);
} /* end if */
/* Release the file info */
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index 295e3c9f..86a5d39 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -57,10 +57,10 @@ H5FD_mpi_get_rank(const H5FD_t *file)
FUNC_ENTER_NOAPI(FAIL)
- assert(file);
+ HDassert(file);
cls = (const H5FD_class_mpi_t *)(file->cls);
- assert(cls);
- assert(cls->get_rank); /* All MPI drivers must implement this */
+ HDassert(cls);
+ HDassert(cls->get_rank); /* All MPI drivers must implement this */
/* Dispatch to driver */
if ((ret_value=(cls->get_rank)(file))<0)
@@ -95,10 +95,10 @@ H5FD_mpi_get_size(const H5FD_t *file)
FUNC_ENTER_NOAPI(FAIL)
- assert(file);
+ HDassert(file);
cls = (const H5FD_class_mpi_t *)(file->cls);
- assert(cls);
- assert(cls->get_size); /* All MPI drivers must implement this */
+ HDassert(cls);
+ HDassert(cls->get_size); /* All MPI drivers must implement this */
/* Dispatch to driver */
if ((ret_value=(cls->get_size)(file))<0)
@@ -133,10 +133,10 @@ H5FD_mpi_get_comm(const H5FD_t *file)
FUNC_ENTER_NOAPI(MPI_COMM_NULL)
- assert(file);
+ HDassert(file);
cls = (const H5FD_class_mpi_t *)(file->cls);
- assert(cls);
- assert(cls->get_comm); /* All MPI drivers must implement this */
+ HDassert(cls);
+ HDassert(cls->get_comm); /* All MPI drivers must implement this */
/* Dispatch to driver */
if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL)
@@ -217,7 +217,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(mpi_off);
+ HDassert(mpi_off);
/* Convert the HDF5 address into an MPI offset */
*mpi_off = (MPI_Offset)addr;
@@ -373,8 +373,8 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file)
FUNC_ENTER_NOAPI(FAIL)
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
/* Portably initialize MPI status variable */
HDmemset(&rcvstat,0,sizeof(MPI_Status));
@@ -427,14 +427,12 @@ H5FD_mpio_signal_right_neighbor(H5FD_t *_file)
FUNC_ENTER_NOAPI(FAIL)
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
- if (file->mpi_rank != (file->mpi_size-1)) {
- if (MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR,
- file->mpi_rank+1, 0, file->comm)))
+ if(file->mpi_rank != (file->mpi_size - 1))
+ if(MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR, file->mpi_rank + 1, 0, file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mpi_code)
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 878bf82..f23a3b5 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -825,10 +825,10 @@ H5FD_mpio_fapl_free(void *_fa)
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stderr, "in H5FD_mpio_fapl_free\n");
#endif
- assert(fa);
+ HDassert(fa);
/* Free the internal communicator and INFO object */
- assert(MPI_COMM_NULL!=fa->comm);
+ HDassert(MPI_COMM_NULL!=fa->comm);
H5FD_mpi_comm_info_free(&fa->comm, &fa->info);
H5MM_xfree(fa);
@@ -1167,8 +1167,8 @@ H5FD_mpio_close(H5FD_t *_file)
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stdout, "Entering H5FD_mpio_close\n");
#endif
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
/* MPI_File_close sets argument to MPI_FILE_NULL */
if (MPI_SUCCESS != (mpi_code=MPI_File_close(&(file->f)/*in,out*/)))
@@ -1257,8 +1257,8 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
FUNC_LEAVE_NOAPI(file->eoa)
}
@@ -1292,8 +1292,8 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
file->eoa = addr;
@@ -1337,8 +1337,8 @@ H5FD_mpio_get_eof(const H5FD_t *_file)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
FUNC_LEAVE_NOAPI(file->eof)
}
@@ -1468,12 +1468,12 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stdout, "Entering H5FD_mpio_read\n" );
#endif
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
/* Make certain we have the correct type of property list */
- assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
- assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
- assert(buf);
+ HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
+ HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
+ HDassert(buf);
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat,0,sizeof(MPI_Status));
@@ -1752,12 +1752,12 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stdout, "Entering H5FD_mpio_write\n" );
#endif
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
/* Make certain we have the correct type of property list */
- assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
- assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
- assert(buf);
+ HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
+ HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
+ HDassert(buf);
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
@@ -2058,8 +2058,8 @@ H5FD_mpio_mpi_rank(const H5FD_t *_file)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
FUNC_LEAVE_NOAPI(file->mpi_rank)
} /* end H5FD_mpio_mpi_rank() */
@@ -2087,8 +2087,8 @@ H5FD_mpio_mpi_size(const H5FD_t *_file)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
FUNC_LEAVE_NOAPI(file->mpi_size)
} /* end H5FD_mpio_mpi_size() */
@@ -2117,8 +2117,8 @@ H5FD_mpio_communicator(const H5FD_t *_file)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(file);
- assert(H5FD_MPIO==file->pub.driver_id);
+ HDassert(file);
+ HDassert(H5FD_MPIO==file->pub.driver_id);
FUNC_LEAVE_NOAPI(file->comm)
}
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 978494e..7248dff 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -263,8 +263,8 @@ H5FD_mpiposix_init(void)
FUNC_ENTER_NOAPI(FAIL)
- if (H5I_VFL != H5Iget_type(H5FD_MPIPOSIX_g))
- H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g,sizeof(H5FD_class_mpi_t),FALSE);
+ if(H5I_VFL != H5I_get_type(H5FD_MPIPOSIX_g))
+ H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g, sizeof(H5FD_class_mpi_t), FALSE);
/* Set return value */
ret_value = H5FD_MPIPOSIX_g;
diff --git a/src/H5FO.c b/src/H5FO.c
index ace66ec..a6c47cb 100644
--- a/src/H5FO.c
+++ b/src/H5FO.c
@@ -78,8 +78,8 @@ H5FO_create(const H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
- assert(f);
- assert(f->shared);
+ HDassert(f);
+ HDassert(f->shared);
/* Create container used to store open object info */
if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL)
@@ -166,11 +166,11 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag)
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
- assert(f);
- assert(f->shared);
- assert(f->shared->open_objs);
- assert(H5F_addr_defined(addr));
- assert(obj);
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->open_objs);
+ HDassert(H5F_addr_defined(addr));
+ HDassert(obj);
/* Allocate new opened object information structure */
if((open_obj=H5FL_MALLOC(H5FO_open_obj_t))==NULL)
@@ -269,10 +269,10 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
FUNC_ENTER_NOAPI_NOERR
/* Sanity check */
- assert(f);
- assert(f->shared);
- assert(f->shared->open_objs);
- assert(H5F_addr_defined(addr));
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->open_objs);
+ HDassert(H5F_addr_defined(addr));
/* Get the object node from the container */
if(NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr)))
@@ -352,9 +352,9 @@ H5FO_dest(const H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
- assert(f);
- assert(f->shared);
- assert(f->shared->open_objs);
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->open_objs);
/* Check if the object info set is empty */
if(H5SL_count(f->shared->open_objs)!=0)
diff --git a/src/H5Fint.c b/src/H5Fint.c
index a853140..88464f9 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -1669,8 +1669,10 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na
} /* end else */
done:
- if(new_fapl_id > 0 && H5Pclose(new_fapl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL")
+ /* Close the property list */
+ if(new_fapl_id > 0)
+ if(H5I_dec_app_ref(new_fapl_id) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL")
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_build_actual_name() */
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 07d29f2..4d3ca34 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -101,7 +101,7 @@ H5F_mpi_get_rank(const H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
- assert(f && f->shared);
+ HDassert(f && f->shared);
/* Dispatch to driver */
if ((ret_value=H5FD_mpi_get_rank(f->shared->lf)) < 0)
@@ -135,7 +135,7 @@ H5F_mpi_get_comm(const H5F_t *f)
FUNC_ENTER_NOAPI(MPI_COMM_NULL)
- assert(f && f->shared);
+ HDassert(f && f->shared);
/* Dispatch to driver */
if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL)
@@ -169,7 +169,7 @@ H5F_mpi_get_size(const H5F_t *f)
FUNC_ENTER_NOAPI(FAIL)
- assert(f && f->shared);
+ HDassert(f && f->shared);
/* Dispatch to driver */
if ((ret_value=H5FD_mpi_get_size(f->shared->lf)) < 0)
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 98de62a..0ef5a0d 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -306,7 +306,6 @@ H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id);
H5_DLL herr_t H5F_close_mounts(H5F_t *f);
H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key);
H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs);
-H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id);
/* Superblock related routines */
H5_DLL herr_t H5F_super_init(H5F_t *f, hid_t dxpl_id);
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index a05d945..5a30828 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -639,6 +639,7 @@ H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl,
H5_DLL hbool_t H5F_is_mount(const H5F_t *file);
H5_DLL hbool_t H5F_has_mount(const H5F_t *file);
H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/);
+H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id);
/* Functions that operate on blocks of bytes wrt super block */
H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr,
diff --git a/src/H5Gname.c b/src/H5Gname.c
index fd8bf92..9dc8849 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -135,7 +135,7 @@ H5G__component(const char *name, size_t *size_p)
{
FUNC_ENTER_PACKAGE_NOERR
- assert(name);
+ HDassert(name);
while ('/' == *name)
name++;
@@ -236,13 +236,13 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r)
/* Get component of each name */
fullpath=H5RS_get_str(fullpath_r);
- assert(fullpath);
+ HDassert(fullpath);
fullpath=H5G__component(fullpath,&nchars1);
- assert(fullpath);
+ HDassert(fullpath);
prefix=H5RS_get_str(prefix_r);
- assert(prefix);
+ HDassert(prefix);
prefix=H5G__component(prefix,&nchars2);
- assert(prefix);
+ HDassert(prefix);
/* Check if we have a real string for each component */
while(*fullpath && *prefix) {
@@ -256,9 +256,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r)
/* Get next component of each name */
fullpath=H5G__component(fullpath,&nchars1);
- assert(fullpath);
+ HDassert(fullpath);
prefix=H5G__component(prefix,&nchars2);
- assert(prefix);
+ HDassert(prefix);
} /* end if */
else
HGOTO_DONE(FALSE)
diff --git a/src/H5HG.c b/src/H5HG.c
index 7a90475..d55eaab 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -191,7 +191,7 @@ HDmemset(heap->chunk, 0, size);
/* The freespace object */
heap->obj[0].size = size - H5HG_SIZEOF_HDR(f);
- assert(H5HG_ISALIGNED(heap->obj[0].size));
+ HDassert(H5HG_ISALIGNED(heap->obj[0].size));
heap->obj[0].nrefs = 0;
heap->obj[0].begin = p;
UINT16ENCODE(p, 0); /*object ID*/
@@ -372,7 +372,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr)
UINT16ENCODE(p, 0); /*nrefs*/
UINT32ENCODE(p, 0); /*reserved*/
H5F_ENCODE_LENGTH (f, p, heap->obj[0].size);
- assert(H5HG_ISALIGNED(heap->obj[0].size));
+ HDassert(H5HG_ISALIGNED(heap->obj[0].size));
} /* end else-if */
else {
/*
@@ -381,7 +381,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr)
*/
heap->obj[0].size -= need;
heap->obj[0].begin += need;
- assert(H5HG_ISALIGNED(heap->obj[0].size));
+ HDassert(H5HG_ISALIGNED(heap->obj[0].size));
}
/* Mark the heap as dirty */
@@ -475,7 +475,7 @@ HDmemset(new_chunk + heap->size, 0, need);
UINT16ENCODE(p, 0); /*nrefs*/
UINT32ENCODE(p, 0); /*reserved*/
H5F_ENCODE_LENGTH(f, p, heap->obj[0].size);
- assert(H5HG_ISALIGNED(heap->obj[0].size));
+ HDassert(H5HG_ISALIGNED(heap->obj[0].size));
/* Resize the heap in the cache */
if(H5AC_resize_entry(heap, heap->size) < 0)
diff --git a/src/H5HP.c b/src/H5HP.c
index 335fde2..f6fb20c 100644
--- a/src/H5HP.c
+++ b/src/H5HP.c
@@ -342,7 +342,7 @@ H5HP_create(H5HP_type_t heap_type)
FUNC_ENTER_NOAPI(NULL)
/* Check args */
- assert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP);
+ HDassert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP);
/* Allocate ref-counted string structure */
if((new_heap=H5FL_MALLOC(H5HP_t))==NULL)
@@ -416,15 +416,15 @@ H5HP_count(const H5HP_t *heap)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(heap);
+ HDassert(heap);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Return the number of objects in the heap */
H5_CHECK_OVERFLOW(heap->nobjs,size_t,ssize_t);
@@ -463,16 +463,16 @@ H5HP_insert(H5HP_t *heap, int val, void *obj)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(heap);
- assert(obj);
+ HDassert(heap);
+ HDassert(obj);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Increment number of objects in heap */
heap->nobjs++;
@@ -507,11 +507,11 @@ done:
/* Check internal consistency */
/* (Post-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_insert() */
@@ -542,16 +542,16 @@ H5HP_top(const H5HP_t *heap, int *val)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(heap);
- assert(val);
+ HDassert(heap);
+ HDassert(val);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Get value of the top object in the heap */
*val=heap->heap[1].val;
@@ -589,24 +589,24 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(heap);
- assert(val);
- assert(obj);
+ HDassert(heap);
+ HDassert(val);
+ HDassert(obj);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Check if there are any objects on the heap to remove */
if(heap->nobjs==0)
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap is empty");
/* Get the information for the top object on the heap */
- assert(heap->heap[1].obj->heap_loc==1);
+ HDassert(heap->heap[1].obj->heap_loc==1);
*val=heap->heap[1].val;
*obj=heap->heap[1].obj;
@@ -634,11 +634,11 @@ done:
/* Check internal consistency */
/* (Post-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_remove() */
@@ -675,20 +675,20 @@ H5HP_change(H5HP_t *heap, int val, void *_obj)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(heap);
- assert(obj);
+ HDassert(heap);
+ HDassert(obj);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Get the location of the object in the heap */
obj_loc=obj->heap_loc;
- assert(obj_loc>0 && obj_loc<=heap->nobjs);
+ HDassert(obj_loc>0 && obj_loc<=heap->nobjs);
/* Change the heap object's priority */
old_val=heap->heap[obj_loc].val;
@@ -720,11 +720,11 @@ done:
/* Check internal consistency */
/* (Post-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_change() */
@@ -760,20 +760,20 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(heap);
- assert(obj);
+ HDassert(heap);
+ HDassert(obj);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Get the location of the object in the heap */
obj_loc = obj->heap_loc;
- assert(obj_loc > 0 && obj_loc <= heap->nobjs);
+ HDassert(obj_loc > 0 && obj_loc <= heap->nobjs);
/* Change the heap object's priority */
heap->heap[obj_loc].val += (int)amt;
@@ -792,11 +792,11 @@ done:
/* Check internal consistency */
/* (Post-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_incr() */
@@ -832,20 +832,20 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(heap);
- assert(obj);
+ HDassert(heap);
+ HDassert(obj);
/* Check internal consistency */
/* (Pre-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
/* Get the location of the object in the heap */
obj_loc=obj->heap_loc;
- assert(obj_loc>0 && obj_loc<=heap->nobjs);
+ HDassert(obj_loc>0 && obj_loc<=heap->nobjs);
/* Change the heap object's priority */
heap->heap[obj_loc].val-=amt;
@@ -864,11 +864,11 @@ done:
/* Check internal consistency */
/* (Post-condition) */
- assert(heap->nobjs<heap->nalloc);
- assert(heap->heap);
- assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
+ HDassert(heap->nobjs<heap->nalloc);
+ HDassert(heap->heap);
+ HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) ||
(heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN));
- assert(heap->heap[0].obj==NULL);
+ HDassert(heap->heap[0].obj==NULL);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_decr() */
diff --git a/src/H5MM.c b/src/H5MM.c
index 23ef9f9..caeac37 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -59,7 +59,7 @@ H5MM_malloc(size_t size)
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(size);
+ HDassert(size);
FUNC_LEAVE_NOAPI(HDmalloc(size));
} /* end H5MM_malloc() */
@@ -92,7 +92,7 @@ H5MM_calloc(size_t size)
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(size);
+ HDassert(size);
FUNC_LEAVE_NOAPI(HDcalloc(1,size));
} /* end H5MM_calloc() */
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 85346eb..543a9c1 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -326,9 +326,9 @@ herr_t H5O_copy(H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const
done:
if(loc_found && H5G_loc_free(&src_loc) < 0)
- HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location")
- if(obj_open)
- H5O_close(&src_oloc);
+ HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location")
+ if(obj_open && H5O_close(&src_oloc) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_copy() */
@@ -709,7 +709,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
} /* end if */
/* Add in destination's object header size now */
- dst_oh_size += H5O_SIZEOF_HDR(oh_dst);
+ dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst);
/* Allocate space for chunk in destination file */
if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size)))
@@ -1324,7 +1324,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
H5O_loc_t dst_oloc; /* Copied object object location */
H5O_loc_t src_oloc; /* Temporary object location for source object */
H5G_loc_t dst_root_loc; /* The location of root group of the destination file */
- uint8_t *p; /* Pointer to OID to store */
+ const uint8_t *q; /* Pointer to source OID to store */
+ uint8_t *p; /* Pointer to destination OID to store */
size_t i; /* Local index variable */
herr_t ret_value = SUCCEED;
@@ -1358,8 +1359,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Making equivalent references in the destination file */
for(i = 0; i < ref_count; i++) {
/* Set up for the object copy for the reference */
- p = (uint8_t *)(&src_ref[i]);
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr));
+ q = (uint8_t *)(&src_ref[i]);
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr));
dst_oloc.addr = HADDR_UNDEF;
/* Attempt to copy object from source to destination file */
@@ -1387,9 +1388,9 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Making equivalent references in the destination file */
for(i = 0; i < ref_count; i++) {
/* Get the heap ID for the dataset region */
- p = (uint8_t *)(&src_ref[i]);
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ q = (const uint8_t *)(&src_ref[i]);
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(hobjid.addr));
+ UINT32DECODE(q, hobjid.idx);
if(hobjid.addr != (haddr_t)0) {
/* Get the dataset region from the heap (allocate inside routine) */
@@ -1397,8 +1398,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information")
/* Get the object oid for the dataset */
- p = (uint8_t *)buf;
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr));
+ q = (const uint8_t *)buf;
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr));
dst_oloc.addr = HADDR_UNDEF;
/* copy the object pointed by the ref to the destination */
@@ -1424,7 +1425,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Set the dataset region reference info for the destination file */
p = (uint8_t *)(&dst_ref[i]);
H5F_addr_encode(dst_oloc.file, &p, hobjid.addr);
- INT32ENCODE(p, hobjid.idx);
+ UINT32ENCODE(p, hobjid.idx);
/* Free the buffer allocated in H5HG_read() */
H5MM_xfree(buf);
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index db9066e..487b6f4 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -118,9 +118,9 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh,
/* Number of slots */
UINT16DECODE(p, mesg->nalloc);
- assert(mesg->nalloc>0);
+ HDassert(mesg->nalloc>0);
UINT16DECODE(p, mesg->nused);
- assert(mesg->nused <= mesg->nalloc);
+ HDassert(mesg->nused <= mesg->nalloc);
/* Heap address */
H5F_addr_decode(f, &p, &(mesg->heap_addr));
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 6326fd9..4c43873 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -127,7 +127,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* Layout class */
mesg->type = (H5D_layout_t)*p++;
- assert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type);
+ HDassert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type);
/* Reserved bytes */
p += 5;
diff --git a/src/H5Oname.c b/src/H5Oname.c
index c1cb8c8..5ca05e1 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -228,8 +228,8 @@ H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void *
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(mesg);
+ HDassert(f);
+ HDassert(mesg);
ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0;
@@ -294,11 +294,11 @@ H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(mesg);
- assert(stream);
- assert(indent >= 0);
- assert(fwidth >= 0);
+ HDassert(f);
+ HDassert(mesg);
+ HDassert(stream);
+ HDassert(indent >= 0);
+ HDassert(fwidth >= 0);
fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth,
"Name:",
diff --git a/src/H5Ostab.c b/src/H5Ostab.c
index d05c7c2..f7c77bc 100644
--- a/src/H5Ostab.c
+++ b/src/H5Ostab.c
@@ -149,9 +149,9 @@ H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(p);
- assert(stab);
+ HDassert(f);
+ HDassert(p);
+ HDassert(stab);
/* encode */
H5F_addr_encode(f, &p, stab->btree_addr);
@@ -433,11 +433,11 @@ H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(stab);
- assert(stream);
- assert(indent >= 0);
- assert(fwidth >= 0);
+ HDassert(f);
+ HDassert(stab);
+ HDassert(stream);
+ HDassert(indent >= 0);
+ HDassert(fwidth >= 0);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
"B-tree address:", stab->btree_addr);
diff --git a/src/H5PL.c b/src/H5PL.c
index 07e90af..def41d1 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -415,7 +415,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
/* Get info for directory entry */
if(HDstat(pathname, &my_stat) == -1)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", HDstrerror(errno))
/* If it is a directory, skip it */
if(S_ISDIR(my_stat.st_mode))
@@ -437,7 +437,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
done:
if(dirp)
if(HDclosedir(dirp) < 0)
- HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno))
+ HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno))
if(pathname)
pathname = (char *)H5MM_xfree(pathname);
@@ -456,7 +456,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
FUNC_ENTER_STATIC
/* Specify a file mask. *.* = We want everything! */
- sprintf(service, "%s\/*.dll", dir);
+ sprintf(service, "%s\\*.dll", dir);
if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE)
HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory")
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 6117ff5..9ed489d 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1687,13 +1687,6 @@ done:
* Programmer: Kent Yang
* Tuesday, April 1, 2003
*
- * Modifications:
- *
- * Nat Furrer and James Laird
- * June 30, 2004
- * Now ensures that SZIP encoding is enabled
- * SZIP defaults to k13 compression
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1703,22 +1696,22 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block)
H5P_genplist_t *plist; /* Property list pointer */
unsigned cd_values[2]; /* Filter parameters */
unsigned int config_flags;
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iIuIu", plist_id, options_mask, pixels_per_block);
- if(H5Zget_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0)
+ if(H5Z_get_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't get filter info")
- if(! (config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED))
+ if(!(config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED))
HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled.")
/* Check arguments */
- if ((pixels_per_block%2)==1)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even")
- if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large")
+ if((pixels_per_block % 2) == 1)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even")
+ if(pixels_per_block > H5_SZIP_MAX_PIXELS_PER_BLOCK)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 50fe271..b78df3d 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -2522,7 +2522,7 @@ H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed")
} /* end if */
else
- free(info.buffer);
+ HDfree(info.buffer);
} /* end if */
/* Free udata if it exists */
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 52db9d5..a117469 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -2684,7 +2684,7 @@ done:
PURPOSE
Internal routine to query the existance of a property in a property list.
USAGE
- herr_t H5P_exist_plist(plist, name)
+ htri_t H5P_exist_plist(plist, name)
const H5P_genplist_t *plist; IN: Property list to check
const char *name; IN: Name of property to check for
RETURNS
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index f80e4e7..2166020 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -1453,7 +1453,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/,
/* Filter configuration (assume filter ID has already been checked) */
if(filter_config)
- H5Zget_filter_info(filter->id, filter_config);
+ H5Z_get_filter_info(filter->id, filter_config);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5P_get_filter() */
diff --git a/src/H5R.c b/src/H5R.c
index 9a43563..2139143 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -291,7 +291,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5
/* Serialize the heap ID and index for storage in the file */
p = (uint8_t *)ref;
H5F_addr_encode(loc->oloc->file, &p, hobjid.addr);
- INT32ENCODE(p, hobjid.idx);
+ UINT32ENCODE(p, hobjid.idx);
/* Free the buffer we serialized data in */
H5MM_xfree(buf);
@@ -443,7 +443,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type,
/* Get the heap ID for the dataset region */
p = (const uint8_t *)_ref;
H5F_addr_decode(oloc.file, &p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ UINT32DECODE(p, hobjid.idx);
/* Get the dataset region from the heap (allocate inside routine) */
if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)))
@@ -656,7 +656,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref)
/* Get the heap ID for the dataset region */
p = (const uint8_t *)_ref;
H5F_addr_decode(oloc.file, &p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ UINT32DECODE(p, hobjid.idx);
/* Get the dataset region from the heap (allocate inside routine) */
if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL)
@@ -797,7 +797,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type,
/* Get the heap ID for the dataset region */
p = (const uint8_t *)_ref;
H5F_addr_decode(oloc.file, &p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ UINT32DECODE(p, hobjid.idx);
/* Get the dataset region from the heap (allocate inside routine) */
if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL)
@@ -956,7 +956,7 @@ H5R_get_name(H5G_loc_t *loc, hid_t lapl_id, hid_t dxpl_id, H5R_type_t ref_type,
/* Get the heap ID for the dataset region */
p = (const uint8_t *)_ref;
H5F_addr_decode(oloc.file, &p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ UINT32DECODE(p, hobjid.idx);
/* Get the dataset region from the heap (allocate inside routine) */
if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL)
diff --git a/src/H5S.c b/src/H5S.c
index 2b21a91..66bb627 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -325,7 +325,7 @@ H5S_extent_release(H5S_extent_t *extent)
FUNC_ENTER_NOAPI(FAIL)
- assert(extent);
+ HDassert(extent);
/* Release extent */
if(extent->type == H5S_SIMPLE) {
@@ -726,7 +726,7 @@ H5S_get_npoints_max(const H5S_t *ds)
FUNC_ENTER_NOAPI(0)
/* check args */
- assert(ds);
+ HDassert(ds);
switch (H5S_GET_EXTENT_TYPE(ds)) {
case H5S_NULL:
@@ -756,7 +756,7 @@ H5S_get_npoints_max(const H5S_t *ds)
case H5S_NO_CLASS:
default:
- assert("unknown dataspace class" && 0);
+ HDassert("unknown dataspace class" && 0);
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)")
}
@@ -1435,7 +1435,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/],
FUNC_ENTER_NOAPI(NULL)
/* Check arguments */
- assert(rank <=H5S_MAX_RANK);
+ HDassert(rank <=H5S_MAX_RANK);
/* Create the space and set the extent */
if(NULL==(ret_value=H5S_create(H5S_SIMPLE)))
@@ -1713,7 +1713,7 @@ H5S_get_simple_extent_type(const H5S_t *space)
FUNC_ENTER_NOAPI(H5S_NO_CLASS)
- assert(space);
+ HDassert(space);
ret_value=H5S_GET_EXTENT_TYPE(space);
diff --git a/src/H5SL.c b/src/H5SL.c
index 7581858..5c46fd4 100644
--- a/src/H5SL.c
+++ b/src/H5SL.c
@@ -754,7 +754,7 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -940,7 +940,7 @@ H5SL_count(H5SL_t *slist)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -978,8 +978,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(slist);
- assert(key);
+ HDassert(slist);
+ HDassert(key);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1025,8 +1025,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(slist);
- assert(key);
+ HDassert(slist);
+ HDassert(key);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1252,8 +1252,8 @@ H5SL_search(H5SL_t *slist, const void *key)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
- assert(key);
+ HDassert(slist);
+ HDassert(key);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1341,8 +1341,8 @@ H5SL_less(H5SL_t *slist, const void *key)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
- assert(key);
+ HDassert(slist);
+ HDassert(key);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1535,8 +1535,8 @@ H5SL_find(H5SL_t *slist, const void *key)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
- assert(key);
+ HDassert(slist);
+ HDassert(key);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1806,7 +1806,7 @@ H5SL_first(H5SL_t *slist)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1840,7 +1840,7 @@ H5SL_next(H5SL_node_t *slist_node)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist_node);
+ HDassert(slist_node);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1874,7 +1874,7 @@ H5SL_prev(H5SL_node_t *slist_node)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist_node);
+ HDassert(slist_node);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1909,7 +1909,7 @@ H5SL_last(H5SL_t *slist)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -1943,7 +1943,7 @@ H5SL_item(H5SL_node_t *slist_node)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist_node);
+ HDassert(slist_node);
/* Check internal consistency */
/* (Pre-condition) */
@@ -2040,7 +2040,7 @@ H5SL_release(H5SL_t *slist)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -2086,7 +2086,7 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -2132,7 +2132,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
@@ -2169,7 +2169,7 @@ H5SL_close(H5SL_t *slist)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(slist);
+ HDassert(slist);
/* Check internal consistency */
/* (Pre-condition) */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 8d56c80..19d1efc 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -118,8 +118,8 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space));
- assert (iter);
+ HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space));
+ HDassert (iter);
/* Initialize the number of elements to iterate over */
iter->elmt_left=H5S_GET_SELECT_NPOINTS(space);
@@ -158,8 +158,8 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert (iter);
- assert (coords);
+ HDassert (iter);
+ HDassert (coords);
/* Calculate the coordinates for the current iterator offset */
if(H5V_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0)
@@ -193,9 +193,9 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
- assert (start);
- assert (end);
+ HDassert (iter);
+ HDassert (start);
+ HDassert (end);
for(u=0; u<iter->rank; u++) {
/* Set the start of the 'all' block */
@@ -231,7 +231,7 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
+ HDassert (iter);
FUNC_LEAVE_NOAPI(iter->elmt_left)
} /* H5S_all_iter_nelmts() */
@@ -260,7 +260,7 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
+ HDassert (iter);
FUNC_LEAVE_NOAPI(FALSE)
} /* H5S_all_iter_has_next_block() */
@@ -290,8 +290,8 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
- assert (nelem>0);
+ HDassert (iter);
+ HDassert (nelem>0);
/* Increment the iterator */
iter->u.all.elmt_offset+=nelem;
@@ -324,7 +324,7 @@ H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
+ HDassert (iter);
FUNC_LEAVE_NOAPI(FAIL)
} /* H5S_all_iter_next_block() */
@@ -353,7 +353,7 @@ H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert (iter);
+ HDassert (iter);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_all_iter_release() */
@@ -450,7 +450,7 @@ H5S_all_is_valid (const H5S_t UNUSED *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
} /* end H5S_all_is_valid() */
@@ -480,7 +480,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
/* Basic number of bytes required to serialize point selection:
* <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> +
@@ -514,7 +514,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
/* Store the preamble information */
UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */
@@ -671,7 +671,7 @@ H5S_all_is_contiguous(const H5S_t UNUSED *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
} /* H5S_all_is_contiguous() */
@@ -700,7 +700,7 @@ H5S_all_is_single(const H5S_t UNUSED *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
} /* H5S_all_is_single() */
@@ -731,7 +731,7 @@ H5S_all_is_regular(const H5S_t UNUSED *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
+ HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
} /* H5S_all_is_regular() */
@@ -955,14 +955,14 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
- assert(iter);
- assert(maxseq>0);
- assert(maxelem>0);
- assert(nseq);
- assert(nelem);
- assert(off);
- assert(len);
+ HDassert(space);
+ HDassert(iter);
+ HDassert(maxseq>0);
+ HDassert(maxelem>0);
+ HDassert(nseq);
+ HDassert(nelem);
+ HDassert(off);
+ HDassert(len);
/* Determine the actual number of elements to use */
H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t);
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 9a993a5..1eb0cbc 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -112,8 +112,8 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(dst);
- assert(src);
+ HDassert(dst);
+ HDassert(src);
/* Copy regular fields */
dst->select=src->select;
@@ -152,7 +152,7 @@ H5S_select_release(H5S_t *ds)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(ds);
+ HDassert(ds);
/* Call the selection type's release function */
ret_value=(*ds->select.type->release)(ds);
@@ -224,7 +224,7 @@ H5S_select_serial_size(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
/* Call the selection type's serial_size function */
ret_value=(*space->select.type->serial_size)(space);
@@ -262,8 +262,8 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
- assert(buf);
+ HDassert(space);
+ HDassert(buf);
/* Call the selection type's serialize function */
ret_value=(*space->select.type->serialize)(space,buf);
@@ -413,7 +413,7 @@ H5S_select_valid(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(space);
+ HDassert(space);
ret_value = (*space->select.type->is_valid)(space);
@@ -452,7 +452,7 @@ H5S_select_deserialize (H5S_t *space, const uint8_t *buf)
FUNC_ENTER_NOAPI(FAIL)
- assert(space);
+ HDassert(space);
tbuf=buf;
UINT32DECODE(tbuf, sel_type);
@@ -571,9 +571,9 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
- assert(start);
- assert(end);
+ HDassert(space);
+ HDassert(start);
+ HDassert(end);
ret_value = (*space->select.type->bounds)(space,start,end);
@@ -650,7 +650,7 @@ H5S_select_is_contiguous(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
+ HDassert(space);
ret_value = (*space->select.type->is_contiguous)(space);
@@ -687,7 +687,7 @@ H5S_select_is_single(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
+ HDassert(space);
ret_value = (*space->select.type->is_single)(space);
@@ -724,7 +724,7 @@ H5S_select_is_regular(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
+ HDassert(space);
ret_value = (*space->select.type->is_regular)(space);
@@ -929,8 +929,8 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(sel_iter);
- assert(coords);
+ HDassert(sel_iter);
+ HDassert(coords);
/* Call iter_coords routine for selection type */
ret_value = (*sel_iter->type->iter_coords)(sel_iter,coords);
@@ -971,9 +971,9 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR
/* Check args */
- assert(iter);
- assert(start);
- assert(end);
+ HDassert(iter);
+ HDassert(start);
+ HDassert(end);
/* Call iter_block routine for selection type */
ret_value = (*iter->type->iter_block)(iter,start,end);
@@ -1011,7 +1011,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(sel_iter);
+ HDassert(sel_iter);
/* Call iter_nelmts routine for selection type */
ret_value = (*sel_iter->type->iter_nelmts)(sel_iter);
@@ -1050,7 +1050,7 @@ H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter)
FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR
/* Check args */
- assert(iter);
+ HDassert(iter);
/* Call iter_has_next_block routine for selection type */
ret_value = (*iter->type->iter_has_next_block)(iter);
@@ -1090,8 +1090,8 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(iter);
- assert(nelem>0);
+ HDassert(iter);
+ HDassert(nelem>0);
/* Call iter_next routine for selection type */
ret_value = (*iter->type->iter_next)(iter,nelem);
@@ -1135,7 +1135,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(iter);
+ HDassert(iter);
/* Call iter_next_block routine for selection type */
ret_value = (*iter->type->iter_next_block)(iter);
@@ -1173,7 +1173,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(sel_iter);
+ HDassert(sel_iter);
/* Call selection type-specific release routine */
ret_value = (*sel_iter->type->iter_release)(sel_iter);
@@ -1387,7 +1387,7 @@ H5S_get_select_type(const H5S_t *space)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- assert(space);
+ HDassert(space);
/* Set return value */
ret_value=H5S_GET_SELECT_TYPE(space);
diff --git a/src/H5T.c b/src/H5T.c
index 359d5b5..b7ace9b 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1351,7 +1351,7 @@ H5T_init_interface(void)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)")
/* ========== Datatype Creation Property Class Initialization ============*/
- assert(H5P_CLS_DATATYPE_CREATE_g!=-1);
+ HDassert(H5P_CLS_DATATYPE_CREATE_g!=-1);
/* Get the pointer to group creation class */
if(NULL == (crt_pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATATYPE_CREATE_g)))
@@ -1916,7 +1916,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal)
FUNC_ENTER_NOAPI(H5T_NO_CLASS)
- assert(dt);
+ HDassert(dt);
/* Externally, a VL string is a string; internally, a VL string is a VL. */
if(internal) {
@@ -2273,7 +2273,7 @@ H5T_get_super(const H5T_t *dt)
FUNC_ENTER_NOAPI(NULL)
- assert(dt);
+ HDassert(dt);
if (!dt->shared->parent)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type");
@@ -2321,11 +2321,11 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(src);
- assert(dst);
- assert(func);
- assert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers);
- assert(name && *name);
+ HDassert(src);
+ HDassert(dst);
+ HDassert(func);
+ HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers);
+ HDassert(name && *name);
if(H5T_PERS_HARD == pers) {
/* Only bother to register the path if it's not a no-op path (for this machine) */
@@ -2371,7 +2371,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
*/
for (i=1; i<H5T_g.npaths; i++) {
old_path = H5T_g.path[i];
- assert(old_path);
+ HDassert(old_path);
/* Does the new soft conversion function apply to this path? */
if (old_path->is_hard ||
@@ -3439,7 +3439,7 @@ H5T_lock (H5T_t *dt, hbool_t immutable)
FUNC_ENTER_NOAPI(FAIL)
- assert (dt);
+ HDassert (dt);
switch (dt->shared->state) {
case H5T_STATE_TRANSIENT:
@@ -3714,10 +3714,10 @@ H5T_set_size(H5T_t *dt, size_t size)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(dt);
- assert(size!=0);
- assert(H5T_REFERENCE!=dt->shared->type);
- assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
+ HDassert(dt);
+ HDassert(size!=0);
+ HDassert(H5T_REFERENCE!=dt->shared->type);
+ HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
if (dt->shared->parent) {
if (H5T_set_size(dt->shared->parent, size)<0)
@@ -3846,12 +3846,12 @@ H5T_set_size(H5T_t *dt, size_t size)
case H5T_VLEN:
case H5T_ARRAY:
case H5T_REFERENCE:
- assert("can't happen" && 0);
+ HDassert("can't happen" && 0);
case H5T_NO_CLASS:
case H5T_NCLASSES:
- assert("invalid type" && 0);
+ HDassert("invalid type" && 0);
default:
- assert("not implemented yet" && 0);
+ HDassert("not implemented yet" && 0);
}
/* Commit (if we didn't convert this type to a VL string) */
@@ -3898,7 +3898,7 @@ H5T_get_size(const H5T_t *dt)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(dt);
+ HDassert(dt);
FUNC_LEAVE_NOAPI(dt->shared->size)
}
@@ -4004,9 +4004,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset)
#ifdef H5T_DEBUG
/* I don't quite trust the code above yet :-) --RPM */
for (u=0; u<dt1->shared->u.compnd.nmembs-1; u++) {
- assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name,
+ HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name,
dt1->shared->u.compnd.memb[idx1[u + 1]].name));
- assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name,
+ HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name,
dt2->shared->u.compnd.memb[idx2[u + 1]].name));
}
#endif
@@ -4084,9 +4084,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset)
#ifdef H5T_DEBUG
/* I don't quite trust the code above yet :-) --RPM */
for (u=0; u<dt1->shared->u.enumer.nmembs-1; u++) {
- assert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]],
+ HDassert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]],
dt1->shared->u.enumer.name[idx1[u+1]]));
- assert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]],
+ HDassert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]],
dt2->shared->u.enumer.name[idx2[u+1]]));
}
#endif
@@ -4142,10 +4142,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset)
break;
case H5T_VLEN:
- assert(dt1->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.type<H5T_VLEN_MAXTYPE);
- assert(dt2->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.type<H5T_VLEN_MAXTYPE);
- assert(dt1->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.loc<H5T_LOC_MAXLOC);
- assert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.loc<H5T_LOC_MAXLOC);
+ HDassert(dt1->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.type<H5T_VLEN_MAXTYPE);
+ HDassert(dt2->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.type<H5T_VLEN_MAXTYPE);
+ HDassert(dt1->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.loc<H5T_LOC_MAXLOC);
+ HDassert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.loc<H5T_LOC_MAXLOC);
/* Arbitrarily sort sequence VL datatypes before string VL datatypes */
if (dt1->shared->u.vlen.type==H5T_VLEN_SEQUENCE &&
@@ -4305,14 +4305,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset)
case H5R_BADTYPE:
case H5R_MAXTYPE:
- assert("invalid type" && 0);
+ HDassert("invalid type" && 0);
default:
- assert("not implemented yet" && 0);
+ HDassert("not implemented yet" && 0);
}
break;
default:
- assert("not implemented yet" && 0);
+ HDassert("not implemented yet" && 0);
}
break;
} /* end switch */
@@ -4638,7 +4638,7 @@ H5T_path_noop(const H5T_path_t *p)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(p);
+ HDassert(p);
FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE)))
} /* end H5T_path_noop() */
@@ -4707,7 +4707,7 @@ H5T_path_bkg(const H5T_path_t *p)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(p);
+ HDassert(p);
FUNC_LEAVE_NOAPI(p->cdata.need_bkg)
} /* end H5T_path_bkg() */
@@ -4923,7 +4923,7 @@ H5T_is_immutable(const H5T_t *dt)
FUNC_ENTER_NOAPI(FAIL)
- assert(dt);
+ HDassert(dt);
if(dt->shared->state == H5T_STATE_IMMUTABLE)
ret_value = TRUE;
@@ -4956,7 +4956,7 @@ H5T_is_named(const H5T_t *dt)
FUNC_ENTER_NOAPI(FAIL)
- assert(dt);
+ HDassert(dt);
if(dt->shared->state == H5T_STATE_OPEN || dt->shared->state == H5T_STATE_NAMED)
ret_value = TRUE;
@@ -4993,7 +4993,7 @@ H5T_get_ref_type(const H5T_t *dt)
FUNC_ENTER_NOAPI(H5R_BADTYPE)
- assert(dt);
+ HDassert(dt);
if(dt->shared->type==H5T_REFERENCE)
ret_value=dt->shared->u.atomic.u.r.rtype;
@@ -5027,7 +5027,7 @@ H5T_is_sensible(const H5T_t *dt)
FUNC_ENTER_NOAPI(FAIL)
- assert(dt);
+ HDassert(dt);
switch(dt->shared->type) {
case H5T_COMPOUND:
@@ -5092,8 +5092,8 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc)
FUNC_ENTER_NOAPI(FAIL)
- assert(dt);
- assert(loc>=H5T_LOC_BADLOC && loc<H5T_LOC_MAXLOC);
+ HDassert(dt);
+ HDassert(loc>=H5T_LOC_BADLOC && loc<H5T_LOC_MAXLOC);
/* Datatypes can't change in size if the force_conv flag is not set */
if(dt->shared->force_conv) {
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 4e5d1f0..c6cba52 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -189,7 +189,7 @@
* to the destination. SLU - 2005/06/29
*/
#define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (*(S) > (DT)(D_MAX)) { \
+ if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -198,7 +198,7 @@
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else if (*(S) < (DT)(D_MIN)) { \
+ } else if (*(S) < (ST)(D_MIN)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -211,16 +211,16 @@
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (*(S) > (DT)(D_MAX)) { \
+ if (*(S) > (ST)(D_MAX)) { \
*(D) = (DT)(D_MAX); \
- } else if (*(S) < (DT)(D_MIN)) { \
+ } else if (*(S) < (ST)(D_MIN)) { \
*(D) = (DT)(D_MIN); \
} else \
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (*(S) > (DT)(D_MAX)) { \
+ if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -233,7 +233,7 @@
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (*(S) > (DT)(D_MAX)) { \
+ if (*(S) > (ST)(D_MAX)) { \
*(D) = (DT)(D_MAX); \
} else \
*(D) = (DT)(*(S)); \
@@ -241,7 +241,7 @@
#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
- H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
@@ -266,7 +266,7 @@
#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
- H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
@@ -283,7 +283,7 @@
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if (sizeof(ST)==sizeof(DT) && *(S) > (D_MAX)) { \
+ if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \
*(D) = (D_MAX); \
} else \
*(D) = (DT)(*(S)); \
@@ -291,17 +291,17 @@
#define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
- H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
- H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
- H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
@@ -314,7 +314,7 @@
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) { \
+ } else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -329,7 +329,7 @@
#define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
if(*(S) < 0) \
*(D) = 0; \
- else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) \
+ else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \
*(D) = (DT)(D_MAX); \
else \
*(D) = (DT)(*(S)); \
@@ -337,17 +337,17 @@
#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
- H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
- H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
- H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
@@ -374,12 +374,12 @@
#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)==sizeof(DT)); \
- H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
/* Assumes memory format of unsigned & signed integers is same */ \
- if (*(S) > (DT)(D_MAX)) { \
+ if (*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -393,7 +393,7 @@
}
#define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
/* Assumes memory format of unsigned & signed integers is same */ \
- if(*(S) > (DT)(D_MAX)) \
+ if(*(S) > (ST)(D_MAX)) \
*(D) = (DT)(D_MAX); \
else \
*(D) = (DT)(*(S)); \
@@ -401,19 +401,19 @@
#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)==sizeof(DT)); \
- H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)<=sizeof(DT)); \
- H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
/* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN
* when an overflow occurs, use the 'float' infinity values.
*/
#define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if(*(S) > (DT)(D_MAX)) { \
+ if(*(S) > (ST)(D_MAX)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -422,7 +422,7 @@
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else if (*(S) < (DT)(D_MIN)) { \
+ } else if (*(S) < (ST)(D_MIN)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -435,9 +435,9 @@
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if(*(S) > (DT)(D_MAX)) \
+ if(*(S) > (ST)(D_MAX)) \
*(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \
- else if (*(S) < (DT)(D_MIN)) \
+ else if (*(S) < (ST)(D_MIN)) \
*(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \
else \
*(D) = (DT)(*(S)); \
@@ -445,7 +445,7 @@
#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
HDcompile_assert(sizeof(ST)>=sizeof(DT)); \
- H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \
}
#define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \
@@ -455,8 +455,8 @@
\
count = 0; \
for(u = 0; u < sizeof(TYP); u++) { \
- count = ((sizeof(TYP) - 1) - u) * 8; \
- p = ((V) >> count) & 0xff; \
+ count = (((unsigned)sizeof(TYP) - 1) - u) * 8; \
+ p = (unsigned char)((V) >> count); \
if(p > 0) { \
if(p & 0x80) \
count += 7; \
@@ -480,7 +480,7 @@
\
count = 0; \
for(u = 0; u < sizeof(TYP); u++) { \
- p = ((V) >> (u * 8)) & 0xff; \
+ p = (unsigned char)((V) >> (u * 8)); \
if(p > 0) { \
count = u * 8; \
\
@@ -536,7 +536,7 @@
}
#define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
/* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))).
@@ -544,11 +544,11 @@
* of "INT_MAX". Compilers do roundup making this value "INT_MAX+1". This branch
* is to check that situation and return exception for some compilers, mainly GCC.
* The branch if (*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) ==
- * (DT)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under
+ * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under
* the same situation the "int" doesn't overflow. SLU - 2005/9/12
*/
#define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if(*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == (DT)(D_MAX))) { \
+ if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -557,7 +557,7 @@
else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
- } else if (*(S) < (DT)(D_MIN)) { \
+ } else if (*(S) < (ST)(D_MIN)) { \
H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \
src_id, dst_id, S, D, cb_struct.user_data); \
if(except_ret == H5T_CONV_UNHANDLED) \
@@ -580,28 +580,31 @@
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
- if(*(S) > (DT)(D_MAX)) \
+ if(*(S) > (ST)(D_MAX)) \
*(D) = (DT)(D_MAX); \
- else if(*(S) < (DT)(D_MIN)) \
+ else if(*(S) < (ST)(D_MIN)) \
*(D) = (DT)(D_MIN); \
else \
*(D) = (DT)(*(S)); \
}
#define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
- H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
+ H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \
}
/* Since all "no exception" cores do the same thing (assign the value in the
* source location to the destination location, using casting), use one "core"
* to do them all.
*/
+#ifndef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \
*(D) = (DT)(*(S)); \
}
+#endif /* H5_WANT_DCONV_EXCEPTION */
+
/* The main part of every integer hardware conversion macro */
-#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \
+#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \
{ \
herr_t ret_value=SUCCEED; /* Return value */ \
\
@@ -609,13 +612,11 @@
\
{ \
size_t elmtno; /*element number */ \
- size_t sprec; /*source precision */ \
- size_t dprec; /*destination precision */ \
+ H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \
uint8_t *src_buf; /*'raw' source buffer */ \
uint8_t *dst_buf; /*'raw' destination buffer */ \
ST *src, *s; /*source buffer */ \
DT *dst, *d; /*destination buffer */ \
- H5T_class_t tclass; /*datatype's class */ \
H5T_t *st, *dt; /*datatype descriptors */ \
ST src_aligned; /*source aligned type */ \
DT dst_aligned; /*destination aligned type */ \
@@ -647,8 +648,8 @@
case H5T_CONV_CONV: \
/* Initialize source & destination strides */ \
if (buf_stride) { \
- assert(buf_stride>=sizeof(ST)); \
- assert(buf_stride>=sizeof(DT)); \
+ HDassert(buf_stride >= sizeof(ST)); \
+ HDassert(buf_stride >= sizeof(DT)); \
s_stride = d_stride = (ssize_t)buf_stride; \
} else { \
s_stride = sizeof(ST); \
@@ -659,11 +660,11 @@
s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \
((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \
/* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \
- s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
+ (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \
d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \
((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \
/* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \
- d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \
CI_INC_SRC(s_mv) \
CI_INC_DST(d_mv) \
\
@@ -679,19 +680,7 @@
if (NULL==(st=(H5T_t*)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL==(dt=(H5T_t*)H5I_object_verify(dst_id, H5I_DATATYPE))) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \
\
- /* Get source & destination precisions into a variable */ \
- tclass = st->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- sprec = st->shared->u.atomic.prec; \
- else \
- sprec = 1 + st->shared->u.atomic.u.f.msize; \
- tclass = dt->shared->type; \
- HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
- if(tclass == H5T_INTEGER) \
- dprec = dt->shared->u.atomic.prec; \
- else \
- dprec = 1 + dt->shared->u.atomic.u.f.msize; \
+ H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \
\
/* The outer loop of the type conversion macro, controlling which */ \
/* direction the buffer is walked */ \
@@ -701,21 +690,21 @@
/* Compute the number of "safe" destination elements at */ \
/* the end of the buffer (Those which don't overlap with */ \
/* any source elements at the beginning of the buffer) */ \
- safe=nelmts-(((nelmts*s_stride)+(d_stride-1))/d_stride); \
+ safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \
\
/* If we're down to the last few elements, just wrap up */ \
/* with a "real" reverse copy */ \
if(safe<2) { \
- src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-1)*s_stride); \
- dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-1)*d_stride); \
+ src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \
+ dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \
s_stride = -s_stride; \
d_stride = -d_stride; \
\
safe=nelmts; \
} /* end if */ \
else { \
- src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-safe)*s_stride); \
- dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-safe)*d_stride); \
+ src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \
+ dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \
} /* end else */ \
} /* end if */ \
else { \
@@ -757,6 +746,36 @@ done: \
FUNC_LEAVE_NOAPI(ret_value) \
}
+/* Declare the source & destination precision variables */
+#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC)
+
+#define H5T_CONV_DECL_PREC_Y \
+ size_t sprec; /*source precision */ \
+ size_t dprec; /*destination precision */ \
+ H5T_class_t tclass; /*datatype's class */
+
+#define H5T_CONV_DECL_PREC_N /*no precision variables */
+
+/* Initialize the source & destination precision variables */
+#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC)
+
+#define H5T_CONV_SET_PREC_Y \
+ /* Get source & destination precisions into a variable */ \
+ tclass = st->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ sprec = st->shared->u.atomic.prec; \
+ else \
+ sprec = 1 + st->shared->u.atomic.u.f.msize; \
+ tclass = dt->shared->type; \
+ HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \
+ if(tclass == H5T_INTEGER) \
+ dprec = dt->shared->u.atomic.prec; \
+ else \
+ dprec = 1 + dt->shared->u.atomic.u.f.msize;
+
+#define H5T_CONV_SET_PREC_N /*don't init precision variables */
+
/* Macro defining action on source data which needs to be aligned (before main action) */
#define H5T_CONV_LOOP_PRE_SALIGN(ST) { \
HDmemcpy(&src_aligned, src, sizeof(ST)); \
@@ -903,7 +922,7 @@ typedef struct H5T_conv_struct_t {
/* Conversion data for H5T__conv_enum() */
typedef struct H5T_enum_struct_t {
int base; /*lowest `in' value */
- int length; /*num elements in arrays */
+ unsigned length; /*num elements in arrays */
int *src2dst; /*map from src to dst index */
} H5T_enum_struct_t;
@@ -1085,6 +1104,15 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported")
break;
+ case H5T_NO_CLASS:
+ case H5T_TIME:
+ case H5T_STRING:
+ case H5T_OPAQUE:
+ case H5T_COMPOUND:
+ case H5T_ENUM:
+ case H5T_VLEN:
+ case H5T_ARRAY:
+ case H5T_NCLASSES:
default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported")
}
@@ -1402,6 +1430,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5_SWAP_BYTES(buf, 7, 8);
} /* end for */
break;
+
+ default:
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "invalid conversion size")
} /* end switch */
break;
@@ -1487,6 +1518,16 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} /* end if */
break;
+ case H5T_NO_CLASS:
+ case H5T_TIME:
+ case H5T_STRING:
+ case H5T_OPAQUE:
+ case H5T_COMPOUND:
+ case H5T_REFERENCE:
+ case H5T_ENUM:
+ case H5T_VLEN:
+ case H5T_ARRAY:
+ case H5T_NCLASSES:
default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported")
} /* end switch */
@@ -1543,7 +1584,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
{
uint8_t *buf = (uint8_t*)_buf;
H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */
- int direction; /*direction of traversal */
+ ssize_t direction; /*direction of traversal */
size_t elmtno; /*element number */
size_t olap; /*num overlapping elements */
size_t half_size; /*1/2 of total size for swapping*/
@@ -1620,6 +1661,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
src_rev = (uint8_t *)H5MM_calloc(src->shared->size);
/* The conversion loop */
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
for(elmtno = 0; elmtno < nelmts; elmtno++) {
/*
@@ -1703,6 +1747,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE);
break;
+ case H5T_PAD_ERROR:
+ case H5T_PAD_BACKGROUND:
+ case H5T_NPAD:
default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding")
} /* end switch */
@@ -1715,6 +1762,10 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
case H5T_PAD_ONE:
H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE);
break;
+
+ case H5T_PAD_ERROR:
+ case H5T_PAD_BACKGROUND:
+ case H5T_NPAD:
default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding")
} /* end switch */
@@ -1739,12 +1790,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if(d == dbuf)
HDmemcpy(dp, d, dst->shared->size);
if(buf_stride) {
- sp += direction * buf_stride;
- dp += direction * buf_stride;
+ sp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */
+ dp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */
} /* end if */
else {
- sp += direction * src->shared->size;
- dp += direction * dst->shared->size;
+ sp += direction * (ssize_t)src->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */
+ dp += direction * (ssize_t)dst->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */
} /* end else */
} /* end for */
@@ -2062,20 +2113,6 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata)
* Programmer: Robb Matzke
* Thursday, January 22, 1998
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is
- * non-zero then convert one value at each memory location
- * advancing BUF_STRIDE bytes each time; otherwise assume
- * both source and destination values are packed.
- *
- * Robb Matzke, 2000-05-17
- * Added the BKG_STRIDE argument to fix a design bug. If
- * BUF_STRIDE and BKG_STRIDE are both non-zero then each
- * data element converted will be placed temporarily at a
- * multiple of BKG_STRIDE in the BKG buffer; otherwise the
- * BKG buffer is assumed to be a packed array of destination
- * datatype.
*-------------------------------------------------------------------------
*/
herr_t
@@ -2091,7 +2128,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/
H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
size_t offset; /*byte offset wrt struct */
- size_t src_delta; /*source stride */
+ ssize_t src_delta; /*source stride */
+ ssize_t bkg_delta; /*background stride */
size_t elmtno;
unsigned u; /*counters */
int i; /*counters */
@@ -2149,17 +2187,22 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Direction of conversion and striding through background.
*/
if(buf_stride) {
- src_delta = buf_stride;
- if(!bkg_stride)
- bkg_stride = dst->shared->size;
+ H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t);
+ if(!bkg_stride) {
+ H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t);
+ } /* end if */
+ else
+ H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t);
} /* end if */
else if(dst->shared->size <= src->shared->size) {
- src_delta = src->shared->size;
- bkg_stride = dst->shared->size;
+ H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t);
+ H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t);
} /* end else-if */
else {
- src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/
- bkg_stride = -(int)dst->shared->size; /*overflow shouldn't be possible*/
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ src_delta = -(ssize_t)src->shared->size;
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
+ bkg_delta = -(ssize_t)dst->shared->size;
xbuf += (nelmts - 1) * src->shared->size;
xbkg += (nelmts - 1) * dst->shared->size;
} /* end else */
@@ -2204,7 +2247,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* yet). Then copy the member to the destination offset in the
* background buffer.
*/
- for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
+ H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int);
+ for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
if(src2dst[i] < 0)
continue; /*subsetting*/
src_memb = src->shared->u.compnd.memb + i;
@@ -2229,12 +2273,12 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Update pointers
*/
xbuf += src_delta;
- xbkg += bkg_stride;
+ xbkg += bkg_delta;
} /* end for */
- /* If the bkg_stride was set to -(dst->shared->size), make it positive now */
+ /* If the bkg_delta was set to -(dst->shared->size), make it positive now */
if(buf_stride == 0 && dst->shared->size > src->shared->size)
- bkg_stride = dst->shared->size;
+ H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t);
/*
* Copy the background buffer back into the in-place conversion
@@ -2243,7 +2287,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
for(xbuf = buf, xbkg = bkg, elmtno = 0; elmtno < nelmts; elmtno++) {
HDmemmove(xbuf, xbkg, dst->shared->size);
xbuf += buf_stride ? buf_stride : dst->shared->size;
- xbkg += bkg_stride;
+ xbkg += bkg_delta;
} /* end for */
break;
@@ -2390,7 +2434,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
if(dst_memb->size > src_memb->size)
offset += src_memb->size;
} /* end for */
- for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
+ H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int);
+ for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
if(src2dst[i] < 0)
continue;
src_memb = src->shared->u.compnd.memb + i;
@@ -2509,7 +2554,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
* is larger than the source) and them to their final position in the
* bkg buffer.
*/
- for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
+ H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int);
+ for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) {
if(src2dst[i] < 0)
continue;
src_memb = src->shared->u.compnd.memb + i;
@@ -2605,7 +2651,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
j++;
if(j >= dst->shared->u.enumer.nmembs)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type")
- priv->src2dst[i] = j;
+ priv->src2dst[i] = (int)j;
} /* end for */
/*
@@ -2634,45 +2680,44 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
* Because this is the optimized code, we won't fix it. It should still work in some
* situations. SLU - 2011/5/24)
*/
- if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) {
- for (i=0; i<src->shared->u.enumer.nmembs; i++) {
- if (1==src->shared->size) {
- n = *((signed char*)(src->shared->u.enumer.value+i));
- } else if (sizeof(short)==src->shared->size) {
- n = *((short*)(src->shared->u.enumer.value+i*src->shared->size));
- } else {
- n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));
- }
- if (0==i) {
+ if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) {
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if (sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
+ if(0 == i) {
domain[0] = domain[1] = n;
} else {
domain[0] = MIN(domain[0], n);
domain[1] = MAX(domain[1], n);
}
- }
+ } /* end for */
- length = (domain[1]-domain[0])+1;
- if (src->shared->u.enumer.nmembs<2 ||
- (double)length/src->shared->u.enumer.nmembs<1.2) {
+ HDassert(domain[1] >= domain[0]);
+ length = (unsigned)(domain[1] - domain[0]) + 1;
+ if(src->shared->u.enumer.nmembs < 2 ||
+ (double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) {
priv->base = domain[0];
priv->length = length;
- if (NULL==(map=(int *)H5MM_malloc(length*sizeof(int))))
+ if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- for (i=0; i<length; i++)
+ for(i = 0; i < length; i++)
map[i] = -1; /*entry unused*/
- for (i=0; i<src->shared->u.enumer.nmembs; i++) {
- if (1==src->shared->size) {
- n = *((signed char*)(src->shared->u.enumer.value+i));
- } else if (sizeof(short)==src->shared->size) {
- n = *((short*)(src->shared->u.enumer.value+i*src->shared->size));
- } else {
- n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));
- }
+ for(i = 0; i < src->shared->u.enumer.nmembs; i++) {
+ if(1 == src->shared->size)
+ n = *((signed char *)(src->shared->u.enumer.value + i));
+ else if(sizeof(short) == src->shared->size)
+ n = *((short *)(src->shared->u.enumer.value + i * src->shared->size));
+ else
+ n = *((int *)(src->shared->u.enumer.value + i * src->shared->size));
n -= priv->base;
- assert(n>=0 && n<priv->length);
- assert(map[n]<0);
+ HDassert(n >= 0 && (unsigned)n < priv->length);
+ HDassert(map[n] < 0);
map[n] = priv->src2dst[i];
- }
+ } /* end for */
/*
* Replace original src2dst array with our new one. The original
@@ -2718,9 +2763,8 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
{
uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */
H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
- H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/
uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */
- int src_delta, dst_delta; /*conversion strides */
+ ssize_t src_delta, dst_delta; /*conversion strides */
int n; /*src value cast as native int */
H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv);
H5P_genplist_t *plist; /*property list pointer */
@@ -2785,17 +2829,20 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Direction of conversion.
*/
if(buf_stride) {
- src_delta = dst_delta = (int)buf_stride;
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ src_delta = dst_delta = (ssize_t)buf_stride;
s = d = buf;
} else if(dst->shared->size <= src->shared->size) {
- src_delta = (int)src->shared->size; /*overflow shouldn't be possible*/
- dst_delta = (int)dst->shared->size; /*overflow shouldn't be possible*/
+ H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t);
+ H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t);
s = d = buf;
} else {
- src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/
- dst_delta = -(int)dst->shared->size; /*overflow shouldn't be possible*/
- s = buf + (nelmts-1) * src->shared->size;
- d = buf + (nelmts-1) * dst->shared->size;
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
+ src_delta = -(ssize_t)src->shared->size;
+ dst_delta = -(ssize_t)dst->shared->size;
+ s = buf + (nelmts - 1) * src->shared->size;
+ d = buf + (nelmts - 1) * dst->shared->size;
}
/* Get the plist structure */
@@ -2822,28 +2869,29 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
else
n = *((int*)s);
n -= priv->base;
- if(n < 0 || n >= priv->length || priv->src2dst[n] < 0) {
+ if(n < 0 || (unsigned)n >= priv->length || priv->src2dst[n] < 0) {
/*overflow*/
except_ret = H5T_CONV_UNHANDLED;
- if(cb_struct.func) { /*If user's exception handler is present, use it*/
+ /*If user's exception handler is present, use it*/
+ if(cb_struct.func)
except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id,
s, d, cb_struct.user_data);
- }
- if(except_ret == H5T_CONV_UNHANDLED) {
+ if(except_ret == H5T_CONV_UNHANDLED)
HDmemset(d, 0xff, dst->shared->size);
- } else if(except_ret == H5T_CONV_ABORT)
+ else if(except_ret == H5T_CONV_ABORT)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
- } else {
+ } else
HDmemcpy(d,
- dst->shared->u.enumer.value+priv->src2dst[n]*dst->shared->size,
+ dst->shared->u.enumer.value + (unsigned)priv->src2dst[n] * dst->shared->size,
dst->shared->size);
- }
- } else {
+ } /* end if */
+ else {
/* Use O(log N) lookup */
- int lt = 0;
- int rt = src->shared->u.enumer.nmembs;
- int md, cmp;
+ unsigned lt = 0;
+ unsigned rt = src->shared->u.enumer.nmembs;
+ unsigned md;
+ int cmp;
while(lt < rt) {
md = (lt + rt) / 2;
@@ -2858,22 +2906,23 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} /* end while */
if(lt >= rt) {
except_ret = H5T_CONV_UNHANDLED;
- if(cb_struct.func) { /*If user's exception handler is present, use it*/
+ /*If user's exception handler is present, use it*/
+ if(cb_struct.func)
except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id,
src, d, cb_struct.user_data);
- }
- if(except_ret == H5T_CONV_UNHANDLED) {
+ if(except_ret == H5T_CONV_UNHANDLED)
HDmemset(d, 0xff, dst->shared->size);
- } else if(except_ret == H5T_CONV_ABORT)
+ else if(except_ret == H5T_CONV_ABORT)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
} /* end if */
else {
+ HDassert(priv->src2dst[md] >= 0);
HDmemcpy(d,
- dst->shared->u.enumer.value+priv->src2dst[md]*dst->shared->size,
+ dst->shared->u.enumer.value + (unsigned)priv->src2dst[md] * dst->shared->size,
dst->shared->size);
} /* end else */
- }
+ } /* end else */
}
break;
@@ -2906,7 +2955,7 @@ done:
*/
herr_t
H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
- size_t buf_stride, size_t UNUSED bkg_stride, void *_buf,
+ size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf,
void UNUSED *bkg, hid_t UNUSED dxpl_id)
{
H5T_t *src, *dst; /*src and dst datatypes */
@@ -3017,7 +3066,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_path_t *tpath = NULL; /* Type conversion path */
hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */
hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */
- hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */
+ htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */
hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
H5T_t *src = NULL; /*source datatype */
H5T_t *dst = NULL; /*destination datatype */
@@ -3028,7 +3077,6 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
ssize_t s_stride, d_stride; /*src and dst strides */
ssize_t b_stride; /*bkg stride */
size_t safe; /*how many elements are safe to process in each pass */
- ssize_t seq_len; /*the number of elements in the current sequence*/
size_t bg_seq_len = 0;
size_t src_base_size, dst_base_size;/*source & destination base size*/
void *conv_buf = NULL; /*temporary conversion buffer */
@@ -3116,12 +3164,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
noop_conv = TRUE;
/* Check if we need a temporary buffer for this conversion */
- parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE);
+ if((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class")
if(tpath->cdata.need_bkg || parent_is_vlen) {
/* Set up initial background buffer */
tmp_buf_size = MAX(src_base_size, dst_base_size);
if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion")
} /* end if */
/* Get the allocation info */
@@ -3141,17 +3190,22 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
while(nelmts > 0) {
/* Check if we need to go backwards through the buffer */
if(d_stride > s_stride) {
+ /* Sanity check */
+ HDassert(s_stride > 0);
+ HDassert(d_stride > 0);
+ HDassert(b_stride >= 0);
+
/* Compute the number of "safe" destination elements at */
/* the end of the buffer (Those which don't overlap with */
/* any source elements at the beginning of the buffer) */
- safe = nelmts - (((nelmts * s_stride) + (d_stride - 1)) / d_stride);
+ safe = nelmts - (((nelmts * (size_t)s_stride) + ((size_t)d_stride - 1)) / (size_t)d_stride);
/* If we're down to the last few elements, just wrap up */
/* with a "real" reverse copy */
if(safe < 2) {
- s = (uint8_t *)buf + (nelmts - 1) * s_stride;
- d = (uint8_t *)buf + (nelmts - 1) * d_stride;
- b = (uint8_t *)bkg + (nelmts - 1) * b_stride;
+ s = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride;
+ d = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride;
+ b = (uint8_t *)bkg + (nelmts - 1) * (size_t)b_stride;
s_stride = -s_stride;
d_stride = -d_stride;
b_stride = -b_stride;
@@ -3159,9 +3213,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
safe = nelmts;
} /* end if */
else {
- s = (uint8_t *)buf + (nelmts - safe) * s_stride;
- d = (uint8_t *)buf + (nelmts - safe) * d_stride;
- b = (uint8_t *)bkg + (nelmts - safe) * b_stride;
+ s = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride;
+ d = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride;
+ b = (uint8_t *)bkg + (nelmts - safe) * (size_t)b_stride;
} /* end else */
} /* end if */
else {
@@ -3179,9 +3233,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'")
} /* end if */
else {
+ ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/
+ size_t seq_len; /* The number of elements in the current sequence*/
+
/* Get length of element sequences */
- if((seq_len = (*(src->shared->u.vlen.getlen))(s)) < 0)
+ if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect length")
+ seq_len = (size_t)sseq_len;
/* If we are reading from memory and there is no conversion, just get the pointer to sequence */
if(write_to_file && noop_conv) {
@@ -3230,7 +3288,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* If we are writing and there is a nested VL type, read
* the sequence into the background buffer */
if(nested) {
- uint8_t *tmp = b;
+ const uint8_t *tmp = b;
UINT32DECODE(tmp, bg_seq_len);
if(bg_seq_len > 0) {
@@ -3240,40 +3298,40 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion")
HDmemset(tmp_buf, 0, tmp_buf_size);
} /* end if */
- H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr));
- INT32DECODE(tmp, bg_hobjid.idx);
+ H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr));
+ UINT32DECODE(tmp, bg_hobjid.idx);
if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL))
HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer")
} /* end if */
/* If the sequence gets shorter, pad out the original sequence with zeros */
- if((ssize_t)bg_seq_len < seq_len)
+ if(bg_seq_len < seq_len)
HDmemset((uint8_t *)tmp_buf + dst_base_size * bg_seq_len, 0, (seq_len - bg_seq_len) * dst_base_size);
} /* end if */
/* Convert VL sequence */
- if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0)
+ if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed")
} /* end if */
/* Write sequence to destination location */
- if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, (size_t)seq_len, dst_base_size) < 0)
+ if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data")
if(!noop_conv) {
/* For nested VL case, free leftover heap objects from the deeper level if the length of new data elements is shorter than the old data elements.*/
- if(nested && seq_len < (ssize_t)bg_seq_len) {
+ if(nested && seq_len < bg_seq_len) {
size_t parent_seq_len;
- uint8_t *tmp_p;
+ const uint8_t *tmp;
size_t u;
/* TMP_P is reset each time in the loop because DST_BASE_SIZE may include some data in addition to VL info. - SLU */
for(u = seq_len; u < bg_seq_len; u++) {
- tmp_p = (uint8_t*)tmp_buf + u * dst_base_size;
- UINT32DECODE(tmp_p, parent_seq_len);
+ tmp = (uint8_t *)tmp_buf + u * dst_base_size;
+ UINT32DECODE(tmp, parent_seq_len);
if(parent_seq_len > 0) {
- H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp_p, &(parent_hobjid.addr));
- INT32DECODE(tmp_p, parent_hobjid.idx);
+ H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr));
+ UINT32DECODE(tmp, parent_hobjid.idx);
if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object")
} /* end if */
@@ -3343,7 +3401,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_t *src = NULL; /*source datatype */
H5T_t *dst = NULL; /*destination datatype */
uint8_t *sp, *dp; /*source and dest traversal ptrs */
- size_t src_delta, dst_delta; /*source & destination stride */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
int direction; /*direction of traversal */
size_t elmtno; /*element number counter */
unsigned u; /* local index variable */
@@ -3408,8 +3466,11 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/*
* Direction & size of buffer traversal.
*/
- src_delta = direction * (buf_stride ? buf_stride : src->shared->size);
- dst_delta = direction * (buf_stride ? buf_stride : dst->shared->size);
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
+ src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size);
+ dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size);
/* Set up conversion path for base elements */
if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) {
@@ -3499,6 +3560,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
{
H5T_t *src = NULL; /*source datatype */
H5T_t *dst = NULL; /*destination datatype */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
int direction; /*direction of traversal */
size_t elmtno; /*element number */
size_t half_size; /*half the type size */
@@ -3565,6 +3627,15 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
direction = -1;
}
+ /*
+ * Direction & size of buffer traversal.
+ */
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
+ src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size);
+ dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size);
+
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID")
@@ -3577,25 +3648,25 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
src_rev = (uint8_t*)H5MM_calloc(src->shared->size);
/* The conversion loop */
- for (elmtno=0; elmtno<nelmts; elmtno++) {
+ for(elmtno = 0; elmtno < nelmts; elmtno++) {
/*
* If the source and destination buffers overlap then use a
* temporary buffer for the destination.
*/
- if (direction>0) {
+ if(direction > 0) {
s = sp;
- d = elmtno<olap ? dbuf : dp;
+ d = elmtno < olap ? dbuf : dp;
} else {
s = sp;
- d = elmtno+olap >= nelmts ? dbuf : dp;
+ d = elmtno + olap >= nelmts ? dbuf : dp;
}
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
if (d==dbuf) {
- assert ((dp>=sp && dp<sp+src->shared->size) || (sp>=dp && sp<dp+dst->shared->size));
+ HDassert((dp>=sp && dp<sp+src->shared->size) || (sp>=dp && sp<dp+dst->shared->size));
} else {
- assert ((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp));
+ HDassert((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp));
}
#endif
@@ -3819,11 +3890,11 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Set padding areas in destination.
*/
if (dst->shared->u.atomic.offset>0) {
- assert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad);
+ HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad);
H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad));
}
if (dst->shared->u.atomic.offset+dst->shared->u.atomic.prec!=8*dst->shared->size) {
- assert (H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad);
+ HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad);
H5T__bit_set (d, dst->shared->u.atomic.offset+dst->shared->u.atomic.prec,
8*dst->shared->size - (dst->shared->u.atomic.offset+ dst->shared->u.atomic.prec),
(hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.msb_pad));
@@ -3846,16 +3917,13 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* If we had used a temporary buffer for the destination then we
* should copy the value to the true destination buffer.
*/
- if (d==dbuf)
- HDmemcpy (dp, d, dst->shared->size);
- if (buf_stride) {
- sp += direction * buf_stride;
- dp += direction * buf_stride;
- } else {
- sp += direction * src->shared->size;
- dp += direction * dst->shared->size;
- }
- }
+ if(d==dbuf)
+ HDmemcpy(dp, d, dst->shared->size);
+
+ /* Advance source & destination pointers by delta amounts */
+ sp += src_delta;
+ dp += dst_delta;
+ } /* end for */
break;
@@ -3911,6 +3979,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_t *dst_p; /*destination datatype */
H5T_atomic_t src; /*atomic source info */
H5T_atomic_t dst; /*atomic destination info */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
int direction; /*forward or backward traversal */
size_t elmtno; /*element number */
size_t half_size; /*half the type size */
@@ -3923,11 +3992,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
- hssize_t expo; /*exponent */
+ int64_t expo; /*exponent */
hssize_t expo_max; /*maximum possible dst exponent */
size_t msize = 0; /*useful size of mantissa in src*/
size_t mpos; /*offset to useful mant is src */
- hssize_t sign; /*source sign bit value */
+ uint64_t sign; /*source sign bit value */
size_t mrsh; /*amount to right shift mantissa*/
hbool_t carry = 0; /*carry after rounding mantissa */
size_t i; /*miscellaneous counters */
@@ -3995,6 +4064,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
direction = -1;
}
+ /*
+ * Direction & size of buffer traversal.
+ */
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(src_p->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst_p->shared->size, size_t, ssize_t);
+ src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size);
+ dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size);
+
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID")
@@ -4026,10 +4104,10 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
if (d==dbuf) {
- assert ((dp>=sp && dp<sp+src_p->shared->size) ||
+ HDassert((dp>=sp && dp<sp+src_p->shared->size) ||
(sp>=dp && sp<dp+dst_p->shared->size));
} else {
- assert ((dp<sp && dp+dst_p->shared->size<=sp) ||
+ HDassert((dp<sp && dp+dst_p->shared->size<=sp) ||
(sp<dp && sp+src_p->shared->size<=dp));
}
#endif
@@ -4048,7 +4126,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
} else if (H5T_ORDER_VAX==src.order) {
tsize = src_p->shared->size;
- assert(0 == tsize % 2);
+ HDassert(0 == tsize % 2);
for (i = 0; i < tsize; i += 4) {
tmp1 = s[i];
@@ -4146,9 +4224,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
goto padding;
-#ifdef H5_VMS
- } /*Temporary solution to handle VAX special values*/
-#else /*H5_VMS*/
+#ifndef H5_VMS /*Temporary solution to handle VAX special values*/
} else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize,
H5T_BIT_LSB, FALSE)<0) {
/* NaN */
@@ -4173,15 +4249,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception")
goto padding;
- }
#endif /*H5_VMS*/
+ }
/*
* Get the exponent as an unsigned quantity from the section of
* the source bit field where it's located. Don't worry about
* the exponent bias yet.
*/
- expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize);
+ expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize);
if(expo==0)
denormalized=TRUE;
@@ -4193,10 +4269,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
implied = 1;
mpos = src.u.f.mpos;
mrsh = 0;
- if (0==expo || H5T_NORM_NONE==src.u.f.norm) {
- if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize,
- H5T_BIT_MSB, TRUE))>0) {
- msize = bitno;
+ if(0 == expo || H5T_NORM_NONE == src.u.f.norm) {
+ if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) {
+ msize = (size_t)bitno;
} else if (0==bitno) {
msize = 1;
H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE);
@@ -4204,8 +4279,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} else if (H5T_NORM_IMPLIED==src.u.f.norm) {
msize = src.u.f.msize;
} else {
- assert("normalization method not implemented yet" && 0);
- HDabort();
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet")
}
/*
@@ -4219,13 +4293,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* the source exponent bias.
*/
if (0==expo || H5T_NORM_NONE==src.u.f.norm) {
- assert(bitno>=0);
- expo -= (src.u.f.ebias-1) + (src.u.f.msize-bitno);
+ HDassert(bitno>=0);
+ expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno));
} else if (H5T_NORM_IMPLIED==src.u.f.norm) {
- expo -= src.u.f.ebias;
+ expo -= (int64_t)src.u.f.ebias;
} else {
- assert("normalization method not implemented yet" && 0);
- HDabort();
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet")
}
/*
@@ -4240,7 +4313,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* bias and clipping by the minimum and maximum possible
* destination exponent values.
*/
- expo += dst.u.f.ebias;
+ expo += (int64_t)dst.u.f.ebias;
if (expo < -(hssize_t)(dst.u.f.msize)) {
/* The exponent is way too small. Result is zero. */
@@ -4254,7 +4327,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* accomodate that value. The mantissa of course is no
* longer normalized.
*/
- H5_ASSIGN_OVERFLOW(mrsh,(mrsh+1-expo),hssize_t,size_t);
+ mrsh += (size_t)(1 - expo);
expo = 0;
denormalized=TRUE;
} else if (expo>=expo_max) {
@@ -4293,20 +4366,20 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* mantissa bit is `1', else it is `10' binary.
*/
if (msize>0 && mrsh<=dst.u.f.msize && mrsh+msize>dst.u.f.msize) {
- bitno = (ssize_t)(mrsh+msize - dst.u.f.msize);
- assert(bitno>=0 && (size_t)bitno<=msize);
- /*If the 1st bit being cut off is set and source isn't denormalized.*/
- if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) {
- /*Don't do rounding if exponent is 111...110 and mantissa is 111...11.
- *To do rounding and increment exponent in this case will create an infinity value.*/
- if((H5T__bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || expo<expo_max-1)) {
- carry = H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno);
- if (carry)
+ bitno = (ssize_t)(mrsh + msize - dst.u.f.msize);
+ HDassert(bitno >= 0 && (size_t)bitno <= msize);
+ /* If the 1st bit being cut off is set and source isn't denormalized.*/
+ if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) {
+ /* Don't do rounding if exponent is 111...110 and mantissa is 111...11.
+ * To do rounding and increment exponent in this case will create an infinity value.*/
+ if((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, FALSE) >= 0 || expo < expo_max - 1)) {
+ carry = (hbool_t)H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno);
+ if(carry)
implied = 2;
}
- } else if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && denormalized)
- /*For either source or destination, denormalized value doesn't increment carry.*/
- H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno);
+ } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized)
+ /* For either source or destination, denormalized value doesn't increment carry.*/
+ H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno);
}
else
carry=0;
@@ -4383,11 +4456,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Set external padding areas
*/
if (dst.offset>0) {
- assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad);
+ HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad);
H5T__bit_set (d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad));
}
if (dst.offset+dst.prec!=8*dst_p->shared->size) {
- assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad);
+ HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad);
H5T__bit_set (d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+dst.prec),
(hbool_t)(H5T_PAD_ONE==dst.msb_pad));
}
@@ -4405,7 +4478,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
} else if (H5T_ORDER_VAX==dst.order && reverse) {
tsize = dst_p->shared->size;
- assert(0 == tsize % 2);
+ HDassert(0 == tsize % 2);
for (i = 0; i < tsize; i += 4) {
tmp1 = d[i];
@@ -4424,15 +4497,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* should copy the value to the true destination buffer.
*/
next:
- if (d==dbuf)
- HDmemcpy (dp, d, dst_p->shared->size);
- if (buf_stride) {
- sp += direction * buf_stride;
- dp += direction * buf_stride;
- } else {
- sp += direction * src_p->shared->size;
- dp += direction * dst_p->shared->size;
- }
+ if(d == dbuf)
+ HDmemcpy(dp, d, dst_p->shared->size);
+
+ /* Advance source & destination pointers by delta amounts */
+ sp += src_delta;
+ dp += dst_delta;
}
break;
@@ -4478,7 +4548,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
{
H5T_t *src=NULL; /*source datatype */
H5T_t *dst=NULL; /*destination datatype */
- int direction; /*direction of traversal */
+ ssize_t src_delta, dst_delta; /*source & destination stride */
+ int direction; /*direction of traversal */
size_t elmtno; /*element number */
size_t olap; /*num overlapping elements */
size_t nchars=0; /*number of characters copied */
@@ -4503,8 +4574,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset)
|| (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF")
- if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD ||
- dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD)
+ if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR ||
+ dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NSTR)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding")
cdata->need_bkg = H5T_BKG_NO;
break;
@@ -4545,6 +4616,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
direction = -1;
}
+ /*
+ * Direction & size of buffer traversal.
+ */
+ H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t);
+ src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size);
+ dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size);
+
/* Allocate the overlap buffer */
if(NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion")
@@ -4566,12 +4646,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
if (src->shared->size==dst->shared->size || buf_stride) {
- assert(s==d);
+ HDassert(s==d);
} else if (d==dbuf) {
- assert((dp>=sp && dp<sp+src->shared->size) ||
+ HDassert((dp>=sp && dp<sp+src->shared->size) ||
(sp>=dp && sp<dp+dst->shared->size));
} else {
- assert((dp<sp && dp+dst->shared->size<=sp) ||
+ HDassert((dp<sp && dp+dst->shared->size<=sp) ||
(sp<dp && sp+src->shared->size<=dp));
}
#endif
@@ -4617,6 +4697,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
case H5T_STR_RESERVED_14:
case H5T_STR_RESERVED_15:
case H5T_STR_ERROR:
+ default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source string padding method not supported")
} /* end switch */
@@ -4652,6 +4733,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
case H5T_STR_RESERVED_14:
case H5T_STR_RESERVED_15:
case H5T_STR_ERROR:
+ default:
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination string padding method not supported")
} /* end switch */
@@ -4659,15 +4741,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* If we used a temporary buffer for the destination then we
* should copy the value to the true destination buffer.
*/
- if (d==dbuf)
+ if(d == dbuf)
HDmemcpy(dp, d, dst->shared->size);
- if (buf_stride) {
- sp += direction * buf_stride;
- dp += direction * buf_stride;
- } else {
- sp += direction * src->shared->size;
- dp += direction * dst->shared->size;
- }
+
+ /* Advance source & destination pointers by delta amounts */
+ sp += src_delta;
+ dp += dst_delta;
} /* end for */
break;
@@ -8871,10 +8950,10 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
if (d==dbuf) {
- assert ((dp>=sp && dp<sp+src_p->shared->size) ||
+ HDassert((dp>=sp && dp<sp+src_p->shared->size) ||
(sp>=dp && sp<dp+dst_p->shared->size));
} else {
- assert ((dp<sp && dp+dst_p->shared->size<=sp) ||
+ HDassert((dp<sp && dp+dst_p->shared->size<=sp) ||
(sp<dp && sp+src_p->shared->size<=dp));
}
#endif
@@ -8892,7 +8971,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
} else if (H5T_ORDER_VAX==src.order) {
tsize = src_p->shared->size;
- assert(0 == tsize % 2);
+ HDassert(0 == tsize % 2);
for (i = 0; i < tsize; i += 4) {
tmp1 = s[i];
@@ -9050,8 +9129,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
} else if (H5T_NORM_IMPLIED==src.u.f.norm) {
expo -= src.u.f.ebias;
} else {
- assert("normalization method not implemented yet" && 0);
- HDabort();
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet")
}
/*
@@ -9253,11 +9331,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Set padding areas in destination.
*/
if (dst.offset>0) {
- assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad);
+ HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad);
H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad));
}
if (dst.offset+dst.prec!=8*dst_p->shared->size) {
- assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad);
+ HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad);
H5T__bit_set(d, dst.offset+dst.prec,
8*dst_p->shared->size - (dst.offset+ dst.prec),
(hbool_t)(H5T_PAD_ONE==dst.msb_pad));
@@ -9467,10 +9545,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
if (d==dbuf) {
- assert ((dp>=sp && dp<sp+src_p->shared->size) ||
+ HDassert((dp>=sp && dp<sp+src_p->shared->size) ||
(sp>=dp && sp<dp+dst_p->shared->size));
} else {
- assert ((dp<sp && dp+dst_p->shared->size<=sp) ||
+ HDassert((dp<sp && dp+dst_p->shared->size<=sp) ||
(sp<dp && sp+src_p->shared->size<=dp));
}
#endif
@@ -9556,8 +9634,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if (H5T_NORM_NONE==dst.u.f.norm || H5T_NORM_IMPLIED==dst.u.f.norm) {
expo = first + dst.u.f.ebias;
} else {
- assert("normalization method not implemented yet" && 0);
- HDabort();
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet")
}
/* Handle mantissa part here */
@@ -9637,7 +9714,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if the exponent is too big */
- expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1;
+ expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1;
if(expo > expo_max) { /*overflows*/
if(cb_struct.func) { /*user's exception handler. Reverse back source order*/
@@ -9695,7 +9772,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
}
} else if (H5T_ORDER_VAX==dst.order && reverse) {
tsize = dst_p->shared->size;
- assert(0 == tsize % 2);
+ HDassert(0 == tsize % 2);
for (i = 0; i < tsize; i += 4) {
tmp1 = d[i];
@@ -9770,8 +9847,8 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(s);
- assert(size);
+ HDassert(s);
+ HDassert(size);
if (H5T_ORDER_VAX == order) {
for (i = 0; i < size; i += 2) {
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index 8e4e8a2..2b7563b 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -127,14 +127,14 @@ H5T__enum_create(const H5T_t *parent)
FUNC_ENTER_PACKAGE
- assert(parent);
+ HDassert(parent);
/* Build new type */
if(NULL == (ret_value = H5T__alloc()))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
ret_value->shared->type = H5T_ENUM;
ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL);
- assert(ret_value->shared->parent);
+ HDassert(ret_value->shared->parent);
ret_value->shared->size = ret_value->shared->parent->shared->size;
done:
@@ -220,9 +220,9 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value)
FUNC_ENTER_PACKAGE
- assert(dt);
- assert(name && *name);
- assert(value);
+ HDassert(dt);
+ HDassert(name && *name);
+ HDassert(value);
/* The name and value had better not already exist */
for (i=0; i<dt->shared->u.enumer.nmembs; i++) {
@@ -322,8 +322,8 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/)
{
FUNC_ENTER_PACKAGE_NOERR
- assert(dt);
- assert(value);
+ HDassert(dt);
+ HDassert(value);
HDmemcpy(value, dt->shared->u.enumer.value + membno*dt->shared->size, dt->shared->size);
@@ -563,9 +563,9 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/)
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
- assert(dt && H5T_ENUM==dt->shared->type);
- assert(name && *name);
- assert(value);
+ HDassert(dt && H5T_ENUM==dt->shared->type);
+ HDassert(name && *name);
+ HDassert(value);
/* Sanity check */
if (dt->shared->u.enumer.nmembs == 0)
diff --git a/src/H5Tfields.c b/src/H5Tfields.c
index 163bab3..0e0d4e7 100644
--- a/src/H5Tfields.c
+++ b/src/H5Tfields.c
@@ -202,7 +202,7 @@ H5T__get_member_name(H5T_t const *dt, unsigned membno)
FUNC_ENTER_PACKAGE
- assert(dt);
+ HDassert(dt);
switch (dt->shared->type) {
case H5T_COMPOUND:
@@ -435,8 +435,8 @@ H5T__sort_name(const H5T_t *dt, int *map)
FUNC_ENTER_PACKAGE_NOERR
/* Check args */
- assert(dt);
- assert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type);
+ HDassert(dt);
+ HDassert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type);
/* Use a bubble sort because we can short circuit */
if (H5T_COMPOUND==dt->shared->type) {
@@ -462,7 +462,7 @@ H5T__sort_name(const H5T_t *dt, int *map)
#ifndef NDEBUG
/* I never trust a sort :-) -RPM */
for (i=0; i<nmembs-1; i++) {
- assert(HDstrcmp(dt->shared->u.compnd.memb[i].name,
+ HDassert(HDstrcmp(dt->shared->u.compnd.memb[i].name,
dt->shared->u.compnd.memb[i+1].name)<0);
}
#endif
@@ -472,7 +472,7 @@ H5T__sort_name(const H5T_t *dt, int *map)
dt->shared->u.enumer.sorted = H5T_SORT_NAME;
nmembs = dt->shared->u.enumer.nmembs;
size = dt->shared->size;
- assert(size<=sizeof(tbuf));
+ HDassert(size<=sizeof(tbuf));
for (i=nmembs-1, swapped=TRUE; i>0 && swapped; --i) {
for (j=0, swapped=FALSE; j<i; j++) {
if (HDstrcmp(dt->shared->u.enumer.name[j],
@@ -502,7 +502,7 @@ H5T__sort_name(const H5T_t *dt, int *map)
#ifndef NDEBUG
/* I never trust a sort :-) -RPM */
for (i=0; i<nmembs-1; i++)
- assert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0);
+ HDassert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0);
#endif
}
}
diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c
index 51737eb..b2401d4 100644
--- a/src/H5Tfixed.c
+++ b/src/H5Tfixed.c
@@ -113,7 +113,7 @@ H5T_get_sign(H5T_t const *dt)
FUNC_ENTER_NOAPI(H5T_SGN_ERROR)
- assert(dt);
+ HDassert(dt);
/* Defer to parent */
while(dt->shared->parent)
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index b9192f9..1a97f39 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -172,7 +172,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
FUNC_ENTER_NOAPI(NULL)
- assert(dtype);
+ HDassert(dtype);
if(H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, FALSE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class")
@@ -355,6 +355,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
case H5T_ENUM:
{
+ H5T_path_t *tpath; /* Type conversion info */
hid_t super_type_id, nat_super_type_id;
/* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */
@@ -380,6 +381,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
if(NULL == (new_type = H5T__enum_create(nat_super_type)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type")
+ /* Find the conversion function */
+ if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5P_DEFAULT, FALSE)))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and dst data types")
+
/* Retrieve member info and insert members into new enum type */
if((snmemb = H5T_get_nmembers(dtype)) <= 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumerate data type doesn't have any member")
@@ -391,7 +396,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value")
HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type));
- if(H5Tconvert(super_type_id, nat_super_type_id, (size_t)1, memb_value, NULL, H5P_DEFAULT) < 0)
+ if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL, H5P_DEFAULT) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value")
if(H5T__enum_insert(new_type, memb_name, memb_value) < 0)
@@ -402,10 +407,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
tmp_memb_value = H5MM_xfree(tmp_memb_value);
/* Close base type */
- if(H5Tclose(nat_super_type_id) < 0)
+ if(H5I_dec_app_ref(nat_super_type_id) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
- /* Close super type */
- if(H5Tclose(super_type_id) < 0)
+ /* Close super type */
+ if(H5I_dec_app_ref(super_type_id) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
ret_value = new_type;
@@ -571,19 +576,19 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
FUNC_ENTER_NOAPI(NULL)
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
- if(prec <= H5Tget_precision(H5T_NATIVE_SCHAR)) {
+ if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) {
match = H5T_NATIVE_INT_MATCH_CHAR;
native_size = sizeof(char);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) {
+ } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) {
match = H5T_NATIVE_INT_MATCH_SHORT;
native_size = sizeof(short);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) {
+ } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) {
match = H5T_NATIVE_INT_MATCH_INT;
native_size = sizeof(int);
- } else if(prec <= H5Tget_precision(H5T_NATIVE_LONG)) {
+ } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) {
match = H5T_NATIVE_INT_MATCH_LONG;
native_size = sizeof(long);
- } else if(prec <= H5Tget_precision(H5T_NATIVE_LLONG)) {
+ } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LLONG_g))) {
match = H5T_NATIVE_INT_MATCH_LLONG;
native_size = sizeof(long long);
} else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */
@@ -591,16 +596,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
native_size = sizeof(long long);
}
} else if(direction == H5T_DIR_DESCEND) {
- if(prec > H5Tget_precision(H5T_NATIVE_LONG)) {
+ if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) {
match = H5T_NATIVE_INT_MATCH_LLONG;
native_size = sizeof(long long);
- } else if(prec > H5Tget_precision(H5T_NATIVE_INT)) {
+ } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) {
match = H5T_NATIVE_INT_MATCH_LONG;
native_size = sizeof(long);
- } else if(prec > H5Tget_precision(H5T_NATIVE_SHORT)) {
+ } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) {
match = H5T_NATIVE_INT_MATCH_INT;
native_size = sizeof(int);
- } else if(prec > H5Tget_precision(H5T_NATIVE_SCHAR)) {
+ } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) {
match = H5T_NATIVE_INT_MATCH_SHORT;
native_size = sizeof(short);
} else {
@@ -710,7 +715,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
FUNC_ENTER_NOAPI(NULL)
- assert(size>0);
+ HDassert(size>0);
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
if(size<=sizeof(float)) {
@@ -786,7 +791,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
} /* end switch */
/* Create new native type */
- assert(tid>=0);
+ HDassert(tid>=0);
if(NULL==(dt=(H5T_t *)H5I_object(tid)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type")
if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL)
@@ -829,19 +834,19 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a
FUNC_ENTER_NOAPI(NULL)
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
- if(prec<=H5Tget_precision(H5T_NATIVE_B8)) {
+ if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) {
tid = H5T_NATIVE_B8;
native_size = 1;
align = H5T_NATIVE_UINT8_ALIGN_g;
- } else if(prec<=H5Tget_precision(H5T_NATIVE_B16)) {
+ } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) {
tid = H5T_NATIVE_B16;
native_size = 2;
align = H5T_NATIVE_UINT16_ALIGN_g;
- } else if(prec<=H5Tget_precision(H5T_NATIVE_B32)) {
+ } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) {
tid = H5T_NATIVE_B32;
native_size = 4;
align = H5T_NATIVE_UINT32_ALIGN_g;
- } else if(prec<=H5Tget_precision(H5T_NATIVE_B64)) {
+ } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B64_g))) {
tid = H5T_NATIVE_B64;
native_size = 8;
align = H5T_NATIVE_UINT64_ALIGN_g;
@@ -851,15 +856,15 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a
align = H5T_NATIVE_UINT64_ALIGN_g;
}
} else if(direction == H5T_DIR_DESCEND) {
- if(prec>H5Tget_precision(H5T_NATIVE_B32)) {
+ if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) {
tid = H5T_NATIVE_B64;
native_size = 8;
align = H5T_NATIVE_UINT64_ALIGN_g;
- } else if(prec>H5Tget_precision(H5T_NATIVE_B16)) {
+ } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) {
tid = H5T_NATIVE_B32;
native_size = 4;
align = H5T_NATIVE_UINT32_ALIGN_g;
- } else if(prec>H5Tget_precision(H5T_NATIVE_B8)) {
+ } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) {
tid = H5T_NATIVE_B16;
native_size = 2;
align = H5T_NATIVE_UINT16_ALIGN_g;
@@ -871,7 +876,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a
}
/* Create new native type */
- assert(tid>=0);
+ HDassert(tid>=0);
if(NULL==(dt=(H5T_t *)H5I_object(tid)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type")
diff --git a/src/H5Toffset.c b/src/H5Toffset.c
index bea8d2b..ea4b3b5 100644
--- a/src/H5Toffset.c
+++ b/src/H5Toffset.c
@@ -272,12 +272,12 @@ H5T_set_offset(const H5T_t *dt, size_t offset)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(dt);
- assert(H5T_STRING!=dt->shared->type || 0==offset);
- assert(H5T_REFERENCE!=dt->shared->type);
- assert(H5T_OPAQUE!=dt->shared->type);
- assert(H5T_COMPOUND!=dt->shared->type);
- assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
+ HDassert(dt);
+ HDassert(H5T_STRING!=dt->shared->type || 0==offset);
+ HDassert(H5T_REFERENCE!=dt->shared->type);
+ HDassert(H5T_OPAQUE!=dt->shared->type);
+ HDassert(H5T_COMPOUND!=dt->shared->type);
+ HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
if (dt->shared->parent) {
if (H5T_set_offset(dt->shared->parent, offset)<0)
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c
index 671ae2e..6725165 100644
--- a/src/H5Tprecis.c
+++ b/src/H5Tprecis.c
@@ -238,12 +238,12 @@ H5T_set_precision(const H5T_t *dt, size_t prec)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(dt);
- assert(prec>0);
- assert(H5T_OPAQUE!=dt->shared->type);
- assert(H5T_COMPOUND!=dt->shared->type);
- assert(H5T_STRING!=dt->shared->type);
- assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
+ HDassert(dt);
+ HDassert(prec>0);
+ HDassert(H5T_OPAQUE!=dt->shared->type);
+ HDassert(H5T_COMPOUND!=dt->shared->type);
+ HDassert(H5T_STRING!=dt->shared->type);
+ HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs));
if (dt->shared->parent) {
if (H5T_set_precision(dt->shared->parent, prec)<0)
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index f497d1e..52a2cde 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -882,7 +882,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED
/* Get the heap information */
H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr));
- INT32DECODE(vl,hobjid.idx);
+ UINT32DECODE(vl,hobjid.idx);
/* Check if this sequence actually has any data */
if(hobjid.addr>0) {
@@ -935,7 +935,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED
/* Get heap information */
H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr));
- INT32DECODE(bg, bg_hobjid.idx);
+ UINT32DECODE(bg, bg_hobjid.idx);
/* Free heap object for old data */
if(bg_hobjid.addr > 0) {
@@ -955,7 +955,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED
/* Encode the heap information */
H5F_addr_encode(f, &vl, hobjid.addr);
- INT32ENCODE(vl, hobjid.idx);
+ UINT32ENCODE(vl, hobjid.idx);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -997,7 +997,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg)
/* Get heap information */
H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr));
- INT32DECODE(bg, bg_hobjid.idx);
+ UINT32DECODE(bg, bg_hobjid.idx);
/* Free heap object for old data */
if(bg_hobjid.addr > 0) {
@@ -1012,7 +1012,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg)
/* Encode the "nil" heap pointer information */
H5F_addr_encode(f, &vl, (haddr_t)0);
- INT32ENCODE(vl, 0);
+ UINT32ENCODE(vl, 0);
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5V.c b/src/H5V.c
index 2697822..3277b90 100644
--- a/src/H5V.c
+++ b/src/H5V.c
@@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
- assert(1 == H5V_vector_reduce_product(0, NULL));
+ HDassert(1 == H5V_vector_reduce_product(0, NULL));
/*
* Combine adjacent memory accesses
@@ -127,8 +127,8 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
- assert(1 == H5V_vector_reduce_product(0, NULL));
- assert (*elmt_size>0);
+ HDassert(1 == H5V_vector_reduce_product(0, NULL));
+ HDassert(*elmt_size>0);
/*
* Combine adjacent memory accesses
@@ -267,48 +267,48 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(n <= H5V_HYPER_NDIMS);
- assert(size);
- assert(total_size);
- assert(stride);
+ HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(size);
+ HDassert(total_size);
+ HDassert(stride);
/* init */
- assert(n>0);
+ HDassert(n>0);
stride[n-1] = 1;
skip = offset ? offset[n-1] : 0;
switch(n) {
case 2: /* 1-D dataset */
- assert (total_size[1]>=size[1]);
+ HDassert(total_size[1]>=size[1]);
stride[0] = total_size[1]-size[1]; /*overflow checked*/
acc = total_size[1];
skip += acc * (offset ? offset[0] : 0);
break;
case 3: /* 2-D dataset */
- assert (total_size[2]>=size[2]);
+ HDassert(total_size[2]>=size[2]);
stride[1] = total_size[2]-size[2]; /*overflow checked*/
acc = total_size[2];
skip += acc * (offset ? (hsize_t)offset[1] : 0);
- assert (total_size[1]>=size[1]);
+ HDassert(total_size[1]>=size[1]);
stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/
acc *= total_size[1];
skip += acc * (offset ? (hsize_t)offset[0] : 0);
break;
case 4: /* 3-D dataset */
- assert (total_size[3]>=size[3]);
+ HDassert(total_size[3]>=size[3]);
stride[2] = total_size[3]-size[3]; /*overflow checked*/
acc = total_size[3];
skip += acc * (offset ? (hsize_t)offset[2] : 0);
- assert (total_size[2]>=size[2]);
+ HDassert(total_size[2]>=size[2]);
stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/
acc *= total_size[2];
skip += acc * (offset ? (hsize_t)offset[1] : 0);
- assert (total_size[1]>=size[1]);
+ HDassert(total_size[1]>=size[1]);
stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/
acc *= total_size[1];
skip += acc * (offset ? (hsize_t)offset[0] : 0);
@@ -317,7 +317,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
default:
/* others */
for (i=(int)(n-2), acc=1; i>=0; --i) {
- assert (total_size[i+1]>=size[i+1]);
+ HDassert(total_size[i+1]>=size[i+1]);
stride[i] = acc * (total_size[i+1] - size[i+1]); /*overflow checked*/
acc *= total_size[i+1];
skip += acc * (offset ? (hsize_t)offset[i] : 0);
@@ -474,14 +474,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(n > 0 && n <= H5V_HYPER_NDIMS);
- assert(_size);
- assert(total_size);
- assert(dst);
+ HDassert(n > 0 && n <= H5V_HYPER_NDIMS);
+ HDassert(_size);
+ HDassert(total_size);
+ HDassert(dst);
#ifndef NDEBUG
for (u = 0; u < n; u++) {
- assert(_size[u] > 0);
- assert(total_size[u] > 0);
+ HDassert(_size[u] > 0);
+ HDassert(total_size[u] > 0);
}
#endif
@@ -560,17 +560,17 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(n > 0 && n <= H5V_HYPER_NDIMS);
- assert(_size);
- assert(dst_size);
- assert(src_size);
- assert(dst);
- assert(src);
+ HDassert(n > 0 && n <= H5V_HYPER_NDIMS);
+ HDassert(_size);
+ HDassert(dst_size);
+ HDassert(src_size);
+ HDassert(dst);
+ HDassert(src);
#ifndef NDEBUG
for (u = 0; u < n; u++) {
- assert(_size[u] > 0);
- assert(dst_size[u] > 0);
- assert(src_size[u] > 0);
+ HDassert(_size[u] > 0);
+ HDassert(dst_size[u] > 0);
+ HDassert(src_size[u] > 0);
}
#endif
@@ -589,7 +589,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
int ii; /*counter */
/* init */
- assert(n>0);
+ HDassert(n>0);
dst_stride[n-1] = 1;
src_stride[n-1] = 1;
dst_start = dst_offset ? dst_offset[n-1] : 0;
@@ -598,8 +598,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
/* Unroll loop for common cases */
switch(n) {
case 2:
- assert (dst_size[1]>=size[1]);
- assert (src_size[1]>=size[1]);
+ HDassert(dst_size[1]>=size[1]);
+ HDassert(src_size[1]>=size[1]);
dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/
src_stride[0] = src_size[1] - size[1]; /*overflow checked*/
dst_acc = dst_size[1];
@@ -609,8 +609,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
break;
case 3:
- assert (dst_size[2]>=size[2]);
- assert (src_size[2]>=size[2]);
+ HDassert(dst_size[2]>=size[2]);
+ HDassert(src_size[2]>=size[2]);
dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/
src_stride[1] = src_size[2] - size[2]; /*overflow checked*/
dst_acc = dst_size[2];
@@ -618,8 +618,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0);
src_start += src_acc * (src_offset ? src_offset[1] : 0);
- assert (dst_size[1]>=size[1]);
- assert (src_size[1]>=size[1]);
+ HDassert(dst_size[1]>=size[1]);
+ HDassert(src_size[1]>=size[1]);
dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/
src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/
dst_acc *= dst_size[1];
@@ -629,8 +629,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
break;
case 4:
- assert (dst_size[3]>=size[3]);
- assert (src_size[3]>=size[3]);
+ HDassert(dst_size[3]>=size[3]);
+ HDassert(src_size[3]>=size[3]);
dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/
src_stride[2] = src_size[3] - size[3]; /*overflow checked*/
dst_acc = dst_size[3];
@@ -638,8 +638,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0);
src_start += src_acc * (src_offset ? src_offset[2] : 0);
- assert (dst_size[2]>=size[2]);
- assert (src_size[2]>=size[2]);
+ HDassert(dst_size[2]>=size[2]);
+ HDassert(src_size[2]>=size[2]);
dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/
src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/
dst_acc *= dst_size[2];
@@ -647,8 +647,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0);
src_start += src_acc * (src_offset ? src_offset[1] : 0);
- assert (dst_size[1]>=size[1]);
- assert (src_size[1]>=size[1]);
+ HDassert(dst_size[1]>=size[1]);
+ HDassert(src_size[1]>=size[1]);
dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/
src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/
dst_acc *= dst_size[1];
@@ -660,8 +660,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
default:
/* others */
for (ii=(int)(n-2), dst_acc=1, src_acc=1; ii>=0; --ii) {
- assert (dst_size[ii+1]>=size[ii+1]);
- assert (src_size[ii+1]>=size[ii+1]);
+ HDassert(dst_size[ii+1]>=size[ii+1]);
+ HDassert(src_size[ii+1]>=size[ii+1]);
dst_stride[ii] = dst_acc * (dst_size[ii+1] - size[ii+1]); /*overflow checked*/
src_stride[ii] = src_acc * (src_size[ii+1] - size[ii+1]); /*overflow checked*/
dst_acc *= dst_size[ii+1];
@@ -713,7 +713,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert (elmt_size < SIZET_MAX);
+ HDassert(elmt_size < SIZET_MAX);
H5V_vector_cpy(n, idx, size);
nelmts = H5V_vector_reduce_product(n, size);
@@ -729,7 +729,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
if (--idx[j])
carry = FALSE;
else {
- assert(size);
+ HDassert(size);
idx[j] = size[j];
} /* end else */
}
@@ -775,7 +775,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert (elmt_size<SIZET_MAX);
+ HDassert(elmt_size<SIZET_MAX);
if (n) {
H5V_vector_cpy(n, idx, size);
@@ -794,7 +794,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
if (--idx[j])
carry = FALSE;
else {
- assert(size);
+ HDassert(size);
idx[j] = size[j];
}
}
@@ -844,7 +844,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert (elmt_size<SIZET_MAX);
+ HDassert(elmt_size<SIZET_MAX);
if (n) {
H5V_vector_cpy(n, idx, size);
@@ -863,7 +863,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
if (--idx[j])
carry = FALSE;
else {
- assert(size);
+ HDassert(size);
idx[j] = size[j];
}
}
@@ -918,9 +918,9 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert (elmt_size < SIZET_MAX);
- assert(dst_n>0);
- assert(src_n>0);
+ HDassert(elmt_size < SIZET_MAX);
+ HDassert(dst_n>0);
+ HDassert(src_n>0);
H5V_vector_cpy(dst_n, dst_idx, dst_size);
H5V_vector_cpy(src_n, src_idx, src_size);
@@ -937,7 +937,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
if (--dst_idx[j])
carry = FALSE;
else {
- assert(dst_size);
+ HDassert(dst_size);
dst_idx[j] = dst_size[j];
} /* end else */
}
@@ -946,7 +946,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
if (--src_idx[j])
carry = FALSE;
else {
- assert(src_size);
+ HDassert(src_size);
src_idx[j] = src_size[j];
} /* end else */
}
@@ -983,10 +983,10 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert (dst);
- assert (src);
- assert (size < SIZET_MAX && size > 0);
- assert (count < SIZET_MAX && count > 0);
+ HDassert(dst);
+ HDassert(src);
+ HDassert(size < SIZET_MAX && size > 0);
+ HDassert(count < SIZET_MAX && count > 0);
HDmemcpy(dst, src, size); /* copy first item */
@@ -1038,9 +1038,9 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(n <= H5V_HYPER_NDIMS);
- assert(total_size);
- assert(down);
+ HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(total_size);
+ HDassert(down);
/* Build the sizes of each dimension in the array */
/* (From fastest to slowest) */
@@ -1084,9 +1084,9 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(n <= H5V_HYPER_NDIMS);
- assert(acc);
- assert(offset);
+ HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(acc);
+ HDassert(offset);
/* Compute offset in array */
for (i=(int)(n-1), ret_value=0; i>=0; --i)
@@ -1124,9 +1124,9 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
- assert(n <= H5V_HYPER_NDIMS);
- assert(total_size);
- assert(offset);
+ HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(total_size);
+ HDassert(offset);
/* Build the sizes of each dimension in the array */
if(H5V_array_down(n,total_size,acc_arr)<0)
@@ -1278,10 +1278,10 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- assert(ndims <= H5V_HYPER_NDIMS);
- assert(coord);
- assert(chunk);
- assert(chunk_idx);
+ HDassert(ndims <= H5V_HYPER_NDIMS);
+ HDassert(coord);
+ HDassert(chunk);
+ HDassert(chunk_idx);
/* Compute the scaled coordinates for actual coordinates */
for(u=0; u<ndims; u++)
diff --git a/src/H5VLnative.c b/src/H5VLnative.c
index d67b012..9b669f3 100644
--- a/src/H5VLnative.c
+++ b/src/H5VLnative.c
@@ -2125,7 +2125,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t UNUSED dxpl_id, void UNUSED **req, va_list arguments)
+H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t UNUSED dxpl_id,
+ void UNUSED **req, va_list arguments)
{
H5F_t *f = NULL; /* File */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2136,14 +2137,18 @@ H5VL_native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t U
/* H5Fget_filesize */
case H5VL_FILE_GET_SIZE:
{
- haddr_t eof; /* End of file address */
+ haddr_t eof; /* End of file address */
+ haddr_t base_addr; /* Base address for the file */
hsize_t *ret = va_arg (arguments, hsize_t *);
f = (H5F_t *)obj;
/* Go get the actual file size */
- if(HADDR_UNDEF == (eof = H5FDget_eof(f->shared->lf)))
+ if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf)))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
- *ret = (hsize_t)eof;
+ base_addr = H5FD_get_base_addr(f->shared->lf);
+
+ if(ret)
+ *ret = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */
break;
}
/* H5Fget_file_image */
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index de85fbc..5ce26a0 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -42,7 +42,7 @@ typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
/* Other functions */
#define H5V_vector_cpy(N,DST,SRC) { \
- assert (sizeof(*(DST))==sizeof(*(SRC))); \
+ HDassert(sizeof(*(DST))==sizeof(*(SRC))); \
if (SRC) HDmemcpy (DST, SRC, (N)*sizeof(*(DST))); \
else HDmemset (DST, 0, (N)*sizeof(*(DST))); \
}
diff --git a/src/H5Z.c b/src/H5Z.c
index 5861e0e..d415060 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -57,9 +57,6 @@ typedef enum {
H5Z_PRELUDE_SET_LOCAL /* Call "set local" callback */
} H5Z_prelude_type_t;
-/* Maximal number of the list of opened objects (2^16) */
-#define NUM_OBJS 65536
-
/* Local variables */
static size_t H5Z_table_alloc_g = 0;
static size_t H5Z_table_used_g = 0;
@@ -70,8 +67,9 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL;
/* Local functions */
static int H5Z_find_idx(H5Z_filter_t id);
-static int H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key);
-static int H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key);
+static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key);
+static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key);
+static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key);
/*-------------------------------------------------------------------------
@@ -371,8 +369,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, November 14, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -384,14 +380,14 @@ H5Zunregister(H5Z_filter_t id)
H5TRACE1("e", "Zf", id);
/* Check args */
- if (id<0 || id>H5Z_FILTER_MAX)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
- if (id<H5Z_FILTER_RESERVED)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
+ if(id < 0 || id > H5Z_FILTER_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
+ if(id < H5Z_FILTER_RESERVED)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
/* Do it */
- if (H5Z_unregister (id)<0)
- HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter")
+ if(H5Z_unregister(id) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter")
done:
FUNC_LEAVE_API(ret_value)
@@ -409,12 +405,10 @@ done:
* Programmer: Quincey Koziol
* Thursday, November 14, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Z_unregister (H5Z_filter_t filter_id)
+H5Z_unregister(H5Z_filter_t filter_id)
{
size_t filter_index; /* Local index variable for filter */
H5Z_object_t object;
@@ -422,7 +416,7 @@ H5Z_unregister (H5Z_filter_t filter_id)
FUNC_ENTER_NOAPI(FAIL)
- assert (filter_id>=0 && filter_id<=H5Z_FILTER_MAX);
+ HDassert(filter_id>=0 && filter_id<=H5Z_FILTER_MAX);
/* Is the filter already registered? */
for (filter_index=0; filter_index<H5Z_table_used_g; filter_index++)
@@ -438,21 +432,21 @@ H5Z_unregister (H5Z_filter_t filter_id)
object.found = FALSE;
/* Iterate through all opened datasets, returns a failure if any of them uses the filter */
- if(H5I_iterate(H5I_DATASET, H5Z_get_object_cb, &object, FALSE) < 0)
+ if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
if(object.found)
HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it")
/* Iterate through all opened groups, returns a failure if any of them uses the filter */
- if(H5I_iterate(H5I_GROUP, H5Z_get_object_cb, &object, FALSE) < 0)
+ if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
if(object.found)
HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it")
/* Iterate through all opened files and flush them */
- if(H5I_iterate(H5I_FILE, H5Z_get_file_cb, NULL, FALSE) < 0)
+ if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
/* Remove filter from table */
@@ -469,7 +463,41 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Z_get_object_cb
+ * Function: H5Z__check_unregister
+ *
+ * Purpose: Check if an object uses the filter to be unregistered.
+ *
+ * Return: TRUE if the object uses the filter.
+ * FALSE if not, NEGATIVE on error.
+ *
+ * Programmer: Quincey Koziol
+ * 11 May 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+static htri_t
+H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id)
+{
+ H5P_genplist_t *plist; /* Property list */
+ htri_t ret_value = FALSE; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Get the plist structure of object creation */
+ if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE)))
+ HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Check if the object creation property list uses the filter */
+ if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5Z__check_unregister() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z__check_unregister_group_cb
*
* Purpose: The callback function for H5Z_unregister. It iterates
* through all opened objects. If the object is a dataset
@@ -485,61 +513,97 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key)
+H5Z__check_unregister_group_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key)
{
- H5I_type_t id_type;
- hid_t ocpl_id;
- H5P_genplist_t *plist; /* Property list */
+ hid_t ocpl_id = -1;
H5Z_object_t *object = (H5Z_object_t *)key;
htri_t filter_in_pline = FALSE;
int ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(obj_ptr);
- if((id_type = H5I_get_type(obj_id)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "bad object id");
+ /* Get the group creation property */
+ if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list")
- switch(id_type) {
- case H5I_GROUP:
- if((ocpl_id = H5G_get_create_plist(obj_ptr)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get group creation property list")
+ /* Check if the filter is in the group creation property list */
+ if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline")
- break;
+ /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and
+ * let H5Z_unregister return failure.
+ */
+ if(filter_in_pline) {
+ object->found = TRUE;
+ ret_value = TRUE;
+ } /* end if */
- case H5I_DATASET:
- if((ocpl_id = H5D_get_create_plist(obj_ptr)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get dataset creation property list")
-
- break;
+done:
+ if(ocpl_id > 0)
+ if(H5I_dec_app_ref(ocpl_id) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist")
- default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object")
- } /* end switch */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5Z__check_unregister_group_cb() */
- /* Get the plist structure of object creation */
- if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z__check_unregister_dset_cb
+ *
+ * Purpose: The callback function for H5Z_unregister. It iterates
+ * through all opened objects. If the object is a dataset
+ * or a group and it uses the filter to be unregistered, the
+ * function returns TRUE.
+ *
+ * Return: TRUE if the object uses the filter.
+ * FALSE otherwise.
+ *
+ * Programmer: Raymond Lu
+ * 6 May 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key)
+{
+ hid_t ocpl_id = -1;
+ H5Z_object_t *object = (H5Z_object_t *)key;
+ htri_t filter_in_pline = FALSE;
+ int ret_value = FALSE; /* Return value */
- /* Check if the object creation property list uses the filter */
- if((filter_in_pline = H5P_filter_in_pline(plist, object->filter_id)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't check filter in pipeline")
+ FUNC_ENTER_STATIC
- /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and let
- * H5Z_unregister return failure */
+ HDassert(obj_ptr);
+
+ /* Get the dataset creation property */
+ if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list")
+
+ /* Check if the filter is in the dataset creation property list */
+ if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline")
+
+ /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and
+ * let H5Z_unregister return failure.
+ */
if(filter_in_pline) {
object->found = TRUE;
ret_value = TRUE;
- }
+ } /* end if */
done:
+ if(ocpl_id > 0)
+ if(H5I_dec_app_ref(ocpl_id) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist")
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_get_object_cb() */
+} /* end H5Z__check_unregister_dset_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Z_get_file_cb
+ * Function: H5Z__flush_file_cb
*
* Purpose: The callback function for H5Z_unregister. It iterates
* through all opened files and flush them.
@@ -553,11 +617,11 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key)
+H5Z__flush_file_cb(void *obj_ptr, hid_t UNUSED obj_id, void UNUSED *key)
{
int ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(obj_ptr);
@@ -565,12 +629,12 @@ H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key)
* if the file is opened for write */
if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) {
if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy")
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy")
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_get_file_cb() */
+} /* end H5Z__flush_file_cb() */
/*-------------------------------------------------------------------------
@@ -1238,12 +1302,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
FUNC_ENTER_NOAPI(FAIL)
- assert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK)));
- assert(filter_mask);
- assert(nbytes && *nbytes>0);
- assert(buf_size && *buf_size>0);
- assert(buf && *buf);
- assert(!pline || pline->nused<H5Z_MAX_NFILTERS);
+ HDassert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK)));
+ HDassert(filter_mask);
+ HDassert(nbytes && *nbytes>0);
+ HDassert(buf_size && *buf_size>0);
+ HDassert(buf && *buf);
+ HDassert(!pline || pline->nused<H5Z_MAX_NFILTERS);
if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */
for (i=pline->nused; i>0; --i) {
@@ -1393,8 +1457,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter)
FUNC_ENTER_NOAPI(NULL)
- assert(pline);
- assert(filter>=0 && filter<=H5Z_FILTER_MAX);
+ HDassert(pline);
+ HDassert(filter>=0 && filter<=H5Z_FILTER_MAX);
/* Locate the filter in the pipeline */
for(idx=0; idx<pline->nused; idx++)
@@ -1438,8 +1502,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter)
FUNC_ENTER_NOAPI(FAIL)
- assert(pline);
- assert(filter>=0 && filter<=H5Z_FILTER_MAX);
+ HDassert(pline);
+ HDassert(filter>=0 && filter<=H5Z_FILTER_MAX);
/* Locate the filter in the pipeline */
for(idx=0; idx<pline->nused; idx++)
@@ -1480,7 +1544,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- assert(pline);
+ HDassert(pline);
/* Iterate through all the filters in pipeline */
for(i=0; i<pline->nused; i++) {
@@ -1602,15 +1666,44 @@ done:
herr_t
H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
{
- H5Z_class2_t *fclass;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "Zf*Iu", filter, filter_config_flags);
+ /* Get the filter info */
+ if(H5Z_get_filter_info(filter, filter_config_flags) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Zget_filter_info() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z_get_filter_info
+ *
+ * Purpose: Gets information about a pipeline data filter and stores it
+ * in filter_config_flags.
+ *
+ * Return: zero on success / negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, May 11, 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
+{
+ H5Z_class2_t *fclass;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
/* Look up the filter class info */
if(NULL == (fclass = H5Z_find(filter)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Filter not defined")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined")
/* Set the filter config flags for the application */
if(filter_config_flags != NULL) {
@@ -1623,6 +1716,6 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
} /* end if */
done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Zget_filter_info() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5Z_get_filter_info() */
diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
index d2ad965..8d2643d 100644
--- a/src/H5Zfletcher32.c
+++ b/src/H5Zfletcher32.c
@@ -87,7 +87,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
FUNC_ENTER_NOAPI(0)
- assert(sizeof(uint32_t)>=4);
+ HDassert(sizeof(uint32_t)>=4);
if (flags & H5Z_FLAG_REVERSE) { /* Read */
/* Do checksum if it's enabled for read; otherwise skip it
diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h
index 6c0a46f..bd5bef0 100644
--- a/src/H5Zprivate.h
+++ b/src/H5Zprivate.h
@@ -74,7 +74,6 @@ struct H5O_pline_t; /*forward decl*/
/* Internal API routines */
H5_DLL herr_t H5Z_init(void);
H5_DLL herr_t H5Z_register(const H5Z_class2_t *cls);
-H5_DLL herr_t H5Z_unregister(H5Z_filter_t id);
H5_DLL herr_t H5Z_append(struct H5O_pline_t *pline, H5Z_filter_t filter,
unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]);
H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter,
@@ -93,8 +92,10 @@ H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline,
H5Z_filter_t filter);
H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter);
H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline);
+H5_DLL herr_t H5Z_unregister(H5Z_filter_t filter_id);
H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id);
H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter);
+H5_DLL herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags);
/* Data Transform Functions */
typedef struct H5Z_data_xform_t H5Z_data_xform_t; /* Defined in H5Ztrans.c */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 1538765..0aaff11 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1164,7 +1164,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
minval |= minval_mask;
}
- assert(minbits <= p.size * 8);
+ HDassert(minbits <= p.size * 8);
p.minbits = minbits;
/* calculate size of output buffer after decompression */
@@ -1241,7 +1241,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed")
}
- assert(minbits <= p.size * 8);
+ HDassert(minbits <= p.size * 8);
/* calculate buffer size after compression
* minbits and minval are stored in the front of the compressed buffer
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index fd3d90c..4544ec3 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -198,7 +198,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Set "local" parameter for this dataset's "pixels-per-scanline" */
/* (Use the chunk's fastest changing dimension size) */
- assert(ndims > 0);
+ HDassert(ndims > 0);
scanline = dims[ndims - 1];
/* Adjust scanline if it is smaller than number of pixels per block or
@@ -288,13 +288,13 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Sanity check to make certain that we haven't drifted out of date with
* the mask options from the szlib.h header */
- assert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK);
- assert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK);
- assert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK);
- assert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK);
- assert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK);
- assert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK);
- assert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK);
+ HDassert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK);
+ HDassert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK);
+ HDassert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK);
+ HDassert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK);
+ HDassert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK);
+ HDassert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK);
+ HDassert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK);
/* Check arguments */
if (cd_nelmts!=4)
@@ -324,7 +324,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
size_out=nalloc;
if(SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes-4, &sz_param) != SZ_OK)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed")
- assert(size_out==nalloc);
+ HDassert(size_out==nalloc);
/* Free the input buffer */
H5MM_xfree(*buf);
@@ -351,7 +351,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
size_out = nbytes;
if(SZ_OK!= SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param))
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow")
- assert(size_out<=nbytes);
+ HDassert(size_out<=nbytes);
/* Free the input buffer */
H5MM_xfree(*buf);
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 498db03..f9e7186 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -378,7 +378,7 @@ H5Z_unget_token(H5Z_token *current)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(current);
+ HDassert(current);
current->tok_type = current->tok_last_type;
current->tok_begin = current->tok_last_begin;
@@ -414,7 +414,7 @@ H5Z_get_token(H5Z_token *current)
FUNC_ENTER_NOAPI_NOINIT
/* check args */
- assert(current);
+ HDassert(current);
/* Save the last position for possible ungets */
current->tok_last_type = current->tok_type;
@@ -424,9 +424,9 @@ H5Z_get_token(H5Z_token *current)
current->tok_begin = current->tok_end;
while (current->tok_begin[0] != '\0') {
- if (isspace(current->tok_begin[0])) {
+ if (HDisspace(current->tok_begin[0])) {
/* ignore whitespace */
- } else if (isdigit(current->tok_begin[0]) ||
+ } else if (HDisdigit(current->tok_begin[0]) ||
current->tok_begin[0] == '.') {
current->tok_end = current->tok_begin;
@@ -439,7 +439,7 @@ H5Z_get_token(H5Z_token *current)
/* is number */
current->tok_type = H5Z_XFORM_INTEGER;
- while (isdigit(current->tok_end[0]))
+ while (HDisdigit(current->tok_end[0]))
++current->tok_end;
}
@@ -458,7 +458,7 @@ H5Z_get_token(H5Z_token *current)
if (current->tok_end[0] == '.')
do {
++current->tok_end;
- } while (isdigit(current->tok_end[0]));
+ } while (HDisdigit(current->tok_end[0]));
if (current->tok_end[0] == 'e' ||
current->tok_end[0] == 'E') {
@@ -468,29 +468,29 @@ H5Z_get_token(H5Z_token *current)
current->tok_end[0] == '+')
++current->tok_end;
- if (!isdigit(current->tok_end[0])) {
+ if (!HDisdigit(current->tok_end[0])) {
current->tok_type = H5Z_XFORM_ERROR;
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number")
}
- while (isdigit(current->tok_end[0]))
+ while (HDisdigit(current->tok_end[0]))
++current->tok_end;
}
/* Check that this is a properly formatted numerical value */
- if (isalpha(current->tok_end[0]) || current->tok_end[0] == '.') {
+ if (HDisalpha(current->tok_end[0]) || current->tok_end[0] == '.') {
current->tok_type = H5Z_XFORM_ERROR;
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number")
}
}
break;
- } else if (isalpha(current->tok_begin[0])) {
+ } else if (HDisalpha(current->tok_begin[0])) {
/* is symbol */
current->tok_type = H5Z_XFORM_SYMBOL;
current->tok_end = current->tok_begin;
- while (isalnum(current->tok_end[0]))
+ while (HDisalnum(current->tok_end[0]))
++current->tok_end;
break;
@@ -995,7 +995,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size
H5Z_XFORM_DO_OP5(short, array_size)
else if(array_type == H5T_NATIVE_USHORT)
H5Z_XFORM_DO_OP5(unsigned short, array_size)
- else if( array_type == H5T_NATIVE_INT)
+ else if(array_type == H5T_NATIVE_INT)
H5Z_XFORM_DO_OP5(int, array_size)
else if(array_type == H5T_NATIVE_UINT)
H5Z_XFORM_DO_OP5(unsigned int, array_size)
@@ -1026,10 +1026,10 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size
/* If it's a quadratic transform, we have no choice but to store multiple copies of the data */
else {
for(i = 0; i < data_xform_prop->dat_val_pointers->num_ptrs; i++) {
- if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5Tget_size(array_type))))
+ if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5T_get_size((H5T_t *)H5I_object(array_type)))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Ran out of memory trying to allocate space for data in data transform")
- HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5Tget_size(array_type));
+ HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5T_get_size((H5T_t *)H5I_object(array_type)));
} /* end for */
} /* end else */
@@ -1037,7 +1037,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
if(data_xform_prop->dat_val_pointers->num_ptrs > 1)
- HDmemcpy(array, res.value.dat_val, array_size * H5Tget_size(array_type));
+ HDmemcpy(array, res.value.dat_val, array_size * H5T_get_size((H5T_t *)H5I_object(array_type)));
/* Free the temporary arrays we used */
if(data_xform_prop->dat_val_pointers->num_ptrs > 1)
@@ -1175,60 +1175,60 @@ H5Z_xform_find_type(const H5T_t* type)
HDassert(type);
/* Check for SHORT type */
- if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SHORT, H5I_DATATYPE))
+ if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_SHORT)
/* Check for INT type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_INT, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_INT)
/* Check for LONG type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LONG, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_LONG)
/* Check for LONGLONG type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LLONG, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LLONG))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_LLONG)
/* Check for UCHAR type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UCHAR, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_UCHAR)
/* Check for CHAR type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_CHAR, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_CHAR))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_CHAR)
/* Check for SCHAR type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SCHAR, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_SCHAR)
/* Check for USHORT type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_USHORT, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_USHORT))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_USHORT)
/* Check for UINT type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UINT, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UINT))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_UINT)
/* Check for ULONG type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULONG, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULONG))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_ULONG)
/* Check for ULONGLONG type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULLONG, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_ULLONG)
/* Check for FLOAT type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_FLOAT, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_FLOAT)
/* Check for DOUBLE type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_DOUBLE, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_DOUBLE)
#if H5_SIZEOF_LONG_DOUBLE !=0
/* Check for LONGDOUBLE type */
- else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LDOUBLE, H5I_DATATYPE))
+ else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE))
&& 0 == H5T_cmp(type, tmp, FALSE))
HGOTO_DONE(H5T_NATIVE_LDOUBLE)
#endif
@@ -1258,7 +1258,7 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva
FUNC_ENTER_NOAPI(NULL)
- assert(tree);
+ HDassert(tree);
if(tree->type == H5Z_XFORM_INTEGER)
{
@@ -1335,7 +1335,7 @@ H5Z_op_is_numbs(H5Z_node* _tree)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(_tree);
+ HDassert(_tree);
if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT)))
ret_value = TRUE;
@@ -1364,7 +1364,7 @@ H5Z_op_is_numbs2(H5Z_node* _tree)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- assert(_tree);
+ HDassert(_tree);
if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) ||
((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT)))))
@@ -1494,7 +1494,7 @@ H5Z_xform_create(const char *expr)
FUNC_ENTER_NOAPI(NULL)
- assert(expr);
+ HDassert(expr);
/* Allocate space for the data transform information */
if(NULL == (data_xform_prop = (H5Z_data_xform_t *)H5MM_calloc(sizeof(H5Z_data_xform_t))))
@@ -1740,7 +1740,7 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop)
/* There should be no way that this can be NULL since the function
* that calls this one checks to make sure it isn't before
* pasing them */
- assert(data_xform_prop);
+ HDassert(data_xform_prop);
FUNC_LEAVE_NOAPI(data_xform_prop->xform_exp)
} /* H5Z_xform_extract_xform_str() */
diff --git a/src/H5detect.c b/src/H5detect.c
index d6f6a3b..2bf0d2d 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -246,7 +246,7 @@ precision (detected_t *d)
_v = (_v << 8) + _i; \
for(_i = 0, _x = (unsigned char *)&_v; _i < (signed)sizeof(TYPE); _i++) { \
_j = (*_x++) - 1; \
- assert(_j < (signed)sizeof(TYPE)); \
+ HDassert(_j < (signed)sizeof(TYPE)); \
INFO.perm[_i] = _j; \
} /* end for */ \
} else { /*Not able to detect order if type size is 1 byte. Use native int \
@@ -255,7 +255,7 @@ precision (detected_t *d)
_int_v = (_int_v << 8) + _i; \
for(_i = 0, _x = (unsigned char *)&_int_v; _i < (signed)sizeof(int); _i++) { \
_j = (*_x++)-1; \
- assert(_j < (signed)sizeof(int)); \
+ HDassert(_j < (signed)sizeof(int)); \
INFO.perm[_i] = _j; \
} /* end for */ \
} /* end else */ \
@@ -296,23 +296,23 @@ precision (detected_t *d)
int _i, _j, _last = (-1); \
char *_mesg; \
\
- memset(&INFO, 0, sizeof(INFO)); \
+ HDmemset(&INFO, 0, sizeof(INFO)); \
INFO.varname = #VAR; \
INFO.size = sizeof(TYPE); \
\
/* Completely initialize temporary variables, in case the bits used in */ \
/* the type take less space than the number of bits used to store the type */ \
- memset(&_v3, 0, sizeof(TYPE)); \
- memset(&_v2, 0, sizeof(TYPE)); \
- memset(&_v1, 0, sizeof(TYPE)); \
+ HDmemset(&_v3, 0, sizeof(TYPE)); \
+ HDmemset(&_v2, 0, sizeof(TYPE)); \
+ HDmemset(&_v1, 0, sizeof(TYPE)); \
\
/* Byte Order */ \
for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \
_v3 = _v1; \
_v1 += _v2; \
_v2 /= 256.0; \
- memcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
- memcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \
+ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
+ HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \
_j = byte_cmp(sizeof(TYPE), &_buf3, &_buf1); \
if(_j >= 0) { \
INFO.perm[_i] = _j; \
@@ -321,7 +321,7 @@ precision (detected_t *d)
} \
fix_order(sizeof(TYPE), _last, INFO.perm, (const char**)&_mesg); \
\
- if(!strcmp(_mesg, "VAX")) \
+ if(!HDstrcmp(_mesg, "VAX")) \
INFO.is_vax = TRUE; \
\
/* Implicit mantissa bit */ \
@@ -351,8 +351,8 @@ precision (detected_t *d)
INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \
precision (&(INFO)); \
ALIGNMENT(TYPE, INFO); \
- if(!strcmp(INFO.varname, "FLOAT") || !strcmp(INFO.varname, "DOUBLE") || \
- !strcmp(INFO.varname, "LDOUBLE")) { \
+ if(!HDstrcmp(INFO.varname, "FLOAT") || !HDstrcmp(INFO.varname, "DOUBLE") || \
+ !HDstrcmp(INFO.varname, "LDOUBLE")) { \
COMP_ALIGNMENT(TYPE,INFO.comp_align); \
} \
}
@@ -399,7 +399,7 @@ precision (detected_t *d)
void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \
void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\
\
- _buf = (char*)malloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
+ _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
if(H5SETJMP(jbuf_g)) _ano++; \
if(_ano < NELMTS(align_g)) { \
*((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \
@@ -409,12 +409,12 @@ precision (detected_t *d)
/* pointer values when pointing to non-word aligned */ \
/* locations with pointers that are supposed to be */ \
/* word aligned. -QAK */ \
- memset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
+ HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \
/*How to handle VAX types?*/ \
if(INFO.perm[0]) /* Big-Endian */ \
- memcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \
else /* Little-Endian */ \
- memcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
+ HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \
_val2 = *((TYPE*)(_buf+align_g[_ano])); \
if(_val!=_val2) \
H5LONGJMP(jbuf_g, 1); \
@@ -424,7 +424,7 @@ precision (detected_t *d)
(INFO.align)=0; \
fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \
} \
- free(_buf); \
+ HDfree(_buf); \
HDsignal(SIGBUS, _handler); /*restore original handler*/ \
HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \
}
@@ -669,7 +669,7 @@ H5TN_init_interface(void)\n\
dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n",
d[i].offset, /*offset */
d[i].precision); /*precision */
- /*assert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */
+ /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */
if (0 == d[i].msize) {
/* The part unique to fixed point types */
@@ -705,10 +705,10 @@ H5TN_init_interface(void)\n\
d[i].varname, (unsigned long)(d[i].align));
/* Variables for alignment of compound datatype */
- if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") ||
- !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") ||
- !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") ||
- !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) {
+ if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") ||
+ !HDstrcmp(d[i].varname, "INT") || !HDstrcmp(d[i].varname, "LONG") ||
+ !HDstrcmp(d[i].varname, "LLONG") || !HDstrcmp(d[i].varname, "FLOAT") ||
+ !HDstrcmp(d[i].varname, "DOUBLE") || !HDstrcmp(d[i].varname, "LDOUBLE")) {
printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n",
d[i].varname, (unsigned long)(d[i].comp_align));
}
@@ -823,7 +823,7 @@ iprint(detected_t *d)
printf(" * ");
for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) {
printf ("%4d", d->perm[i]);
- if (i>pass*4) fputs (" ", stdout);
+ if (i>pass*4) HDfputs (" ", stdout);
}
/*
@@ -835,23 +835,23 @@ iprint(detected_t *d)
i>=pass*4; --i) {
for (j=7; j>=0; --j) {
if (k==d->sign && d->msize) {
- putchar('S');
+ HDputchar('S');
} else if (k>=d->epos && k<d->epos+d->esize) {
- putchar('E');
+ HDputchar('E');
} else if (k>=d->mpos && k<d->mpos+d->msize) {
- putchar('M');
+ HDputchar('M');
} else if (d->msize) {
- putchar('?'); /*unknown floating point bit */
+ HDputchar('?'); /*unknown floating point bit */
} else if (d->sign) {
- putchar('I');
+ HDputchar('I');
} else {
- putchar('U');
+ HDputchar('U');
}
--k;
}
- if (i>pass*4) putchar(' ');
+ if (i>pass*4) HDputchar(' ');
}
- putchar('\n');
+ HDputchar('\n');
}
/*
@@ -934,13 +934,13 @@ bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b)
unsigned char aa, bb;
for (i = 0; i < nbytes; i++) {
- assert(perm[i] < nbytes);
+ HDassert(perm[i] < nbytes);
if ((aa = a[perm[i]]) != (bb = b[perm[i]])) {
for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
if ((aa & 1) != (bb & 1)) return i * 8 + j;
}
- assert("INTERNAL ERROR" && 0);
- abort();
+ HDassert("INTERNAL ERROR" && 0);
+ HDabort();
}
}
return -1;
@@ -998,7 +998,7 @@ fix_order(int n, int last, int *perm, const char **mesg)
* It could have some other endianess and fall into this
* case - JKM & QAK)
*/
- assert(0 == n % 2);
+ HDassert(0 == n % 2);
if (mesg) *mesg = "VAX";
for (i = 0; i < n; i += 2) {
perm[i] = (n - 2) - i;
@@ -1008,7 +1008,7 @@ fix_order(int n, int last, int *perm, const char **mesg)
} else {
fprintf(stderr,
"Failed to detect byte order of %d-byte floating point.\n", n);
- exit(1);
+ HDexit(1);
}
}
@@ -1062,7 +1062,7 @@ imp_bit(int n, int *perm, volatile void *_a, volatile void *_b)
* A and B. This is the least significant bit of the exponent.
*/
changed = bit_cmp(n, perm, a, b);
- assert(changed >= 0);
+ HDassert(changed >= 0);
/*
* The bit to the right (less significant) of the changed bit should
@@ -1139,8 +1139,8 @@ static void
print_header(void)
{
- time_t now = time(NULL);
- struct tm *tm = localtime(&now);
+ time_t now = HDtime(NULL);
+ struct tm *tm = HDlocaltime(&now);
char real_name[30];
char host_name[256];
int i;
@@ -1199,13 +1199,13 @@ bit.\n";
{
size_t n;
char *comma;
- if ((pwd = getpwuid(getuid()))) {
- if ((comma = strchr(pwd->pw_gecos, ','))) {
+ if ((pwd = HDgetpwuid(HDgetuid()))) {
+ if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
- strncpy(real_name, pwd->pw_gecos, n);
+ HDstrncpy(real_name, pwd->pw_gecos, n);
real_name[n] = '\0';
} else {
- strncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
real_name[sizeof(real_name) - 1] = '\0';
}
} else {
@@ -1220,7 +1220,7 @@ bit.\n";
* The FQDM of this host or the empty string.
*/
#ifdef H5_HAVE_GETHOSTNAME
- if (gethostname(host_name, sizeof(host_name)) < 0) {
+ if (HDgethostname(host_name, sizeof(host_name)) < 0) {
host_name[0] = '\0';
}
#else
@@ -1231,7 +1231,7 @@ bit.\n";
* The file header: warning, copyright notice, build information.
*/
printf("/* Generated automatically by H5detect -- do not edit */\n\n\n");
- puts(FileHeader); /*the copyright notice--see top of this file */
+ HDputs(FileHeader); /*the copyright notice--see top of this file */
printf(" *\n * Created:\t\t%s %2d, %4d\n",
month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
@@ -1239,15 +1239,15 @@ bit.\n";
printf(" *\t\t\t");
if (real_name[0]) printf("%s <", real_name);
#ifdef H5_HAVE_GETPWUID
- if (pwd) fputs(pwd->pw_name, stdout);
+ if (pwd) HDfputs(pwd->pw_name, stdout);
#endif
if (host_name[0]) printf("@%s", host_name);
if (real_name[0]) printf(">");
- putchar('\n');
+ HDputchar('\n');
}
printf(" *\n * Purpose:\t\t");
for (s = purpose; *s; s++) {
- putchar(*s);
+ HDputchar(*s);
if ('\n' == *s && s[1]) printf(" *\t\t\t");
}
@@ -1256,7 +1256,7 @@ bit.\n";
printf(" *\tIt was generated by code in `H5detect.c'.\n");
printf(" *\n *");
- for (i = 0; i < 73; i++) putchar('-');
+ for (i = 0; i < 73; i++) HDputchar('-');
printf("\n */\n\n");
}
@@ -1645,7 +1645,7 @@ main(void)
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",
- strerror(errno));
+ HDstrerror(errno));
}
#endif
#endif
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index d903592..fa00c64 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -94,7 +94,7 @@ insert_libhdf5_settings(FILE *flibinfo)
else
HDputc(inchar, flibinfo);
} /* end while */
- if(feof(fsettings)) {
+ if(HDfeof(fsettings)) {
/* wrap up */
if(!bol)
/* EOF found without a new line */
@@ -182,7 +182,7 @@ information about the library build configuration\n";
size_t n;
char *comma;
- if((pwd = HDgetpwuid(getuid()))) {
+ if((pwd = HDgetpwuid(HDgetuid()))) {
if((comma = HDstrchr(pwd->pw_gecos, ','))) {
n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
HDstrncpy(real_name, pwd->pw_gecos, n);
@@ -204,7 +204,7 @@ information about the library build configuration\n";
* The FQDM of this host or the empty string.
*/
#ifdef H5_HAVE_GETHOSTNAME
- if(gethostname(host_name, sizeof(host_name)) < 0)
+ if(HDgethostname(host_name, sizeof(host_name)) < 0)
host_name[0] = '\0';
#else
host_name[0] = '\0';
diff --git a/src/H5private.h b/src/H5private.h
index b4db8c5..802eaa1 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -844,6 +844,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#ifndef HDgetgroups
#define HDgetgroups(Z,G) getgroups(Z,G)
#endif /* HDgetgroups */
+#ifndef HDgethostname
+ #define HDgethostname(N,L) gethostname(N,L)
+#endif /* HDgetlogin */
#ifndef HDgetlogin
#define HDgetlogin() getlogin()
#endif /* HDgetlogin */
@@ -2346,7 +2349,11 @@ func_init_failed: \
#define H5_GLUE4(w,x,y,z) w##x##y##z
/* Compile-time "assert" macro */
-#define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0)
+#define HDcompile_assert(e) ((void)sizeof(char[ !!(e) ? 1 : -1]))
+/* Variants that are correct, but generate compile-time warnings in some circumstances:
+ #define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0)
+ #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0)
+*/
/* Private functions, not part of the publicly documented API */
H5_DLL herr_t H5_init_library(void);
diff --git a/src/H5public.h b/src/H5public.h
index 88d8984..ad13851 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 151 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 156 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.151" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.156" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/H5system.c b/src/H5system.c
index 3ffe411..a93a128 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -117,8 +117,8 @@ HDfprintf(FILE *stream, const char *fmt, ...)
const char *s;
va_list ap;
- assert (stream);
- assert (fmt);
+ HDassert(stream);
+ HDassert(fmt);
va_start (ap, fmt);
while (*fmt) {
diff --git a/src/H5timer.c b/src/H5timer.c
index 7bdee8a..301d98b 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -97,8 +97,8 @@
void
H5_timer_reset (H5_timer_t *timer)
{
- assert (timer);
- HDmemset (timer, 0, sizeof *timer);
+ HDassert(timer);
+ HDmemset(timer, 0, sizeof *timer);
} /* end H5_timer_reset() */
@@ -126,7 +126,7 @@ H5_timer_begin (H5_timer_t *timer)
struct timeval etime;
#endif
- assert (timer);
+ HDassert(timer);
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage (RUSAGE_SELF, &rusage);
@@ -169,7 +169,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/)
{
H5_timer_t now;
- assert (timer);
+ HDassert(timer);
H5_timer_begin (&now);
timer->utime = MAX(0.0, now.utime - timer->utime);
@@ -220,7 +220,7 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds)
HDstrcpy(buf, " NaN");
else {
bw = nbytes/nseconds;
- if(fabs(bw) < 0.0000000001)
+ if(HDfabs(bw) < 0.0000000001)
/* That is == 0.0, but direct comparison between floats is bad */
HDstrcpy(buf, "0.000 B/s");
else if(bw < 1.0)
diff --git a/src/H5trace.c b/src/H5trace.c
index 92736d4..2babcd4 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -156,7 +156,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
} /* end if */
/* Get tim for event */
- if(fabs(first_time.etime) < 0.0000000001)
+ if(HDfabs(first_time.etime) < 0.0000000001)
/* That is == 0.0, but direct comparison between floats is bad */
H5_timer_begin(&first_time);
if(H5_debug_g.ttimes)
@@ -179,10 +179,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
char tmp[128];
sprintf(tmp, "%.6f", event_time.etime-first_time.etime);
- fprintf(out, " %*s ", (int)strlen(tmp), "");
+ fprintf(out, " %*s ", (int)HDstrlen(tmp), "");
} /* end if */
for(i = 0; i < current_depth; i++)
- fputc('+', out);
+ HDfputc('+', out);
fprintf(out, "%*s%s = ", 2*current_depth, "", func);
} /* end if */
else {
@@ -192,11 +192,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
} /* end if */
else {
if(current_depth>last_call_depth)
- fputs(" = <delayed>\n", out);
+ HDfputs(" = <delayed>\n", out);
if(H5_debug_g.ttimes)
fprintf(out, "@%.6f ", event_time.etime - first_time.etime);
for(i = 0; i < current_depth; i++)
- fputc('+', out);
+ HDfputc('+', out);
fprintf(out, "%*s%s(", 2*current_depth, "", func);
} /* end else */
diff --git a/src/Makefile.in b/src/Makefile.in
index 4cf6542..143ede0 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -514,7 +514,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 141
+LT_VERS_REVISION = 146
LT_VERS_AGE = 0
H5detect_CFLAGS = -g $(AM_CFLAGS)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 766ed7b..741976b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -27,6 +27,7 @@ SET (TEST_LIB_HEADERS
)
ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS})
+TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ")
IF (MSVC)
TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
ENDIF (MSVC)
@@ -64,6 +65,7 @@ IF (BUILD_SHARED_LIBS)
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c)
+ TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (
${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME}
@@ -94,6 +96,7 @@ IF (BUILD_SHARED_LIBS)
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c)
+ TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (
${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME}
@@ -279,6 +282,7 @@ SET (testhdf5_SRCS
#-- Adding test for testhdf5
ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS})
TARGET_NAMING (testhdf5 ${LIB_TYPE})
+TARGET_C_PROPERTIES (testhdf5 " " " ")
TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test)
@@ -331,6 +335,7 @@ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
MACRO (ADD_H5_TEST file)
ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (${file} " " " ")
TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test)
@@ -474,6 +479,7 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1)
#-- Adding test for cache
ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c)
TARGET_NAMING (cache ${LIB_TYPE})
+TARGET_C_PROPERTIES (cache " " " ")
TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test)
ADD_TEST (
@@ -488,6 +494,7 @@ SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects)
#-- Adding test for cache_api
ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c)
TARGET_NAMING (cache_api ${LIB_TYPE})
+TARGET_C_PROPERTIES (cache_api " " " ")
TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test)
@@ -503,6 +510,7 @@ SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects
#-- Adding test for cache_tagging
ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c)
TARGET_NAMING (cache_tagging ${LIB_TYPE})
+TARGET_C_PROPERTIES (cache_tagging " " " ")
TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test)
@@ -525,6 +533,7 @@ ADD_EXECUTABLE (ttsafe
${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c
)
TARGET_NAMING (ttsafe ${LIB_TYPE})
+TARGET_C_PROPERTIES (ttsafe " " " ")
TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test)
@@ -544,6 +553,7 @@ SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects)
IF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c)
TARGET_NAMING (err_compat ${LIB_TYPE})
+ TARGET_C_PROPERTIES (err_compat " " " ")
TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test)
@@ -570,6 +580,7 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
#-- Adding test for error_test
ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c)
TARGET_NAMING (error_test ${LIB_TYPE})
+TARGET_C_PROPERTIES (error_test " " " ")
TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test)
@@ -596,6 +607,7 @@ SET_TESTS_PROPERTIES (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::"
#-- Adding test for links_env
ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c)
TARGET_NAMING (links_env ${LIB_TYPE})
+TARGET_C_PROPERTIES (links_env " " " ")
TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test)
@@ -649,6 +661,7 @@ IF (BUILD_SHARED_LIBS)
ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c)
TARGET_NAMING (plugin ${LIB_TYPE})
+ TARGET_C_PROPERTIES (plugin " " " ")
TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET})
SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test)
@@ -784,6 +797,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
MACRO (ADD_H5_GENERATOR genfile)
ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
TARGET_NAMING (${genfile} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (${genfile} " " " ")
TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test)
ENDMACRO (ADD_H5_GENERATOR genfile)
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
index 8bc8780..202d050 100644
--- a/test/H5srcdir.h
+++ b/test/H5srcdir.h
@@ -50,10 +50,12 @@ static const char *H5_get_srcdir_filename(const char *filename)
#ifdef H5_VMS
if(filename[0] == '[') {
char *tmp = filename;
- srcdir_testpath[strlen(srcdir)-1] = '\0';
- strcat(srcdir_testpath, ++tmp);
- } else
- strcat(srcdir_testpath, filename);
+
+ srcdir_testpath[HDstrlen(srcdir) - 1] = '\0';
+ HDstrcat(srcdir_testpath, ++tmp);
+ } /* end if */
+ else
+ HDstrcat(srcdir_testpath, filename);
#else
HDstrcat(srcdir_testpath, "/");
HDstrcat(srcdir_testpath, filename);
@@ -84,4 +86,3 @@ static const char *H5_get_srcdir(void)
}
#endif /* _H5SRCDIR_H */
-
diff --git a/test/h5test.c b/test/h5test.c
index 91497e3..32d78bd 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1124,24 +1124,8 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name)
{
int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */
ssize_t nread; /* Number of bytes read in */
- char buf[READ_BUF_SIZE]; /* Buffer for copying data */
- char filename[FILENAME_BUF_SIZE] = "";
-#ifdef H5_VMS
- HDstrcat(filename, origfilename);
-#else
- const char * srcdir = HDgetenv("srcdir"); /* The source directory */
-
- /* Check for using the srcdir from configure time */
- if(NULL == srcdir)
- srcdir = config_srcdir;
-
- if(srcdir && ((HDstrlen(srcdir) +
- HDstrlen(origfilename) + 6) < FILENAME_BUF_SIZE)) {
- HDstrcpy(filename, srcdir);
- HDstrcat(filename, "/");
- }
- HDstrcat(filename, origfilename);
-#endif
+ char buf[READ_BUF_SIZE]; /* Buffer for copying data */
+ const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */
/* Copy old file into temporary file */
if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1;
diff --git a/test/links.c b/test/links.c
index 19b620a..6aad164 100644
--- a/test/links.c
+++ b/test/links.c
@@ -558,8 +558,8 @@ cklinks(hid_t fapl, hbool_t new_format)
} /* end if */
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
H5_FAILED();
- puts(" Hard link test failed. Link seems not to point to the ");
- puts(" expected file location.");
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
TEST_ERROR
} /* end if */
if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
@@ -574,14 +574,14 @@ cklinks(hid_t fapl, hbool_t new_format)
} /* end if */
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
H5_FAILED();
- puts(" Soft link test failed. Link seems not to point to the ");
- puts(" expected file location.");
+ HDputs(" Soft link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
TEST_ERROR
} /* end if */
if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(HDstrcmp(linkval, "/d1")) {
H5_FAILED();
- puts(" Soft link test failed. Wrong link value");
+ HDputs(" Soft link test failed. Wrong link value");
TEST_ERROR
} /* end if */
if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
@@ -592,7 +592,7 @@ cklinks(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" H5Oget_info_by_name() should have failed for a dangling link.");
+ HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -608,7 +608,7 @@ cklinks(hid_t fapl, hbool_t new_format)
} /* end if */
if(HDstrcmp(linkval, "foobar")) {
H5_FAILED();
- puts(" Dangling link test failed. Wrong link value");
+ HDputs(" Dangling link test failed. Wrong link value");
TEST_ERROR
} /* end if */
if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
@@ -619,7 +619,7 @@ cklinks(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" H5Oget_info_by_name() should have failed for a recursive link.");
+ HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -635,7 +635,7 @@ cklinks(hid_t fapl, hbool_t new_format)
} /* end if */
if(HDstrcmp(linkval, "/grp1/recursive")) {
H5_FAILED();
- puts(" Recursive link test failed. Wrong link value");
+ HDputs(" Recursive link test failed. Wrong link value");
TEST_ERROR
} /* end if */
@@ -700,8 +700,8 @@ ck_new_links(hid_t fapl, hbool_t new_format)
}
if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) {
H5_FAILED();
- puts(" Hard link test failed. Link seems not to point to the ");
- puts(" expected file location.");
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
TEST_ERROR
}
@@ -905,7 +905,7 @@ toomany(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if(gid >= 0) {
H5_FAILED();
- puts(" Should have failed for sequence of too many nested links.");
+ HDputs(" Should have failed for sequence of too many nested links.");
TEST_ERROR
} /* end if */
@@ -1189,7 +1189,7 @@ test_move(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if(moved_grp >= 0) {
H5_FAILED();
- puts(" Group still in original location?");
+ HDputs(" Group still in original location?");
TEST_ERROR
} /* end if */
@@ -1684,8 +1684,8 @@ test_deprec(hid_t fapl, hbool_t new_format)
if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) {
H5_FAILED();
- puts(" Hard link test failed. Link seems not to point to the ");
- puts(" expected file location.");
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
TEST_ERROR
} /* end if */
@@ -1695,8 +1695,8 @@ test_deprec(hid_t fapl, hbool_t new_format)
if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) {
H5_FAILED();
- puts(" Hard link test failed. Link seems not to point to the ");
- puts(" expected file location.");
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
TEST_ERROR
} /* end if */
@@ -1812,19 +1812,19 @@ external_link_root(hid_t fapl, hbool_t new_format)
if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
if(H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- puts(" Unexpected object type - should have been an external link");
+ HDputs(" Unexpected object type - should have been an external link");
goto error;
}
if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR
if(HDstrcmp(file, filename1)) {
H5_FAILED();
- puts(" External link file name incorrect");
+ HDputs(" External link file name incorrect");
goto error;
}
if(HDstrcmp(path, "/")) {
H5_FAILED();
- puts(" External link path incorrect");
+ HDputs(" External link path incorrect");
goto error;
}
@@ -1836,19 +1836,19 @@ external_link_root(hid_t fapl, hbool_t new_format)
if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
if(H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- puts(" Unexpected object type - should have been an external link");
+ HDputs(" Unexpected object type - should have been an external link");
goto error;
}
if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR
if(HDstrcmp(file, filename1)) {
H5_FAILED();
- puts(" External link file name incorrect");
+ HDputs(" External link file name incorrect");
goto error;
}
if(HDstrcmp(path, "/")) {
H5_FAILED();
- puts(" External link path incorrect");
+ HDputs(" External link path incorrect");
goto error;
}
@@ -2693,7 +2693,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
- puts(" Should have failed for sequence of too many nested links.");
+ HDputs(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -2703,7 +2703,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
- puts(" Should have failed for sequence of too many nested links.");
+ HDputs(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -2713,7 +2713,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
- puts(" Retreiving name of object by index through dangling file external link should have failed.");
+ HDputs(" Retreiving name of object by index through dangling file external link should have failed.");
} /* end if */
/* Close root group */
@@ -2810,7 +2810,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp directory.");
+ HDputs(" Should have found the file in tmp directory.");
goto error;
}
@@ -2905,7 +2905,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from absolute path set for main file */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp directory.");
+ HDputs(" Should have found the file in tmp directory.");
goto error;
}
@@ -2991,7 +2991,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the main file's relative pathname */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in current working directory");
+ HDputs(" Should have found the file in current working directory");
goto error;
}
@@ -3083,7 +3083,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the current working directory */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in current working directory");
+ HDputs(" Should have found the file in current working directory");
goto error;
}
@@ -3179,7 +3179,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
/* should be able to find the target file with abolute path */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp directory.");
+ HDputs(" Should have found the file in tmp directory.");
goto error;
}
@@ -3273,7 +3273,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from main file's current working directory */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in current working directory.");
+ HDputs(" Should have found the file in current working directory.");
goto error;
}
@@ -3353,7 +3353,7 @@ external_link_reltar(hid_t fapl, hbool_t new_format)
/* Open object through external link */
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp directory.");
+ HDputs(" Should have found the file in tmp directory.");
goto error;
} /* end if */
@@ -3450,7 +3450,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
*/
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp directory.");
+ HDputs(" Should have found the file in tmp directory.");
goto error;
}
@@ -3625,7 +3625,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object A in the current working directory */
if (oidA < 0) {
H5_FAILED();
- puts(" Should succeed in opening family target file A in current working directory");
+ HDputs(" Should succeed in opening family target file A in current working directory");
goto error;
}
@@ -3639,7 +3639,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object B in the current working directory */
if (oidB < 0) {
H5_FAILED();
- puts(" Should succeed in opening multi target file B in current working directory");
+ HDputs(" Should succeed in opening multi target file B in current working directory");
goto error;
}
@@ -3785,7 +3785,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
did = H5Dopen2(fid, "ext_link", dapl_id);
if(did < 0) {
H5_FAILED();
- puts(" Should succeed in opening the target dataset");
+ HDputs(" Should succeed in opening the target dataset");
goto error;
}
@@ -4371,7 +4371,7 @@ external_link_win1(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's CWD*/
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in CWD.");
+ HDputs(" Should have found the file in CWD.");
goto error;
}
@@ -4465,7 +4465,7 @@ external_link_win2(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp.");
+ HDputs(" Should have found the file in tmp.");
goto error;
}
@@ -4558,7 +4558,7 @@ external_link_win3(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp.");
+ HDputs(" Should have found the file in tmp.");
goto error;
}
@@ -4647,7 +4647,7 @@ external_link_win4(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's absolute drive/relative path */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in CWD.");
+ HDputs(" Should have found the file in CWD.");
goto error;
}
@@ -4743,7 +4743,7 @@ external_link_win5(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's rel drive/abs path */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in CWD.");
+ HDputs(" Should have found the file in CWD.");
goto error;
}
@@ -4836,7 +4836,7 @@ external_link_win6(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via target file's rel path in current drive */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp.");
+ HDputs(" Should have found the file in tmp.");
goto error;
}
@@ -4923,7 +4923,7 @@ external_link_win7(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's local host/main drive*/
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in local host/main drive.");
+ HDputs(" Should have found the file in local host/main drive.");
goto error;
}
@@ -5015,7 +5015,7 @@ external_link_win8(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp.");
+ HDputs(" Should have found the file in tmp.");
goto error;
}
@@ -5102,7 +5102,7 @@ external_link_win9(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's local host/main drive*/
if(gid < 0) {
H5_FAILED();
- puts(" Should have found the file in local host/main drive.");
+ HDputs(" Should have found the file in local host/main drive.");
goto error;
}
@@ -5173,7 +5173,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
- puts(" Should have failed for recursive external links.");
+ HDputs(" Should have failed for recursive external links.");
goto error;
}
@@ -5243,7 +5243,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR
if (H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- puts(" Unexpected link class - should have been an external link");
+ HDputs(" Unexpected link class - should have been an external link");
goto error;
}
@@ -5269,7 +5269,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR
if(H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- puts(" Unexpected link class - should have been an external link");
+ HDputs(" Unexpected link class - should have been an external link");
goto error;
}
@@ -5287,7 +5287,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_GROUP != oi.type) {
H5_FAILED();
- puts(" Unexpected object type - should have been a group");
+ HDputs(" Unexpected object type - should have been a group");
goto error;
}
@@ -6510,7 +6510,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
} /* end if */
else {
SKIPPED();
- puts(" Current VFD doesn't support POSIX I/O calls");
+ HDputs(" Current VFD doesn't support POSIX I/O calls");
} /* end else */
return 0;
@@ -6530,7 +6530,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
return -1;
#else /* H5_HAVE_SYMLINK */
SKIPPED();
- puts(" Current file system or operating system doesn't support symbolic links");
+ HDputs(" Current file system or operating system doesn't support symbolic links");
return 0;
#endif /* H5_HAVE_SYMLINK */
@@ -7569,7 +7569,7 @@ ud_hard_links(hid_t fapl)
if(li.u.val_size != 0) TEST_ERROR
if(UD_HARD_TYPE != li.type) {
H5_FAILED();
- puts(" Unexpected link class - should have been a UD hard link");
+ HDputs(" Unexpected link class - should have been a UD hard link");
goto error;
} /* end if */
@@ -7983,7 +7983,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if(li.u.val_size != 16) TEST_ERROR
if (UD_CB_TYPE != li.type) {
H5_FAILED();
- puts(" Unexpected link class - should have been a UD hard link");
+ HDputs(" Unexpected link class - should have been a UD hard link");
goto error;
}
@@ -8631,7 +8631,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
} H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
- puts(" Should have failed for sequence of too many nested links.");
+ HDputs(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -10146,7 +10146,7 @@ corder_create_empty(hid_t fapl)
} H5E_END_TRY;
if(ret > 0) {
H5_FAILED();
- puts(" H5Pset_link_create_order() should have failed for a creation order index with no tracking.");
+ HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking.");
TEST_ERROR
} /* end if */
@@ -14702,7 +14702,7 @@ main(void)
if(nerrors) {
printf("***** %d LINK TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- exit(1);
+ HDexit(1);
}
printf("All link tests passed.\n");
@@ -14717,7 +14717,7 @@ main(void)
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
}
diff --git a/test/links_env.c b/test/links_env.c
index 2da5e64..308d562 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -21,7 +21,6 @@
#define H5G_TESTING
#include "h5test.h"
-#include "H5srcdir.h"
#include "H5Gpkg.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index cccb148..04aa383 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -29,6 +29,7 @@ SET (testphdf5_SRCS
#-- Adding test for testhdf5
ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS})
TARGET_NAMING (testphdf5 ${LIB_TYPE})
+TARGET_C_PROPERTIES (testphdf5 " " " ")
TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par)
@@ -37,6 +38,7 @@ ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX
MACRO (ADD_H5P_TEST file)
ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} ${LIB_TYPE})
+ TARGET_C_PROPERTIES (${file} " " " ")
TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4479c20..76b32d2 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -24,6 +24,6 @@ include $(top_srcdir)/config/commence.am
CONFIG=ordered
# All subdirectories
-SUBDIRS=lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump
+SUBDIRS=lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat
include $(top_srcdir)/config/conclude.am
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 7e82170..fb347c4 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
CONFIG = ordered
# All subdirectories
-SUBDIRS = lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump
+SUBDIRS = lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat
# Automake needs to be taught how to build lib, progs, and tests targets.
# These will be filled in automatically for the most part (e.g.,
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 7f68e76..137edb0 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c)
TARGET_NAMING (h5copy ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5copy " " " ")
TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools)
@@ -26,6 +27,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c)
TARGET_NAMING (h5copygentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5copygentest " " " ")
TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools)
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index 8eb5ad1..e4e722a 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -14,6 +14,7 @@ ADD_EXECUTABLE (h5diff
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c
)
TARGET_NAMING (h5diff ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5diff " " " ")
TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools)
@@ -25,6 +26,7 @@ IF (H5_HAVE_PARALLEL)
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c
)
TARGET_NAMING (ph5diff ${LIB_TYPE})
+ TARGET_C_PROPERTIES (ph5diff " " " ")
TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools)
ENDIF (H5_HAVE_PARALLEL)
@@ -42,6 +44,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
TARGET_NAMING (h5diffgentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5diffgentest " " " ")
TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools)
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index 607d58e..a916ec5 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -101,7 +101,6 @@ int main(int argc, const char *argv[])
print_info(&options);
-out:
/*-------------------------------------------------------------------------
* exit code
* 1 if differences, 0 if no differences, 2 if error
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index c7ebe63..8d15e2b 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -15,6 +15,7 @@ ADD_EXECUTABLE (h5dump
${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c
)
TARGET_NAMING (h5dump ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5dump " " " ")
TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools)
@@ -33,6 +34,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
TARGET_NAMING (h5dumpgentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5dumpgentest " " " ")
TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools)
@@ -50,6 +52,7 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl
@@ -148,6 +151,7 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/trawdatafile.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/trawssetfile.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl
@@ -199,6 +203,7 @@ IF (BUILD_TESTING)
tall-6.exp
tnoddlfile.exp
trawdatafile.exp
+ trawssetfile.exp
tstr2bin2.exp
tstr2bin6.exp
twithddl.exp
@@ -301,6 +306,7 @@ IF (BUILD_TESTING)
${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err
${PROJECT_SOURCE_DIR}/errfiles/tall-1.err
${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err
+ ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err
${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err
${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err
${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err
@@ -1068,6 +1074,8 @@ IF (BUILD_TESTING)
tall-2.out.err
tall-2A.out
tall-2A.out.err
+ tall-2A0.out
+ tall-2A0.out.err
tall-2B.out
tall-2B.out.err
tall-3.out
@@ -1254,6 +1262,9 @@ IF (BUILD_TESTING)
trawdatafile.out
trawdatafile.out.err
trawdatafile.txt
+ trawssetfile.out
+ trawssetfile.out.err
+ trawssetfile.txt
tno-subset.out
tno-subset.out.err
tnullspace.out
@@ -1369,7 +1380,8 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5)
ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o)
ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o)
-
+ ADD_H5_TEST_EXPORT (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -y -o)
+
ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o)
# test for maximum display datasets
@@ -1498,6 +1510,9 @@ IF (BUILD_TESTING)
# test '-A' to suppress data but print attr's
ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5)
+ # test '-A' to suppress attr's but print data
+ ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5)
+
# test '-r' to print attributes in ASCII instead of decimal
ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5)
@@ -1631,20 +1646,14 @@ IF (BUILD_TESTING)
ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin)
- SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5)
- SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects)
+ ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
# the NATIVE test can be validated with h5import/h5diff
ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin)
- SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5)
- SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects)
+ ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
# test for dataset region references
diff --git a/tools/h5dump/errfiles/tall-2A0.err b/tools/h5dump/errfiles/tall-2A0.err
new file mode 100644
index 0000000..ba691d0
--- /dev/null
+++ b/tools/h5dump/errfiles/tall-2A0.err
@@ -0,0 +1,25 @@
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Oopen(): unable to open object
+ major: Symbol table
+ minor: Can't open object
+ #001: (file name) line (number) in H5O_open_name(): object not found
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID
+ major: Symbol table
+ minor: Unable to find atom information (already closed?)
+ #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile'
+ major: Links
+ minor: Unable to open file
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index d89202c..9b304bd 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -30,7 +30,7 @@ static const char *xml_dtd_uri = NULL;
/* module-scoped variables for XML option */
#define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"
-#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd"
+#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"
/* Standard DDL output */
static const dump_functions ddl_function_table = {
@@ -71,7 +71,7 @@ struct handler_t {
*/
/* The following initialization makes use of C language cancatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*";
+static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -175,7 +175,7 @@ static struct long_options l_opts[] = {
{ "xml-n", require_arg, 'X' },
{ "xml", no_arg, 'x' },
{ "xm", no_arg, 'x' },
- { "onlyattr", no_arg, 'A' },
+ { "onlyattr", optional_arg, 'A' },
{ "escape", no_arg, 'e' },
{ "noindex", no_arg, 'y' },
{ "binary", optional_arg, 'b' },
@@ -221,11 +221,6 @@ leave(int ret)
* Purpose: Print the usage message about dumper
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * Pedro Vicente, October 5, 2007. Add -q and -z flags
*-------------------------------------------------------------------------
*/
static void
@@ -240,6 +235,7 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n");
PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n");
PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
+ PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n");
PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n");
PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n");
PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n");
@@ -1093,9 +1089,14 @@ parse_start:
last_was_dset = FALSE;
break;
case 'A':
- display_data = FALSE;
- display_attr_data = TRUE;
- last_was_dset = FALSE;
+ if ( opt_arg != NULL) {
+ if(0 == HDatoi(opt_arg)) include_attrs = FALSE;
+ }
+ else {
+ display_data = FALSE;
+ display_attr_data = TRUE;
+ last_was_dset = FALSE;
+ }
break;
case 'i':
display_oid = TRUE;
@@ -1649,7 +1650,7 @@ main(int argc, const char *argv[])
indx = HDstrrchr(ns,(int)':');
if (indx) *indx = '\0';
- PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
+ PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
"http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns);
diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h
index 7d4f460..7bfead7 100644
--- a/tools/h5dump/h5dump.h
+++ b/tools/h5dump/h5dump.h
@@ -76,6 +76,7 @@ int display_region = FALSE; /*print region reference data */
int enable_error_stack= FALSE; /* re-enable error stack */
int disable_compact_subset= FALSE; /* disable compact form of subset notation */
int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/
+int include_attrs = TRUE; /* Display attributes */
/* sort parameters */
H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index c4a9ecb..a9a23a5 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -556,19 +556,20 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags)
{
/* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set
in the group for attributes, then, sort by creation order, otherwise by name */
-
- if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) {
- if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) {
- error_msg("error getting attribute information\n");
- h5tools_setstatus(EXIT_FAILURE);
- } /* end if */
- } /* end if */
- else {
- if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) {
- error_msg("error getting attribute information\n");
- h5tools_setstatus(EXIT_FAILURE);
+ if(include_attrs) {
+ if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) {
+ if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) {
+ error_msg("error getting attribute information\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ } /* end if */
} /* end if */
- } /* end else */
+ else {
+ if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) {
+ error_msg("error getting attribute information\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ } /* end if */
+ } /* end else */
+ }
}
/*-------------------------------------------------------------------------
@@ -1360,8 +1361,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
string_dataformat.do_escape = display_escape;
outputformat = &string_dataformat;
- //attr_name = attr + j + 1;
- // need to replace escape characters
attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/");
diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h
index 5a0f2bd..08f9e36 100644
--- a/tools/h5dump/h5dump_extern.h
+++ b/tools/h5dump/h5dump_extern.h
@@ -76,6 +76,7 @@ extern int display_region; /*print region reference data */
extern int enable_error_stack; /* re-enable error stack */
extern int disable_compact_subset; /* disable compact form of subset notation */
extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/
+extern int include_attrs; /* Display attributes */
/* sort parameters */
extern H5_index_t sort_by; /*sort_by [creation_order | name] */
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index ceefc08..0e3cfda 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -59,7 +59,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
+TEST_P_DIR=./testfiles
TESTDIR=./testfiles/std
+test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
@@ -173,6 +175,7 @@ $SRC_H5DUMP_TESTFILES/packedbits.ddl
$SRC_H5DUMP_TESTFILES/tall-1.ddl
$SRC_H5DUMP_TESTFILES/tall-2.ddl
$SRC_H5DUMP_TESTFILES/tall-2A.ddl
+$SRC_H5DUMP_TESTFILES/tall-2A0.ddl
$SRC_H5DUMP_TESTFILES/tall-2B.ddl
$SRC_H5DUMP_TESTFILES/tall-3.ddl
$SRC_H5DUMP_TESTFILES/tall-4s.ddl
@@ -274,6 +277,8 @@ $SRC_H5DUMP_TESTFILES/tno-subset.ddl
$SRC_H5DUMP_TESTFILES/tnullspace.ddl
$SRC_H5DUMP_TESTFILES/trawdatafile.ddl
$SRC_H5DUMP_TESTFILES/trawdatafile.exp
+$SRC_H5DUMP_TESTFILES/trawssetfile.ddl
+$SRC_H5DUMP_TESTFILES/trawssetfile.exp
$SRC_H5DUMP_TESTFILES/zerodim.ddl
$SRC_H5DUMP_TESTFILES/tordergr1.ddl
$SRC_H5DUMP_TESTFILES/tordergr2.ddl
@@ -331,6 +336,7 @@ LIST_ERROR_TEST_FILES="
${SRC_H5DUMP_ERRORFILES}/filter_fail.err
${SRC_H5DUMP_ERRORFILES}/tall-1.err
${SRC_H5DUMP_ERRORFILES}/tall-2A.err
+${SRC_H5DUMP_ERRORFILES}/tall-2A0.err
${SRC_H5DUMP_ERRORFILES}/tall-2B.err
${SRC_H5DUMP_ERRORFILES}/tarray1_big.err
${SRC_H5DUMP_ERRORFILES}/tattr-3.err
@@ -873,6 +879,7 @@ TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5
TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5
TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5
TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5
+TOOLTEST2 trawssetfile.exp --enable-error-stack -d "/dset1[1,1;;;]" -y -o trawssetfile.txt tdset.h5
# test for maximum display datasets
TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5
@@ -1000,6 +1007,9 @@ TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5
# test '-A' to suppress data but print attr's
TOOLTEST4 tall-2A.ddl --enable-error-stack -A tall.h5
+# test '-A' to suppress attr's but print data
+TOOLTEST4 tall-2A0.ddl --enable-error-stack -A 0 tall.h5
+
# test '-r' to print attributes in ASCII instead of decimal
TOOLTEST4 tall-2B.ddl --enable-error-stack -A -r tall.h5
diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in
index 8e8e0c0..def687b 100644
--- a/tools/h5dump/testh5dumppbits.sh.in
+++ b/tools/h5dump/testh5dumppbits.sh.in
@@ -64,7 +64,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
+TEST_P_DIR=./testfiles
TESTDIR=./testfiles/pbits
+test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index a70d31c..6e4efd1 100644
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -50,7 +50,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
+TEST_P_DIR=./testfiles
TESTDIR=./testfiles/xml
+test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt
index 97f7be9..94dd69c 100644
--- a/tools/h5import/CMakeLists.txt
+++ b/tools/h5import/CMakeLists.txt
@@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c)
TARGET_NAMING (h5import ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5import " " " ")
TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools)
@@ -29,6 +30,7 @@ IF (BUILD_TESTING)
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c)
TARGET_NAMING (h5importtest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5importtest " " " ")
TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools)
diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt
index 95777b3..af9639d 100644
--- a/tools/h5jam/CMakeLists.txt
+++ b/tools/h5jam/CMakeLists.txt
@@ -11,21 +11,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c)
TARGET_NAMING (h5jam ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5jam " " " ")
TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools)
ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c)
TARGET_NAMING (getub ${LIB_TYPE})
+TARGET_C_PROPERTIES (getub " " " ")
TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools)
ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c)
TARGET_NAMING (tellub ${LIB_TYPE})
+TARGET_C_PROPERTIES (tellub " " " ")
TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c)
TARGET_NAMING (h5unjam ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5unjam " " " ")
TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools)
@@ -49,6 +53,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c)
TARGET_NAMING (h5jamgentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (testhdf5 " " " ")
TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools)
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index f536605..d84f7f2 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -153,7 +153,7 @@ main (int argc, const char *argv[])
exit (EXIT_FAILURE);
}
- buf = malloc ((unsigned)(size + 1));
+ buf = (char *)HDmalloc ((unsigned)(size + 1));
if (buf == NULL)
{
HDclose (fd);
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt
index 70943b5..2d7bd97 100644
--- a/tools/h5ls/CMakeLists.txt
+++ b/tools/h5ls/CMakeLists.txt
@@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
#-----------------------------------------------------------------------------
ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c)
TARGET_NAMING (h5ls ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5ls " " " ")
TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools)
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 06c6b71..7d251ac 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -22,6 +22,7 @@ SET (REPACK_COMMON_SRCS
ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
TARGET_NAMING (h5repack ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5repack " " " ")
TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools)
@@ -39,11 +40,13 @@ IF (BUILD_TESTING)
# --------------------------------------------------------------------
ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE})
+ TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ")
TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c)
TARGET_NAMING (h5repacktest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5repacktest " " " ")
TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools)
diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt
index 447df70..78f39dd 100644
--- a/tools/h5stat/CMakeLists.txt
+++ b/tools/h5stat/CMakeLists.txt
@@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
# --------------------------------------------------------------------
ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c)
TARGET_NAMING (h5stat ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5stat " " " ")
TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools)
@@ -29,6 +30,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
TARGET_NAMING (h5stat_gentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5stat_gentest " " " ")
TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools)
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index a68760d..dcc2c08 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -136,7 +136,8 @@ static int display_object = FALSE; /* not implemented yet */
/* a structure for handling the order command-line parameters come in */
struct handler_t {
- char *obj;
+ size_t obj_count;
+ char **obj;
};
@@ -552,7 +553,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
if(type_found)
(iter->dset_type_info[u].count)++;
else {
- unsigned curr_ntype = iter->dset_ntypes;
+ unsigned curr_ntype = (unsigned)iter->dset_ntypes;
/* Increment # of datatypes seen for datasets */
iter->dset_ntypes++;
@@ -670,9 +671,11 @@ obj_stats(const char *path, const H5O_info_t *oi, const char *already_visited,
break;
case H5O_TYPE_NAMED_DATATYPE:
- datatype_stats(iter, oi);
+ datatype_stats(iter, oi);
break;
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
default:
/* Gather statistics about this type of object */
iter->uniq_others++;
@@ -710,6 +713,9 @@ lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter)
iter->uniq_links++;
break;
+ case H5L_TYPE_HARD:
+ case H5L_TYPE_MAX:
+ case H5L_TYPE_ERROR:
default:
/* Gather statistics about this type of object */
iter->uniq_others++;
@@ -740,19 +746,19 @@ freespace_stats(hid_t fid, iter_t *iter)
/* Query section information */
if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0)
- return(FAIL);
+ return(FAIL);
else if(nsects) {
- if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t))))
- return(FAIL);
- nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info);
- HDassert(nsects);
+ if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t))))
+ return(FAIL);
+ nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info);
+ HDassert(nsects);
} /* end else-if */
for(u = 0; u < (size_t)nsects; u++) {
unsigned bin; /* "bin" the number of objects falls in */
- if(sect_info[u].size < SIZE_SMALL_SECTS)
- (iter->num_small_sects[(size_t)sect_info[u].size])++;
+ if(sect_info[u].size < SIZE_SMALL_SECTS)
+ (iter->num_small_sects[(size_t)sect_info[u].size])++;
/* Add section size to proper bin */
bin = ceil_log10((unsigned long)sect_info[u].size);
@@ -781,6 +787,35 @@ freespace_stats(hid_t fid, iter_t *iter)
/*-------------------------------------------------------------------------
+ * Function: hand_free
+ *
+ * Purpose: Free handler structure
+ *
+ * Return: Success: 0
+ *
+ * Failure: Never fails
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+hand_free(struct handler_t *hand)
+{
+ if(hand) {
+ unsigned u;
+
+ for(u = 0; u < hand->obj_count; u++)
+ if(hand->obj[u]) {
+ HDfree(hand->obj[u]);
+ hand->obj[u] = NULL;
+ } /* end if */
+ hand->obj_count = 0;
+ HDfree(hand->obj);
+ HDfree(hand);
+ } /* end if */
+} /* end hand_free() */
+
+
+/*-------------------------------------------------------------------------
* Function: parse_command_line
*
* Purpose: Parses command line and sets up global variable to control output
@@ -794,50 +829,25 @@ freespace_stats(hid_t fid, iter_t *iter)
*
*-------------------------------------------------------------------------
*/
-static struct handler_t *
-parse_command_line(int argc, const char *argv[])
+static int
+parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
{
- int opt, i;
+ int opt;
+ unsigned u;
struct handler_t *hand = NULL;
- /* Allocate space to hold the command line info */
- if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
- error_msg("unable to parse command line arguments \n");
- goto error;
- }
-
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
- switch ((char)opt) {
+ while((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ switch((char)opt) {
case 'h':
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_SUCCESS);
- if (hand) {
- for (i = 0; i < argc; i++)
- if(hand[i].obj) {
- free(hand[i].obj);
- hand[i].obj=NULL;
- }
-
- free(hand);
- hand = NULL;
- }
goto done;
break;
case 'V':
print_version(h5tools_getprogname());
h5tools_setstatus(EXIT_SUCCESS);
- if (hand) {
- for (i = 0; i < argc; i++)
- if(hand[i].obj) {
- free(hand[i].obj);
- hand[i].obj=NULL;
- }
-
- free(hand);
- hand = NULL;
- }
goto done;
break;
@@ -894,45 +904,52 @@ parse_command_line(int argc, const char *argv[])
case 'O':
display_all = FALSE;
display_object = TRUE;
- for(i = 0; i < argc; i++)
- if(!hand[i].obj) {
- hand[i].obj = HDstrdup(opt_arg);
- break;
+
+ /* Allocate space to hold the command line info */
+ if(NULL == (hand = (struct handler_t *)HDcalloc((size_t)1, sizeof(struct handler_t)))) {
+ error_msg("unable to allocate memory for object struct\n");
+ goto error;
+ } /* end if */
+
+ /* Allocate space to hold the object strings */
+ hand->obj_count = (size_t)argc;
+ if(NULL == (hand->obj = (char **)HDcalloc((size_t)argc, sizeof(char *)))) {
+ error_msg("unable to allocate memory for object array\n");
+ goto error;
+ } /* end if */
+
+ /* Store object names */
+ for(u = 0; u < hand->obj_count; u++)
+ if(NULL == (hand->obj[u] = HDstrdup(opt_arg))) {
+ error_msg("unable to allocate memory for object name\n");
+ goto error;
} /* end if */
break;
default:
usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
goto error;
} /* end switch */
} /* end while */
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if(argc <= opt_ind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
goto error;
} /* end if */
+ /* Set handler structure */
+ *hand_ret = hand;
+
done:
- return hand;
+ return 0;
error:
- if (hand) {
- for (i = 0; i < argc; i++)
- if(hand[i].obj) {
- free(hand[i].obj);
- hand[i].obj=NULL;
- }
-
- free(hand);
- hand = NULL;
- }
+ hand_free(hand);
h5tools_setstatus(EXIT_FAILURE);
- return hand;
+ return -1;
}
@@ -947,32 +964,39 @@ error:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static void
iter_free(iter_t *iter)
{
/* Clear array of bins for group counts */
- if(iter->group_bins)
- free(iter->group_bins);
- iter->group_bins = NULL;
+ if(iter->group_bins) {
+ HDfree(iter->group_bins);
+ iter->group_bins = NULL;
+ } /* end if */
+
/* Clear array of bins for attribute counts */
- if(iter->attr_bins)
- free(iter->attr_bins);
- iter->attr_bins = NULL;
+ if(iter->attr_bins) {
+ HDfree(iter->attr_bins);
+ iter->attr_bins = NULL;
+ } /* end if */
+
/* Clear dataset datatype information found */
- if(iter->dset_type_info)
- free(iter->dset_type_info);
- iter->dset_type_info = NULL;
+ if(iter->dset_type_info) {
+ HDfree(iter->dset_type_info);
+ iter->dset_type_info = NULL;
+ } /* end if */
+
/* Clear array of bins for dataset dimensions */
- if(iter->dset_dim_bins)
- free(iter->dset_dim_bins);
- iter->dset_dim_bins = NULL;
- /* Clear array of bins for free-space section sizes */
- if(iter->sect_bins)
- free(iter->sect_bins);
- iter->sect_bins = NULL;
+ if(iter->dset_dim_bins) {
+ HDfree(iter->dset_dim_bins);
+ iter->dset_dim_bins = NULL;
+ } /* end if */
- return 0;
-}
+ /* Clear array of bins for free-space section sizes */
+ if(iter->sect_bins) {
+ HDfree(iter->sect_bins);
+ iter->sect_bins = NULL;
+ } /* end if */
+} /* end iter_free() */
/*-------------------------------------------------------------------------
@@ -1428,7 +1452,7 @@ print_storage_summary(const iter_t *iter)
{
hsize_t total_meta = 0;
hsize_t unaccount = 0;
- float percent = 0.0;
+ double percent = 0.0f;
HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]);
printf("Summary of file space information:\n");
@@ -1451,7 +1475,7 @@ print_storage_summary(const iter_t *iter)
HDfprintf(stdout, " File metadata: %Hu bytes\n", total_meta);
HDfprintf(stdout, " Raw data: %Hu bytes\n", iter->dset_storage_size);
- percent = ((float)iter->free_space / (float)iter->filesize) * 100;
+ percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f;
HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n",
iter->free_space, percent);
@@ -1584,10 +1608,7 @@ main(int argc, const char *argv[])
iter_t iter;
const char *fname = NULL;
hid_t fid = -1;
- hid_t fcpl;
struct handler_t *hand = NULL;
- H5F_info2_t finfo;
- int i;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -1598,97 +1619,91 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- if((hand = parse_command_line(argc, argv))==NULL) {
- goto done;
- }
-
- fname = argv[opt_ind];
-
- printf("Filename: %s\n", fname);
-
HDmemset(&iter, 0, sizeof(iter));
- fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);
- if(fid < 0) {
- error_msg("unable to open file \"%s\"\n", fname);
- h5tools_setstatus(EXIT_FAILURE);
+ if(parse_command_line(argc, argv, &hand) < 0)
goto done;
- } /* end if */
- /* Initialize iter structure */
- iter.fid = fid;
-
- if(H5Fget_filesize(fid, &iter.filesize) < 0)
- warn_msg("Unable to retrieve file size\n");
- HDassert(iter.filesize != 0);
-
- /* Get storge info for file-level structures */
- if(H5Fget_info2(fid, &finfo) < 0)
- warn_msg("Unable to retrieve file info\n");
- else {
- iter.super_size = finfo.super.super_size;
- iter.super_ext_size = finfo.super.super_ext_size;
- iter.SM_hdr_storage_size = finfo.sohm.hdr_size;
- iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size;
- iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size;
- iter.free_space = finfo.free.tot_space;
- iter.free_hdr = finfo.free.meta_size;
- } /* end else */
-
- if((fcpl = H5Fget_create_plist(fid)) < 0)
- warn_msg("Unable to retrieve file creation property\n");
-
- if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0)
- warn_msg("Unable to retrieve userblock size\n");
+ fname = argv[opt_ind];
- if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0)
- warn_msg("Unable to retrieve file space information\n");
- HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES);
+ /* Check for filename given */
+ if(fname) {
+ hid_t fcpl;
+ H5F_info2_t finfo;
- /* get information for free-space sections */
- if(freespace_stats(fid, &iter) < 0)
- warn_msg("Unable to retrieve freespace info\n");
+ printf("Filename: %s\n", fname);
- /* Walk the objects or all file */
- if(display_object) {
- unsigned u;
+ fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if(fid < 0) {
+ error_msg("unable to open file \"%s\"\n", fname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ } /* end if */
- u = 0;
- while(hand[u].obj) {
- if (h5trav_visit(fid, hand[u].obj, TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0)
- warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj);
+ /* Initialize iter structure */
+ iter.fid = fid;
+
+ if(H5Fget_filesize(fid, &iter.filesize) < 0)
+ warn_msg("Unable to retrieve file size\n");
+ HDassert(iter.filesize != 0);
+
+ /* Get storge info for file-level structures */
+ if(H5Fget_info2(fid, &finfo) < 0)
+ warn_msg("Unable to retrieve file info\n");
+ else {
+ iter.super_size = finfo.super.super_size;
+ iter.super_ext_size = finfo.super.super_ext_size;
+ iter.SM_hdr_storage_size = finfo.sohm.hdr_size;
+ iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size;
+ iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size;
+ iter.free_space = finfo.free.tot_space;
+ iter.free_hdr = finfo.free.meta_size;
+ } /* end else */
+
+ if((fcpl = H5Fget_create_plist(fid)) < 0)
+ warn_msg("Unable to retrieve file creation property\n");
+
+ if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0)
+ warn_msg("Unable to retrieve userblock size\n");
+
+ if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0)
+ warn_msg("Unable to retrieve file space information\n");
+ HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES);
+
+ /* get information for free-space sections */
+ if(freespace_stats(fid, &iter) < 0)
+ warn_msg("Unable to retrieve freespace info\n");
+
+ /* Walk the objects or all file */
+ if(display_object) {
+ unsigned u;
+
+ for(u = 0; u < hand->obj_count; u++) {
+ if(h5trav_visit(fid, hand->obj[u], TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0)
+ warn_msg("Unable to traverse object \"%s\"\n", hand->obj[u]);
+ else
+ print_statistics(hand->obj[u], &iter);
+ } /* end for */
+ } /* end if */
+ else {
+ if(h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0)
+ warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname);
else
- print_statistics(hand[u].obj, &iter);
- u++;
- } /* end while */
+ print_statistics("/", &iter);
+ } /* end else */
} /* end if */
- else {
- if (h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0)
- warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname);
- else
- print_statistics("/", &iter);
- } /* end else */
done:
- if(hand) {
- for (i = 0; i < argc; i++)
- if(hand[i].obj) {
- free(hand[i].obj);
- hand[i].obj=NULL;
- }
+ hand_free(hand);
- free(hand);
- hand = NULL;
+ /* Free iter structure */
+ iter_free(&iter);
- /* Free iter structure */
- iter_free(&iter);
-
- if(fid >= 0 && H5Fclose(fid) < 0) {
- error_msg("unable to close file \"%s\"\n", fname);
- h5tools_setstatus(EXIT_FAILURE);
- }
- }
+ if(fid >= 0 && H5Fclose(fid) < 0) {
+ error_msg("unable to close file \"%s\"\n", fname);
+ h5tools_setstatus(EXIT_FAILURE);
+ } /* end if */
leave(h5tools_getstatus());
-}
+} /* end main() */
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index ac86e8a..6649e48 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -37,8 +37,9 @@ SET (H5_TOOLS_LIB_HDRS
)
ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS})
+TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
+SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
H5_SET_LIB_OPTIONS (
${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME}
${LIB_TYPE}
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 528fc40..96b508d 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -5783,17 +5783,19 @@ static
int ull2float(unsigned long long ull_value, float *f_value)
{
hid_t dxpl_id;
- unsigned char *buf;
+ unsigned char *buf = NULL;
size_t src_size;
size_t dst_size;
h5difftrace("ull2float start\n");
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0)
- return -1;
+ goto error;
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size));
+ if(!buf)
+ goto error;
HDmemcpy(buf, &ull_value, src_size);
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 5f4227c..3e9c43e 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -527,16 +527,18 @@ h5tools_detect_vlen_str(hid_t tid)
}
}
else if(tclass == H5T_COMPOUND) {
- int i = 0;
- int n = H5Tget_nmembers(tid);
+ unsigned nmembs;
+ int snmembs = H5Tget_nmembers(tid);
+ unsigned u;
- if(n < 0) {
- n = ret;
+ if(snmembs < 0) {
+ ret = FAIL;
goto done;
}
+ nmembs = (unsigned)snmembs;
- for(i = 0; i < n; i++) {
- hid_t mtid = H5Tget_member_type(tid, i);
+ for(u = 0; u < nmembs; u++) {
+ hid_t mtid = H5Tget_member_type(tid, u);
ret = h5tools_detect_vlen_str(mtid);
if((ret == TRUE) || (ret < 0)) {
@@ -1150,6 +1152,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
s = *(char**) mem;
if (s != NULL)
size = HDstrlen(s);
+ else
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string");
}
else {
s = (char *) mem;
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index d6cd0a0..cde249c 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -188,7 +188,7 @@ table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */
static int h5tools_print_region_data_blocks(hid_t region_id,
FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx,
h5tools_str_t *buffer/*string into which to render */, size_t ncols,
- int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata);
+ unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata);
hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
FILE *stream, const h5tool_format_t *info,
@@ -314,13 +314,13 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
if (region_space >= 0) {
if (h5tools_is_zero(memref, H5Tget_size(type))) {
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
+ h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos, 0);
/* Render the region element begin */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "NULL");
- dimension_break = h5tools_render_element(stream, info,
+ dimension_break = h5tools_render_element(rawoutstream, info,
ctx, &buffer, &curr_pos, ncols, i, elmt_counter);
}
else {
@@ -328,25 +328,25 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_name failed");
ctx->need_prefix = TRUE;
- h5tools_simple_prefix(stream, info, ctx, curr_pos+i, 0);
+ h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos+i, 0);
/* Render the region element begin */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, info->dset_format, ref_name);
- dimension_break = h5tools_render_element(stream, info,
+ dimension_break = h5tools_render_element(rawoutstream, info,
ctx, &buffer, &curr_pos, ncols, i, elmt_counter);
region_type = H5Sget_select_type(region_space);
if(region_type == H5S_SEL_POINTS)
/* Print point information */
dimension_break = h5tools_dump_region_data_points(
- region_space, region_id, stream, info, ctx,
+ region_space, region_id, rawoutstream, info, ctx,
&buffer, &curr_pos, ncols, i, elmt_counter);
else if(region_type == H5S_SEL_HYPERSLABS)
/* Print block information */
dimension_break = h5tools_dump_region_data_blocks(
- region_space, region_id, stream, info, ctx,
+ region_space, region_id, rawoutstream, info, ctx,
&buffer, &curr_pos, ncols, i, elmt_counter);
else
HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type");
@@ -419,7 +419,7 @@ static int
h5tools_print_region_data_blocks(hid_t region_id,
FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx,
h5tools_str_t *buffer/*string into which to render */, size_t ncols,
- int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata)
+ unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
{
hbool_t dimension_break = TRUE;
hsize_t *dims1 = NULL;
@@ -432,9 +432,9 @@ h5tools_print_region_data_blocks(hid_t region_id,
unsigned int region_flags; /* buffer extent flags */
hsize_t numelem;
hsize_t numindex;
- size_t jndx;
unsigned indx;
- int type_size;
+ unsigned jndx;
+ size_t type_size;
int ret_value = SUCCEED;
hid_t mem_space = -1;
hid_t sid1 = -1;
@@ -447,6 +447,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
HDassert(ptdata);
HDmemset(&ctx, 0, sizeof(ctx));
+
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
@@ -463,7 +464,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
}
/* Create dataspace for reading buffer */
- if((mem_space = H5Screate_simple(ndims, dims1, NULL)) < 0)
+ if((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
if((type_size = H5Tget_size(type_id)) == 0)
@@ -504,7 +505,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
/* assume entire data space to be printed */
- for (indx = 0; indx < (size_t) ctx.ndims; indx++)
+ for (indx = 0; indx < (unsigned)ctx.ndims; indx++)
ctx.p_min_idx[indx] = start[indx];
init_acc_pos(&ctx, total_size);
@@ -513,11 +514,11 @@ h5tools_print_region_data_blocks(hid_t region_id,
if (blkndx == nblocks - 1)
region_flags |= END_OF_DATA;
- for (indx = 0; indx < (size_t)ctx.ndims; indx++)
+ for (indx = 0; indx < (unsigned)ctx.ndims; indx++)
ctx.p_max_idx[indx] = dims1[indx];
curr_pos = 0;
- ctx.sm_pos = blkndx*2*ndims;
+ ctx.sm_pos = blkndx * 2 * ndims;
ctx.size_last_dim = dims1[ndims-1];
h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0);
@@ -540,7 +541,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
if(FALSE == dimension_break)
elmtno = 0;
- } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */
+ } /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */
ctx.indent_level--;
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -593,24 +594,28 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
{
HERR_INIT(hbool_t, TRUE)
hbool_t dimension_break = TRUE;
- hssize_t nblocks;
+ hssize_t snblocks;
+ hsize_t nblocks;
hsize_t alloc_size;
hsize_t *ptdata = NULL;
- int ndims;
+ int sndims;
+ unsigned ndims;
hid_t dtype = -1;
hid_t type_id = -1;
- int i;
+ hsize_t u;
HDassert(info);
HDassert(ctx);
HDassert(buffer);
- if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
+ if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
+ nblocks = (hsize_t)snblocks;
/* Print block information */
- if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0)
+ if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ ndims = (unsigned)sndims;
/* Render the region { element begin */
h5tools_str_reset(buffer);
@@ -632,30 +637,28 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
{
HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
HGOTO_DONE(dimension_break);
- //HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
}
- H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t);
- if(H5Sget_select_hyper_blocklist(region_space, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0)
+ if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0)
HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed");
- for (i = 0; i < nblocks; i++) {
- int j;
+ for(u = 0; u < nblocks; u++) {
+ unsigned v;
h5tools_str_append(buffer, info->dset_blockformat_pre,
- i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) i);
+ u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u);
/* Start coordinates and opposite corner */
- for (j = 0; j < ndims; j++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(",
- ptdata[i * 2 * ndims + j]);
+ for (v = 0; v < ndims; v++)
+ h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : "(",
+ ptdata[u * 2 * ndims + v]);
- for (j = 0; j < ndims; j++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(",
- ptdata[i * 2 * ndims + j + ndims]);
+ for (v = 0; v < ndims; v++)
+ h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : ")-(",
+ ptdata[u * 2 * ndims + v + ndims]);
h5tools_str_append(buffer, ")");
- } /* end for (i = 0; i < nblocks; i++) */
+ } /* end for (u = 0; u < nblocks; u++) */
dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter);
/* Render the region datatype info and indices element end */
@@ -1786,7 +1789,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if(!sset)
status = h5tools_dump_simple_dset(rawdatastream, info, ctx, dset, p_type);
else
- status = h5tools_dump_simple_subset(stream, info, ctx, dset, p_type, sset);
+ status = h5tools_dump_simple_subset(rawdatastream, info, ctx, dset, p_type, sset);
}
else
/* space is H5S_NULL */
@@ -2222,12 +2225,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
/* Change the endianness and see if they're equal. */
order = H5Tget_order(tmp_type);
- if (order == H5T_ORDER_LE)
- H5Tset_order(str_type, H5T_ORDER_LE);
- else if (order == H5T_ORDER_BE)
- H5Tset_order(str_type, H5T_ORDER_BE);
-
- if (H5Tequal(tmp_type, str_type)) {
+ if(order == H5T_ORDER_LE) {
+ if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ } /* end if */
+ else if(order == H5T_ORDER_BE) {
+ if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ } /* end if */
+
+ if(H5Tequal(tmp_type, str_type)) {
h5tools_str_append(buffer, "H5T_C_S1;");
goto found_string_type;
}
@@ -2249,12 +2256,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
/* Change the endianness and see if they're equal. */
order = H5Tget_order(tmp_type);
- if (order == H5T_ORDER_LE)
- H5Tset_order(str_type, H5T_ORDER_LE);
- else if (order == H5T_ORDER_BE)
- H5Tset_order(str_type, H5T_ORDER_BE);
-
- if (H5Tequal(tmp_type, str_type)) {
+ if(order == H5T_ORDER_LE) {
+ if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ } /* end if */
+ else if(order == H5T_ORDER_BE) {
+ if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed");
+ } /* end if */
+
+ if(H5Tequal(tmp_type, str_type)) {
h5tools_str_append(buffer, "H5T_FORTRAN_S1;");
goto found_string_type;
}
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index e17ae89..9bacd19 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -631,8 +631,6 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info,
for (i = 0; i < indentlevel; i++) {
h5tools_str_append(str, "%s", OPT(info->line_indent, ""));
}
-
-// ctx->need_prefix = 0;
}
/*-------------------------------------------------------------------------
@@ -1397,24 +1395,24 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac
char *head = NULL;
if ( substr == NULL || replacement == NULL )
- return strdup (string);
+ return HDstrdup (string);
- newstr = strdup (string);
+ newstr = HDstrdup (string);
head = newstr;
- while ( (tok = strstr ( head, substr ))){
+ while ( (tok = HDstrstr ( head, substr ))){
oldstr = newstr;
- newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 );
+ newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 );
if ( newstr == NULL ){
HDfree (oldstr);
return NULL;
}
- memcpy ( newstr, oldstr, tok - oldstr );
- memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) );
- memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) );
- memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 );
+ HDmemcpy ( newstr, oldstr, tok - oldstr );
+ HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) );
+ HDmemcpy ( newstr + (tok - oldstr) + HDstrlen( replacement ), tok + HDstrlen ( substr ), HDstrlen ( oldstr ) - HDstrlen ( substr ) - ( tok - oldstr ) );
+ HDmemset ( newstr + HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) , 0, 1 );
/* move back head right after the last replacement */
- head = newstr + (tok - oldstr) + strlen( replacement );
+ head = newstr + (tok - oldstr) + HDstrlen( replacement );
HDfree (oldstr);
}
diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt
index e778d2f..dc98967 100644
--- a/tools/misc/CMakeLists.txt
+++ b/tools/misc/CMakeLists.txt
@@ -12,16 +12,19 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
#-- Misc Executables
ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c)
TARGET_NAMING (h5debug ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5debug " " " ")
TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c)
TARGET_NAMING (h5repart ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5repart " " " ")
TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c)
TARGET_NAMING (h5mkgrp ${LIB_TYPE})
+TARGET_C_PROPERTIES (h5mkgrp " " " ")
TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools)
@@ -51,6 +54,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c)
TARGET_NAMING (h5repart_gentest ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5repart_gentest " " " ")
TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>)
@@ -58,6 +62,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c)
TARGET_NAMING (h5repart_test ${LIB_TYPE})
+ TARGET_C_PROPERTIES (h5repart_test " " " ")
TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools)
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index 40510a4..b735b18 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tall-2A.h5.xml b/tools/testfiles/tall-2A.h5.xml
index d118a69..c7d2fcf 100644
--- a/tools/testfiles/tall-2A.h5.xml
+++ b/tools/testfiles/tall-2A.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="attr1">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tall-2A0.ddl b/tools/testfiles/tall-2A0.ddl
new file mode 100644
index 0000000..e0955f3
--- /dev/null
+++ b/tools/testfiles/tall-2A0.ddl
@@ -0,0 +1,64 @@
+HDF5 "tall.h5" {
+GROUP "/" {
+ GROUP "g1" {
+ GROUP "g1.1" {
+ DATASET "dset1.1.1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ DATA {
+ (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ (1,0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ (2,0): 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
+ (3,0): 0, 3, 6, 9, 12, 15, 18, 21, 24, 27,
+ (4,0): 0, 4, 8, 12, 16, 20, 24, 28, 32, 36,
+ (5,0): 0, 5, 10, 15, 20, 25, 30, 35, 40, 45,
+ (6,0): 0, 6, 12, 18, 24, 30, 36, 42, 48, 54,
+ (7,0): 0, 7, 14, 21, 28, 35, 42, 49, 56, 63,
+ (8,0): 0, 8, 16, 24, 32, 40, 48, 56, 64, 72,
+ (9,0): 0, 9, 18, 27, 36, 45, 54, 63, 72, 81
+ }
+ }
+ DATASET "dset1.1.2" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 20 ) / ( 20 ) }
+ DATA {
+ (0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ (17): 17, 18, 19
+ }
+ }
+ }
+ GROUP "g1.2" {
+ EXTERNAL_LINK "extlink" {
+ TARGETFILE "somefile"
+ TARGETPATH "somepath"
+ }
+ GROUP "g1.2.1" {
+ SOFTLINK "slink" {
+ LINKTARGET "somevalue"
+ }
+ }
+ }
+ }
+ GROUP "g2" {
+ DATASET "dset2.1" {
+ DATATYPE H5T_IEEE_F32BE
+ DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
+ DATA {
+ (0): 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9
+ }
+ }
+ DATASET "dset2.2" {
+ DATATYPE H5T_IEEE_F32BE
+ DATASPACE SIMPLE { ( 3, 5 ) / ( 3, 5 ) }
+ DATA {
+ (0,0): 0, 0.1, 0.2, 0.3, 0.4,
+ (1,0): 0, 0.2, 0.4, 0.6, 0.8,
+ (2,0): 0, 0.3, 0.6, 0.9, 1.2
+ }
+ }
+ USERDEFINED_LINK "udlink" {
+ LINKCLASS 187
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml
index a74ccbe..ba130f1 100644
--- a/tools/testfiles/tall.h5.xml
+++ b/tools/testfiles/tall.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="attr1">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml
index 86db36f..26d2d9b 100644
--- a/tools/testfiles/tarray1.h5.xml
+++ b/tools/testfiles/tarray1.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml
index 7f89b9b..8f4f312 100644
--- a/tools/testfiles/tarray2.h5.xml
+++ b/tools/testfiles/tarray2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml
index 0b74db8..3879994 100644
--- a/tools/testfiles/tarray3.h5.xml
+++ b/tools/testfiles/tarray3.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml
index 628a342..0fb50ed 100644
--- a/tools/testfiles/tarray6.h5.xml
+++ b/tools/testfiles/tarray6.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml
index dbf5ec5..e6a5bca 100644
--- a/tools/testfiles/tarray7.h5.xml
+++ b/tools/testfiles/tarray7.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml
index fceea99..ce54360 100644
--- a/tools/testfiles/tattr.h5.xml
+++ b/tools/testfiles/tattr.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Attribute Name="/attr1">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml
index 73365f0..c8ba026 100644
--- a/tools/testfiles/tbitfields.h5.xml
+++ b/tools/testfiles/tbitfields.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="typetests" OBJ-XID="xid_1344" H5Path="/typetests" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="bitfield_1" OBJ-XID="xid_1720" H5Path= "/typetests/bitfield_1" Parents="xid_1344" H5ParentPaths="/typetests">
diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml
index 10ef36e..5c74493 100644
--- a/tools/testfiles/tcompound.h5.xml
+++ b/tools/testfiles/tcompound.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:NamedDataType Name="#6632" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/">
<hdf5:DataType>
diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml
index ac139d9..5c69cef 100644
--- a/tools/testfiles/tcompound2.h5.xml
+++ b/tools/testfiles/tcompound2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:NamedDataType Name="#9560" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/">
<hdf5:DataType>
diff --git a/tools/testfiles/tcompound_complex.h5.xml b/tools/testfiles/tcompound_complex.h5.xml
index b35193a..92bd64d 100644
--- a/tools/testfiles/tcompound_complex.h5.xml
+++ b/tools/testfiles/tcompound_complex.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="CompoundComplex" OBJ-XID="xid_976" H5Path= "/CompoundComplex" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml
index 327e213..ea65384 100644
--- a/tools/testfiles/tdatareg.h5.xml
+++ b/tools/testfiles/tdatareg.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1284" H5Path= "/Dataset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml
index e914bf6..80dcf6f 100644
--- a/tools/testfiles/tdset.h5.xml
+++ b/tools/testfiles/tdset.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml
index 34f43e1..7f78685 100644
--- a/tools/testfiles/tdset2.h5.xml
+++ b/tools/testfiles/tdset2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tempty-dtd-2.h5.xml b/tools/testfiles/tempty-dtd-2.h5.xml
index a9b1d4f..213d582 100644
--- a/tools/testfiles/tempty-dtd-2.h5.xml
+++ b/tools/testfiles/tempty-dtd-2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
diff --git a/tools/testfiles/tempty-dtd.h5.xml b/tools/testfiles/tempty-dtd.h5.xml
index a9b1d4f..213d582 100644
--- a/tools/testfiles/tempty-dtd.h5.xml
+++ b/tools/testfiles/tempty-dtd.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
diff --git a/tools/testfiles/tempty-ns-2.h5.xml b/tools/testfiles/tempty-ns-2.h5.xml
index 3476b60..00040d2 100644
--- a/tools/testfiles/tempty-ns-2.h5.xml
+++ b/tools/testfiles/tempty-ns-2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<thing:RootGroup OBJ-XID="xid_928" H5Path="/">
<thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<thing:StorageLayout>
diff --git a/tools/testfiles/tempty-ns.h5.xml b/tools/testfiles/tempty-ns.h5.xml
index 3476b60..00040d2 100644
--- a/tools/testfiles/tempty-ns.h5.xml
+++ b/tools/testfiles/tempty-ns.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<thing:HDF5-File xmlns:thing="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<thing:RootGroup OBJ-XID="xid_928" H5Path="/">
<thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<thing:StorageLayout>
diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml
index d75bc70..41eef37 100644
--- a/tools/testfiles/tempty.h5.xml
+++ b/tools/testfiles/tempty.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml
index ecc7804..33a6e62 100644
--- a/tools/testfiles/tenum.h5.xml
+++ b/tools/testfiles/tenum.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:NamedDataType Name="enum normal" OBJ-XID="xid_976" H5Path="/enum normal" Parents="xid_928" H5ParentPaths="/">
<hdf5:DataType>
diff --git a/tools/testfiles/textlink.h5.xml b/tools/testfiles/textlink.h5.xml
index f6c7ff6..9097f79 100644
--- a/tools/testfiles/textlink.h5.xml
+++ b/tools/testfiles/textlink.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:ExternalLink LinkName="extlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/extlink1" TargetFilename="filename" TargetPath="objname" Parents="xid_96" H5ParentPaths="/" />
<hdf5:ExternalLink LinkName="extlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/extlink2" TargetFilename="anotherfile" TargetPath="anotherobj" Parents="xid_96" H5ParentPaths="/" />
diff --git a/tools/testfiles/tfpformat.h5.xml b/tools/testfiles/tfpformat.h5.xml
index c2bd96f..6445979 100644
--- a/tools/testfiles/tfpformat.h5.xml
+++ b/tools/testfiles/tfpformat.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_96" H5Path="/">
<Dataset Name="double" OBJ-XID="xid_800" H5Path= "/double" Parents="xid_96" H5ParentPaths="/">
diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml
index 8065165..1eaf662 100644
--- a/tools/testfiles/tgroup.h5.xml
+++ b/tools/testfiles/tgroup.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_3616" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml
index 65d7f8a..d0fa36e 100644
--- a/tools/testfiles/thlink.h5.xml
+++ b/tools/testfiles/thlink.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_808" H5Path= "/dset1" Parents="xid_96" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml
index 36e8f1b..8cc6880 100644
--- a/tools/testfiles/tloop.h5.xml
+++ b/tools/testfiles/tloop.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml
index 185e08b..e2df102 100644
--- a/tools/testfiles/tloop2.h5.xml
+++ b/tools/testfiles/tloop2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml
index 8056783..842f1f5 100644
--- a/tools/testfiles/tmany.h5.xml
+++ b/tools/testfiles/tmany.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_800" H5Path="/g1" Parents="xid_96" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_1832" H5Path="/g1/g1.1" Parents="xid_800" H5ParentPaths="/g1" >
diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml
index f28cdc5..e40c38b 100644
--- a/tools/testfiles/tname-amp.h5.xml
+++ b/tools/testfiles/tname-amp.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&amp;withamp">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml
index 2194971..2acd0bf 100644
--- a/tools/testfiles/tname-apos.h5.xml
+++ b/tools/testfiles/tname-apos.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&apos;withapos">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml
index 6a56587..b44949e 100644
--- a/tools/testfiles/tname-gt.h5.xml
+++ b/tools/testfiles/tname-gt.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&gt;withgt">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml
index a6d2480..b148275 100644
--- a/tools/testfiles/tname-lt.h5.xml
+++ b/tools/testfiles/tname-lt.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&lt;withlt">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml
index 96ad068..83fd347 100644
--- a/tools/testfiles/tname-quot.h5.xml
+++ b/tools/testfiles/tname-quot.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&quot;withquot">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml
index d6f8278..07b80e4 100644
--- a/tools/testfiles/tname-sp.h5.xml
+++ b/tools/testfiles/tname-sp.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1 withspace">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tnamed_dtype_attr.h5.xml b/tools/testfiles/tnamed_dtype_attr.h5.xml
index 199211c..c0e30b4 100644
--- a/tools/testfiles/tnamed_dtype_attr.h5.xml
+++ b/tools/testfiles/tnamed_dtype_attr.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Dataset Name="Dataset" OBJ-XID="xid_1256" H5Path= "/Dataset" Parents="xid_96" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml
index 2cae353..a5ca214 100644
--- a/tools/testfiles/tnestedcomp.h5.xml
+++ b/tools/testfiles/tnestedcomp.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="ArrayOfStructures" OBJ-XID="xid_744" H5Path= "/ArrayOfStructures" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml
index 17b4ac9..b60c4dc 100644
--- a/tools/testfiles/tnodata.h5.xml
+++ b/tools/testfiles/tnodata.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl
index 440e3d9..e8d6d84 100644
--- a/tools/testfiles/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/tnofilename-with-packed-bits.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml
index 016b298..71eb6ed 100644
--- a/tools/testfiles/tobjref.h5.xml
+++ b/tools/testfiles/tobjref.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="Dataset3" OBJ-XID="xid_2348" H5Path= "/Dataset3" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml
index 314fd23..25dbcdb 100644
--- a/tools/testfiles/topaque.h5.xml
+++ b/tools/testfiles/topaque.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="opaque test" OBJ-XID="xid_744" H5Path= "/opaque test" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/torderattr1.h5.xml b/tools/testfiles/torderattr1.h5.xml
index 027cd64..e3e56eb 100644
--- a/tools/testfiles/torderattr1.h5.xml
+++ b/tools/testfiles/torderattr1.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="a">
<hdf5:Dataspace>
diff --git a/tools/testfiles/torderattr2.h5.xml b/tools/testfiles/torderattr2.h5.xml
index fe441da..1163afb 100644
--- a/tools/testfiles/torderattr2.h5.xml
+++ b/tools/testfiles/torderattr2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="c">
<hdf5:Dataspace>
diff --git a/tools/testfiles/torderattr3.h5.xml b/tools/testfiles/torderattr3.h5.xml
index 38bbef7..73ef223 100644
--- a/tools/testfiles/torderattr3.h5.xml
+++ b/tools/testfiles/torderattr3.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="a">
<hdf5:Dataspace>
diff --git a/tools/testfiles/torderattr4.h5.xml b/tools/testfiles/torderattr4.h5.xml
index 0f90b22..1cc78fd 100644
--- a/tools/testfiles/torderattr4.h5.xml
+++ b/tools/testfiles/torderattr4.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="c">
<hdf5:Dataspace>
diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl
index 758b6b4..06c5613 100644
--- a/tools/testfiles/tpbitsIncomplete.ddl
+++ b/tools/testfiles/tpbitsIncomplete.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl
index a85ba49..ffd9910 100644
--- a/tools/testfiles/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/tpbitsLengthExceeded.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl
index d5a1c88..a54812b 100644
--- a/tools/testfiles/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/tpbitsLengthPositive.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl
index e24245c..1a8dd11 100644
--- a/tools/testfiles/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/tpbitsMaxExceeded.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl
index 8f58c47..7527131 100644
--- a/tools/testfiles/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/tpbitsOffsetExceeded.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl
index 6df8cce..21b573d 100644
--- a/tools/testfiles/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/tpbitsOffsetNegative.ddl
@@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files
-B, --superblock Print the content of the super block
-H, --header Print the header only; no data is displayed
-A, --onlyattr Print the header and value of attributes
+ Optional value 0 suppresses printing attributes.
-i, --object-ids Print the object ids
-r, --string Print 1-byte integer datasets as ASCII
-e, --escape Escape non printing characters
diff --git a/tools/testfiles/trawssetfile.ddl b/tools/testfiles/trawssetfile.ddl
new file mode 100644
index 0000000..e8f07f8
--- /dev/null
+++ b/tools/testfiles/trawssetfile.ddl
@@ -0,0 +1,14 @@
+HDF5 "tdset.h5" {
+DATASET "/dset1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 10, 20 ) / ( 10, 20 ) }
+ SUBSET {
+ START ( 1, 1 );
+ STRIDE ( 1, 1 );
+ COUNT ( 1, 1 );
+ BLOCK ( 1, 1 );
+ DATA {
+ }
+ }
+}
+}
diff --git a/tools/testfiles/trawssetfile.exp b/tools/testfiles/trawssetfile.exp
new file mode 100644
index 0000000..2de8392
--- /dev/null
+++ b/tools/testfiles/trawssetfile.exp
@@ -0,0 +1,2 @@
+
+ 2 \ No newline at end of file
diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml
index 8126484..40c6b89 100644
--- a/tools/testfiles/tref-escapes-at.h5.xml
+++ b/tools/testfiles/tref-escapes-at.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset space" OBJ-XID="xid_3716" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1">
diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml
index 6c6455b..4ebac85 100644
--- a/tools/testfiles/tref-escapes.h5.xml
+++ b/tools/testfiles/tref-escapes.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset space" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1">
diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml
index 7ff360e..4c3fb8f 100644
--- a/tools/testfiles/tref.h5.xml
+++ b/tools/testfiles/tref.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset1" Parents="xid_1344" H5ParentPaths="/Group1">
diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml
index 8da41b9..d646791 100644
--- a/tools/testfiles/tsaf.h5.xml
+++ b/tools/testfiles/tsaf.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name=".DSL_METADATA" OBJ-XID="xid_744" H5Path= "/.DSL_METADATA" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml
index 9d8040e..493decd 100644
--- a/tools/testfiles/tslink.h5.xml
+++ b/tools/testfiles/tslink.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:SoftLink LinkName="slink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/slink1" TargetPath="somevalue" Parents="xid_696" H5ParentPaths="/" />
<hdf5:SoftLink LinkName="slink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/slink2" TargetPath="linkvalue" Parents="xid_696" H5ParentPaths="/" />
diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml
index d7214fd..32d63af 100644
--- a/tools/testfiles/tstr.h5.xml
+++ b/tools/testfiles/tstr.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="comp1" OBJ-XID="xid_2520" H5Path= "/comp1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml
index 26758b3..1203417 100644
--- a/tools/testfiles/tstr2.h5.xml
+++ b/tools/testfiles/tstr2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="dset1" OBJ-XID="xid_1720" H5Path= "/g1/dset1" Parents="xid_1344" H5ParentPaths="/g1">
diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml
index 1962610..a8281f4 100644
--- a/tools/testfiles/tstring-at.h5.xml
+++ b/tools/testfiles/tstring-at.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml
index ebd0a3c..d68db77 100644
--- a/tools/testfiles/tstring.h5.xml
+++ b/tools/testfiles/tstring.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tudlink.h5.xml b/tools/testfiles/tudlink.h5.xml
index 7e57dd8..137c47b 100644
--- a/tools/testfiles/tudlink.h5.xml
+++ b/tools/testfiles/tudlink.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:UserDefined LinkName="udlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/udlink1" LinkClass="187" Parents="xid_96" H5ParentPaths="/" />
<hdf5:UserDefined LinkName="udlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/udlink2" LinkClass="187" Parents="xid_96" H5ParentPaths="/" />
diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml
index 9c519f0..b1aa5a6 100644
--- a/tools/testfiles/tvldtypes1.h5.xml
+++ b/tools/testfiles/tvldtypes1.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml
index 9cabfdf..662ad3a 100644
--- a/tools/testfiles/tvldtypes2.h5.xml
+++ b/tools/testfiles/tvldtypes2.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml
index 811d536..56d81a1 100644
--- a/tools/testfiles/tvldtypes3.h5.xml
+++ b/tools/testfiles/tvldtypes3.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tvldtypes4.h5.xml b/tools/testfiles/tvldtypes4.h5.xml
index 1d368ce..8e31bd9 100644
--- a/tools/testfiles/tvldtypes4.h5.xml
+++ b/tools/testfiles/tvldtypes4.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tvldtypes5.h5.xml b/tools/testfiles/tvldtypes5.h5.xml
index d6ed774..be68e09 100644
--- a/tools/testfiles/tvldtypes5.h5.xml
+++ b/tools/testfiles/tvldtypes5.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset" OBJ-XID="xid_976" H5Path= "/Dataset" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml
index e5ec1f3..d945964 100644
--- a/tools/testfiles/tvlstr.h5.xml
+++ b/tools/testfiles/tvlstr.h5.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
+<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="test_scalar">
<hdf5:Dataspace>
diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h
index a112ad1..e042076 100644
--- a/vms/src/h5pubconf.h
+++ b/vms/src/h5pubconf.h
@@ -102,6 +102,9 @@
/* Define if the direct I/O virtual file driver should be compiled */
/* #undef H5_HAVE_DIRECT */
+/* Define to 1 if you have the <dirent.h> header file. */
+#define H5_HAVE_DIRENT_H 1
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define H5_HAVE_DLFCN_H 1
@@ -199,6 +202,9 @@
/* Define to 1 if you have the <io.h> header file. */
/* #undef H5_HAVE_IO_H */
+/* Define to 1 if you have the `dl' library (-ldl). */
+#define H5_HAVE_LIBDL 1
+
/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */
/* #undef H5_HAVE_LIBDMALLOC */
@@ -277,6 +283,9 @@
/* Define to 1 if you have the `rand_r' function. */
/* #define H5_HAVE_RAND_R 1 */
+/* Define to 1 if you have the `setjmp' function. */
+#define H5_HAVE_SETJMP 1
+
/* Define to 1 if you have the <setjmp.h> header file. */
#define H5_HAVE_SETJMP_H 1
@@ -505,7 +514,7 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.151"
+#define H5_PACKAGE_STRING "HDF5 1.9.156"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
@@ -514,7 +523,7 @@
#define H5_PACKAGE_URL ""
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.151"
+#define H5_PACKAGE_VERSION "1.9.156"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "ll"
@@ -677,7 +686,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.151"
+#define H5_VERSION "1.9.156"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */
diff --git a/vms/src/make.com b/vms/src/make.com
index bd1f55c..cdf0f4a 100644
--- a/vms/src/make.com
+++ b/vms/src/make.com
@@ -57,7 +57,7 @@ $ cobj1= "H5MFaggr, H5MF, H5MFdbg, H5MFsection, H5MM,"+-
"H5O, H5Ocache, H5Ochunk, H5Ocont, H5Ocopy, H5Odbg, H5Odrvinfo, H5Odtype, H5Oefl, H5Ofill, H5Ofsinfo,"+-
"H5Oginfo, H5Olayout, H5Olinfo, H5Olink, H5Omessage, H5Omtime, H5Oname, H5Onull, H5Opline,"+-
"H5Orefcount, H5Osdspace, H5Oshared, H5Oshmesg, H5Ostab, H5Otest, H5Ounknown,"+-
- "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+-
+ "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pencdec, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+-
"H5Plapl, H5Plcpl, H5Pocpl, H5Pocpypl, H5Pstrcpl, H5Ptest,"+-
"H5R, H5RC, H5Rdeprec, H5RS, H5Sall, H5S, H5Sdbg, H5Shyper, H5SL, H5SMbtree2, H5SM, H5SMcache,"+-
"H5SMmessage, H5Smpio, H5SMtest, H5Snone, H5Spoint, H5Sselect, H5ST, H5Stest,"+-