From a2e93075f2ec86dad367a8aafadc20f6386f9b0e Mon Sep 17 00:00:00 2001 From: "Frank.Willmore" Date: Fri, 30 Sep 2016 11:50:14 -0500 Subject: added test file --- this_is_a_test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 this_is_a_test diff --git a/this_is_a_test b/this_is_a_test new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From 80d57c242a15edd983673e9bad4e966c72975289 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Apr 2017 15:18:18 -0400 Subject: Set the HDF5_GENERATE_HEADERS CMake option to default to ON and removed the option from the CMake cache init files. Fixes HDFFV-10184 --- config/cmake/cacheinit.cmake | 2 -- config/cmake/mccacheinit.cmake | 2 -- release_docs/INSTALL_CMake.txt | 3 +-- src/CMakeLists.txt | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index c923283..6a66c8a 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -17,8 +17,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 1f60a01..3f0dd4f 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -17,8 +17,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 4c4460e..7cb0225 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -396,7 +396,6 @@ These five steps are described in detail below. # EXTERNAL cache entries ######################## set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) - set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) @@ -592,7 +591,7 @@ HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF +HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2acd30..178c954 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -816,7 +816,7 @@ set (H5_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) -option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) find_package (Perl) -- cgit v0.12 From 0bf41bec5aab468036f32afb287f224d266edf7a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Apr 2017 16:32:38 -0500 Subject: Add extra files to be copied --- config/cmake/README.txt.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 1d6ef45..ceeda49 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -35,6 +35,8 @@ To test the installation with the examples; Create a directory to run the examples. Copy HDF5Examples folder to this directory. Copy HDF5_Examples.cmake to this directory. + Copy HDF5_Examples_options.cmake to this directory. + Copy CTestScript.cmake to this directory. The default source folder is defined as "HDF5Examples". It can be changed with the CTEST_SOURCE_NAME script option. The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". @@ -44,7 +46,7 @@ To test the installation with the examples; be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". - Other options can be changed by editing the HDF5_Examples.cmake file. + Other options can be changed by editing the HDF5_Examples_options.cmake file. If the defaults are okay, execute from this directory: ctest -S HDF5_Examples.cmake -C Release -V -O test.log -- cgit v0.12 From be49a9422654ac9eec07ffe3599b4a7f7561cdb6 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 28 Apr 2017 16:37:22 -0500 Subject: Comment out install-exec-hooks to remove libdynlib* files. Allen did the same for hdf5_1_10 and hdf5_1_10_1 because the hooks don't reliably work. In the develop branch they are causing make install failures because the autotools' install commands sometimes attempt to chmod these files when they no longer exist. --- test/Makefile.am | 4 ++-- tools/test/h5diff/Makefile.am | 4 ++-- tools/test/h5dump/Makefile.am | 4 ++-- tools/test/h5ls/Makefile.am | 4 ++-- tools/test/h5repack/Makefile.am | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index b274302..20b63f6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -126,8 +126,8 @@ libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_li libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 922dddc..5721aaa 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -57,8 +57,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5diff. They should diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index 64d2d7c..df97396 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -46,8 +46,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5dumpgentest. They should diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 9773ee5..8ace14d 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -43,8 +43,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index b3cfc88..da2a3c3 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -56,8 +56,8 @@ libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EX libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif -- cgit v0.12 From 7608b264e4a0325589ba6300ca9666ce83d88b37 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 May 2017 12:36:02 -0500 Subject: Make test scripts fail if result files are created --- tools/test/h5copy/testh5copy.sh.in | 2 + tools/test/h5diff/h5diff_plugin.sh.in | 2 + tools/test/h5diff/testh5diff.sh.in | 2 + tools/test/h5dump/h5dump_plugin.sh.in | 2 + tools/test/h5dump/testh5dump.sh.in | 46 +++- tools/test/h5dump/testh5dumppbits.sh.in | 22 +- tools/test/h5dump/testh5dumpvds.sh.in | 8 + tools/test/h5dump/testh5dumpxml.sh.in | 14 +- tools/test/h5jam/testh5jam.sh.in | 438 ++++++++++++++++---------------- tools/test/h5ls/h5ls_plugin.sh.in | 30 ++- tools/test/h5ls/testh5ls.sh.in | 36 +-- tools/test/h5ls/testh5lsvds.sh.in | 34 +-- tools/test/h5repack/h5repack.sh.in | 38 +-- tools/test/h5stat/testh5stat.sh.in | 60 ++--- tools/test/misc/testh5mkgrp.sh.in | 32 ++- 15 files changed, 418 insertions(+), 348 deletions(-) diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index ace3981..203bfef 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -381,6 +381,8 @@ CMP_OUTPUT() # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index 0390c40..212f5d6 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -242,6 +242,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 86658e2..d769c23 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -502,6 +502,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index e7ac564..6a00a16 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -196,6 +196,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index cf5f246..d6eab4e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -487,6 +487,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $xCMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else @@ -529,11 +531,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -584,16 +590,22 @@ TOOLTEST2A() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $DIFF $expectdata $actualdata; then if [ ! -f $expectmeta ]; then # Create the expect meta file if it doesn't yet exist. echo " CREATED" cp $actualmeta $expectmeta + echo " Expected metafile (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectmeta $actualmeta; then echo " PASSED" else @@ -645,6 +657,8 @@ TOOLTEST2B() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -700,6 +714,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -757,15 +773,17 @@ TOOLTEST4() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" @@ -821,15 +839,17 @@ TOOLTEST5() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" @@ -863,6 +883,8 @@ TOOLTEST_HELP() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actual $expect-CREATED + echo " Expected output (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index 3b9b078..9cf5c99 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -241,6 +241,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -282,11 +284,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -348,6 +354,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -404,15 +412,17 @@ TOOLTEST4() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index 63c0d85..f89234e 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -220,6 +220,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -261,11 +263,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -327,6 +333,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 5a69845..a33f5bc 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -202,10 +202,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -263,7 +263,9 @@ TOOLTEST() { if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actual $expect + cp $actual $expect + echo " Expected result (*.xml) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -279,7 +281,7 @@ TOOLTEST() { fi } -# Print a "SKIP" message +# Print a "SKIP" message SKIP() { TESTING $DUMPER $@ echo " -SKIP-" @@ -345,7 +347,7 @@ TOOLTEST tsaf.h5.xml --xml tsaf.h5 TOOLTEST tempty.h5.xml --xml tempty.h5 TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5 ##Test dataset and attribute of null space. Commented out: -## wait until the XML schema is updated for null space. +## wait until the XML schema is updated for null space. ##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5 # other options for xml @@ -356,7 +358,7 @@ TOOLTEST tempty-nons.h5.xml --xml -X ":" tempty.h5 TOOLTEST tempty-nons-2.h5.xml --xml --xml-ns=":" tempty.h5 ## Some of these combinations are syntactically correct but -## the URLs are dummies +## the URLs are dummies TOOLTEST tempty-ns.h5.xml --xml -X "thing:" tempty.h5 TOOLTEST tempty-ns-2.h5.xml --xml --xml-ns="thing:" tempty.h5 TOOLTEST tempty-nons-uri.h5.xml --xml --xml-ns=":" --xml-dtd="http://somewhere.net" tempty.h5 diff --git a/tools/test/h5jam/testh5jam.sh.in b/tools/test/h5jam/testh5jam.sh.in index d3d7a9a..3ae180b 100644 --- a/tools/test/h5jam/testh5jam.sh.in +++ b/tools/test/h5jam/testh5jam.sh.in @@ -107,10 +107,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -154,19 +154,19 @@ SKIP() { echo " -SKIP-" } -# +# # COMPARE_FILES a.h5 b.h5 -# Compare two files, skipping the first line. This is used to +# Compare two files, skipping the first line. This is used to # compare the output of the dumper, skipping the file name which # is different. # The result is stored in 'compval'. # cmpval=0; COMPARE_FILES() { - $AWK 'NR > 1' $1 > $1.cmp - $AWK 'NR > 1' $2 > $2.cmp - $CMP $1.cmp $2.cmp - cmpval=$? + $AWK 'NR > 1' $1 > $1.cmp + $AWK 'NR > 1' $2 > $2.cmp + $CMP $1.cmp $2.cmp + cmpval=$? rm -f $1.cmp $2.cmp } @@ -174,10 +174,10 @@ COMPARE_FILES() { # Clean up named files. CLEANUP() { if test -z "$HDF5_NOCLEANUP"; then - for i in $* - do - rm -f $i - done + for i in $* + do + rm -f $i + done fi } @@ -190,7 +190,7 @@ CLEANUP() { # the "cat" command. # SETUP() { - cat < $1 > $2 + cat < $1 > $2 } # @@ -233,7 +233,7 @@ CHECKFILE() { } # -# CHECK_UB file.h5 user_block_file origfile.h5 +# CHECK_UB file.h5 user_block_file origfile.h5 # # Check the user block in 'file.h5' is the same as # 'user_block' (allowing for padding). @@ -243,73 +243,73 @@ CHECKFILE() { # and the test file compared to: # cat compare_ub user_block_file. # -# This test uses './getub' to extract the user block from +# This test uses './getub' to extract the user block from # 'file.h5', which is compared to the file described above. # # The result is set in variable 'result1'. # result1=0; CHECK_UB_1() { - hfile="$1" - ufile="$2" - - # check for third argument (the original file) - origfile=""; - if [ -n "$3" ]; - then - origfile="$3" - fi - - # find the length of the user block to check - s1=`cat $ufile | wc -c | sed -e 's/ //g'` - if [ "$s1" = "0" ]; - then - echo "File "$ufile" is empty" - result1=1; - fi - - # Get the size of the original user block, if any. - if [ -n "$origfile" ]; - then - # 'tellub' calls H5Fget_user_block to get the size - # of the user block - s2=`$JAM_BIN/tellub $origfile` - if [ "$s2" = "0" ]; - then - size=$s1; - cmpfile=$ufile - else - cmpfile="tt2" - size=`expr $s2 + $s1` - $JAM_BIN/getub -c $s2 $origfile > $cmpfile - cat $ufile >> $cmpfile - fi - else - # assume no user block - s2="0" - size=$s1; - cmpfile=$ufile - fi - - # Extract 'size' bytes from the front of 'hfile' - # Compare to 'cmpfile', result is set in result1 - tfile="tt1" - $JAM_BIN/getub -c $size $hfile > $tfile - res=`cmp $cmpfile $tfile` - if [ "$?" != "0" ]; - then - echo $res - result1=1; - else - result1=0; - fi - - # clean up - rm -f $tfile - if [ "$s2" != "0" ] ; - then - rm -f $cmpfile - fi + hfile="$1" + ufile="$2" + + # check for third argument (the original file) + origfile=""; + if [ -n "$3" ]; + then + origfile="$3" + fi + + # find the length of the user block to check + s1=`cat $ufile | wc -c | sed -e 's/ //g'` + if [ "$s1" = "0" ]; + then + echo "File "$ufile" is empty" + result1=1; + fi + + # Get the size of the original user block, if any. + if [ -n "$origfile" ]; + then + # 'tellub' calls H5Fget_user_block to get the size + # of the user block + s2=`$JAM_BIN/tellub $origfile` + if [ "$s2" = "0" ]; + then + size=$s1; + cmpfile=$ufile + else + cmpfile="tt2" + size=`expr $s2 + $s1` + $JAM_BIN/getub -c $s2 $origfile > $cmpfile + cat $ufile >> $cmpfile + fi + else + # assume no user block + s2="0" + size=$s1; + cmpfile=$ufile + fi + + # Extract 'size' bytes from the front of 'hfile' + # Compare to 'cmpfile', result is set in result1 + tfile="tt1" + $JAM_BIN/getub -c $size $hfile > $tfile + res=`cmp $cmpfile $tfile` + if [ "$?" != "0" ]; + then + echo $res + result1=1; + else + result1=0; + fi + + # clean up + rm -f $tfile + if [ "$s2" != "0" ] ; + then + rm -f $cmpfile + fi } @@ -321,25 +321,25 @@ CHECK_UB_1() { result2=0; CHECK_NOUB() { - hfile="$1" - - # call 'ubsize' to get the size of the user block - ubsize=`$JAM_BIN/tellub $hfile` - - if [ "$?" != "0" ]; - then - # error - result2=1; - else - if [ "$ubsize" = "0" ]; - then - # pass - result2=0; - else - # fail - result2=1; - fi - fi + hfile="$1" + + # call 'ubsize' to get the size of the user block + ubsize=`$JAM_BIN/tellub $hfile` + + if [ "$?" != "0" ]; + then + # error + result2=1; + else + if [ "$ubsize" = "0" ]; + then + # pass + result2=0; + else + # fail + result2=1; + fi + fi } # JAMTEST user_block file.h5 [--clobber] [ofile.h5] @@ -351,119 +351,119 @@ CHECK_NOUB() { # 3. check the user block is correct in the output (Check_UB) # If the user block is correct, print "PASSED", else "*FAILED*" JAMTEST() { - ufile="$1" - ifile="$2" - compare_test="" # the file to test - compare_orig="" # the comparison to test against - cleanup="" - - # sort out the arguments for the test and the check - do_clobber="no" - if [ "$3" = "--clobber" ]; - then - # clobber overwrites any existing user block - do_clobber="yes" - clobber="--clobber" - compare_orig="" - if [ -z "$4" ]; - then - # output goes to infile, compare ubfile to infile - ofile="" - compare_test="$ifile" - else - # output goes to $4, compare ofile to ubfile - ofile="$4" - compare_test="$ofile" - fi - else - clobber="" - # add user block to existing ub, if any - if [ -z "$3" ]; - then - # output goes to infile, compare ubfile to infile - ofile="" - compare_test="$ifile" - cp $ifile xxofile.h5 - compare_orig="xxofile.h5" - cleanup="$cleanup $compare_orig" - else - # output goes to $3, compare ofile to ubfile - ofile="$3" - compare_test="$ofile" - compare_orig="$ifile" - fi - fi - - # call 'jam' with the appropriate arguments - if [ -n "$ofile" ]; - then - TESTING h5jam -u `basename $ufile` -i `basename $ifile` -o `basename $ofile` $clobber - $JAM_BIN/$JAM -u $ufile -i $ifile -o $ofile $clobber - else - TESTING jam -u `basename $ufile` -i `basename $ifile` $clobber - $JAM_BIN/$JAM -u $ufile -i $ifile $clobber - fi - - #echo "CHECK_UB_1 $compare_test $ufile $compare_orig" - CHECK_UB_1 $compare_test $ufile $compare_orig - - if [ "$result1" = "0" ] ; - then - echo " PASSED" - else - echo " *FAILED*" - nerrors="`expr $nerrors + 1`" - fi - CLEANUP $cleanup + ufile="$1" + ifile="$2" + compare_test="" # the file to test + compare_orig="" # the comparison to test against + cleanup="" + + # sort out the arguments for the test and the check + do_clobber="no" + if [ "$3" = "--clobber" ]; + then + # clobber overwrites any existing user block + do_clobber="yes" + clobber="--clobber" + compare_orig="" + if [ -z "$4" ]; + then + # output goes to infile, compare ubfile to infile + ofile="" + compare_test="$ifile" + else + # output goes to $4, compare ofile to ubfile + ofile="$4" + compare_test="$ofile" + fi + else + clobber="" + # add user block to existing ub, if any + if [ -z "$3" ]; + then + # output goes to infile, compare ubfile to infile + ofile="" + compare_test="$ifile" + cp $ifile xxofile.h5 + compare_orig="xxofile.h5" + cleanup="$cleanup $compare_orig" + else + # output goes to $3, compare ofile to ubfile + ofile="$3" + compare_test="$ofile" + compare_orig="$ifile" + fi + fi + + # call 'jam' with the appropriate arguments + if [ -n "$ofile" ]; + then + TESTING h5jam -u `basename $ufile` -i `basename $ifile` -o `basename $ofile` $clobber + $JAM_BIN/$JAM -u $ufile -i $ifile -o $ofile $clobber + else + TESTING jam -u `basename $ufile` -i `basename $ifile` $clobber + $JAM_BIN/$JAM -u $ufile -i $ifile $clobber + fi + + #echo "CHECK_UB_1 $compare_test $ufile $compare_orig" + CHECK_UB_1 $compare_test $ufile $compare_orig + + if [ "$result1" = "0" ] ; + then + echo " PASSED" + else + echo " *FAILED*" + nerrors="`expr $nerrors + 1`" + fi + CLEANUP $cleanup } - + # UNJAMTEST file.h5 [- | --delete] ofile # # Test the 'unjam' tool # ###fix the working directory here and in jamtest UNJAMTEST () { - infile="$1" - ofile="$3" - if [ "$2" = "-" ]; - then - uofile="uofile" - TESTING h5unjam -i `basename $infile` -o `basename $ofile` "> "`basename $uofile` - $JAM_BIN/$UNJAM -i $infile -o $ofile > $uofile - else - if [ "$2" = "--delete" ]; - then - uofile="none" - TESTING h5unjam -i `basename $infile` -o `basename $ofile` --delete - $JAM_BIN/$UNJAM -i $infile -o $ofile --delete - - else - uofile="$2" - TESTING h5unjam -i `basename $infile` -u `basename $uofile` -o `basename $ofile` - $JAM_BIN/$UNJAM -i $infile -u $uofile -o $ofile - fi - fi - - result1=0 - result2=0 - cleanup="" - if [ "$uofile" != "none" ]; - then - # sets result1 - CHECK_UB_1 $infile $uofile - CLEANUP $uofile - fi - - # sets result2 - CHECK_NOUB $ofile - - if [ "$result1" = "0" -a "$result2" = "0" ]; - then - echo " PASSED" - else - echo " *FAILED*" - nerrors="`expr $nerrors + 1`" - fi + infile="$1" + ofile="$3" + if [ "$2" = "-" ]; + then + uofile="uofile" + TESTING h5unjam -i `basename $infile` -o `basename $ofile` "> "`basename $uofile` + $JAM_BIN/$UNJAM -i $infile -o $ofile > $uofile + else + if [ "$2" = "--delete" ]; + then + uofile="none" + TESTING h5unjam -i `basename $infile` -o `basename $ofile` --delete + $JAM_BIN/$UNJAM -i $infile -o $ofile --delete + + else + uofile="$2" + TESTING h5unjam -i `basename $infile` -u `basename $uofile` -o `basename $ofile` + $JAM_BIN/$UNJAM -i $infile -u $uofile -o $ofile + fi + fi + + result1=0 + result2=0 + cleanup="" + if [ "$uofile" != "none" ]; + then + # sets result1 + CHECK_UB_1 $infile $uofile + CLEANUP $uofile + fi + + # sets result2 + CHECK_NOUB $ofile + + if [ "$result1" = "0" -a "$result2" = "0" ]; + then + echo " PASSED" + else + echo " *FAILED*" + nerrors="`expr $nerrors + 1`" + fi } @@ -500,28 +500,30 @@ TOOLTEST_OUTPUT() { STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - # combine stderr to stdout for output compare + # combine stderr to stdout for output compare cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect - rm -f $actual $actual_sav $actual_err $actual_err_sav + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" + rm -f $actual $actual_sav $actual_err $actual_err_sav elif $CMP $expect $actual; then echo " PASSED" - rm -f $actual $actual_sav $actual_err $actual_err_sav + rm -f $actual $actual_sav $actual_err $actual_err_sav else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -550,19 +552,19 @@ CHECKFILE $TESTDIR/tall.h5 ta5.h5 CLEANUP ta5.h5 SETUP $TESTDIR/tall.h5 ta6.h5 -JAMTEST $TESTDIR/u10.txt ta6.h5 +JAMTEST $TESTDIR/u10.txt ta6.h5 CHECKFILE $TESTDIR/tall.h5 ta6.h5 CLEANUP ta6.h5 SETUP $TESTDIR/tall.h5 ta7.h5 -JAMTEST $TESTDIR/u511.txt ta7.h5 +JAMTEST $TESTDIR/u511.txt ta7.h5 CHECKFILE $TESTDIR/tall.h5 ta7.h5 CLEANUP ta7.h5 SETUP $TESTDIR/tall.h5 ta8.h5 -JAMTEST $TESTDIR/u512.txt ta8.h5 +JAMTEST $TESTDIR/u512.txt ta8.h5 CHECKFILE $TESTDIR/tall.h5 ta8.h5 CLEANUP ta8.h5 SETUP $TESTDIR/tall.h5 ta9.h5 -JAMTEST $TESTDIR/u513.txt ta9.h5 +JAMTEST $TESTDIR/u513.txt ta9.h5 CHECKFILE $TESTDIR/tall.h5 ta9.h5 CLEANUP ta9.h5 @@ -592,29 +594,29 @@ JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 tax9.h5 CHECKFILE $TESTDIR/tall.h5 tax9.h5 CLEANUP tax9.h5 -JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5 CHECKFILE $TESTDIR/tall.h5 taz2.h5 CLEANUP taz2.h5 JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 --clobber taz3.h5 CHECKFILE $TESTDIR/tall.h5 taz3.h5 CLEANUP taz3.h5 -JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 CHECKFILE $TESTDIR/tall.h5 taz4.h5 CLEANUP taz4.h5 -JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 CHECKFILE $TESTDIR/tall.h5 taz5.h5 CLEANUP taz5.h5 -JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5 CHECKFILE $TESTDIR/tall.h5 taz6.h5 CLEANUP taz6.h5 JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 --clobber taz7.h5 CHECKFILE $TESTDIR/tall.h5 taz7.h5 CLEANUP taz7.h5 -JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5 CHECKFILE $TESTDIR/tall.h5 taz8.h5 CLEANUP taz8.h5 -JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5 CHECKFILE $TESTDIR/tall.h5 taz9.h5 CLEANUP taz9.h5 @@ -653,7 +655,7 @@ CHECKFILE $TESTDIR/tall.h5 tay9.h5 CLEANUP tay9.h5 #--------------------------------- -# Testing h5unjam +# Testing h5unjam #--------------------------------- # help page TOOLTEST_OUTPUT UNJAM h5unjam-help.txt 0 -h diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index 34114d8..c89269d 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -184,7 +184,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $ENVCMD $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -196,31 +196,33 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 31877d9..a88ae88 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -181,7 +181,7 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." @@ -239,7 +239,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -251,37 +251,39 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test diff --git a/tools/test/h5ls/testh5lsvds.sh.in b/tools/test/h5ls/testh5lsvds.sh.in index ddb1632..eb44367 100644 --- a/tools/test/h5ls/testh5lsvds.sh.in +++ b/tools/test/h5ls/testh5lsvds.sh.in @@ -187,7 +187,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -199,37 +199,39 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index c943b22..08f670b 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -177,7 +177,7 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." @@ -373,6 +373,8 @@ VERIFY_LAYOUT_VDS() # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else @@ -384,7 +386,7 @@ VERIFY_LAYOUT_VDS() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi # clean up tmp files @@ -539,11 +541,11 @@ TOOLTEST1() ) RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } @@ -570,11 +572,11 @@ TOOLTESTV() ) >$actual 2>$actual_err RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi # display output compare @@ -635,6 +637,8 @@ TOOLTESTM() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.tst) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -646,7 +650,7 @@ TOOLTESTM() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -760,11 +764,11 @@ TOOLTEST_META() # verify sizes. MESSAGE "Verify the sizes of both output files ($size1 vs $size2)" if [ $size1 -lt $size2 ]; then - # pass - echo " PASSED" + # pass + echo " PASSED" else - #fail - echo "*FAILED*" + #fail + echo "*FAILED*" nerrors="`expr $nerrors + 1`" fi @@ -791,6 +795,8 @@ TOOLTEST_HELP() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actual $expect-CREATED + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif cmp -s $expect $actual; then echo " PASSED" else @@ -838,7 +844,7 @@ USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN` fi ############################################################################## -### T H E T E S T S +### T H E T E S T S ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in index c4a52c3..ca7ca4c 100644 --- a/tools/test/h5stat/testh5stat.sh.in +++ b/tools/test/h5stat/testh5stat.sh.in @@ -14,8 +14,8 @@ # Tests for the h5stat tool # # Modifcations: -# Vailin Choi; July 2013 -# Add tests for -l, -m, -a options +# Vailin Choi; July 2013 +# Add tests for -l, -m, -a options # srcdir=@srcdir@ @@ -132,10 +132,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -199,9 +199,11 @@ TOOLTEST() { cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -220,15 +222,15 @@ TOOLTEST() { # Print a "SKIP" message SKIP() { - TESTING $STAT $@ - echo " -SKIP-" + TESTING $STAT $@ + echo " -SKIP-" } - + ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -252,7 +254,7 @@ TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5 TOOLTEST h5stat_filters-UD.ddl -D h5stat_filters.h5 TOOLTEST h5stat_filters-UT.ddl -T h5stat_filters.h5 # -# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c # as of release 1.8.7-snap0 (on a 64-bit machine) TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5 # h5stat_newgrat.h5 is generated by h5stat_gentest.c @@ -262,36 +264,36 @@ TOOLTEST h5stat_newgrat-UA.ddl -A h5stat_newgrat.h5 # h5stat_idx.h5 is generated by h5stat_gentest.c TOOLTEST h5stat_idx.ddl h5stat_idx.h5 # -# Tests for -l (--links) option on h5stat_threshold.h5: -# -l 0 (incorrect threshold value) -# -g -l 8 -# --links=8 -# --links=20 -g +# Tests for -l (--links) option on h5stat_threshold.h5: +# -l 0 (incorrect threshold value) +# -g -l 8 +# --links=8 +# --links=20 -g TOOLTEST h5stat_err1_links.ddl -l 0 h5stat_threshold.h5 TOOLTEST h5stat_links1.ddl -g -l 8 h5stat_threshold.h5 TOOLTEST h5stat_links2.ddl --links=8 h5stat_threshold.h5 TOOLTEST h5stat_links3.ddl --links=20 -g h5stat_threshold.h5 # -# Tests for -l (--links) option on h5stat_newgrat.h5: -# -g -# -g -l 40000 +# Tests for -l (--links) option on h5stat_newgrat.h5: +# -g +# -g -l 40000 TOOLTEST h5stat_links4.ddl -g h5stat_newgrat.h5 TOOLTEST h5stat_links5.ddl -g -l 40000 h5stat_newgrat.h5 # # Tests for -m (--dims) option on h5stat_threshold.h5 -# -d --dims=-1 (incorrect threshold value) -# -gd -m 5 -# -d --di=15 +# -d --dims=-1 (incorrect threshold value) +# -gd -m 5 +# -d --di=15 TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5 TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5 TOOLTEST h5stat_dims2.ddl -d --di=15 h5stat_threshold.h5 # # Tests for -a option on h5stat_threshold.h5 -# -a -2 (incorrect threshold value) -# --numattrs (without threshold value) -# -AS -a 10 -# -a 1 -# -A --numattrs=25 +# -a -2 (incorrect threshold value) +# --numattrs (without threshold value) +# -AS -a 10 +# -a 1 +# -A --numattrs=25 TOOLTEST h5stat_err1_numattrs.ddl -a -2 h5stat_threshold.h5 TOOLTEST h5stat_err2_numattrs.ddl --numattrs h5stat_threshold.h5 TOOLTEST h5stat_numattrs1.ddl -AS -a 10 h5stat_threshold.h5 @@ -299,7 +301,7 @@ TOOLTEST h5stat_numattrs2.ddl -a 1 h5stat_threshold.h5 TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5 # # Tests for -a option on h5stat_newgrat.h5 -# -A -a 100 +# -A -a 100 TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5 # diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 3990bd2..3ad1f71 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -98,7 +98,7 @@ COPY_TESTFILES_TO_TESTDIR() $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -122,7 +122,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -TESTING() +TESTING() { SPACES=" " echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' @@ -134,7 +134,7 @@ TESTING() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_H5LS() +VERIFY_H5LS() { SPACES=" " echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -146,7 +146,7 @@ VERIFY_H5LS() # Assumed arguments: # $* arguments for h5mkgrp. -TOOLTEST() +TOOLTEST() { TESTING $H5MKGRP $@ ( @@ -171,7 +171,7 @@ TOOLTEST() # Call the h5ls tool to verify the correct output data in the destination file # -H5LSTEST() +H5LSTEST() { expect="$TESTDIR/`basename $1 .h5`.ls" actual="$TESTDIR/`basename $1 .h5`.out" @@ -191,9 +191,11 @@ H5LSTEST() STDERR_FILTER $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -215,7 +217,7 @@ H5LSTEST() # $1 is test file name # $2 is h5mkgrp options # $* are groups to create -RUNTEST() +RUNTEST() { FILEOUT=$1 shift @@ -244,7 +246,7 @@ RUNTEST() # $1 is test expected output file # $2 is h5mkgrp options # $* are groups to create -CMPTEST() +CMPTEST() { FILEOUT=$1 expect="$TESTDIR/`basename $1 .h5`.txt" @@ -260,11 +262,13 @@ CMPTEST() $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual - + if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + echo " CREATED" + cp $actual $expect + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -302,7 +306,7 @@ RUNTEST h5mkgrp_several_v.h5 "-v" one two RUNTEST h5mkgrp_several_p.h5 "-p" one two RUNTEST h5mkgrp_several_l.h5 "-l" one two -# Create various nested groups +# Create various nested groups RUNTEST h5mkgrp_nested_p.h5 "-p" /one/two RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four -- cgit v0.12 From bcaf579ac4f0dba23b58c80a693ca40e5909b321 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 May 2017 15:54:40 -0500 Subject: Add test file to list and fix test typo --- tools/test/h5dump/testh5dump.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index d6eab4e..acd7e28 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -97,6 +97,7 @@ $SRC_H5DUMP_TESTFILES/tattrintsize.h5 $SRC_H5DUMP_TESTFILES/tattrreg.h5 $SRC_H5DUMP_TESTFILES/tbigdims.h5 $SRC_H5DUMP_TESTFILES/tbinary.h5 +$SRC_H5DUMP_TESTFILES/tbitopaque.h5 $SRC_H5DUMP_TESTFILES/tchar.h5 $SRC_H5DUMP_TESTFILES/tcmpdattrintsize.h5 $SRC_H5DUMP_TESTFILES/tcmpdintsize.h5 @@ -217,6 +218,7 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl +$SRC_H5DUMP_TESTFILES/tbitopaque.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl @@ -1058,7 +1060,7 @@ TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 -TOOLTEST tcompound_complex.ddl --enable-error-stack tcompound_complex2.h5 +TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5 -- cgit v0.12 From 006e56802196ee6a43261aec7027815ad24ad3db Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 11:41:47 -0500 Subject: Remove duplicate defines --- tools/test/perform/pio_standalone.h | 9 --------- tools/test/perform/sio_standalone.h | 9 --------- 2 files changed, 18 deletions(-) diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 66ca05a..a40cff8 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -189,15 +189,6 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDoff_t off_t #endif -#ifndef H5_HAVE_WIN32_API -/* These definitions differ in Windows and are defined in - * H5win32defs for that platform. - */ -typedef struct stat h5_stat_t; -typedef off_t h5_stat_size_t; -#define HDoff_t off_t -#endif /* H5_HAVE_WIN32_API */ - #define HDftell(F) ftell(F) #define HDftruncate(F,L) ftruncate(F,L) #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 8d6d110..e73a6b5 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -211,15 +211,6 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDoff_t off_t #endif -#ifndef H5_HAVE_WIN32_API -/* These definitions differ in Windows and are defined in - * H5win32defs for that platform. - */ -typedef struct stat h5_stat_t; -typedef off_t h5_stat_size_t; -#define HDoff_t off_t -#endif /* H5_HAVE_WIN32_API */ - #define HDftell(F) ftell(F) #define HDftruncate(F,L) ftruncate(F,L) #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) -- cgit v0.12 From 412f68103ecc9e75a895dd057ad28d0e456f3a58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 13:31:48 -0500 Subject: Use correct var types for data --- tools/test/h5dump/h5dumpgentest.c | 37 +++++++++++++++++++------------------ tools/testfiles/tbitnopaque.ddl | 32 ++++++++++++++++---------------- tools/testfiles/tbitnopaque.h5 | Bin 8240 -> 8240 bytes 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 48bc27d..169eddb 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -9717,18 +9717,19 @@ static void gent_bitnopaquefields(void) /* Compound datatype */ typedef struct s_t { - unsigned char a; - unsigned int b; - unsigned long c; - unsigned long long d; + uint8_t a; + uint16_t b; + uint32_t c; + uint64_t d; } s_t; + hid_t file, grp=-1, type=-1, space=-1, dset=-1; size_t i; hsize_t nelmts = F80_DIM32; - unsigned char buf[F80_DIM32]; /* bitfield, opaque */ - unsigned int buf2[F80_DIM32]; /* bitfield, opaque */ - unsigned long buf3[F80_DIM32]; /* bitfield, opaque */ - unsigned long long buf4[F80_DIM32]; /* bitfield, opaque */ + uint8_t buf[F80_DIM32]; /* bitfield, opaque */ + uint16_t buf2[F80_DIM32]; /* bitfield, opaque */ + uint32_t buf3[F80_DIM32]; /* bitfield, opaque */ + uint64_t buf4[F80_DIM32]; /* bitfield, opaque */ s_t buf5[F80_DIM32]; /* compound */ file = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -9739,7 +9740,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf[i] = (unsigned char)0xff ^ (unsigned char)i; + buf[i] = (uint8_t)0xff ^ (uint8_t)i; } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); @@ -9754,7 +9755,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf2[i] = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); @@ -9769,7 +9770,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_3", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf3[i] = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); + buf3[i] = (uint32_t)0xffffffff ^ (uint32_t)(i * 32); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); H5Dclose(dset); @@ -9784,7 +9785,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_4", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf4[i] = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + buf4[i] = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf4); H5Dclose(dset); @@ -9804,7 +9805,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) - buf[i] = (unsigned char)0xff ^ (unsigned char)i; + buf[i] = (uint8_t)0xff ^ (uint8_t)i; H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); } @@ -9820,7 +9821,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) - buf2[i] = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16); H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); @@ -9843,10 +9844,10 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) { - buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; - buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); - buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); - buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + buf5[i].a = (uint8_t)0xff ^ (uint8_t)i; + buf5[i].b = (uint16_t)0xffff ^ (uint16_t)(i * 16); + buf5[i].c = (uint32_t)0xffffffff ^ (uint32_t)(i * 32); + buf5[i].d = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); diff --git a/tools/testfiles/tbitnopaque.ddl b/tools/testfiles/tbitnopaque.ddl index 9000463..0c59c0b 100644 --- a/tools/testfiles/tbitnopaque.ddl +++ b/tools/testfiles/tbitnopaque.ddl @@ -15,24 +15,24 @@ GROUP "/" { DATATYPE H5T_STD_B16LE DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff, 00:00, ef:ff, 00:00, df:ff, 00:00, cf:ff, 00:00, bf:ff, - (9): 00:00, af:ff, 00:00, 9f:ff, 00:00, 8f:ff, 00:00, 7f:ff, 00:00, - (18): 6f:ff, 00:00, 5f:ff, 00:00, 4f:ff, 00:00, 3f:ff, 00:00, 2f:ff, - (27): 00:00, 1f:ff, 00:00, 0f:ff, 00:00 + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe } } DATASET "bitfield_3" { DATATYPE H5T_STD_B32LE DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff:ff:ff, 00:00:00:00, df:ff:ff:ff, 00:00:00:00, - (4): bf:ff:ff:ff, 00:00:00:00, 9f:ff:ff:ff, 00:00:00:00, - (8): 7f:ff:ff:ff, 00:00:00:00, 5f:ff:ff:ff, 00:00:00:00, - (12): 3f:ff:ff:ff, 00:00:00:00, 1f:ff:ff:ff, 00:00:00:00, - (16): ff:fe:ff:ff, 00:00:00:00, df:fe:ff:ff, 00:00:00:00, - (20): bf:fe:ff:ff, 00:00:00:00, 9f:fe:ff:ff, 00:00:00:00, - (24): 7f:fe:ff:ff, 00:00:00:00, 5f:fe:ff:ff, 00:00:00:00, - (28): 3f:fe:ff:ff, 00:00:00:00, 1f:fe:ff:ff, 00:00:00:00 + (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, + (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, + (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, + (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, + (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, + (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, + (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, + (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff } } DATASET "bitfield_4" { @@ -282,10 +282,10 @@ GROUP "/" { } DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff, 00:00, ef:ff, 00:00, df:ff, 00:00, cf:ff, 00:00, bf:ff, - (9): 00:00, af:ff, 00:00, 9f:ff, 00:00, 8f:ff, 00:00, 7f:ff, 00:00, - (18): 6f:ff, 00:00, 5f:ff, 00:00, 4f:ff, 00:00, 3f:ff, 00:00, 2f:ff, - (27): 00:00, 1f:ff, 00:00, 0f:ff, 00:00 + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe } } } diff --git a/tools/testfiles/tbitnopaque.h5 b/tools/testfiles/tbitnopaque.h5 index 2b1f23d..089a86d 100644 Binary files a/tools/testfiles/tbitnopaque.h5 and b/tools/testfiles/tbitnopaque.h5 differ -- cgit v0.12 From c90f72a0d44ab53d16e0c7979363565dff30cf24 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 16:42:22 -0500 Subject: Correct name of file to copy --- tools/test/h5dump/testh5dump.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index acd7e28..f652c9e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -97,7 +97,7 @@ $SRC_H5DUMP_TESTFILES/tattrintsize.h5 $SRC_H5DUMP_TESTFILES/tattrreg.h5 $SRC_H5DUMP_TESTFILES/tbigdims.h5 $SRC_H5DUMP_TESTFILES/tbinary.h5 -$SRC_H5DUMP_TESTFILES/tbitopaque.h5 +$SRC_H5DUMP_TESTFILES/tbitnopaque.h5 $SRC_H5DUMP_TESTFILES/tchar.h5 $SRC_H5DUMP_TESTFILES/tcmpdattrintsize.h5 $SRC_H5DUMP_TESTFILES/tcmpdintsize.h5 -- cgit v0.12 From 9076e74d38f10d9d71a41ceeb118777468b6b530 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 May 2017 10:05:59 -0500 Subject: Fix name to copy --- tools/test/h5dump/testh5dump.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index f652c9e..7edaedd 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -218,7 +218,7 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl -$SRC_H5DUMP_TESTFILES/tbitopaque.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl -- cgit v0.12 From e2ad2751dc0b72f6581cd3b41576a07211b62e9b Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 4 May 2017 17:14:38 -0500 Subject: Update release_docs/HISTORY-1_10.txt and RELEASE.txt after HDF5 1.10.1 release. --- release_docs/HISTORY-1_10.txt | 734 ++++++++++++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 391 ++++------------------ 2 files changed, 790 insertions(+), 335 deletions(-) diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt index 03d0e3e..52eb273 100644 --- a/release_docs/HISTORY-1_10.txt +++ b/release_docs/HISTORY-1_10.txt @@ -3,11 +3,745 @@ HDF5 History This file contains development history of the HDF5 1.10 branch +03. Release Information for hdf5-1.10.1 02. Release Information for hdf5-1.10.0-patch1 01. Release Information for hdf5-1.10.0 [Search on the string '%%%%' for section breaks of each release.] +%%%%1.10.1%%%% + +HDF5 version 1.10.1 released on 2017-04-27 +================================================================================ + +INTRODUCTION + +This document describes the differences between HDF5-1.10.0-patch1 and +HDF5 1.10.1, and contains information on the platforms tested and known +problems in HDF5-1.10.1. For more details check the HISTORY*.txt files +in the HDF5 source. + +Links to HDF5 1.10.1 source code, documentation, and additional materials can +be found on The HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.10.1 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for the snapshot can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.10.x release series, including brief general +descriptions of some new and modified APIs, are described in the "New Features +in HDF5 Release 1.10" document: + + https://support.hdfgroup.org/HDF5/docNewFeatures/index.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 10.1 (current +release) versus Release 1.10.0 + + https://support.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- Major New Features Introduced in HDF5 1.10.1 +- Other New Features and Enhancements +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.10.0-patch1 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems + + +Major New Features Introduced in HDF5 1.10.1 +============================================ + +For links to the RFCs and documentation in this section please view +https://support.hdfgroup.org/HDF5/docNewFeatures in a web browser. + +________________________________________ +Metadata Cache Image +________________________________________ + + HDF5 metadata is typically small, and scattered throughout the HDF5 file. + This can affect performance, particularly on large HPC systems. The + Metadata Cache Image feature can improve performance by writing the + metadata cache in a single block on file close, and then populating the + cache with the contents of this block on file open, thus avoiding the many + small I/O operations that would otherwise be required on file open and + close. See the RFC for complete details regarding this feature. Also, + see the Fine Tuning the Metadata Cache documentation. + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + +________________________________________ +Metadata Cache Evict on Close +________________________________________ + + The HDF5 library's metadata cache is fairly conservative about holding on + to HDF5 object metadata (object headers, chunk index structures, etc.), + which can cause the cache size to grow, resulting in memory pressure on + an application or system. The "evict on close" property will cause all + metadata for an object to be evicted from the cache as long as metadata + is not referenced from any other open object. See the Fine Tuning the + Metadata Cache documentation for information on the APIs. + + At present, evict on close is disabled in parallel builds. + +________________________________________ +Paged Aggregation +________________________________________ + + The current HDF5 file space allocation accumulates small pieces of metadata + and raw data in aggregator blocks which are not page aligned and vary + widely in sizes. The paged aggregation feature was implemented to provide + efficient paged access of these small pieces of metadata and raw data. + See the RFC for details. Also, see the File Space Management documentation. + +________________________________________ +Page Buffering +________________________________________ + + Small and random I/O accesses on parallel file systems result in poor + performance for applications. Page buffering in conjunction with paged + aggregation can improve performance by giving an application control of + minimizing HDF5 I/O requests to a specific granularity and alignment. + See the RFC for details. Also, see the Page Buffering documentation. + + At present, page buffering is disabled in parallel builds. + + + +Other New Features and Enhancements +=================================== + + Library + ------- + - Added a mechanism for disabling the SWMR file locking scheme. + + The file locking calls used in HDF5 1.10.0 (including patch1) + will fail when the underlying file system does not support file + locking or where locks have been disabled. To disable all file + locking operations, an environment variable named + HDF5_USE_FILE_LOCKING can be set to the five-character string + 'FALSE'. This does not fundamentally change HDF5 library + operation (aside from initial file open/create, SWMR is lock-free), + but users will have to be more careful about opening files + to avoid problematic access patterns (i.e.: multiple writers) + that the file locking was designed to prevent. + + Additionally, the error message that is emitted when file lock + operations set errno to ENOSYS (typical when file locking has been + disabled) has been updated to describe the problem and potential + resolution better. + + (DER, 2016/10/26, HDFFV-9918) + + - The return type of H5Pget_driver_info() has been changed from void * + to const void *. + + The pointer returned by this function points to internal library + memory and should not be freed by the user. + + (DER, 2016/11/04, HDFFV-10017) + + - The direct I/O VFD has been removed from the list of VFDs that + support SWMR. + + This configuration was never officially tested and several SWMR + tests fail when this VFD is set. + + (DER, 2016/11/03, HDFFV-10169) + + Configuration: + -------------- + - The minimum version of CMake required to build HDF5 is now 3.2.2. + + (ADB, 2017/01/10) + + - An --enable/disable-developer-warnings option has been added to + configure. + + This disables warnings that do not indicate poor code quality such + as -Winline and gcc's -Wsuggest-attribute. Developer warnings are + disabled by default. + + (DER, 2017/01/10) + + - A bin/restore.sh script was added that reverts autogen.sh processing. + + (DER, 2016/11/08) + + - CMake: Added NAMESPACE hdf5:: to package configuration files to allow + projects using installed HDF5 binaries built with CMake to link with + them without specifying the HDF5 library location via IMPORTED_LOCATION. + + (ABD, 2016/10/17, HDFFV-10003) + + - CMake: Changed the CTEST_BUILD_CONFIGURATION option to + CTEST_CONFIGURATION_TYPE as recommended by the CMake documentation. + + (ABD, 2016/10/17, HDFFV-9971) + + + Fortran Library: + ---------------- + + - The HDF5 Fortran library can now be compiled with the NAG compiler. + + (MSB, 2017/2/10, HDFFV-9973) + + + C++ Library: + ------------ + + - The following C++ API wrappers have been added to the C++ Library: + + // Sets/Gets the strategy and the threshold value that the library + // will employ in managing file space. + FileCreatPropList::setFileSpaceStrategy - H5Pset_file_space_strategy + FileCreatPropList::getFileSpaceStrategy - H5Pget_file_space_strategy + + // Sets/Gets the file space page size for paged aggregation. + FileCreatPropList::setFileSpacePagesize - H5Pset_file_space_page_size + FileCreatPropList::getFileSpacePagesize - H5Pget_file_space_page_size + + // Checks if the given ID is valid. + IdComponent::isValid - H5Iis_valid + + // Sets/Gets the number of soft or user-defined links that can be + // traversed before a failure occurs. + LinkAccPropList::setNumLinks - H5Pset_nlinks + LinkAccPropList::getNumLinks - H5Pget_nlinks + + // Returns a copy of the creation property list of a datatype. + DataType::getCreatePlist - H5Tget_create_plist + + // Opens/Closes an object within a group or a file, regardless of object + // type + Group::getObjId - H5Oopen + Group::closeObjId - H5Oclose + + // Maps elements of a virtual dataset to elements of the source dataset. + DSetCreatPropList::setVirtual - H5Pset_virtual + + // Gets general information about this file. + H5File::getFileInfo - H5Fget_info2 + + // Returns the number of members in a type. + IdComponent::getNumMembers - H5Inmembers + + // Determines if an element type exists. + IdComponent::typeExists - H5Itype_exists + + // Determines if an object exists. + H5Location::exists - H5Lexists. + + // Returns the header version of an HDF5 object. + H5Object::objVersion - H5Oget_info for version + + (BMR, 2017/03/20, HDFFV-10004, HDFFV-10139, HDFFV-10145) + + - New exception: ObjHeaderIException for H5O interface. + + (BMR, 2017/03/15, HDFFV-10145) + + - New class LinkAccPropList for link access property list, to be used by + wrappers of H5Lexists. + + (BMR, 2017/01/04, HDFFV-10145) + + - New constructors to open datatypes in ArrayType, CompType, DataType, + EnumType, FloatType, IntType, StrType, and VarLenType. + + (BMR, 2016/12/26, HDFFV-10056) + + - New member functions: + + DSetCreatPropList::setNbit() to setup N-bit compression for a dataset. + + ArrayType::getArrayNDims() const + ArrayType::getArrayDims() const + both to replace the non-const versions. + + (BMR, 2016/04/25, HDFFV-8623, HDFFV-9725) + + + Tools: + ------ + - The following options have been added to h5clear: + -s: clear the status_flags field in the file's superblock + -m: Remove the metadata cache image from the file + + (QAK, 2017/03/22, PR#361) + + + High-Level APIs: + --------------- + - Added New Fortran 2003 API for h5tbmake_table_f. + + (MSB, 2017/02/10, HDFFV-8486) + + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added NAG compiler + + + +Bug Fixes since HDF5-1.10.0-patch1 release +================================== + + Library + ------- + - Outdated data structure was used in H5D_CHUNK_DEBUG blocks, causing + compilation errors when H5D_CHUNK_DEBUG was defined. This is fixed. + + (BMR, 2017/04/04, HDFFV-8089) + + - SWMR implementation in the HDF5 1.10.0 and 1.10.0-patch1 releases has a + broken metadata flush dependency that manifested itself with the following + error at the end of the HDF5 error stack: + + H5Dint.c line 846 in H5D__swmr_setup(): dataspace chunk index must be 0 + for SWMR access, chunkno = 1 + major: Dataset + minor: Bad value + + It was also reported at https://github.com/areaDetector/ADCore/issues/203 + + The flush dependency is fixed in this release. + + - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY + + (ABD, 2016/12/12, PR#201) + + - A number of issues were fixed when reading/writing from/to corrupted + files to ensure that the library fails gracefully in these cases: + + * Writing to a corrupted file that has an object message which is + incorrectly marked as sharable on disk results in a buffer overflow / + invalid write instead of a clean error message. + + * Decoding data from a corrupted file with a dataset encoded with the + H5Z_NBIT decoding can result in a code execution vulnerability under + the context of the application using the HDF5 library. + + * When decoding an array datatype from a corrupted file, the HDF5 library + fails to return an error in production if the number of dimensions + decoded is greater than the maximum rank. + + * When decoding an "old style" array datatype from a corrupted file, the + HDF5 library fails to return an error in production if the number of + dimensions decoded is greater than the maximum rank. + + (NAF, 2016/10/06, HDFFV-9950, HDFFV-9951, HDFFV-9992, HDFFV-9993) + + - Fixed an error that would occur when copying an object with an attribute + which is a compound datatype consisting of a variable length string. + + (VC, 2016/08/24, HDFFV-7991) + + - H5DOappend will no longer fail if a dataset has no append callback + registered. + + (VC, 2016/08/14, HDFFV-9960) + + - Fixed an issue where H5Pset_alignment could result in misaligned blocks + with some input combinations, causing an assertion failure in debug mode. + + (NAF, 2016/08/11, HDFFV-9948) + + - Fixed a problem where a plugin compiled into a DLL in the default plugin + directory could not be found by the HDF5 library at runtime on Windows + when the HDF5_PLUGIN_PATH environment variable was not set. + + (ABD, 2016/08/01, HDFFV-9706) + + - Fixed an error that would occur when calling H5Adelete on an attribute + which is attached to an externally linked object in the target file and + whose datatype is a committed datatype in the main file. + + (VC, 2016/07/06, HDFFV-9940) + + - (a) Throw an error instead of assertion when v1 btree level hits the 1 + byte limit. + (b) Modifications to better handle error recovery when conversion by + h5format_convert fails. + + (VC, 2016/05/29, HDFFV-9434) + + - Fixed a memory leak where an array used by the library to track SWMR + read retries was unfreed. + + The leaked memory was small (on the order of a few tens of ints) and + allocated per-file. The memory was allocated (and lost) only when a + file was opened for SWMR access. + + (DER, 2016/04/27, HDFFV-9786) + + - Fixed a memory leak that could occur when opening a file for the first + time (including creating) and the call fails. + + This occurred when the file-driver-specific info was not cleaned up. + The amount of memory leaked varied with the file driver, but would + normally be less than 1 kB. + + (DER, 2016/12/06, HDFFV-10168) + + - Fixed a failure in collective metadata writes. + + This failure only appeared when collective metadata writes + were enabled (via H5Pset_coll_metadata_write()). + + (JRM, 2017/04/10, HDFFV-10055) + + + Parallel Library + ---------------- + - Fixed a bug that could occur when allocating a chunked dataset in parallel + with an alignment set and an alignment threshold greater than the chunk + size but less than or equal to the raw data aggregator size. + + (NAF, 2016/08/11, HDFFV-9969) + + + Configuration + ------------- + - Configuration will check for the strtoll and strtoull functions + before using alternatives + + (ABD, 2017/03/17, PR#340) + + - CMake uses a Windows pdb directory variable if available and + will generate both static and shared pdb files. + + (ABD, 2017/02/06, HDFFV-9875) + + - CMake now builds shared versions of tools. + + (ABD, 2017/02/01, HDFFV-10123) + + - Makefiles and test scripts have been updated to correctly remove files + created when running "make check" and to avoid removing any files under + source control. In-source builds followed by "make clean" and "make + distclean" should result in the original source files. + (LRK, 2017/01/17, HDFFV-10099) + + - The tools directory has been divided into two separate source and test + directories. This resolves a build dependency and, as a result, + 'make check' will no longer fail in the tools directory if 'make' was + not executed first. + + (ABD, 2016/10/27, HDFFV-9719) + + - CMake: Fixed a timeout error that would occasionally occur when running + the virtual file driver tests simultaneously due to test directory + and file name collisions. + + (ABD, 2016/09/19, HDFFV-9431) + + - CMake: Fixed a command length overflow error by converting custom + commands inside CMakeTest.cmake files into regular dependencies and + targets. + + (ABD, 2016/07/12, HDFFV-9939) + + - Fixed a problem preventing HDF5 to be built on 32-bit CYGWIN by + condensing cygwin configuration files into a single file and + removing outdated compiler settings. + + (ABD, 2016/07/12, HDFFV-9946) + + + Fortran + -------- + - Changed H5S_ALL_F from INTEGER to INTEGER(HID_T) + + (MSB, 2016/10/14, HDFFV-9987) + + + Tools + ----- + - h5diff now correctly ignores strpad in comparing strings. + + (ABD, 2017/03/03, HDFFV-10128) + + - h5repack now correctly parses the command line filter options. + + (ABD, 2017/01/24, HDFFV-10046) + + - h5diff now correctly returns an error when it cannot read data due + to an unavailable filter plugin. + + (ADB 2017/01/18, HDFFV-9994 ) + + - Fixed an error in the compiler wrapper scripts (h5cc, h5fc, et al.) + in which they would erroneously drop the file argument specified via + the -o flag when the -o flag was specified before the -c flag on the + command line, resulting in a failure to compile. + + (LRK, 2016/11/04, HDFFV-9938, HDFFV-9530) + + - h5repack User Defined (UD) filter parameters were not parsed correctly. + + The UD filter parameters were not being parsed correctly. Reworked coding + section to parse the correct values and verify number of parameters. + + (ABD, 2016/10/19, HDFFV-9996, HDFFV-9974, HDFFV-9515, HDFFV-9039) + + - h5repack allows the --enable-error-stack option on the command line. + + (ADB, 2016/08/08, HDFFV-9775) + + + C++ APIs + -------- + - The member function H5Location::getNumObjs() is moved to + class Group because the objects are in a group or a file only, + and H5Object::getNumAttrs to H5Location to get the number of + attributes at a given location. + + (BMR, 2017/03/17, PR#466) + + - Due to the change in the C API, the overloaded functions of + PropList::setProperty now need const for some arguments. They are + planned for deprecation and are replaced by new versions with proper + consts. + + (BMR, 2017/03/17, PR#344) + + - The high-level API Packet Table (PT) did not write data correctly when + the datatype is a compound type that has string type as one of the + members. This problem started in 1.8.15, after the fix of HDFFV-9042 + was applied, which caused the Packet Table to use native type to access + the data. It should be up to the application to specify whether the + buffer to be read into memory is in the machine's native architecture. + Thus, the PT is fixed to not use native type but to make a copy of the + user's provided datatype during creation or the packet table's datatype + during opening. If an application wishes to use native type to read the + data, then the application will request that. However, the Packet Table + doesn't provide a way to specify memory datatype in this release. This + feature will be available in future releases. + + (BMR, 2016/10/27, HDFFV-9758) + + - The obsolete macros H5_NO_NAMESPACE and H5_NO_STD have been removed from + the HDF5 C++ API library. + + (BMR, 2016/10/23, HDFFV-9532) + + - The problem where a user-defined function cannot access both, attribute + and dataset, using only one argument is now fixed. + + (BMR, 2016/10/11, HDFFV-9920) + + - In-memory array information, ArrayType::rank and + ArrayType::dimensions, were removed. This is an implementation + detail and should not affect applications. + + (BMR, 2016/04/25, HDFFV-9725) + + + Testing + ------- + - Fixed a problem that caused tests using SWMR to occasionally fail when + running "make check" using parallel make. + + (LRK, 2016/03/22, PR#338, PR#346, PR#358) + + +Supported Platforms +=================== + + Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 + (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== + +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + Intel(R) C (icc) and C++ (icpc) compilers + Version 15.0.3.187 (Build 20150407) + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with + #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 + (ostrich) and IBM XL Fortran for Linux, V15.1 + + Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc, g++ (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc, g++ (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + (cmake and autotools) + + Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + (cmake and autotools) + + +Known Problems +============== + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source. Please report any new problems found to + help@hdfgroup.org. + + %%%%1.10.0-patch1%%%% diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index be8cec8..01b2558 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,8 +4,8 @@ HDF5 version 1.11.0 currently under development INTRODUCTION -This document describes the differences between HDF5-1.10.0-patch1 and -HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. +This document describes the differences between HDF5-1.10.1 and HDF5 1.10.2, and +contains information on the platforms tested and known problems in HDF5-1.10.1. For more details check the HISTORY*.txt files in the HDF5 source. @@ -15,23 +15,23 @@ Links to HDF5 1.10.1 source code, documentation, and additional materials can be The HDF5 1.10.1 release can be obtained from: - https://support.hdfgroup.org/HDF5/release/obtain5110.html + https://support.hdfgroup.org/HDF5/release/obtain5.html User documentation for the snapshot can be accessed directly at this location: - https://support.hdfgroup.org/HDF5/doc1.10/ + https://support.hdfgroup.org/HDF5/doc/ New features in the HDF5-1.10.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New -in 1.10.1?" document: +descriptions of some new and modified APIs, are described in the "New Features +in HDF5 1.10" document: - https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html +https://support.hdfgroup.org/HDF5/docNewFeatures/index.html All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.8.19 (current -release) versus Release 1.10.1 +from Release to Release" document, in the section "Release 1.10.1 (current +release) versus Release 1.10.0 - https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html + https://support.hdfgroup.org/HDF5/doc/ADGuide/Changes.html If you have any questions or comments, please send them to the HDF Help Desk: @@ -54,37 +54,11 @@ New Features Configuration: ------------- - - CMake minimum is now 3.2.2. - (ADB 2017/01/10) - - - Tools folder is separated into source and test folders. This - allows autotools to skip the make command and just execute - the make check command. - (HDFFV-9719 ADB 2016/10/27) + - Library: -------- - - Paged Aggregation - - This is one of the file space management strategies. This strategy - aggregates small metadata and raw data allocations into constant-sized - well-aligned pages, which are suitable for page caching. Paged - aggregation together with the page buffering feature will allow efficient - I/O accesses. - - - Page Buffering - - The page buffering layer in the HDF5 library absorbs small accesses to - the file system. Each page in memory corresponds to a page allocated in - the file. Access to the file system is then performed as a single page - or multiple of pages, if they are contiguous. This ensures that small - accesses to the file system are avoided while providing another caching - layer for improved I/O performance. This feature works in conjunction - with the paged aggregation feature. - - - Filter plugin API added to access the table of paths to search for a - library. Java interface expanded with wrappers for the new functions. - (HDFFV-10143 ADB 2017/04/04) + - Parallel Library: ----------------- @@ -100,17 +74,15 @@ New Features Tools: ------ - - Add options to h5clear: - -s: clear the status_flags field in the file's superblock - -m: Remove the metadata cache image from the file - (Pull Request #361 QK 2017/03/22) + - High-Level APIs: --------------- + - C Packet Table API ------------------ - - + - Internal header file -------------------- @@ -118,51 +90,26 @@ New Features Documentation ------------- + - Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.0-patch1 release +Bug Fixes since HDF5-1.10.1 release ================================== Library ------- - - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY - (PR 201 ADB 2016/12/12) - - - Fix error when copying dataset with attribute which is a compound datatype - consisting of a variable length string. - (HDFFV-7991 VC 2016/08/19, 2016/08/21, 2016/08/24) - - - H5DOappend will not fail if a dataset has no append callback registered. - (HDFFV-9960 VC 2016/08/05, 2016/08/14) - - - Fix the problem where the committed datatype's file location is different - from the file location of an attribute with that committed datatype. - (HDFFV-9940 VC 2016/07/03, 2016/07/06) - - - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. - (b) Modifications to better handle error recovery when conversion by - h5format_convert fails. - (HDFFV-9434 VC 2016/05/29) + - Configuration ------------- - - Configuration will check for the strtoll and strtoull functions - before using alternatives - (PR 340 ADB 2017/03/17) - - - CMake uses a Windows pdb directory variable if available and - will generate both static and shared pdb files. - (HDFFV-9875 ADB 2017/02/06) - - - CMake now builds shared versions of tools. - (HDFFV-10123 ADB 2017/02/01) + - Performance ------------- - - + - Fortran -------- @@ -170,18 +117,7 @@ Bug Fixes since HDF5-1.10.0-patch1 release Tools ----- - - h5diff correctly ignores strpad in comparing strings. - (HDFFV-10128 ADB 2017/03/03) - - - h5repack now correctly parses the command line filter options. - (HDFFV-10046 ADB 2017/01/24) - - - h5diff correctly indicates error when it cannot read data due - to an unavailable filter plugin. - (HDFFV-9994 ADB 2017/01/18) - - - h5repack allows the --enable-error-stack option on the command line. - (HDFFV-775 ADB 2016/08/08) + - High-Level APIs: ------ @@ -193,18 +129,16 @@ Bug Fixes since HDF5-1.10.0-patch1 release Documentation ------------- - + - F90 APIs -------- - - C++ APIs -------- - - Testing ------- - @@ -339,6 +273,25 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + Intel(R) C (icc) and C++ (icpc) compilers + Version 15.0.3.187 (Build 20150407) + with NAG Fortran Compiler Release 6.1(Tozai) + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 (ostrich) and IBM XL Fortran for Linux, V15.1 @@ -349,261 +302,29 @@ The following platforms are not supported but have been tested for this release. (cmake and autotools) Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) - GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + gcc, g++ (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) (cmake and autotools) Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux - gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 - GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 (cmake and autotools) Known Problems ============== -* "make check" fails on CYGWIN when building shared lib files is enabled. The - default on Cygwin has been changed to disable shared. It can be enabled with - the --enable-shared configure option but is likely to fail "make check" - with GCC compilers. (LK -2015/04/16) - -* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv - catches some undefined behavior in the alignment algorithm of the macro DETECT_I - in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment - of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for - H5detect.c. In the future, we can separate flags for H5detect.c from the rest of - the library. (SLU - 2013/10/16) - -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It - complains with this message: - "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. - - The reason is that __func__ is a predefined identifier in C99 standard. The - HDF5 C library uses it in H5private.h. The test ttypes.cpp includes - H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 - C++ compiler doesn't support __func__, thus fails to compile the C++ test. - But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this - identifier, try to compile the following simple C++ program: - #include - - int main(void) - { - printf("%s\n", __func__); - return 0; - } - (SLU - 2012/11/5) - -* The C++ and FORTRAN bindings are not currently working on FreeBSD with the - native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the - ports (and probably gcc releases after that). - (QAK - 2012/10/19) - -* The data conversion test dt_arith.c has failures (segmentation fault) from - "long double" to other datatypes during hard conversion when the library - is built with the default GCC 4.2.1 on Mac Lion system. It only happens - with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not - have this problem. Users should disable optimization or try newer version - of GCC. (Issue 8017. SLU - 2012/6/12) - -* The data conversion test dt_arith.c fails in "long double" to integer - conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library - is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal - (3.2.2 on Fedora) doesn't have the problem. Users should lower down the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of - "configure" like: - - CFLAGS=-O1 ./configure - - It will overwrite the library's default optimization level. (Issue 7829. - SLU - 2012/2/7) - -* --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) - -* While working on the 1.8.6 release of HDF5, a bug was discovered that can - occur when reading from a dataset in parallel shortly after it has been - written to collectively. The issue was exposed by a new test in the parallel - HDF5 test suite, but had existed before that. We believe the problem lies with - certain MPI implementations and/or filesystems. - - We have provided a pure MPI test program, as well as a standalone HDF5 - program, that can be used to determine if this is an issue on your system. - They should be run across multiple nodes with a varying number of processes. - These programs can be found at: - http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ - -* Parallel mode in AIX will fail some of the testcheck_version.sh tests where - it treats "exit(134) the same as if process 0 had received an abort signal. - This is fixed and will be available in the next release. AKC - 2009/11/3 - -* The PathScale MPI implementation, accessing a Panasas file system, would - cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not - existing. This is due to the MPI_File_open() call failing if the amode has - the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 - -* Parallel tests failed with 16 processes with data inconsistency at testphdf5 - / dataset_readAll. Parallel tests also failed with 32 and 64 processes with - collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks - with MPI IO. (CMC - 2009/04/28) - -* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel - tests failed with MPI-IO file locking message. AKC - 2007/6/25. -* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use - -mp -O1 compilation flags to build the libraries. Higher level of optimization - causes failures in several HDF5 library tests. -* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the - shared libraries (tested for 1.8.0-beta2) -* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass - and the parallel tests also pass with lots of non-fatal error messages. -* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test -* configuring with --enable-debug=all produces compiler errors on most - platforms. Users who want to run HDF5 in debug mode should use - --enable-debug rather than --enable-debug=all to enable debugging - information on most modules. -* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long - double to (unsigned) long long and from (unsigned)long long to long double. -* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 - optimization flag. -* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to - HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard - for floating-point data. -* On Cray X1, a lone colon on the command line of h5dump --xml (as in - the testh5dumpxml.sh script) is misinterpereted by the operating system - and causes an error. -* On mpich 1.2.5 and 1.2.6, we found that if more than two processes - contribute no IO and the application asks to do IO with collective, we found - that when using 4 processors, a simple collective write will be hung - sometimes. This can be verified with t_mpi test under testpar. -* The dataset created or rewritten with the v1.6.3 library or after can't - be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is - enabled. There was a bug in the calculating code of the Fletcher32 - checksum in the library before v1.6.3. The checksum value wasn't consistent - between big-endian and little-endian systems. This bug was fixed in - Release 1.6.3. However, after fixing the bug, the checksum value is no - longer the same as before on little-endian system. The library release - after 1.6.4 can still read the dataset created or rewritten with the library - of v1.6.2 or before. SLU - 2005/6/30 -* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron - processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests but all related to multi driver. The problem has - been reported to the vendor. -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command poe. - Set the environment variable MP_INFOLEVEL to 0 to minimize the messages - and run the tests again. - The tests may fail with messages like "The socket name is already - in use". HDF5 does not use sockets (except for stream-VFD). This is - due to problems of the poe command trying to set up the debug socket. - Check if there are many old /tmp/s.pedb.* staying around. These are - sockets used by the poe command and left behind due to failed commands. - Ask your system administrator to clean them out. Lastly, request IBM - to provide a mean to run poe without the debug socket. - -* The C++ library's tests fails when compiling with PGI C++ compiler. The - workaround until the problem is correctly handled is to use the - flag "--instantiate=local" prior to the configure and build steps, as: - setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher - - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag will only statically link libraries - if the static version of that library is present. If only the shared version - of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, - for example, only have shared versions), the flag should still result in a - successful compilation, but note that the installed executables will not be - fully static. Thus, the only guarantee on these systems is that the - executable is statically linked with just the HDF5 library. - -* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Not all platforms behave correctly with szip's shared libraries. Szip is - disabled in these cases, and a message is relayed at configure time. Static - libraries should be working on all systems that support szip, and should be - used when shared libraries are unavailable. There is also a configure error - on Altix machines that incorrectly reports when a version of szip without - an encoder is being used. - -* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scipts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - can prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - In such cases, you will have to include the regular prefix in your - filter script. + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. -* H5Ocopy() does not copy reg_ref attributes correctly when shared-message - is turn on. The value of the reference in the destination attriubte is - wrong. This H5Ocopy problem will affect h5copy tool + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source. Please report any new problems found to + help@hdfgroup.org. -- cgit v0.12 From 28f4873e7fc93de865c3e180f09d7221569f64ff Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 5 May 2017 10:47:23 -0500 Subject: Update one missed version string. --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 01b2558..c670066 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -42,7 +42,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.0-patch1 +- Bug Fixes since HDF5-1.10.1 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms -- cgit v0.12 From 6d0d9d46dab559c04bba0b8810a3e0630ce44ad2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 May 2017 16:54:28 -0500 Subject: Fix typo in name of ddl file in command --- tools/test/h5repack/h5repack.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 08f670b..e479031 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -1229,7 +1229,7 @@ TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 if test $USE_FILTER_DEFLATE != "yes" ; then SKIP vds_dset_chunk_20x10x5 else - VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 + VERIFY_LAYOUT_VDS vds_dset_chunk20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 fi if test $USE_FILTER_DEFLATE != "yes" ; then -- cgit v0.12 From 6a4f1187ccef6fd092cf70154e7ffa33f4c2f648 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sat, 6 May 2017 23:40:44 -0500 Subject: Fix for the two issues reported in HDFFV-10051: (1) Repeated open/close of a compact dataset fails due to the increment of ndims in the dataset structure for every open. --This is done only for chunked dataset via H5D__chunk_set_sizes(). (2) layout "dirty" flag for a compact dataset is not reset properly after flushing the data at dataset close. --Reset the "dirty" flag before flushing the message to the object header via H5O_msg_write(). Tested on moohan, kituo, platypus, ostrich, osx1010test, quail, emu. --- src/H5Dcompact.c | 2 +- src/H5Dlayout.c | 12 +++++- test/dsets.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 3 deletions(-) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 2578975..e542e71 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -368,9 +368,9 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { + dset->shared->layout.storage.u.compact.dirty = FALSE; if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") - dset->shared->layout.storage.u.compact.dirty = FALSE; } /* end if */ done: diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index c2fb5c2..ec18e86 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -593,6 +593,7 @@ herr_t H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) { htri_t msg_exists; /* Whether a particular type of message exists */ + hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -622,6 +623,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t */ if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message") + layout_copied = TRUE; /* Check for external file list message (which might not exist) */ if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID, dxpl_id)) < 0) @@ -655,10 +657,16 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout") /* Set chunk sizes */ - if(H5D__chunk_set_sizes(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") + if(H5D_CHUNKED == dataset->shared->layout.type) { + if(H5D__chunk_set_sizes(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") + } done: + if(ret_value < 0 && layout_copied) { + if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_oh_read() */ diff --git a/test/dsets.c b/test/dsets.c index ef58509..a561ef48 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -25,13 +25,16 @@ #define H5FD_TESTING #define H5Z_FRIEND /*suppress error about including H5Zpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "h5test.h" #include "H5srcdir.h" #include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" +#include "H5Iprivate.h" #include "H5Zpkg.h" +#include "H5Dpkg.h" #ifdef H5_HAVE_SZLIB_H # include "szlib.h" #endif @@ -12637,7 +12640,122 @@ error: } /* dls_01_main() */ +/*------------------------------------------------------------------------- + * Function: test_compact_open_close_dirty + * + * Purpose: Verify that the two issues reported in HDFFV-10051 are fixed: + * (1) Repeated open/close of a compact dataset fails due to the + * increment of ndims in the dataset structure for every open. + * (2) layout "dirty" flag for a compact dataset is not reset + * properly after flushing the data at dataset close. + * The test for issue #1 is based on compactoc.c attached + * to the jira issue HDFFV-10051 + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Vailin Choi; April 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_compact_open_close_dirty(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hsize_t dims[1] = {10}; /* Dimension */ + int wbuf[10]; /* Data buffer */ + char filename[FILENAME_BUF_SIZE]; /* Filename */ + int i; /* Local index variable */ + H5D_t *dset = NULL; /* Internal dataset pointer */ + + TESTING("compact dataset repeated open/close and dirty flag"); + + /* Create a file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Initialize data */ + for(i = 0; i < 10; i++) + wbuf[i] = i; + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Set compact layout */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) + TEST_ERROR + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create a compact dataset */ + if((did = H5Dcreate2(fid, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Verify the repeated open/close of the dataset will not fail */ + for(i = 0; i < 20;i++) { + H5E_BEGIN_TRY { + did = H5Dopen (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); + } H5E_END_TRY; + if(did < 0) + TEST_ERROR + if(H5Dclose(did) < 0) + TEST_ERROR + } + + /* Open the dataset */ + if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Get the internal dataset pointer */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + TEST_ERROR + + /* Verify that the "dirty" flag is false */ + if(dset->shared->layout.storage.u.compact.dirty) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + TEST_ERROR + + /* Close the dataset creation property list */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Pclose(dcpl); + H5Dclose(did); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* test_compact_open_close_dirty() */ /*------------------------------------------------------------------------- @@ -12759,6 +12877,7 @@ main(void) nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); nerrors += (test_tconv(file) < 0 ? 1 : 0); nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); -- cgit v0.12 From d436db6c6efdfe7e9dbe06a642715116ef0eb5e3 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 8 May 2017 22:14:20 -0500 Subject: Fix for the two issues reported in HDFFV-10051 Modifications made based on the review comments from pull request #494 Tested on moohan, mayll, kituo, platypus, ostrich, osx1010test, quail, emu. --- src/H5Dcompact.c | 4 +++- src/H5Dtest.c | 41 +++++++++++++++++++++++++++++++++++++++++ test/dsets.c | 19 ++++++------------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index e542e71..99a25b6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -369,8 +369,10 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { dset->shared->layout.storage.u.compact.dirty = FALSE; - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) { + dset->shared->layout.storage.u.compact.dirty = TRUE; HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } } /* end if */ done: diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 2fc71a0..c2b6199 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -142,6 +142,47 @@ done: /*-------------------------------------------------------------------------- NAME + H5D__layout_compact_dirty_test + PURPOSE + Determine the "dirty" flag of a compact layout for a dataset's layout information + USAGE + herr_t H5D__layout_compact_dirty_test(did, dirty) + hid_t did; IN: Dataset to query + hbool_t *dirty; OUT: Pointer to location to place "dirty" info + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Checks the "dirty" flag of a compact dataset. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) +{ + H5D_t *dset; /* Pointer to dataset to query */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") + + if(dirty) { + HDassert(dset->shared->layout.type == H5D_COMPACT); + *dirty = dset->shared->layout.storage.u.compact.dirty; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__layout_compact_dirty_test() */ + + +/*-------------------------------------------------------------------------- + NAME H5D__layout_type_test PURPOSE Determine the storage layout type for a dataset diff --git a/test/dsets.c b/test/dsets.c index a561ef48..ad014a6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -17,24 +17,16 @@ * * Purpose: Tests the dataset interface (H5D) */ - -#define H5D_FRIEND /*suppress error about including H5Dpkg */ -#define H5D_TESTING - #define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "h5test.h" #include "H5srcdir.h" -#include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" -#include "H5Iprivate.h" #include "H5Zpkg.h" -#include "H5Dpkg.h" #ifdef H5_HAVE_SZLIB_H # include "szlib.h" #endif @@ -12669,7 +12661,7 @@ test_compact_open_close_dirty(hid_t fapl) int wbuf[10]; /* Data buffer */ char filename[FILENAME_BUF_SIZE]; /* Filename */ int i; /* Local index variable */ - H5D_t *dset = NULL; /* Internal dataset pointer */ + hbool_t dirty; /* The dirty flag */ TESTING("compact dataset repeated open/close and dirty flag"); @@ -12721,16 +12713,17 @@ test_compact_open_close_dirty(hid_t fapl) if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) TEST_ERROR - /* Get the internal dataset pointer */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + /* Retrieve the "dirty" flag from the compact dataset layout */ + if(H5D__layout_compact_dirty_test(did, &dirty) < 0) TEST_ERROR /* Verify that the "dirty" flag is false */ - if(dset->shared->layout.storage.u.compact.dirty) + if(dirty) TEST_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) TEST_ERROR + if(H5Dclose(did) < 0) + TEST_ERROR /* Close the dataspace */ if(H5Sclose(sid) < 0) -- cgit v0.12 From 5263bc9029dcf06779a0ec2b89688912443a4bfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 May 2017 10:41:00 -0500 Subject: HDFFV-10186 Whitespace changes Mostly replacing tabs with spaces Removed empty mod sections --- src/H5T.c | 2830 +++++++++++++++++++++++------------------------ tools/lib/h5diff_util.c | 10 +- tools/lib/h5tools.c | 74 +- 3 files changed, 1431 insertions(+), 1483 deletions(-) diff --git a/src/H5T.c b/src/H5T.c index 5e4171d..2433137 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -22,24 +22,24 @@ /* Module Setup */ /****************/ -#include "H5Tmodule.h" /* This source code file is part of the H5T module */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Tpkg.h" /* Datatypes */ /* Check for header needed for SGI floating-point code */ #ifdef H5_HAVE_SYS_FPU_H @@ -63,209 +63,209 @@ */ /* Define the code template for bitfields for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_BITFIELD_CORE { \ - dt->shared->type = H5T_BITFIELD; \ +#define H5T_INIT_TYPE_BITFIELD_CORE { \ + dt->shared->type = H5T_BITFIELD; \ } /* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_TIME_CORE { \ - dt->shared->type = H5T_TIME; \ +#define H5T_INIT_TYPE_TIME_CORE { \ + dt->shared->type = H5T_TIME; \ } /* Define the code template for types which reset the offset for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_OFFSET_CORE { \ - dt->shared->u.atomic.offset = 0; \ +#define H5T_INIT_TYPE_OFFSET_CORE { \ + dt->shared->u.atomic.offset = 0; \ } /* Define common code for all numeric types (floating-point & int, signed & unsigned) */ -#define H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) { \ - dt->shared->u.atomic.order = ENDIANNESS; \ - dt->shared->u.atomic.offset = 0; \ - dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; \ - dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) { \ + dt->shared->u.atomic.order = ENDIANNESS; \ + dt->shared->u.atomic.offset = 0; \ + dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; \ + dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \ } /* Define the code templates for standard floats for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.f.sign = 31; \ - dt->shared->u.atomic.u.f.epos = 23; \ - dt->shared->u.atomic.u.f.esize = 8; \ - dt->shared->u.atomic.u.f.ebias = 0x7f; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 23; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.f.sign = 31; \ + dt->shared->u.atomic.u.f.epos = 23; \ + dt->shared->u.atomic.u.f.esize = 8; \ + dt->shared->u.atomic.u.f.ebias = 0x7f; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 23; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ } -#define H5T_INIT_TYPE_FLOATLE_CORE { \ - H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_FLOATLE_CORE { \ + H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_FLOATBE_CORE { \ - H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_FLOATBE_CORE { \ + H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for standard doubles for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_DOUBLE_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.f.sign = 63; \ - dt->shared->u.atomic.u.f.epos = 52; \ - dt->shared->u.atomic.u.f.esize = 11; \ - dt->shared->u.atomic.u.f.ebias = 0x03ff; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 52; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_DOUBLE_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.f.sign = 63; \ + dt->shared->u.atomic.u.f.epos = 52; \ + dt->shared->u.atomic.u.f.esize = 11; \ + dt->shared->u.atomic.u.f.ebias = 0x03ff; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 52; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ } -#define H5T_INIT_TYPE_DOUBLELE_CORE { \ - H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_DOUBLELE_CORE { \ + H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_DOUBLEBE_CORE { \ - H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_DOUBLEBE_CORE { \ + H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for VAX float for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_FLOATVAX_CORE { \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ - dt->shared->u.atomic.u.f.sign = 31; \ - dt->shared->u.atomic.u.f.epos = 23; \ - dt->shared->u.atomic.u.f.esize = 8; \ - dt->shared->u.atomic.u.f.ebias = 0x81; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 23; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ - dt->shared->version = H5O_DTYPE_VERSION_3; \ +#define H5T_INIT_TYPE_FLOATVAX_CORE { \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ + dt->shared->u.atomic.u.f.sign = 31; \ + dt->shared->u.atomic.u.f.epos = 23; \ + dt->shared->u.atomic.u.f.esize = 8; \ + dt->shared->u.atomic.u.f.ebias = 0x81; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 23; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ + dt->shared->version = H5O_DTYPE_VERSION_3; \ } /* Define the code templates for VAX double for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_DOUBLEVAX_CORE { \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ - dt->shared->u.atomic.u.f.sign = 63; \ - dt->shared->u.atomic.u.f.epos = 52; \ - dt->shared->u.atomic.u.f.esize = 11; \ - dt->shared->u.atomic.u.f.ebias = 0x0401; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 52; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ - dt->shared->version = H5O_DTYPE_VERSION_3; \ +#define H5T_INIT_TYPE_DOUBLEVAX_CORE { \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ + dt->shared->u.atomic.u.f.sign = 63; \ + dt->shared->u.atomic.u.f.epos = 52; \ + dt->shared->u.atomic.u.f.esize = 11; \ + dt->shared->u.atomic.u.f.ebias = 0x0401; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 52; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ + dt->shared->version = H5O_DTYPE_VERSION_3; \ } /* Define the code templates for standard signed integers for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.i.sign = H5T_SGN_2; \ +#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.i.sign = H5T_SGN_2; \ } -#define H5T_INIT_TYPE_SINTLE_CORE { \ - H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_SINTLE_CORE { \ + H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_SINTBE_CORE { \ - H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_SINTBE_CORE { \ + H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for standard unsigned integers for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_UINT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE; \ +#define H5T_INIT_TYPE_UINT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE; \ } -#define H5T_INIT_TYPE_UINTLE_CORE { \ - H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_UINTLE_CORE { \ + H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_UINTBE_CORE { \ - H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_UINTBE_CORE { \ + H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_BE) \ } /* Define a macro for common code for all newly allocate datatypes */ -#define H5T_INIT_TYPE_ALLOC_COMMON(TYPE) { \ - dt->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; \ - dt->shared->type = TYPE; \ +#define H5T_INIT_TYPE_ALLOC_COMMON(TYPE) { \ + dt->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; \ + dt->shared->type = TYPE; \ } /* Define the code templates for opaque for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_OPAQ_CORE { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_OPAQUE) \ - dt->shared->u.opaque.tag = H5MM_xstrdup(""); \ +#define H5T_INIT_TYPE_OPAQ_CORE { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_OPAQUE) \ + dt->shared->u.opaque.tag = H5MM_xstrdup(""); \ } /* Define the code templates for strings for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_STRING_COMMON { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ - dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \ +#define H5T_INIT_TYPE_STRING_COMMON { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ + dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \ } -#define H5T_INIT_TYPE_CSTRING_CORE { \ - H5T_INIT_TYPE_STRING_COMMON \ - dt->shared->u.atomic.u.s.pad = H5T_STR_NULLTERM; \ +#define H5T_INIT_TYPE_CSTRING_CORE { \ + H5T_INIT_TYPE_STRING_COMMON \ + dt->shared->u.atomic.u.s.pad = H5T_STR_NULLTERM; \ } -#define H5T_INIT_TYPE_FORSTRING_CORE { \ - H5T_INIT_TYPE_STRING_COMMON \ - dt->shared->u.atomic.u.s.pad = H5T_STR_SPACEPAD; \ +#define H5T_INIT_TYPE_FORSTRING_CORE { \ + H5T_INIT_TYPE_STRING_COMMON \ + dt->shared->u.atomic.u.s.pad = H5T_STR_SPACEPAD; \ } /* Define the code templates for references for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_REF_COMMON { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ +#define H5T_INIT_TYPE_REF_COMMON { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ } -#define H5T_INIT_TYPE_OBJREF_CORE { \ - H5T_INIT_TYPE_REF_COMMON \ - dt->shared->force_conv = TRUE; \ - dt->shared->u.atomic.u.r.rtype = H5R_OBJECT; \ - dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY; \ +#define H5T_INIT_TYPE_OBJREF_CORE { \ + H5T_INIT_TYPE_REF_COMMON \ + dt->shared->force_conv = TRUE; \ + dt->shared->u.atomic.u.r.rtype = H5R_OBJECT; \ + dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY; \ } -#define H5T_INIT_TYPE_REGREF_CORE { \ - H5T_INIT_TYPE_REF_COMMON \ - dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION; \ +#define H5T_INIT_TYPE_REGREF_CORE { \ + H5T_INIT_TYPE_REF_COMMON \ + dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION; \ } /* Define the code templates for the "SIZE_TMPL" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_SET_SIZE(SIZE) { \ - dt->shared->size = SIZE; \ - dt->shared->u.atomic.prec = 8 * SIZE; \ +#define H5T_INIT_TYPE_SET_SIZE(SIZE) { \ + dt->shared->size = SIZE; \ + dt->shared->u.atomic.prec = 8 * SIZE; \ } -#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) { \ +#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) { \ } /* Define the code templates for the "CRT_TMPL" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_COPY_CREATE(BASE) { \ - /* Base off of existing datatype */ \ - if(NULL == (dt = H5T_copy(BASE, H5T_COPY_TRANSIENT))) \ +#define H5T_INIT_TYPE_COPY_CREATE(BASE) { \ + /* Base off of existing datatype */ \ + if(NULL == (dt = H5T_copy(BASE, H5T_COPY_TRANSIENT))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "duplicating base type failed") \ } -#define H5T_INIT_TYPE_ALLOC_CREATE(BASE) { \ - /* Allocate new datatype info */ \ - if(NULL == (dt = H5T__alloc())) \ +#define H5T_INIT_TYPE_ALLOC_CREATE(BASE) { \ + /* Allocate new datatype info */ \ + if(NULL == (dt = H5T__alloc())) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed") \ } -#define H5T_INIT_TYPE(GUTS,GLOBAL,CRT_TMPL,BASE,SIZE_TMPL,SIZE) { \ - /* Get new datatype struct */ \ - H5_GLUE3(H5T_INIT_TYPE_,CRT_TMPL,_CREATE)(BASE) \ - \ - /* Adjust information for all types */ \ - dt->shared->state = H5T_STATE_IMMUTABLE; \ - H5_GLUE3(H5T_INIT_TYPE_,SIZE_TMPL,_SIZE)(SIZE) \ - \ - /* Adjust information for this type */ \ - H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \ - \ - /* Atomize result */ \ - if((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ +#define H5T_INIT_TYPE(GUTS,GLOBAL,CRT_TMPL,BASE,SIZE_TMPL,SIZE) { \ + /* Get new datatype struct */ \ + H5_GLUE3(H5T_INIT_TYPE_,CRT_TMPL,_CREATE)(BASE) \ + \ + /* Adjust information for all types */ \ + dt->shared->state = H5T_STATE_IMMUTABLE; \ + H5_GLUE3(H5T_INIT_TYPE_,SIZE_TMPL,_SIZE)(SIZE) \ + \ + /* Adjust information for this type */ \ + H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \ + \ + /* Atomize result */ \ + if((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \ } @@ -279,9 +279,9 @@ /* Local Prototypes */ /********************/ static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id); + H5T_t *dst, H5T_conv_t func, hid_t dxpl_id); static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call); + H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call); static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst); static herr_t H5T_set_size(H5T_t *dt, size_t size); @@ -308,103 +308,103 @@ hbool_t H5_PKG_INIT_VAR = FALSE; * If more of these are added, the new ones must be added to the list of * types to reset in H5T_term_package(). */ -hid_t H5T_IEEE_F32BE_g = FAIL; -hid_t H5T_IEEE_F32LE_g = FAIL; -hid_t H5T_IEEE_F64BE_g = FAIL; -hid_t H5T_IEEE_F64LE_g = FAIL; - -hid_t H5T_VAX_F32_g = FAIL; -hid_t H5T_VAX_F64_g = FAIL; - -hid_t H5T_STD_I8BE_g = FAIL; -hid_t H5T_STD_I8LE_g = FAIL; -hid_t H5T_STD_I16BE_g = FAIL; -hid_t H5T_STD_I16LE_g = FAIL; -hid_t H5T_STD_I32BE_g = FAIL; -hid_t H5T_STD_I32LE_g = FAIL; -hid_t H5T_STD_I64BE_g = FAIL; -hid_t H5T_STD_I64LE_g = FAIL; -hid_t H5T_STD_U8BE_g = FAIL; -hid_t H5T_STD_U8LE_g = FAIL; -hid_t H5T_STD_U16BE_g = FAIL; -hid_t H5T_STD_U16LE_g = FAIL; -hid_t H5T_STD_U32BE_g = FAIL; -hid_t H5T_STD_U32LE_g = FAIL; -hid_t H5T_STD_U64BE_g = FAIL; -hid_t H5T_STD_U64LE_g = FAIL; -hid_t H5T_STD_B8BE_g = FAIL; -hid_t H5T_STD_B8LE_g = FAIL; -hid_t H5T_STD_B16BE_g = FAIL; -hid_t H5T_STD_B16LE_g = FAIL; -hid_t H5T_STD_B32BE_g = FAIL; -hid_t H5T_STD_B32LE_g = FAIL; -hid_t H5T_STD_B64BE_g = FAIL; -hid_t H5T_STD_B64LE_g = FAIL; -hid_t H5T_STD_REF_OBJ_g = FAIL; -hid_t H5T_STD_REF_DSETREG_g = FAIL; - -hid_t H5T_UNIX_D32BE_g = FAIL; -hid_t H5T_UNIX_D32LE_g = FAIL; -hid_t H5T_UNIX_D64BE_g = FAIL; -hid_t H5T_UNIX_D64LE_g = FAIL; - -hid_t H5T_C_S1_g = FAIL; - -hid_t H5T_FORTRAN_S1_g = FAIL; - -hid_t H5T_NATIVE_SCHAR_g = FAIL; -hid_t H5T_NATIVE_UCHAR_g = FAIL; -hid_t H5T_NATIVE_SHORT_g = FAIL; -hid_t H5T_NATIVE_USHORT_g = FAIL; -hid_t H5T_NATIVE_INT_g = FAIL; -hid_t H5T_NATIVE_UINT_g = FAIL; -hid_t H5T_NATIVE_LONG_g = FAIL; -hid_t H5T_NATIVE_ULONG_g = FAIL; -hid_t H5T_NATIVE_LLONG_g = FAIL; -hid_t H5T_NATIVE_ULLONG_g = FAIL; -hid_t H5T_NATIVE_FLOAT_g = FAIL; -hid_t H5T_NATIVE_DOUBLE_g = FAIL; +hid_t H5T_IEEE_F32BE_g = FAIL; +hid_t H5T_IEEE_F32LE_g = FAIL; +hid_t H5T_IEEE_F64BE_g = FAIL; +hid_t H5T_IEEE_F64LE_g = FAIL; + +hid_t H5T_VAX_F32_g = FAIL; +hid_t H5T_VAX_F64_g = FAIL; + +hid_t H5T_STD_I8BE_g = FAIL; +hid_t H5T_STD_I8LE_g = FAIL; +hid_t H5T_STD_I16BE_g = FAIL; +hid_t H5T_STD_I16LE_g = FAIL; +hid_t H5T_STD_I32BE_g = FAIL; +hid_t H5T_STD_I32LE_g = FAIL; +hid_t H5T_STD_I64BE_g = FAIL; +hid_t H5T_STD_I64LE_g = FAIL; +hid_t H5T_STD_U8BE_g = FAIL; +hid_t H5T_STD_U8LE_g = FAIL; +hid_t H5T_STD_U16BE_g = FAIL; +hid_t H5T_STD_U16LE_g = FAIL; +hid_t H5T_STD_U32BE_g = FAIL; +hid_t H5T_STD_U32LE_g = FAIL; +hid_t H5T_STD_U64BE_g = FAIL; +hid_t H5T_STD_U64LE_g = FAIL; +hid_t H5T_STD_B8BE_g = FAIL; +hid_t H5T_STD_B8LE_g = FAIL; +hid_t H5T_STD_B16BE_g = FAIL; +hid_t H5T_STD_B16LE_g = FAIL; +hid_t H5T_STD_B32BE_g = FAIL; +hid_t H5T_STD_B32LE_g = FAIL; +hid_t H5T_STD_B64BE_g = FAIL; +hid_t H5T_STD_B64LE_g = FAIL; +hid_t H5T_STD_REF_OBJ_g = FAIL; +hid_t H5T_STD_REF_DSETREG_g = FAIL; + +hid_t H5T_UNIX_D32BE_g = FAIL; +hid_t H5T_UNIX_D32LE_g = FAIL; +hid_t H5T_UNIX_D64BE_g = FAIL; +hid_t H5T_UNIX_D64LE_g = FAIL; + +hid_t H5T_C_S1_g = FAIL; + +hid_t H5T_FORTRAN_S1_g = FAIL; + +hid_t H5T_NATIVE_SCHAR_g = FAIL; +hid_t H5T_NATIVE_UCHAR_g = FAIL; +hid_t H5T_NATIVE_SHORT_g = FAIL; +hid_t H5T_NATIVE_USHORT_g = FAIL; +hid_t H5T_NATIVE_INT_g = FAIL; +hid_t H5T_NATIVE_UINT_g = FAIL; +hid_t H5T_NATIVE_LONG_g = FAIL; +hid_t H5T_NATIVE_ULONG_g = FAIL; +hid_t H5T_NATIVE_LLONG_g = FAIL; +hid_t H5T_NATIVE_ULLONG_g = FAIL; +hid_t H5T_NATIVE_FLOAT_g = FAIL; +hid_t H5T_NATIVE_DOUBLE_g = FAIL; #if H5_SIZEOF_LONG_DOUBLE !=0 -hid_t H5T_NATIVE_LDOUBLE_g = FAIL; +hid_t H5T_NATIVE_LDOUBLE_g = FAIL; #endif -hid_t H5T_NATIVE_B8_g = FAIL; -hid_t H5T_NATIVE_B16_g = FAIL; -hid_t H5T_NATIVE_B32_g = FAIL; -hid_t H5T_NATIVE_B64_g = FAIL; -hid_t H5T_NATIVE_OPAQUE_g = FAIL; -hid_t H5T_NATIVE_HADDR_g = FAIL; -hid_t H5T_NATIVE_HSIZE_g = FAIL; -hid_t H5T_NATIVE_HSSIZE_g = FAIL; -hid_t H5T_NATIVE_HERR_g = FAIL; -hid_t H5T_NATIVE_HBOOL_g = FAIL; - -hid_t H5T_NATIVE_INT8_g = FAIL; -hid_t H5T_NATIVE_UINT8_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_INT_FAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST8_g = FAIL; - -hid_t H5T_NATIVE_INT16_g = FAIL; -hid_t H5T_NATIVE_UINT16_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_INT_FAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST16_g = FAIL; - -hid_t H5T_NATIVE_INT32_g = FAIL; -hid_t H5T_NATIVE_UINT32_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_INT_FAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST32_g = FAIL; - -hid_t H5T_NATIVE_INT64_g = FAIL; -hid_t H5T_NATIVE_UINT64_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_INT_FAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; +hid_t H5T_NATIVE_B8_g = FAIL; +hid_t H5T_NATIVE_B16_g = FAIL; +hid_t H5T_NATIVE_B32_g = FAIL; +hid_t H5T_NATIVE_B64_g = FAIL; +hid_t H5T_NATIVE_OPAQUE_g = FAIL; +hid_t H5T_NATIVE_HADDR_g = FAIL; +hid_t H5T_NATIVE_HSIZE_g = FAIL; +hid_t H5T_NATIVE_HSSIZE_g = FAIL; +hid_t H5T_NATIVE_HERR_g = FAIL; +hid_t H5T_NATIVE_HBOOL_g = FAIL; + +hid_t H5T_NATIVE_INT8_g = FAIL; +hid_t H5T_NATIVE_UINT8_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST8_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL; +hid_t H5T_NATIVE_INT_FAST8_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST8_g = FAIL; + +hid_t H5T_NATIVE_INT16_g = FAIL; +hid_t H5T_NATIVE_UINT16_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST16_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL; +hid_t H5T_NATIVE_INT_FAST16_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST16_g = FAIL; + +hid_t H5T_NATIVE_INT32_g = FAIL; +hid_t H5T_NATIVE_UINT32_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST32_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL; +hid_t H5T_NATIVE_INT_FAST32_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST32_g = FAIL; + +hid_t H5T_NATIVE_INT64_g = FAIL; +hid_t H5T_NATIVE_UINT64_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST64_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL; +hid_t H5T_NATIVE_INT_FAST64_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; /* * Alignment constraints for native types. These are initialized at run time @@ -412,45 +412,45 @@ hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; * datatype or C structures, which are different from the alignments for memory * address below this group of variables. */ -size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0; #if H5_SIZEOF_LONG_DOUBLE !=0 -size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0; #endif -size_t H5T_POINTER_COMP_ALIGN_g = 0; -size_t H5T_HVL_COMP_ALIGN_g = 0; -size_t H5T_HOBJREF_COMP_ALIGN_g = 0; -size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0; +size_t H5T_POINTER_COMP_ALIGN_g = 0; +size_t H5T_HVL_COMP_ALIGN_g = 0; +size_t H5T_HOBJREF_COMP_ALIGN_g = 0; +size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0; /* * Alignment constraints for native types. These are initialized at run time * in H5Tinit.c */ -size_t H5T_NATIVE_SCHAR_ALIGN_g = 0; -size_t H5T_NATIVE_UCHAR_ALIGN_g = 0; -size_t H5T_NATIVE_SHORT_ALIGN_g = 0; -size_t H5T_NATIVE_USHORT_ALIGN_g = 0; -size_t H5T_NATIVE_INT_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_ALIGN_g = 0; -size_t H5T_NATIVE_LONG_ALIGN_g = 0; -size_t H5T_NATIVE_ULONG_ALIGN_g = 0; -size_t H5T_NATIVE_LLONG_ALIGN_g = 0; -size_t H5T_NATIVE_ULLONG_ALIGN_g = 0; -size_t H5T_NATIVE_FLOAT_ALIGN_g = 0; -size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0; +size_t H5T_NATIVE_SCHAR_ALIGN_g = 0; +size_t H5T_NATIVE_UCHAR_ALIGN_g = 0; +size_t H5T_NATIVE_SHORT_ALIGN_g = 0; +size_t H5T_NATIVE_USHORT_ALIGN_g = 0; +size_t H5T_NATIVE_INT_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_ALIGN_g = 0; +size_t H5T_NATIVE_LONG_ALIGN_g = 0; +size_t H5T_NATIVE_ULONG_ALIGN_g = 0; +size_t H5T_NATIVE_LLONG_ALIGN_g = 0; +size_t H5T_NATIVE_ULLONG_ALIGN_g = 0; +size_t H5T_NATIVE_FLOAT_ALIGN_g = 0; +size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0; #if H5_SIZEOF_LONG_DOUBLE !=0 -size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; +size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; #endif /* @@ -458,40 +458,40 @@ size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; * H5Tinit.c if the types are provided by the system. Otherwise we set their * values to 0 here (no alignment calculated). */ -size_t H5T_NATIVE_INT8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT8_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST8_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST8_ALIGN_g = 0; - -size_t H5T_NATIVE_INT16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT16_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST16_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST16_ALIGN_g = 0; - -size_t H5T_NATIVE_INT32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT32_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST32_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST32_ALIGN_g = 0; - -size_t H5T_NATIVE_INT64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT64_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST64_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; +size_t H5T_NATIVE_INT8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT8_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST8_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST8_ALIGN_g = 0; + +size_t H5T_NATIVE_INT16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT16_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST16_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST16_ALIGN_g = 0; + +size_t H5T_NATIVE_INT32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT32_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST32_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST32_ALIGN_g = 0; + +size_t H5T_NATIVE_INT64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT64_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST64_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; /* Useful floating-point values for conversion routines */ /* (+/- Inf for all floating-point types) */ -float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f; -float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f; -double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f; -double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f; +float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f; +float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f; +double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f; +double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f; /* Declare the free list for H5T_t's and H5T_shared_t's */ H5FL_DEFINE(H5T_t); @@ -507,12 +507,12 @@ H5FL_DEFINE(H5T_shared_t); * which is used as the key by which the `entries' array is sorted. */ static struct { - int npaths; /*number of paths defined */ - size_t apaths; /*number of paths allocated */ - H5T_path_t **path; /*sorted array of path pointers */ - int nsoft; /*number of soft conversions defined */ - size_t asoft; /*number of soft conversions allocated */ - H5T_soft_t *soft; /*unsorted array of soft conversions */ + int npaths; /*number of paths defined */ + size_t apaths; /*number of paths allocated */ + H5T_path_t **path; /*sorted array of path pointers */ + int nsoft; /*number of soft conversions defined */ + size_t asoft; /*number of soft conversions allocated */ + H5T_soft_t *soft; /*unsorted array of soft conversions */ } H5T_g; /* Declare the free list for H5T_path_t's */ @@ -520,10 +520,10 @@ H5FL_DEFINE_STATIC(H5T_path_t); /* Datatype ID class */ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ - H5I_DATATYPE, /* ID class value */ - 0, /* Class flags */ - 8, /* # of reserved IDs for class */ - (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ + H5I_DATATYPE, /* ID class value */ + 0, /* Class flags */ + 8, /* # of reserved IDs for class */ + (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -532,14 +532,14 @@ static hbool_t H5T_top_package_initialize_s = FALSE; /*------------------------------------------------------------------------- - * Function: H5T_init + * Function: H5T_init * - * Purpose: Initialize the interface from some other package. + * Purpose: Initialize the interface from some other package. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, December 16, 1998 * *------------------------------------------------------------------------- @@ -558,15 +558,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__init_inf + * Function: H5T__init_inf * - * Purpose: Initialize the +/- Infinity floating-poing values for type + * Purpose: Initialize the +/- Infinity floating-poing values for type * conversion. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, November 22, 2003 * *------------------------------------------------------------------------- @@ -574,12 +574,12 @@ done: static herr_t H5T__init_inf(void) { - H5T_t *dst_p; /* Datatype type operate on */ - H5T_atomic_t *dst; /* Datatype's atomic info */ - uint8_t *d; /* Pointer to value to set */ - size_t half_size; /* Half the type size */ - size_t u; /* Local index value */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_t *dst_p; /* Datatype type operate on */ + H5T_atomic_t *dst; /* Datatype's atomic info */ + uint8_t *d; /* Pointer to value to set */ + size_t half_size; /* Half the type size */ + size_t u; /* Local index value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -707,26 +707,26 @@ H5T__init_package(void) H5T_t *std_u32be=NULL; /* Datatype structure for unsigned 32-bit big-endian integer */ H5T_t *std_u64le=NULL; /* Datatype structure for unsigned 64-bit little-endian integer */ H5T_t *std_u64be=NULL; /* Datatype structure for unsigned 64-bit big-endian integer */ - H5T_t *dt = NULL; - H5T_t *fixedpt=NULL; /* Datatype structure for native int */ - H5T_t *floatpt=NULL; /* Datatype structure for native float */ - H5T_t *string=NULL; /* Datatype structure for C string */ - H5T_t *bitfield=NULL; /* Datatype structure for bitfield */ - H5T_t *compound=NULL; /* Datatype structure for compound objects */ - H5T_t *enum_type=NULL; /* Datatype structure for enum objects */ - H5T_t *vlen=NULL; /* Datatype structure for vlen objects */ - H5T_t *array=NULL; /* Datatype structure for array objects */ - H5T_t *objref=NULL; /* Datatype structure for object reference objects */ + H5T_t *dt = NULL; + H5T_t *fixedpt=NULL; /* Datatype structure for native int */ + H5T_t *floatpt=NULL; /* Datatype structure for native float */ + H5T_t *string=NULL; /* Datatype structure for C string */ + H5T_t *bitfield=NULL; /* Datatype structure for bitfield */ + H5T_t *compound=NULL; /* Datatype structure for compound objects */ + H5T_t *enum_type=NULL; /* Datatype structure for enum objects */ + H5T_t *vlen=NULL; /* Datatype structure for vlen objects */ + H5T_t *array=NULL; /* Datatype structure for array objects */ + H5T_t *objref=NULL; /* Datatype structure for object reference objects */ hsize_t dim[1]={1}; /* Dimension info for array datatype */ - herr_t status; + herr_t status; unsigned copied_dtype=1; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATATYPE_CLS) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Make certain there aren't too many classes of datatypes defined */ /* Only 16 (numbered 0-15) are supported in the current file format */ @@ -737,7 +737,7 @@ H5T__init_package(void) * the library configuration by H5detect. */ if(H5T__init_native() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Get the atomic datatype structures needed by the initialization code below */ if(NULL == (native_schar = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) @@ -982,13 +982,13 @@ H5T__init_package(void) fixedpt = native_int; floatpt = native_float; if (NULL == (compound = H5T__create(H5T_COMPOUND, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (enum_type = H5T__create(H5T_ENUM, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (vlen = H5T__vlen_create(native_int))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (array = H5T__array_create(native_int, 1, dim))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_noio_dxpl_id, FALSE); @@ -1247,7 +1247,7 @@ H5T__init_package(void) status |= H5T__init_inf(); if(status < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* Register datatype creation property class properties here. See similar * code in H5D__init_package(), etc. for example. @@ -1295,15 +1295,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__unlock_cb + * Function: H5T__unlock_cb * - * Purpose: Clear the immutable flag for a datatype. This function is - * called when the library is closing in order to unlock all - * registered datatypes and thus make them free-able. + * Purpose: Clear the immutable flag for a datatype. This function is + * called when the library is closing in order to unlock all + * registered datatypes and thus make them free-able. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, April 27, 1998 * *------------------------------------------------------------------------- @@ -1311,16 +1311,15 @@ done: static int H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) { - H5T_t *dt = (H5T_t *)_dt; - int *n = (int *)_udata; + H5T_t *dt = (H5T_t *)_dt; + int *n = (int *)_udata; FUNC_ENTER_STATIC_NOERR HDassert(dt && dt->shared); if(H5T_STATE_IMMUTABLE==dt->shared->state) { - dt->shared->state = H5T_STATE_RDONLY; - + dt->shared->state = H5T_STATE_RDONLY; (*n)++; } /* end if */ @@ -1329,15 +1328,15 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) /*------------------------------------------------------------------------- - * Function: H5T_top_term_package + * Function: H5T_top_term_package * - * Purpose: Close the "top" of the interface, releasing IDs, etc. + * Purpose: Close the "top" of the interface, releasing IDs, etc. * - * Return: Success: Positive if any action might have caused a - * change in some other interface; zero otherwise. - * Failure: Negative + * Return: Success: Positive if any action might have caused a + * change in some other interface; zero otherwise. + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 10, 2015 * *------------------------------------------------------------------------- @@ -1345,13 +1344,13 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) int H5T_top_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5T_top_package_initialize_s) { - /* Unregister all conversion functions */ - if(H5T_g.path) { + /* Unregister all conversion functions */ + if(H5T_g.path) { int i, nprint = 0; for(i = 0; i < H5T_g.npaths; i++) { @@ -1367,9 +1366,9 @@ H5T_top_term_package(void) #ifdef H5T_DEBUG if (H5DEBUG(T)) { fprintf(H5DEBUG(T), "H5T: conversion function " - "0x%08lx failed to free private data for " - "%s (ignored)\n", - (unsigned long)(path->func), path->name); + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->func), path->name); } /* end if */ #endif H5E_clear_stack(NULL); /*ignore the error*/ @@ -1395,118 +1394,118 @@ H5T_top_term_package(void) n++; } /* end if */ - /* Unlock all datatypes, then free them */ - /* note that we are ignoring the return value from H5I_iterate() */ + /* Unlock all datatypes, then free them */ + /* note that we are ignoring the return value from H5I_iterate() */ /* Also note that we are incrementing 'n' in the callback */ - H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); + H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); /* Release all datatype IDs */ - if(H5I_nmembers(H5I_DATATYPE) > 0) { - (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); + if(H5I_nmembers(H5I_DATATYPE) > 0) { + (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ /* Reset all the datatype IDs */ if(H5T_IEEE_F32BE_g > 0) { - H5T_IEEE_F32BE_g = FAIL; - H5T_IEEE_F32LE_g = FAIL; - H5T_IEEE_F64BE_g = FAIL; - H5T_IEEE_F64LE_g = FAIL; - - H5T_STD_I8BE_g = FAIL; - H5T_STD_I8LE_g = FAIL; - H5T_STD_I16BE_g = FAIL; - H5T_STD_I16LE_g = FAIL; - H5T_STD_I32BE_g = FAIL; - H5T_STD_I32LE_g = FAIL; - H5T_STD_I64BE_g = FAIL; - H5T_STD_I64LE_g = FAIL; - H5T_STD_U8BE_g = FAIL; - H5T_STD_U8LE_g = FAIL; - H5T_STD_U16BE_g = FAIL; - H5T_STD_U16LE_g = FAIL; - H5T_STD_U32BE_g = FAIL; - H5T_STD_U32LE_g = FAIL; - H5T_STD_U64BE_g = FAIL; - H5T_STD_U64LE_g = FAIL; - H5T_STD_B8BE_g = FAIL; - H5T_STD_B8LE_g = FAIL; - H5T_STD_B16BE_g = FAIL; - H5T_STD_B16LE_g = FAIL; - H5T_STD_B32BE_g = FAIL; - H5T_STD_B32LE_g = FAIL; - H5T_STD_B64BE_g = FAIL; - H5T_STD_B64LE_g = FAIL; - H5T_STD_REF_OBJ_g = FAIL; - H5T_STD_REF_DSETREG_g = FAIL; - - H5T_UNIX_D32BE_g = FAIL; - H5T_UNIX_D32LE_g = FAIL; - H5T_UNIX_D64BE_g = FAIL; - H5T_UNIX_D64LE_g = FAIL; - - H5T_C_S1_g = FAIL; - - H5T_FORTRAN_S1_g = FAIL; - - H5T_NATIVE_SCHAR_g = FAIL; - H5T_NATIVE_UCHAR_g = FAIL; - H5T_NATIVE_SHORT_g = FAIL; - H5T_NATIVE_USHORT_g = FAIL; - H5T_NATIVE_INT_g = FAIL; - H5T_NATIVE_UINT_g = FAIL; - H5T_NATIVE_LONG_g = FAIL; - H5T_NATIVE_ULONG_g = FAIL; - H5T_NATIVE_LLONG_g = FAIL; - H5T_NATIVE_ULLONG_g = FAIL; - H5T_NATIVE_FLOAT_g = FAIL; - H5T_NATIVE_DOUBLE_g = FAIL; + H5T_IEEE_F32BE_g = FAIL; + H5T_IEEE_F32LE_g = FAIL; + H5T_IEEE_F64BE_g = FAIL; + H5T_IEEE_F64LE_g = FAIL; + + H5T_STD_I8BE_g = FAIL; + H5T_STD_I8LE_g = FAIL; + H5T_STD_I16BE_g = FAIL; + H5T_STD_I16LE_g = FAIL; + H5T_STD_I32BE_g = FAIL; + H5T_STD_I32LE_g = FAIL; + H5T_STD_I64BE_g = FAIL; + H5T_STD_I64LE_g = FAIL; + H5T_STD_U8BE_g = FAIL; + H5T_STD_U8LE_g = FAIL; + H5T_STD_U16BE_g = FAIL; + H5T_STD_U16LE_g = FAIL; + H5T_STD_U32BE_g = FAIL; + H5T_STD_U32LE_g = FAIL; + H5T_STD_U64BE_g = FAIL; + H5T_STD_U64LE_g = FAIL; + H5T_STD_B8BE_g = FAIL; + H5T_STD_B8LE_g = FAIL; + H5T_STD_B16BE_g = FAIL; + H5T_STD_B16LE_g = FAIL; + H5T_STD_B32BE_g = FAIL; + H5T_STD_B32LE_g = FAIL; + H5T_STD_B64BE_g = FAIL; + H5T_STD_B64LE_g = FAIL; + H5T_STD_REF_OBJ_g = FAIL; + H5T_STD_REF_DSETREG_g = FAIL; + + H5T_UNIX_D32BE_g = FAIL; + H5T_UNIX_D32LE_g = FAIL; + H5T_UNIX_D64BE_g = FAIL; + H5T_UNIX_D64LE_g = FAIL; + + H5T_C_S1_g = FAIL; + + H5T_FORTRAN_S1_g = FAIL; + + H5T_NATIVE_SCHAR_g = FAIL; + H5T_NATIVE_UCHAR_g = FAIL; + H5T_NATIVE_SHORT_g = FAIL; + H5T_NATIVE_USHORT_g = FAIL; + H5T_NATIVE_INT_g = FAIL; + H5T_NATIVE_UINT_g = FAIL; + H5T_NATIVE_LONG_g = FAIL; + H5T_NATIVE_ULONG_g = FAIL; + H5T_NATIVE_LLONG_g = FAIL; + H5T_NATIVE_ULLONG_g = FAIL; + H5T_NATIVE_FLOAT_g = FAIL; + H5T_NATIVE_DOUBLE_g = FAIL; #if H5_SIZEOF_LONG_DOUBLE !=0 - H5T_NATIVE_LDOUBLE_g = FAIL; + H5T_NATIVE_LDOUBLE_g = FAIL; #endif - H5T_NATIVE_B8_g = FAIL; - H5T_NATIVE_B16_g = FAIL; - H5T_NATIVE_B32_g = FAIL; - H5T_NATIVE_B64_g = FAIL; - H5T_NATIVE_OPAQUE_g = FAIL; - H5T_NATIVE_HADDR_g = FAIL; - H5T_NATIVE_HSIZE_g = FAIL; - H5T_NATIVE_HSSIZE_g = FAIL; - H5T_NATIVE_HERR_g = FAIL; - H5T_NATIVE_HBOOL_g = FAIL; - - H5T_NATIVE_INT8_g = FAIL; - H5T_NATIVE_UINT8_g = FAIL; - H5T_NATIVE_INT_LEAST8_g = FAIL; - H5T_NATIVE_UINT_LEAST8_g = FAIL; - H5T_NATIVE_INT_FAST8_g = FAIL; - H5T_NATIVE_UINT_FAST8_g = FAIL; - - H5T_NATIVE_INT16_g = FAIL; - H5T_NATIVE_UINT16_g = FAIL; - H5T_NATIVE_INT_LEAST16_g = FAIL; - H5T_NATIVE_UINT_LEAST16_g = FAIL; - H5T_NATIVE_INT_FAST16_g = FAIL; - H5T_NATIVE_UINT_FAST16_g = FAIL; - - H5T_NATIVE_INT32_g = FAIL; - H5T_NATIVE_UINT32_g = FAIL; - H5T_NATIVE_INT_LEAST32_g = FAIL; - H5T_NATIVE_UINT_LEAST32_g = FAIL; - H5T_NATIVE_INT_FAST32_g = FAIL; - H5T_NATIVE_UINT_FAST32_g = FAIL; - - H5T_NATIVE_INT64_g = FAIL; - H5T_NATIVE_UINT64_g = FAIL; - H5T_NATIVE_INT_LEAST64_g = FAIL; - H5T_NATIVE_UINT_LEAST64_g = FAIL; - H5T_NATIVE_INT_FAST64_g = FAIL; - H5T_NATIVE_UINT_FAST64_g = FAIL; + H5T_NATIVE_B8_g = FAIL; + H5T_NATIVE_B16_g = FAIL; + H5T_NATIVE_B32_g = FAIL; + H5T_NATIVE_B64_g = FAIL; + H5T_NATIVE_OPAQUE_g = FAIL; + H5T_NATIVE_HADDR_g = FAIL; + H5T_NATIVE_HSIZE_g = FAIL; + H5T_NATIVE_HSSIZE_g = FAIL; + H5T_NATIVE_HERR_g = FAIL; + H5T_NATIVE_HBOOL_g = FAIL; + + H5T_NATIVE_INT8_g = FAIL; + H5T_NATIVE_UINT8_g = FAIL; + H5T_NATIVE_INT_LEAST8_g = FAIL; + H5T_NATIVE_UINT_LEAST8_g = FAIL; + H5T_NATIVE_INT_FAST8_g = FAIL; + H5T_NATIVE_UINT_FAST8_g = FAIL; + + H5T_NATIVE_INT16_g = FAIL; + H5T_NATIVE_UINT16_g = FAIL; + H5T_NATIVE_INT_LEAST16_g = FAIL; + H5T_NATIVE_UINT_LEAST16_g = FAIL; + H5T_NATIVE_INT_FAST16_g = FAIL; + H5T_NATIVE_UINT_FAST16_g = FAIL; + + H5T_NATIVE_INT32_g = FAIL; + H5T_NATIVE_UINT32_g = FAIL; + H5T_NATIVE_INT_LEAST32_g = FAIL; + H5T_NATIVE_UINT_LEAST32_g = FAIL; + H5T_NATIVE_INT_FAST32_g = FAIL; + H5T_NATIVE_UINT_FAST32_g = FAIL; + + H5T_NATIVE_INT64_g = FAIL; + H5T_NATIVE_UINT64_g = FAIL; + H5T_NATIVE_INT_LEAST64_g = FAIL; + H5T_NATIVE_UINT_LEAST64_g = FAIL; + H5T_NATIVE_INT_FAST64_g = FAIL; + H5T_NATIVE_UINT_FAST64_g = FAIL; n++; } /* end if */ - /* Mark "top" of interface as closed */ + /* Mark "top" of interface as closed */ if(0 == n) H5T_top_package_initialize_s = FALSE; } /* end if */ @@ -1516,19 +1515,19 @@ H5T_top_term_package(void) /*------------------------------------------------------------------------- - * Function: H5T_term_package + * Function: H5T_term_package * - * Purpose: Close this interface. + * Purpose: Close this interface. * - * Note: Finishes shutting down the interface, after - * H5T_top_term_package() is called + * Note: Finishes shutting down the interface, after + * H5T_top_term_package() is called * - * Return: Success: Positive if any action might have caused a - * change in some other interface; zero - * otherwise. - * Failure: Negative + * Return: Success: Positive if any action might have caused a + * change in some other interface; zero + * otherwise. + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * *------------------------------------------------------------------------- @@ -1536,7 +1535,7 @@ H5T_top_term_package(void) int H5T_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1546,9 +1545,9 @@ H5T_term_package(void) HDassert(FALSE == H5T_top_package_initialize_s); /* Destroy the datatype object id group */ - n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); + n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); - /* Mark interface as closed */ + /* Mark interface as closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -1558,47 +1557,44 @@ H5T_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Tcreate + * Function: H5Tcreate * - * Purpose: Create a new type and initialize it to reasonable values. - * The type is a member of type class TYPE and is SIZE bytes. + * Purpose: Create a new type and initialize it to reasonable values. + * The type is a member of type class TYPE and is SIZE bytes. * - * Return: Success: A new type identifier. + * Return: Success: A new type identifier. * - * Failure: Negative + * Failure: Negative * * Errors: - * ARGS BADVALUE Invalid size. - * DATATYPE CANTINIT Can't create type. - * DATATYPE CANTREGISTER Can't register datatype atom. - * - * Programmer: Robb Matzke - * Friday, December 5, 1997 - * - * Modifications: + * ARGS BADVALUE Invalid size. + * DATATYPE CANTINIT Can't create type. + * DATATYPE CANTREGISTER Can't register datatype atom. * + * Programmer: Robb Matzke + * Friday, December 5, 1997 *------------------------------------------------------------------------- */ hid_t H5Tcreate(H5T_class_t type, size_t size) { - H5T_t *dt = NULL; /* New datatype constructed */ - hid_t ret_value; /* Return value */ + H5T_t *dt = NULL; /* New datatype constructed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "Ttz", type, size); /* check args. We support string (fixed-size or variable-length) now. */ if(size <= 0 && size != H5T_VARIABLE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") /* create the type */ if(NULL == (dt = H5T__create(type, size))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type") /* Get an ID for the datatype */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype ID") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype ID") done: FUNC_LEAVE_API(ret_value) @@ -1606,35 +1602,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tcopy + * Function: H5Tcopy * - * Purpose: Copies a datatype. The resulting datatype is not locked. - * The datatype should be closed when no longer needed by - * calling H5Tclose(). + * Purpose: Copies a datatype. The resulting datatype is not locked. + * The datatype should be closed when no longer needed by + * calling H5Tclose(). * - * Return: Success: The ID of a new datatype. + * Return: Success: The ID of a new datatype. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * * Modifications: * - * Robb Matzke, 4 Jun 1998 - * The returned type is always transient and unlocked. If the TYPE_ID - * argument is a dataset instead of a datatype then this function - * returns a transient, modifiable datatype which is a copy of the - * dataset's datatype. + * Robb Matzke, 4 Jun 1998 + * The returned type is always transient and unlocked. If the TYPE_ID + * argument is a dataset instead of a datatype then this function + * returns a transient, modifiable datatype which is a copy of the + * dataset's datatype. * *------------------------------------------------------------------------- */ hid_t H5Tcopy(hid_t type_id) { - H5T_t *dt; /* Pointer to the datatype to copy */ - H5T_t *new_dt = NULL; - hid_t ret_value; /* Return value */ + H5T_t *dt; /* Pointer to the datatype to copy */ + H5T_t *new_dt = NULL; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type_id); @@ -1648,7 +1644,7 @@ H5Tcopy(hid_t type_id) case H5I_DATASET: { - H5D_t *dset; /* Dataset for datatype */ + H5D_t *dset; /* Dataset for datatype */ /* The argument is a dataset handle */ if(NULL == (dset = (H5D_t *)H5I_object(type_id))) @@ -1678,11 +1674,11 @@ H5Tcopy(hid_t type_id) /* Copy datatype */ if(NULL == (new_dt = H5T_copy(dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); /* Atomize result */ if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") done: if(ret_value < 0) @@ -1694,23 +1690,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tclose - * - * Purpose: Frees a datatype and all associated memory. + * Function: H5Tclose * - * Return: Non-negative on success/Negative on failure + * Purpose: Frees a datatype and all associated memory. * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: + * Return: Non-negative on success/Negative on failure * + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 *------------------------------------------------------------------------- */ herr_t H5Tclose(hid_t type_id) { - H5T_t *dt; /* Pointer to datatype to close */ + H5T_t *dt; /* Pointer to datatype to close */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1718,13 +1711,13 @@ H5Tclose(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_IMMUTABLE == dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") /* When the reference count reaches zero the resources are freed */ if(H5I_dec_app_ref(type_id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") done: FUNC_LEAVE_API(ret_value) @@ -1732,34 +1725,34 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tequal + * Function: H5Tequal * - * Purpose: Determines if two datatypes are equal. + * Purpose: Determines if two datatypes are equal. * - * Return: Success: TRUE if equal, FALSE if unequal + * Return: Success: TRUE if equal, FALSE if unequal * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, December 10, 1997 + * Programmer: Robb Matzke + * Wednesday, December 10, 1997 * *------------------------------------------------------------------------- */ htri_t H5Tequal(hid_t type1_id, hid_t type2_id) { - const H5T_t *dt1; /* Pointer to first datatype */ - const H5T_t *dt2; /* Pointer to second datatype */ - htri_t ret_value; /* Return value */ + const H5T_t *dt1; /* Pointer to first datatype */ + const H5T_t *dt2; /* Pointer to second datatype */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", type1_id, type2_id); /* check args */ if(NULL == (dt1 = (H5T_t *)H5I_object_verify(type1_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == (dt2 = (H5T_t *)H5I_object_verify(type2_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") ret_value = (0 == H5T_cmp(dt1, dt2, FALSE)) ? TRUE : FALSE; @@ -1769,33 +1762,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tlock + * Function: H5Tlock * - * Purpose: Locks a type, making it read only and non-destructable. This - * is normally done by the library for predefined datatypes so - * the application doesn't inadvertently change or delete a - * predefined type. + * Purpose: Locks a type, making it read only and non-destructable. This + * is normally done by the library for predefined datatypes so + * the application doesn't inadvertently change or delete a + * predefined type. * - * Once a datatype is locked it can never be unlocked unless - * the entire library is closed. + * Once a datatype is locked it can never be unlocked unless + * the entire library is closed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 9, 1998 + * Programmer: Robb Matzke + * Friday, January 9, 1998 * * Modifications: * - * Robb Matzke, 1 Jun 1998 - * It is illegal to lock a named datatype since we must allow named - * types to be closed (to release file resources) but locking a type - * prevents that. + * Robb Matzke, 1 Jun 1998 + * It is illegal to lock a named datatype since we must allow named + * types to be closed (to release file resources) but locking a type + * prevents that. *------------------------------------------------------------------------- */ herr_t H5Tlock(hid_t type_id) { - H5T_t *dt; /* Datatype to operate on */ + H5T_t *dt; /* Datatype to operate on */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1803,12 +1796,12 @@ H5Tlock(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_NAMED==dt->shared->state || H5T_STATE_OPEN==dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to lock named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to lock named datatype") if(H5T_lock(dt, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") done: FUNC_LEAVE_API(ret_value) @@ -1816,24 +1809,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tget_class + * Function: H5Tget_class * - * Purpose: Returns the datatype class identifier for datatype TYPE_ID. + * Purpose: Returns the datatype class identifier for datatype TYPE_ID. * - * Return: Success: One of the non-negative datatype class - * constants. + * Return: Success: One of the non-negative datatype class constants. * - * Failure: H5T_NO_CLASS (Negative) + * Failure: H5T_NO_CLASS (Negative) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ H5T_class_t H5Tget_class(hid_t type_id) { - H5T_t *dt; /* Pointer to datatype */ + H5T_t *dt; /* Pointer to datatype */ H5T_class_t ret_value; /* Return value */ FUNC_ENTER_API(H5T_NO_CLASS) @@ -1841,7 +1833,7 @@ H5Tget_class(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype") /* Set return value */ ret_value = H5T_get_class(dt, FALSE); @@ -1852,17 +1844,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_class + * Function: H5T_get_class * - * Purpose: Returns the data type class identifier for a datatype ptr. + * Purpose: Returns the data type class identifier for a datatype ptr. * - * Return: Success: One of the non-negative data type class - * constants. + * Return: Success: One of the non-negative data type class constants. * - * Failure: H5T_NO_CLASS (Negative) + * Failure: H5T_NO_CLASS (Negative) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * * Modifications: * Broke out from H5Tget_class - QAK - 6/4/99 @@ -1881,7 +1872,8 @@ H5T_get_class(const H5T_t *dt, htri_t internal) /* Externally, a VL string is a string; internally, a VL string is a VL. */ if(internal) { ret_value=dt->shared->type; - } else { + } + else { if(H5T_IS_VL_STRING(dt->shared)) ret_value=H5T_STRING; else @@ -1894,24 +1886,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tdetect_class - * - * Purpose: Check whether a datatype contains (or is) a certain type of - * datatype. + * Function: H5Tdetect_class * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Purpose: Check whether a datatype contains (or is) a certain type of + * datatype. * - * Programmer: Quincey Koziol - * Wednesday, November 29, 2000 - * - * Modifications: + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * + * Programmer: Quincey Koziol + * Wednesday, November 29, 2000 *------------------------------------------------------------------------- */ htri_t H5Tdetect_class(hid_t type, H5T_class_t cls) { - H5T_t *dt; /* Datatype to query */ + H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1933,15 +1922,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_detect_class + * Function: H5T_detect_class * - * Purpose: Check whether a datatype contains (or is) a certain type of - * datatype. + * Purpose: Check whether a datatype contains (or is) a certain type of + * datatype. * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, November 29, 2000 + * Programmer: Quincey Koziol + * Wednesday, November 29, 2000 * * Modifications: * Raymond Lu @@ -1957,7 +1946,7 @@ done: htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) { - unsigned i; + unsigned i; htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2018,21 +2007,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tis_variable_str + * Function: H5Tis_variable_str * - * Purpose: Check whether a datatype is a variable-length string + * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Raymond Lu - * November 4, 2002 + * Programmer: Raymond Lu + * November 4, 2002 * *------------------------------------------------------------------------- */ htri_t H5Tis_variable_str(hid_t dtype_id) { - H5T_t *dt; /* Datatype to query */ + H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2052,14 +2041,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_is_variable_str + * Function: H5T_is_variable_str * - * Purpose: Check whether a datatype is a variable-length string + * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Quincey Koziol - * October 17, 2007 + * Programmer: Quincey Koziol + * October 17, 2007 * *------------------------------------------------------------------------- */ @@ -2073,33 +2062,33 @@ H5T_is_variable_str(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5Tget_size + * Function: H5Tget_size * - * Purpose: Determines the total size of a datatype in bytes. + * Purpose: Determines the total size of a datatype in bytes. * - * Return: Success: Size of the datatype in bytes. The size of - * datatype is the size of an instance of that - * datatype. + * Return: Success: Size of the datatype in bytes. The size of + * datatype is the size of an instance of that + * datatype. * - * Failure: 0 (valid datatypes are never zero size) + * Failure: 0 (valid datatypes are never zero size) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ size_t H5Tget_size(hid_t type_id) { - H5T_t *dt; /* Datatype to query */ - size_t ret_value; /* Return value */ + H5T_t *dt; /* Datatype to query */ + size_t ret_value; /* Return value */ FUNC_ENTER_API(0) H5TRACE1("z", "i", type_id); /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") /* size */ ret_value = H5T_GET_SIZE(dt); @@ -2110,33 +2099,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tset_size + * Function: H5Tset_size * - * Purpose: Sets the total size in bytes for a datatype (this operation - * is not permitted on reference datatypes). If the size is - * decreased so that the significant bits of the datatype - * extend beyond the edge of the new size, then the `offset' - * property is decreased toward zero. If the `offset' becomes - * zero and the significant bits of the datatype still hang - * over the edge of the new size, then the number of significant - * bits is decreased. + * Purpose: Sets the total size in bytes for a datatype (this operation + * is not permitted on reference datatypes). If the size is + * decreased so that the significant bits of the datatype + * extend beyond the edge of the new size, then the `offset' + * property is decreased toward zero. If the `offset' becomes + * zero and the significant bits of the datatype still hang + * over the edge of the new size, then the number of significant + * bits is decreased. * - * Adjusting the size of an H5T_STRING automatically sets the - * precision to 8*size. + * Adjusting the size of an H5T_STRING automatically sets the + * precision to 8*size. * - * All datatypes have a positive size. + * All datatypes have a positive size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 + * Programmer: Robb Matzke + * Wednesday, January 7, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tset_size(hid_t type_id, size_t size) { - H5T_t *dt; /* Datatype to modify */ + H5T_t *dt; /* Datatype to modify */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2144,21 +2133,21 @@ H5Tset_size(hid_t type_id, size_t size) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") if(size <= 0 && size != H5T_VARIABLE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") if(size == H5T_VARIABLE && !H5T_IS_STRING(dt->shared)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length") if(H5T_ENUM == dt->shared->type && dt->shared->u.enumer.nmembs > 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") if(H5T_REFERENCE == dt->shared->type) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") /* Modify the datatype */ if(H5T_set_size(dt, size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") done: FUNC_LEAVE_API(ret_value) @@ -2166,38 +2155,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tget_super + * Function: H5Tget_super * - * Purpose: Returns the type from which TYPE is derived. In the case of - * an enumeration type the return value is an integer type. + * Purpose: Returns the type from which TYPE is derived. In the case of + * an enumeration type the return value is an integer type. * - * Return: Success: Type ID for base datatype. + * Return: Success: Type ID for base datatype. * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, December 23, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t H5Tget_super(hid_t type) { - H5T_t *dt; /* Datatype to query */ - H5T_t *super = NULL; /* Supertype */ - hid_t ret_value; /* Return value */ + H5T_t *dt; /* Datatype to query */ + H5T_t *super = NULL; /* Supertype */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type); if(NULL == (dt = (H5T_t *)H5I_object_verify(type,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == (super = H5T_get_super(dt))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype") if((ret_value = H5I_register(H5I_DATATYPE, super, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype") done: if(ret_value < 0) @@ -2209,36 +2195,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_super + * Function: H5T_get_super * - * Purpose: Private function for H5Tget_super. Returns the type from - * which TYPE is derived. In the case of an enumeration type - * the return value is an integer type. + * Purpose: Private function for H5Tget_super. Returns the type from + * which TYPE is derived. In the case of an enumeration type + * the return value is an integer type. * - * Return: Success: Data type for base data type. + * Return: Success: Data type for base data type. * - * Failure: NULL + * Failure: NULL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 9, 2002 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_t * H5T_get_super(const H5T_t *dt) { - H5T_t *ret_value=NULL; + H5T_t *ret_value=NULL; FUNC_ENTER_NOAPI(NULL) HDassert(dt); if (!dt->shared->parent) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); if (NULL==(ret_value=H5T_copy(dt->shared->parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2246,37 +2229,34 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_register - * - * Purpose: Register a hard or soft conversion function for a data type - * conversion path. The path is specified by the source and - * destination data types SRC_ID and DST_ID (for soft functions - * only the class of these types is important). If FUNC is a - * hard function then it replaces any previous path; if it's a - * soft function then it replaces all existing paths to which it - * applies and is used for any new path to which it applies as - * long as that path doesn't have a hard function. + * Function: H5T_register * - * Return: Non-negative on success/Negative on failure + * Purpose: Register a hard or soft conversion function for a data type + * conversion path. The path is specified by the source and + * destination data types SRC_ID and DST_ID (for soft functions + * only the class of these types is important). If FUNC is a + * hard function then it replaces any previous path; if it's a + * soft function then it replaces all existing paths to which it + * applies and is used for any new path to which it applies as + * long as that path doesn't have a hard function. * - * Programmer: Robb Matzke - * Friday, January 9, 1998 - * - * Modifications: + * Return: Non-negative on success/Negative on failure * + * Programmer: Robb Matzke + * Friday, January 9, 1998 *------------------------------------------------------------------------- */ static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id, hbool_t api_call) + H5T_conv_t func, hid_t dxpl_id, hbool_t api_call) { - hid_t tmp_sid=-1, tmp_did=-1;/*temporary data type IDs */ - H5T_path_t *old_path=NULL; /*existing conversion path */ - H5T_path_t *new_path=NULL; /*new conversion path */ - H5T_cdata_t cdata; /*temporary conversion data */ - int nprint=0; /*number of paths shut down */ - int i; /*counter */ - herr_t ret_value=SUCCEED; /*return value */ + hid_t tmp_sid = -1, tmp_did = -1; /*temporary data type IDs */ + H5T_path_t *old_path = NULL; /*existing conversion path */ + H5T_path_t *new_path = NULL; /*new conversion path */ + H5T_cdata_t cdata; /*temporary conversion data */ + int nprint=0; /*number of paths shut down */ + int i; /*counter */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2304,7 +2284,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, for(i = 0; i < H5T_g.npaths; i++) if(new_path != H5T_g.path[i]) H5T_g.path[i]->cdata.recalc = TRUE; - } /* end if */ + } /* end if */ } /* end if */ else { /* Add function to end of soft list */ @@ -2375,11 +2355,11 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " - "failed to free private data for %s (ignored)\n", - (unsigned long)(old_path->func), old_path->name); - } + if (H5DEBUG(T)) { + fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " + "failed to free private data for %s (ignored)\n", + (unsigned long)(old_path->func), old_path->name); + } #endif } /* end if */ H5T_close(old_path->src); @@ -2392,23 +2372,23 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, tmp_sid = tmp_did = -1; /* We don't care about any failures during the freeing process */ - H5E_clear_stack(NULL); + H5E_clear_stack(NULL); } /* end for */ } /* end else */ done: if(ret_value < 0) { - if(new_path) { - if(new_path->src) - H5T_close(new_path->src); - if(new_path->dst) - H5T_close(new_path->dst); - new_path = H5FL_FREE(H5T_path_t, new_path); - } /* end if */ - if(tmp_sid >= 0) - H5I_dec_ref(tmp_sid); - if(tmp_did >= 0) - H5I_dec_ref(tmp_did); + if(new_path) { + if(new_path->src) + H5T_close(new_path->src); + if(new_path->dst) + H5T_close(new_path->dst); + new_path = H5FL_FREE(H5T_path_t, new_path); + } /* end if */ + if(tmp_sid >= 0) + H5I_dec_ref(tmp_sid); + if(tmp_did >= 0) + H5I_dec_ref(tmp_did); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -2416,50 +2396,50 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tregister + * Function: H5Tregister * - * Purpose: Register a hard or soft conversion function for a data type - * conversion path. The path is specified by the source and - * destination data types SRC_ID and DST_ID (for soft functions - * only the class of these types is important). If FUNC is a - * hard function then it replaces any previous path; if it's a - * soft function then it replaces all existing paths to which it - * applies and is used for any new path to which it applies as - * long as that path doesn't have a hard function. + * Purpose: Register a hard or soft conversion function for a data type + * conversion path. The path is specified by the source and + * destination data types SRC_ID and DST_ID (for soft functions + * only the class of these types is important). If FUNC is a + * hard function then it replaces any previous path; if it's a + * soft function then it replaces all existing paths to which it + * applies and is used for any new path to which it applies as + * long as that path doesn't have a hard function. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 9, 1998 + * Programmer: Robb Matzke + * Friday, January 9, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { - H5T_t *src; /*source data type descriptor */ - H5T_t *dst; /*destination data type desc */ - herr_t ret_value = SUCCEED; /*return value */ + H5T_t *src; /*source data type descriptor */ + H5T_t *dst; /*destination data type desc */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check args */ if(H5T_PERS_HARD != pers && H5T_PERS_SOFT != pers) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging") if(NULL == (src = (H5T_t *)H5I_object_verify(src_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(NULL == (dst = (H5T_t *)H5I_object_verify(dst_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") /* Go register the function */ if(H5T_register(pers, name, src, dst, func, H5AC_noio_dxpl_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: FUNC_LEAVE_API(ret_value) @@ -2467,18 +2447,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_unregister + * Function: H5T_unregister * - * Purpose: Removes conversion paths that match the specified criteria. - * All arguments are optional. Missing arguments are wild cards. - * The special no-op path cannot be removed. + * Purpose: Removes conversion paths that match the specified criteria. + * All arguments are optional. Missing arguments are wild cards. + * The special no-op path cannot be removed. * - * Return: Succeess: non-negative + * Return: Succeess: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * * Modifications: * Adapted to non-API function - QAK, 11/17/99 @@ -2487,12 +2467,12 @@ done: */ static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id) + H5T_conv_t func, hid_t dxpl_id) { - H5T_path_t *path = NULL; /*conversion path */ - H5T_soft_t *soft = NULL; /*soft conversion information */ - int nprint = 0; /*number of paths shut down */ - int i; /*counter */ + H5T_path_t *path = NULL; /*conversion path */ + H5T_soft_t *soft = NULL; /*soft conversion information */ + int nprint = 0; /*number of paths shut down */ + int i; /*counter */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2566,27 +2546,27 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /*------------------------------------------------------------------------- - * Function: H5Tunregister + * Function: H5Tunregister * - * Purpose: Removes conversion paths that match the specified criteria. - * All arguments are optional. Missing arguments are wild cards. - * The special no-op path cannot be removed. + * Purpose: Removes conversion paths that match the specified criteria. + * All arguments are optional. Missing arguments are wild cards. + * The special no-op path cannot be removed. * - * Return: Succeess: non-negative + * Return: Succeess: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { - H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); @@ -2606,29 +2586,29 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tfind + * Function: H5Tfind * - * Purpose: Finds a conversion function that can handle a conversion from - * type SRC_ID to type DST_ID. The PCDATA argument is a pointer - * to a pointer to type conversion data which was created and - * initialized by the type conversion function of this path - * when the conversion function was installed on the path. + * Purpose: Finds a conversion function that can handle a conversion from + * type SRC_ID to type DST_ID. The PCDATA argument is a pointer + * to a pointer to type conversion data which was created and + * initialized by the type conversion function of this path + * when the conversion function was installed on the path. * - * Return: Success: A pointer to a suitable conversion function. + * Return: Success: A pointer to a suitable conversion function. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) { - H5T_t *src, *dst; - H5T_path_t *path; - H5T_conv_t ret_value; /* Return value */ + H5T_t *src, *dst; + H5T_path_t *path; + H5T_conv_t ret_value; /* Return value */ FUNC_ENTER_API(NULL) H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); @@ -2636,13 +2616,13 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if(!pcdata) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") /* Find it */ if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") if(pcdata) *pcdata = &(path->cdata); @@ -2656,27 +2636,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tcompiler_conv + * Function: H5Tcompiler_conv * - * Purpose: Finds out whether the library's conversion function from - * type src_id to type dst_id is a compiler (hard) conversion. - * A hard conversion uses compiler's casting; a soft conversion - * uses the library's own conversion function. + * Purpose: Finds out whether the library's conversion function from + * type src_id to type dst_id is a compiler (hard) conversion. + * A hard conversion uses compiler's casting; a soft conversion + * uses the library's own conversion function. * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. - * FAIL: failed. + * Return: TRUE: hard conversion. + * FALSE: soft conversion. + * FAIL: failed. * - * Programmer: Raymond Lu - * Friday, Sept 2, 2005 + * Programmer: Raymond Lu + * Friday, Sept 2, 2005 * *------------------------------------------------------------------------- */ htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id) { - H5T_t *src, *dst; - htri_t ret_value; /* Return value */ + H5T_t *src, *dst; + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", src_id, dst_id); @@ -2684,11 +2664,11 @@ H5Tcompiler_conv(hid_t src_id, hid_t dst_id) /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") /* Find it */ if((ret_value = H5T_compiler_conv(src, dst)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") done: FUNC_LEAVE_API(ret_value) @@ -2696,35 +2676,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tconvert - * - * Purpose: Convert NELMTS elements from type SRC_ID to type DST_ID. The - * source elements are packed in BUF and on return the - * destination will be packed in BUF. That is, the conversion - * is performed in place. The optional background buffer is an - * array of NELMTS values of destination type which are merged - * with the converted values to fill in cracks (for instance, - * BACKGROUND might be an array of structs with the `a' and `b' - * fields already initialized and the conversion of BUF supplies - * the `c' and `d' field values). The PLIST_ID a dataset transfer - * property list which is passed to the conversion functions. (It's - * currently only used to pass along the VL datatype custom allocation - * information -QAK 7/1/99) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke + * Function: H5Tconvert + * + * Purpose: Convert NELMTS elements from type SRC_ID to type DST_ID. The + * source elements are packed in BUF and on return the + * destination will be packed in BUF. That is, the conversion + * is performed in place. The optional background buffer is an + * array of NELMTS values of destination type which are merged + * with the converted values to fill in cracks (for instance, + * BACKGROUND might be an array of structs with the `a' and `b' + * fields already initialized and the conversion of BUF supplies + * the `c' and `d' field values). The PLIST_ID a dataset transfer + * property list which is passed to the conversion functions. (It's + * currently only used to pass along the VL datatype custom allocation + * information -QAK 7/1/99) + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke * Wednesday, June 10, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, - void *background, hid_t dxpl_id) + void *background, hid_t dxpl_id) { - H5T_path_t *tpath; /*type conversion info */ - H5T_t *src, *dst; /*unatomized types */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_path_t *tpath; /* type conversion info */ + H5T_t *src, *dst; /* unatomized types */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiz*x*xi", src_id, dst_id, nelmts, buf, background, dxpl_id); @@ -2732,7 +2712,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else @@ -2741,7 +2721,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, /* Find the conversion function */ if(NULL == (tpath = H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") @@ -2752,17 +2732,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tencode + * Function: H5Tencode * - * Purpose: Given an datatype ID, converts the object description into - * binary in a buffer. + * Purpose: Given an datatype ID, converts the object description into + * binary in a buffer. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2778,13 +2757,13 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) /* Check argument and retrieve object */ if(NULL == (dtype = (H5T_t *)H5I_object_verify(obj_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(nalloc == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size") /* Go encode the datatype */ if(H5T_encode(dtype, (unsigned char *)buf, nalloc) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") done: FUNC_LEAVE_API(ret_value) @@ -2792,24 +2771,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tdecode + * Function: H5Tdecode * - * Purpose: Decode a binary object description and return a new object - * handle. + * Purpose: Decode a binary object description and return a new object + * handle. * - * Return: Success: datatype ID(non-negative) + * Return: Success: datatype ID(non-negative) * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * * Modification:Raymond Lu - * songyulu@hdfgroup.org * 17 February 2011 * I changed the value for the APP_REF parameter of H5I_register - * from FALSE to TRUE. + * from FALSE to TRUE. *------------------------------------------------------------------------- */ hid_t @@ -2823,15 +2800,15 @@ H5Tdecode(const void *buf) /* Check args */ if(buf == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") /* Create datatype by decoding buffer */ if(NULL == (dt = H5T_decode((const unsigned char *)buf))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") done: FUNC_LEAVE_API(ret_value) @@ -2844,17 +2821,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_encode + * Function: H5T_encode * - * Purpose: Private function for H5Tencode. Converts an object - * description into binary in a buffer. + * Purpose: Private function for H5Tencode. Converts an object + * description into binary in a buffer. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2870,11 +2846,11 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed */ if((buf_size = H5O_msg_raw_size(f, H5O_DTYPE_ID, TRUE, obj)) == 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size") /* Don't encode if buffer size isn't big enough or buffer is empty */ if(!buf || *nalloc < (buf_size + 1 + 1)) @@ -2901,17 +2877,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_decode + * Function: H5T_decode * - * Purpose: Private function for H5Tdecode. Reconstructs a binary - * description of datatype and returns a new object handle. + * Purpose: Private function for H5Tdecode. Reconstructs a binary + * description of datatype and returns a new object handle. * - * Return: Success: datatype ID(non-negative) + * Return: Success: datatype ID(non-negative) * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2926,19 +2901,19 @@ H5T_decode(const unsigned char *buf) /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode the type of the information */ if(*buf++ != H5O_DTYPE_ID) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADMESG, NULL, "not an encoded datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADMESG, NULL, "not an encoded datatype") /* Decode the version of the datatype information */ if(*buf++ != H5T_ENCODE_VERSION) - HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ if(H5T_set_loc(ret_value, NULL, H5T_LOC_MEMORY) < 0) @@ -2954,18 +2929,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__create + * Function: H5T__create * - * Purpose: Creates a new data type and initializes it to reasonable - * values. The new data type is SIZE bytes and an instance of - * the class TYPE. + * Purpose: Creates a new data type and initializes it to reasonable + * values. The new data type is SIZE bytes and an instance of + * the class TYPE. * - * Return: Success: Pointer to the new type. + * Return: Success: Pointer to the new type. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Friday, December 5, 1997 + * Programmer: Robb Matzke + * Friday, December 5, 1997 * * Modifications: * Raymond Lu @@ -2989,16 +2964,16 @@ H5T__create(H5T_class_t type, size_t size) { H5T_t *origin_dt = NULL; - if(NULL == (origin_dt = (H5T_t *)H5I_object(H5T_C_S1))) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "can't get structure for string type") + if(NULL == (origin_dt = (H5T_t *)H5I_object(H5T_C_S1))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "can't get structure for string type") - /* Copy the default string datatype */ - if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); + /* Copy the default string datatype */ + if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); - /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") + /* Modify the datatype */ + if(H5T_set_size(dt, size) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") } break; @@ -3083,35 +3058,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_copy + * Function: H5T_copy * - * Purpose: Copies datatype OLD_DT. The resulting data type is not - * locked and is a transient type. + * Purpose: Copies datatype OLD_DT. The resulting data type is not + * locked and is a transient type. * - * Return: Success: Pointer to a new copy of the OLD_DT argument. + * Return: Success: Pointer to a new copy of the OLD_DT argument. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * * Modifications: * - * Robb Matzke, 4 Jun 1998 - * Added the METHOD argument. If it's H5T_COPY_TRANSIENT then the - * result will be an unlocked transient type. Otherwise if it's - * H5T_COPY_ALL then the result is a named type if the original is a - * named type, but the result is not opened. Finally, if it's - * H5T_COPY_REOPEN and the original type is a named type then the result - * is a named type and the type object header is opened again. The - * H5T_COPY_REOPEN method is used when returning a named type to the - * application. + * Robb Matzke, 4 Jun 1998 + * Added the METHOD argument. If it's H5T_COPY_TRANSIENT then the + * result will be an unlocked transient type. Otherwise if it's + * H5T_COPY_ALL then the result is a named type if the original is a + * named type, but the result is not opened. Finally, if it's + * H5T_COPY_REOPEN and the original type is a named type then the result + * is a named type and the type object header is opened again. The + * H5T_COPY_REOPEN method is used when returning a named type to the + * application. * - * Robb Matzke, 22 Dec 1998 - * Now able to copy enumeration data types. + * Robb Matzke, 22 Dec 1998 + * Now able to copy enumeration data types. * * Robb Matzke, 20 May 1999 - * Now able to copy opaque types. + * Now able to copy opaque types. * * Pedro Vicente, 21 Sep 2002 * Added a deep copy of the symbol table entry @@ -3121,11 +3096,11 @@ done: H5T_t * H5T_copy(H5T_t *old_dt, H5T_copy_t method) { - H5T_t *new_dt = NULL, *tmp = NULL; + H5T_t *new_dt = NULL, *tmp = NULL; H5T_shared_t *reopened_fo = NULL; - unsigned i; - char *s; - H5T_t *ret_value = NULL; /* Return value */ + unsigned i; + char *s; + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -3207,7 +3182,8 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count") } /* end else */ new_dt->shared->state = H5T_STATE_OPEN; - } else if(H5T_STATE_IMMUTABLE == old_dt->shared->state) { + } + else if(H5T_STATE_IMMUTABLE == old_dt->shared->state) { new_dt->shared->state = H5T_STATE_RDONLY; } break; @@ -3225,71 +3201,71 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) switch(new_dt->shared->type) { case H5T_COMPOUND: { - ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - - /* - * Copy all member fields to new type, then overwrite the - * name and type fields of each new member with copied values. - * That is, H5T_copy() is a deep copy. - */ - /* Only malloc if space has been allocated for members - NAF */ - if(new_dt->shared->u.compnd.nalloc > 0) { - new_dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_malloc(new_dt->shared->u.compnd.nalloc * - sizeof(H5T_cmemb_t)); - if (NULL==new_dt->shared->u.compnd.memb) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - - HDmemcpy(new_dt->shared->u.compnd.memb, old_dt->shared->u.compnd.memb, - new_dt->shared->u.compnd.nmembs * sizeof(H5T_cmemb_t)); - } /* end if */ + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - for(i = 0; i < new_dt->shared->u.compnd.nmembs; i++) { - unsigned j; - int old_match; - - s = new_dt->shared->u.compnd.memb[i].name; - new_dt->shared->u.compnd.memb[i].name = H5MM_xstrdup(s); - tmp = H5T_copy (old_dt->shared->u.compnd.memb[i].type, method); - new_dt->shared->u.compnd.memb[i].type = tmp; - HDassert(tmp != NULL); - - /* Range check against compound member's offset */ - if ((accum_change < 0) && ((ssize_t) new_dt->shared->u.compnd.memb[i].offset < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); - - /* Apply the accumulated size change to the offset of the field */ - new_dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; - - if(old_dt->shared->u.compnd.sorted != H5T_SORT_VALUE) { - for(old_match = -1, j = 0; j < old_dt->shared->u.compnd.nmembs; j++) { - if(!HDstrcmp(new_dt->shared->u.compnd.memb[i].name, old_dt->shared->u.compnd.memb[j].name)) { - old_match = (int) j; - break; - } /* end if */ - } /* end for */ - - /* check if we couldn't find a match */ - if(old_match < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "fields in datatype corrupted"); + /* + * Copy all member fields to new type, then overwrite the + * name and type fields of each new member with copied values. + * That is, H5T_copy() is a deep copy. + */ + /* Only malloc if space has been allocated for members - NAF */ + if(new_dt->shared->u.compnd.nalloc > 0) { + new_dt->shared->u.compnd.memb = + (H5T_cmemb_t *)H5MM_malloc(new_dt->shared->u.compnd.nalloc * sizeof(H5T_cmemb_t)); + if (NULL == new_dt->shared->u.compnd.memb) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + + HDmemcpy(new_dt->shared->u.compnd.memb, old_dt->shared->u.compnd.memb, + new_dt->shared->u.compnd.nmembs * sizeof(H5T_cmemb_t)); } /* end if */ - else - old_match = (int) i; - /* If the field changed size, add that change to the accumulated size change */ - if(new_dt->shared->u.compnd.memb[i].type->shared->size != old_dt->shared->u.compnd.memb[old_match].type->shared->size) { - /* Adjust the size of the member */ - new_dt->shared->u.compnd.memb[i].size = (old_dt->shared->u.compnd.memb[old_match].size*tmp->shared->size)/old_dt->shared->u.compnd.memb[old_match].type->shared->size; + for(i = 0; i < new_dt->shared->u.compnd.nmembs; i++) { + unsigned j; + int old_match; + + s = new_dt->shared->u.compnd.memb[i].name; + new_dt->shared->u.compnd.memb[i].name = H5MM_xstrdup(s); + tmp = H5T_copy (old_dt->shared->u.compnd.memb[i].type, method); + new_dt->shared->u.compnd.memb[i].type = tmp; + HDassert(tmp != NULL); + + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + + /* Apply the accumulated size change to the offset of the field */ + new_dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; + + if(old_dt->shared->u.compnd.sorted != H5T_SORT_VALUE) { + for(old_match = -1, j = 0; j < old_dt->shared->u.compnd.nmembs; j++) { + if(!HDstrcmp(new_dt->shared->u.compnd.memb[i].name, old_dt->shared->u.compnd.memb[j].name)) { + old_match = (int) j; + break; + } /* end if */ + } /* end for */ + + /* check if we couldn't find a match */ + if(old_match < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "fields in datatype corrupted"); + } /* end if */ + else + old_match = (int) i; + + /* If the field changed size, add that change to the accumulated size change */ + if(new_dt->shared->u.compnd.memb[i].type->shared->size != old_dt->shared->u.compnd.memb[old_match].type->shared->size) { + /* Adjust the size of the member */ + new_dt->shared->u.compnd.memb[i].size = (old_dt->shared->u.compnd.memb[old_match].size*tmp->shared->size)/old_dt->shared->u.compnd.memb[old_match].type->shared->size; - accum_change += (ssize_t) (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); - } /* end if */ - } /* end for */ + accum_change += (ssize_t) (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); + } /* end if */ + } /* end for */ - /* Range check against datatype size */ - if ((accum_change < 0) && ((ssize_t) new_dt->shared->size < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); - /* Apply the accumulated size change to the size of the compound struct */ - new_dt->shared->size += (size_t) accum_change; + /* Apply the accumulated size change to the size of the compound struct */ + new_dt->shared->size += (size_t) accum_change; } break; @@ -3299,14 +3275,14 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) * of each new member with copied values. That is, H5T_copy() is a * deep copy. */ - new_dt->shared->u.enumer.name = (char **)H5MM_malloc(new_dt->shared->u.enumer.nalloc * - sizeof(char*)); - new_dt->shared->u.enumer.value = (uint8_t *)H5MM_malloc(new_dt->shared->u.enumer.nalloc * - new_dt->shared->size); + new_dt->shared->u.enumer.name = + (char **)H5MM_malloc(new_dt->shared->u.enumer.nalloc * sizeof(char*)); + new_dt->shared->u.enumer.value = + (uint8_t *)H5MM_malloc(new_dt->shared->u.enumer.nalloc * new_dt->shared->size); if(NULL == new_dt->shared->u.enumer.value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); HDmemcpy(new_dt->shared->u.enumer.value, old_dt->shared->u.enumer.value, - new_dt->shared->u.enumer.nmembs * new_dt->shared->size); + new_dt->shared->u.enumer.nmembs * new_dt->shared->size); for(i = 0; i < new_dt->shared->u.enumer.nmembs; i++) { s = old_dt->shared->u.enumer.name[i]; new_dt->shared->u.enumer.name[i] = H5MM_xstrdup(s); @@ -3390,22 +3366,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_lock + * Function: H5T_lock * - * Purpose: Lock a transient data type making it read-only. If IMMUTABLE - * is set then the type cannot be closed except when the library - * itself closes. + * Purpose: Lock a transient data type making it read-only. If IMMUTABLE + * is set then the type cannot be closed except when the library + * itself closes. * - * This function is a no-op if the type is not transient or if - * the type is already read-only or immutable. + * This function is a no-op if the type is not transient or if + * the type is already read-only or immutable. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 4, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3439,14 +3412,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__alloc + * Function: H5T__alloc * - * Purpose: Allocates a new H5T_t structure, initializing it correctly. + * Purpose: Allocates a new H5T_t structure, initializing it correctly. * - * Return: Pointer to new H5T_t on success/NULL on failure + * Return: Pointer to new H5T_t on success/NULL on failure * - * Programmer: Quincey Koziol - * Monday, August 29, 2005 + * Programmer: Quincey Koziol + * Monday, August 29, 2005 * *------------------------------------------------------------------------- */ @@ -3486,23 +3459,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__free + * Function: H5T__free * - * Purpose: Frees all memory associated with a datatype, but does not - * free the H5T_t or H5T_shared_t structures (which should - * be done in H5T_close). + * Purpose: Frees all memory associated with a datatype, but does not + * free the H5T_t or H5T_shared_t structures (which should + * be done in H5T_close). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Monday, January 6, 2003 + * Programmer: Quincey Koziol + * Monday, January 6, 2003 * *------------------------------------------------------------------------- */ herr_t H5T__free(H5T_t *dt) { - unsigned i; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3535,7 +3508,7 @@ H5T__free(H5T_t *dt) * Don't free locked datatypes. */ if(H5T_STATE_IMMUTABLE==dt->shared->state) - HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype") /* Close the datatype */ switch(dt->shared->type) { @@ -3578,7 +3551,7 @@ H5T__free(H5T_t *dt) /* Close the parent */ HDassert(dt->shared->parent != dt); if(dt->shared->parent && H5T_close(dt->shared->parent) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") dt->shared->parent = NULL; done: @@ -3587,22 +3560,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_close + * Function: H5T_close * - * Purpose: Frees a data type and all associated memory. If the data - * type is locked then nothing happens. + * Purpose: Frees a data type and all associated memory. If the data + * type is locked then nothing happens. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ herr_t H5T_close(H5T_t *dt) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3612,16 +3585,16 @@ H5T_close(H5T_t *dt) dt->shared->fo_count--; if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 0) { - /* Uncork cache entries with object address tag for named datatype only */ - if(dt->shared->state == H5T_STATE_OPEN && dt->shared->fo_count == 0) { - hbool_t corked; /* Whether the named datatype is corked or not */ - - if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") - if(corked) - if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__UNCORK, NULL) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTUNCORK, FAIL, "unable to uncork an object") - } /* end if */ + /* Uncork cache entries with object address tag for named datatype only */ + if(dt->shared->state == H5T_STATE_OPEN && dt->shared->fo_count == 0) { + hbool_t corked; /* Whether the named datatype is corked or not */ + + if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") + if(corked) + if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__UNCORK, NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTUNCORK, FAIL, "unable to uncork an object") + } /* end if */ if(H5T__free(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); @@ -3666,40 +3639,40 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_size + * Function: H5T_set_size * - * Purpose: Sets the total size in bytes for a data type (this operation - * is not permitted on reference data types). If the size is - * decreased so that the significant bits of the data type - * extend beyond the edge of the new size, then the `offset' - * property is decreased toward zero. If the `offset' becomes - * zero and the significant bits of the data type still hang - * over the edge of the new size, then the number of significant - * bits is decreased. + * Purpose: Sets the total size in bytes for a data type (this operation + * is not permitted on reference data types). If the size is + * decreased so that the significant bits of the data type + * extend beyond the edge of the new size, then the `offset' + * property is decreased toward zero. If the `offset' becomes + * zero and the significant bits of the data type still hang + * over the edge of the new size, then the number of significant + * bits is decreased. * - * Adjusting the size of an H5T_STRING automatically sets the - * precision to 8*size. + * Adjusting the size of an H5T_STRING automatically sets the + * precision to 8*size. * - * All data types have a positive size. + * All data types have a positive size. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: nagative + * Failure: nagative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 22, 1998 * * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. + * Robb Matzke, 22 Dec 1998 + * Also works with derived data types. * *------------------------------------------------------------------------- */ static herr_t H5T_set_size(H5T_t *dt, size_t size) { - size_t prec, offset; - herr_t ret_value=SUCCEED; /* Return value */ + size_t prec, offset; + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3718,7 +3691,8 @@ H5T_set_size(H5T_t *dt, size_t size) dt->shared->size = dt->shared->parent->shared->size * dt->shared->u.array.nelem; else if(dt->shared->type!=H5T_VLEN) dt->shared->size = dt->shared->parent->shared->size; - } else { + } + else { if (H5T_IS_ATOMIC(dt->shared)) { offset = dt->shared->u.atomic.offset; prec = dt->shared->u.atomic.prec; @@ -3731,7 +3705,8 @@ H5T_set_size(H5T_t *dt, size_t size) offset = 8 * size - prec; if (prec > 8*size) prec = 8 * size; - } else { + } + else { prec = offset = 0; } @@ -3745,28 +3720,28 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_COMPOUND: /* If decreasing size, check the last member isn't being cut. */ - if(sizeshared->size) { + if(size < dt->shared->size) { int num_membs = 0; - unsigned i, max_index=0; - size_t memb_offset, max_offset=0; + unsigned i, max_index = 0; + size_t memb_offset, max_offset = 0; size_t max_size; - if((num_membs = H5T_get_nmembers(dt))<0) + if((num_membs = H5T_get_nmembers(dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); if(num_membs) { - for(i=0; i<(unsigned)num_membs; i++) { - memb_offset = H5T_get_member_offset(dt, i); - if(memb_offset > max_offset) { - max_offset = memb_offset; - max_index = i; - } - } - - max_size = H5T__get_member_size(dt, max_index); - - if(size<(max_offset+max_size)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); + for(i = 0; i < (unsigned)num_membs; i++) { + memb_offset = H5T_get_member_offset(dt, i); + if(memb_offset > max_offset) { + max_offset = memb_offset; + max_index = i; + } + } + + max_size = H5T__get_member_size(dt, max_index); + + if(size < (max_offset + max_size)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); } /* Compound must not have been packed previously */ @@ -3779,10 +3754,10 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_STRING: /* Convert string to variable-length datatype */ - if(size==H5T_VARIABLE) { - H5T_t *base = NULL; /* base data type */ - H5T_cset_t tmp_cset; /* Temp. cset info */ - H5T_str_t tmp_strpad; /* Temp. strpad info */ + if(size == H5T_VARIABLE) { + H5T_t *base = NULL; /* base data type */ + H5T_cset_t tmp_cset; /* Temp. cset info */ + H5T_str_t tmp_strpad; /* Temp. strpad info */ /* Get a copy of unsigned char type as the base/parent type */ if(NULL == (base = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR))) @@ -3794,14 +3769,14 @@ H5T_set_size(H5T_t *dt, size_t size) /* * Force conversions (i.e. memory to memory conversions - * should duplicate data, not point to the same VL strings) + * should duplicate data, not point to the same VL strings) */ dt->shared->force_conv = TRUE; - /* Before we mess with the info in the union, extract the - * values we need */ - tmp_cset=dt->shared->u.atomic.u.s.cset; - tmp_strpad=dt->shared->u.atomic.u.s.pad; + /* Before we mess with the info in the union, extract the + * values we need */ + tmp_cset = dt->shared->u.atomic.u.s.cset; + tmp_strpad = dt->shared->u.atomic.u.s.pad; /* This is a string, not a sequence */ dt->shared->u.vlen.type = H5T_VLEN_STRING; @@ -3814,7 +3789,8 @@ H5T_set_size(H5T_t *dt, size_t size) if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); - } else { + } + else { prec = 8 * size; offset = 0; } /* end else */ @@ -3848,7 +3824,7 @@ H5T_set_size(H5T_t *dt, size_t size) } /* Commit (if we didn't convert this type to a VL string) */ - if(dt->shared->type!=H5T_VLEN) { + if(dt->shared->type != H5T_VLEN) { dt->shared->size = size; if (H5T_IS_ATOMIC(dt->shared)) { dt->shared->u.atomic.offset = offset; @@ -3867,21 +3843,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_size - * - * Purpose: Determines the total size of a data type in bytes. + * Function: H5T_get_size * - * Return: Success: Size of the data type in bytes. The size of - * the data type is the size of an instance of - * that data type. + * Purpose: Determines the total size of a data type in bytes. * - * Failure: 0 (valid data types are never zero size) + * Return: Success: Size of the data type in bytes. The size of + * the data type is the size of an instance of + * that data type. * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: + * Failure: 0 (valid data types are never zero size) * + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 *------------------------------------------------------------------------- */ size_t @@ -3898,30 +3871,30 @@ H5T_get_size(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5T_cmp + * Function: H5T_cmp * - * Purpose: Compares two data types. + * Purpose: Compares two data types. * - * Return: Success: 0 if DT1 and DT2 are equal. - * <0 if DT1 is less than DT2. - * >0 if DT1 is greater than DT2. + * Return: Success: 0 if DT1 and DT2 are equal. + * <0 if DT1 is less than DT2. + * >0 if DT1 is greater than DT2. * - * Failure: 0, never fails + * Failure: 0, never fails * - * Programmer: Robb Matzke - * Wednesday, December 10, 1997 + * Programmer: Robb Matzke + * Wednesday, December 10, 1997 * *------------------------------------------------------------------------- */ int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) { - unsigned *idx1 = NULL, *idx2 = NULL; - size_t base_size; - hbool_t swapped; - unsigned u; - int tmp; - int ret_value = 0; + unsigned *idx1 = NULL, *idx2 = NULL; + size_t base_size; + hbool_t swapped; + unsigned u; + int tmp; + int ret_value = 0; FUNC_ENTER_NOAPI(0) @@ -3949,10 +3922,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if(!dt1->shared->parent && dt2->shared->parent) HGOTO_DONE(1); if(dt1->shared->parent) { - tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); - if(tmp < 0) + tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); + if(tmp < 0) HGOTO_DONE(-1); - if(tmp > 0) + if(tmp > 0) HGOTO_DONE(1); } /* end if */ @@ -4003,7 +3976,7 @@ 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; ushared->u.compnd.nmembs-1; u++) { + for(u=0; ushared->u.compnd.nmembs-1; u++) { HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt1->shared->u.compnd.memb[idx1[u + 1]].name)); HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, @@ -4012,24 +3985,24 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #endif /* Compare the members */ - for (u=0; ushared->u.compnd.nmembs; u++) { + for(u=0; ushared->u.compnd.nmembs; u++) { tmp = HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt2->shared->u.compnd.memb[idx2[u]].name); - if (tmp < 0) + if(tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) + if(tmp > 0) HGOTO_DONE(1); - if (dt1->shared->u.compnd.memb[idx1[u]].offset < dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(-1); - if (dt1->shared->u.compnd.memb[idx1[u]].offset > dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(1); + if(dt1->shared->u.compnd.memb[idx1[u]].offset < dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(-1); + if(dt1->shared->u.compnd.memb[idx1[u]].offset > dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(1); - if (dt1->shared->u.compnd.memb[idx1[u]].size < dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(-1); - if (dt1->shared->u.compnd.memb[idx1[u]].size > dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(1); + if(dt1->shared->u.compnd.memb[idx1[u]].size < dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(-1); + if(dt1->shared->u.compnd.memb[idx1[u]].size > dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(1); tmp = H5T_cmp(dt1->shared->u.compnd.memb[idx1[u]].type, dt2->shared->u.compnd.memb[idx2[u]].type, superset); - if (tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) HGOTO_DONE(1); + if(tmp < 0) HGOTO_DONE(-1); + if(tmp > 0) HGOTO_DONE(1); } break; @@ -4042,13 +4015,13 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) * more members than dt1 */ if(superset) { - if (dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) HGOTO_DONE(1); } /* end if */ else { - if (dt1->shared->u.enumer.nmembs < dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs < dt2->shared->u.enumer.nmembs) HGOTO_DONE(-1); - if (dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) HGOTO_DONE(1); } /* end else */ @@ -4056,15 +4029,15 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if(NULL == (idx1 = (unsigned *)H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(unsigned))) || NULL == (idx2 = (unsigned *)H5MM_malloc(dt2->shared->u.enumer.nmembs * sizeof(unsigned)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed"); - for (u=0; ushared->u.enumer.nmembs; u++) + for(u=0; ushared->u.enumer.nmembs; u++) idx1[u] = u; if(dt1->shared->u.enumer.nmembs > 1) { int i; for (i = (int) dt1->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) - if (HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], + for(j = 0, swapped = FALSE; j < i; j++) + if(HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], dt1->shared->u.enumer.name[idx1[j+1]]) > 0) { unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j+1]; @@ -4073,16 +4046,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) } } } - for (u=0; ushared->u.enumer.nmembs; u++) + for(u=0; ushared->u.enumer.nmembs; u++) idx2[u] = u; if(dt2->shared->u.enumer.nmembs > 1) { int i; - for (i = (int) dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for(i = (int) dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) - if (HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], + for(j = 0, swapped = FALSE; j < i; j++) + if(HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], dt2->shared->u.enumer.name[idx2[j+1]]) > 0) { unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j+1]; @@ -4094,7 +4067,7 @@ 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; ushared->u.enumer.nmembs-1; u++) { + for(u=0; ushared->u.enumer.nmembs-1; u++) { HDassert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt1->shared->u.enumer.name[idx1[u+1]])); HDassert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], @@ -4104,12 +4077,12 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* Compare the members */ base_size = dt1->shared->parent->shared->size; - for (u=0; ushared->u.enumer.nmembs; u++) { + for(u=0; ushared->u.enumer.nmembs; u++) { unsigned idx = 0; if(superset) { unsigned lt = 0, rt; /* Final, left & right key indices */ - int cmp = 1; /* Key comparison value */ + int cmp = 1; /* Key comparison value */ /* If a superset is allowed, dt2 may have more members * than dt1, so binary search for matching member name in @@ -4117,18 +4090,18 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) */ rt = dt2->shared->u.enumer.nmembs; - while (lt < rt && cmp) { + while(lt < rt && cmp) { idx = (lt + rt) / 2; /* compare */ - if ((cmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], + if((cmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt2->shared->u.enumer.name[idx2[idx]] ) ) < 0) rt = idx; else lt = idx+1; } /* Leave, if we couldn't find match */ - if (cmp) + if(cmp) HGOTO_DONE(-1); } /* end if */ else { @@ -4147,8 +4120,8 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) tmp = HDmemcmp(dt1->shared->u.enumer.value+idx1[u]*base_size, dt2->shared->u.enumer.value+idx2[idx]*base_size, base_size); - if (tmp<0) HGOTO_DONE(-1); - if (tmp>0) HGOTO_DONE(1); + if(tmp<0) HGOTO_DONE(-1); + if(tmp>0) HGOTO_DONE(1); } break; @@ -4159,29 +4132,32 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) HDassert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.locshared->u.vlen.type==H5T_VLEN_SEQUENCE && + if(dt1->shared->u.vlen.type==H5T_VLEN_SEQUENCE && dt2->shared->u.vlen.type==H5T_VLEN_STRING) { HGOTO_DONE(-1); - } else if (dt1->shared->u.vlen.type==H5T_VLEN_STRING && + } + else if(dt1->shared->u.vlen.type==H5T_VLEN_STRING && dt2->shared->u.vlen.type==H5T_VLEN_SEQUENCE) { HGOTO_DONE(1); } /* Arbitrarily sort VL datatypes in memory before disk */ - if (dt1->shared->u.vlen.loc==H5T_LOC_MEMORY && + if(dt1->shared->u.vlen.loc==H5T_LOC_MEMORY && dt2->shared->u.vlen.loc==H5T_LOC_DISK) { HGOTO_DONE(-1); - } else if (dt1->shared->u.vlen.loc==H5T_LOC_DISK && + } + else if(dt1->shared->u.vlen.loc==H5T_LOC_DISK && dt2->shared->u.vlen.loc==H5T_LOC_MEMORY) { HGOTO_DONE(1); - } else if (dt1->shared->u.vlen.loc==H5T_LOC_BADLOC && + } + else if(dt1->shared->u.vlen.loc==H5T_LOC_BADLOC && dt2->shared->u.vlen.loc!=H5T_LOC_BADLOC) { HGOTO_DONE(1); } /* Don't allow VL types in different files to compare as equal */ - if (dt1->shared->u.vlen.f < dt2->shared->u.vlen.f) + if(dt1->shared->u.vlen.f < dt2->shared->u.vlen.f) HGOTO_DONE(-1); - if (dt1->shared->u.vlen.f > dt2->shared->u.vlen.f) + if(dt1->shared->u.vlen.f > dt2->shared->u.vlen.f) HGOTO_DONE(1); break; @@ -4191,22 +4167,22 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_ARRAY: - if (dt1->shared->u.array.ndims < dt2->shared->u.array.ndims) + if(dt1->shared->u.array.ndims < dt2->shared->u.array.ndims) HGOTO_DONE(-1); - if (dt1->shared->u.array.ndims > dt2->shared->u.array.ndims) + if(dt1->shared->u.array.ndims > dt2->shared->u.array.ndims) HGOTO_DONE(1); - for (u=0; ushared->u.array.ndims; u++) { - if (dt1->shared->u.array.dim[u] < dt2->shared->u.array.dim[u]) + for(u=0; ushared->u.array.ndims; u++) { + if(dt1->shared->u.array.dim[u] < dt2->shared->u.array.dim[u]) HGOTO_DONE(-1); - if (dt1->shared->u.array.dim[u] > dt2->shared->u.array.dim[u]) + if(dt1->shared->u.array.dim[u] > dt2->shared->u.array.dim[u]) HGOTO_DONE(1); } tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); - if (tmp < 0) + if(tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) + if(tmp > 0) HGOTO_DONE(1); break; @@ -4222,62 +4198,62 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* * Atomic datatypes... */ - if (dt1->shared->u.atomic.order < dt2->shared->u.atomic.order) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.order > dt2->shared->u.atomic.order) HGOTO_DONE(1); + if(dt1->shared->u.atomic.order < dt2->shared->u.atomic.order) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.order > dt2->shared->u.atomic.order) HGOTO_DONE(1); - if (dt1->shared->u.atomic.prec < dt2->shared->u.atomic.prec) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.prec > dt2->shared->u.atomic.prec) HGOTO_DONE(1); + if(dt1->shared->u.atomic.prec < dt2->shared->u.atomic.prec) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.prec > dt2->shared->u.atomic.prec) HGOTO_DONE(1); - if (dt1->shared->u.atomic.offset < dt2->shared->u.atomic.offset) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.offset > dt2->shared->u.atomic.offset) HGOTO_DONE(1); + if(dt1->shared->u.atomic.offset < dt2->shared->u.atomic.offset) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.offset > dt2->shared->u.atomic.offset) HGOTO_DONE(1); - if (dt1->shared->u.atomic.lsb_pad < dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.lsb_pad > dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(1); + if(dt1->shared->u.atomic.lsb_pad < dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.lsb_pad > dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(1); - if (dt1->shared->u.atomic.msb_pad < dt2->shared->u.atomic.msb_pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.msb_pad > dt2->shared->u.atomic.msb_pad) HGOTO_DONE(1); + if(dt1->shared->u.atomic.msb_pad < dt2->shared->u.atomic.msb_pad) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.msb_pad > dt2->shared->u.atomic.msb_pad) HGOTO_DONE(1); switch (dt1->shared->type) { case H5T_INTEGER: - if (dt1->shared->u.atomic.u.i.sign < dt2->shared->u.atomic.u.i.sign) + if(dt1->shared->u.atomic.u.i.sign < dt2->shared->u.atomic.u.i.sign) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.i.sign > dt2->shared->u.atomic.u.i.sign) + if(dt1->shared->u.atomic.u.i.sign > dt2->shared->u.atomic.u.i.sign) HGOTO_DONE(1); break; case H5T_FLOAT: - if (dt1->shared->u.atomic.u.f.sign < dt2->shared->u.atomic.u.f.sign) + if(dt1->shared->u.atomic.u.f.sign < dt2->shared->u.atomic.u.f.sign) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.sign > dt2->shared->u.atomic.u.f.sign) + if(dt1->shared->u.atomic.u.f.sign > dt2->shared->u.atomic.u.f.sign) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.epos < dt2->shared->u.atomic.u.f.epos) + if(dt1->shared->u.atomic.u.f.epos < dt2->shared->u.atomic.u.f.epos) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.epos > dt2->shared->u.atomic.u.f.epos) + if(dt1->shared->u.atomic.u.f.epos > dt2->shared->u.atomic.u.f.epos) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.esize < dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.esize > dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.esize < dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.esize > dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.ebias < dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.ebias > dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.ebias < dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.ebias > dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.mpos < dt2->shared->u.atomic.u.f.mpos) + if(dt1->shared->u.atomic.u.f.mpos < dt2->shared->u.atomic.u.f.mpos) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.mpos > dt2->shared->u.atomic.u.f.mpos) + if(dt1->shared->u.atomic.u.f.mpos > dt2->shared->u.atomic.u.f.mpos) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.msize < dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.msize > dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.msize < dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.msize > dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.norm < dt2->shared->u.atomic.u.f.norm) + if(dt1->shared->u.atomic.u.f.norm < dt2->shared->u.atomic.u.f.norm) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.norm > dt2->shared->u.atomic.u.f.norm) + if(dt1->shared->u.atomic.u.f.norm > dt2->shared->u.atomic.u.f.norm) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.pad < dt2->shared->u.atomic.u.f.pad) + if(dt1->shared->u.atomic.u.f.pad < dt2->shared->u.atomic.u.f.pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.pad > dt2->shared->u.atomic.u.f.pad) + if(dt1->shared->u.atomic.u.f.pad > dt2->shared->u.atomic.u.f.pad) HGOTO_DONE(1); break; @@ -4287,14 +4263,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_STRING: - if (dt1->shared->u.atomic.u.s.cset < dt2->shared->u.atomic.u.s.cset) + if(dt1->shared->u.atomic.u.s.cset < dt2->shared->u.atomic.u.s.cset) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.s.cset > dt2->shared->u.atomic.u.s.cset) + if(dt1->shared->u.atomic.u.s.cset > dt2->shared->u.atomic.u.s.cset) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.s.pad < dt2->shared->u.atomic.u.s.pad) + if(dt1->shared->u.atomic.u.s.pad < dt2->shared->u.atomic.u.s.pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.s.pad > dt2->shared->u.atomic.u.s.pad) + if(dt1->shared->u.atomic.u.s.pad > dt2->shared->u.atomic.u.s.pad) HGOTO_DONE(1); break; @@ -4304,16 +4280,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_REFERENCE: - if (dt1->shared->u.atomic.u.r.rtype < dt2->shared->u.atomic.u.r.rtype) + if(dt1->shared->u.atomic.u.r.rtype < dt2->shared->u.atomic.u.r.rtype) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.r.rtype > dt2->shared->u.atomic.u.r.rtype) + if(dt1->shared->u.atomic.u.r.rtype > dt2->shared->u.atomic.u.r.rtype) HGOTO_DONE(1); switch(dt1->shared->u.atomic.u.r.rtype) { case H5R_OBJECT: - if (dt1->shared->u.atomic.u.r.loc < dt2->shared->u.atomic.u.r.loc) + if(dt1->shared->u.atomic.u.r.loc < dt2->shared->u.atomic.u.r.loc) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.r.loc > dt2->shared->u.atomic.u.r.loc) + if(dt1->shared->u.atomic.u.r.loc > dt2->shared->u.atomic.u.r.loc) HGOTO_DONE(1); break; @@ -4357,29 +4333,29 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_path_find + * Function: H5T_path_find * - * Purpose: Finds the path which converts type SRC_ID to type DST_ID, - * creating a new path if necessary. If FUNC is non-zero then - * it is set as the hard conversion function for that path - * regardless of whether the path previously existed. Changing - * the conversion function of a path causes statistics to be - * reset to zero after printing them. The NAME is used only - * when creating a new path and is just for debugging. + * Purpose: Finds the path which converts type SRC_ID to type DST_ID, + * creating a new path if necessary. If FUNC is non-zero then + * it is set as the hard conversion function for that path + * regardless of whether the path previously existed. Changing + * the conversion function of a path causes statistics to be + * reset to zero after printing them. The NAME is used only + * when creating a new path and is just for debugging. * - * If SRC and DST are both null pointers then the special no-op - * conversion path is used. This path is always stored as the - * first path in the path table. + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. This path is always stored as the + * first path in the path table. * - * Return: Success: Pointer to the path, valid until the path - * database is modified. + * Return: Success: Pointer to the path, valid until the path + * database is modified. * - * Failure: NULL if the path does not exist and no - * function can be found to apply to the new - * path. + * Failure: NULL if the path does not exist and no + * function can be found to apply to the new + * path. * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * * Modifications: * Added a parameter IS_API to indicate whether to an API @@ -4397,16 +4373,16 @@ H5T_path_t * H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t func, hid_t dxpl_id, hbool_t is_api) { - int lt, rt; /*left and right edges */ - int md; /*middle */ - int cmp; /*comparison result */ - int old_npaths; /* Previous number of paths in table */ - H5T_path_t *table = NULL; /*path existing in the table */ - H5T_path_t *path = NULL; /*new path */ - hid_t src_id = -1, dst_id = -1; /*src and dst type identifiers */ - int i; /*counter */ - int nprint = 0; /*lines of output printed */ - H5T_path_t *ret_value = NULL; /* Return value */ + int lt, rt; /* left and right edges */ + int md; /* middle */ + int cmp; /* comparison result */ + int old_npaths; /* Previous number of paths in table */ + H5T_path_t *table = NULL; /* path existing in the table */ + H5T_path_t *path = NULL; /* new path */ + hid_t src_id = -1, dst_id = -1; /* src and dst type identifiers */ + int i; /* counter */ + int nprint = 0; /* lines of output printed */ + H5T_path_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -4420,23 +4396,23 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * Make sure the first entry in the table is the no-op conversion path. */ if(0 == H5T_g.npaths) { - if(NULL == (H5T_g.path = (H5T_path_t **)H5MM_malloc(128 * sizeof(H5T_path_t *)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path table") - H5T_g.apaths = 128; - if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") + if(NULL == (H5T_g.path = (H5T_path_t **)H5MM_malloc(128 * sizeof(H5T_path_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path table") + H5T_g.apaths = 128; + if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); - H5T_g.path[0]->func = H5T__conv_noop; - H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + H5T_g.path[0]->func = H5T__conv_noop; + H5T_g.path[0]->cdata.command = H5T_CONV_INIT; + if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) - fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); #endif - H5E_clear_stack(NULL); /*ignore the error*/ - } /* end if */ - H5T_g.path[0]->is_noop = TRUE; - H5T_g.npaths = 1; + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ + H5T_g.path[0]->is_noop = TRUE; + H5T_g.npaths = 1; } /* end if */ /* @@ -4449,28 +4425,28 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * are set */ if(src->shared->force_conv == FALSE && dst->shared->force_conv == FALSE && 0 == H5T_cmp(src, dst, TRUE)) { - table = H5T_g.path[0]; - cmp = 0; - md = 0; + table = H5T_g.path[0]; + cmp = 0; + md = 0; } /* end if */ else { - lt = md = 1; - rt = H5T_g.npaths; - cmp = -1; - - while(cmp && lt < rt) { - md = (lt + rt) / 2; - HDassert(H5T_g.path[md]); - cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); - if(0 == cmp) + lt = md = 1; + rt = H5T_g.npaths; + cmp = -1; + + while(cmp && lt < rt) { + md = (lt + rt) / 2; + HDassert(H5T_g.path[md]); + cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); + if(0 == cmp) cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); - if(cmp < 0) - rt = md; - else if(cmp > 0) - lt = md + 1; - else - table = H5T_g.path[md]; - } /* end while */ + if(cmp < 0) + rt = md; + else if(cmp > 0) + lt = md + 1; + else + table = H5T_g.path[md]; + } /* end while */ } /* end else */ /* Keep a record of the number of paths in the table, in case one of the @@ -4486,21 +4462,21 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * create a new path and add the new function to the path. */ if(!table || (table && func && is_api) || (table && !table->is_hard && func && !is_api)) { - if(NULL == (path = H5FL_CALLOC(H5T_path_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path") - if(name && *name) { - HDstrncpy(path->name, name, (size_t)H5T_NAMELEN); - path->name[H5T_NAMELEN - 1] = '\0'; + if(NULL == (path = H5FL_CALLOC(H5T_path_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path") + if(name && *name) { + HDstrncpy(path->name, name, (size_t)H5T_NAMELEN); + path->name[H5T_NAMELEN - 1] = '\0'; } /* end if */ - else - HDsnprintf(path->name, sizeof(path->name), "NONAME"); - if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") + else + HDsnprintf(path->name, sizeof(path->name), "NONAME"); + if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") if(NULL == (path->dst = H5T_copy(dst, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") } /* end if */ else - path = table; + path = table; /* * If a hard conversion function is specified and none is defined for the @@ -4509,22 +4485,22 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * and initialize its conversion data. */ if(func && (!table || (table && is_api) || (table && !table->is_hard && !is_api))) { - HDassert(path != table); - HDassert(NULL == path->func); - if(path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") - if(path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query") - path->cdata.command = H5T_CONV_INIT; - if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") - if(src_id >= 0) + HDassert(path != table); + HDassert(NULL == path->func); + if(path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") + if(path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query") + path->cdata.command = H5T_CONV_INIT; + if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") + if(src_id >= 0) H5I_dec_ref(src_id); - if(dst_id >= 0) + if(dst_id >= 0) H5I_dec_ref(dst_id); - src_id = dst_id = -1; - path->func = func; - path->is_hard = TRUE; + src_id = dst_id = -1; + path->func = func; + path->is_hard = TRUE; } /* end if */ /* @@ -4535,29 +4511,29 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, */ HDassert(path->func || (src && dst)); for(i = H5T_g.nsoft - 1; i >= 0 && !path->func; --i) { - if(src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) - continue; - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register src conversion type for query") - if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query") - path->cdata.command = H5T_CONV_INIT; - if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { - HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ - } /* end if */ + if(src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) + continue; + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register src conversion type for query") + if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query") + path->cdata.command = H5T_CONV_INIT; + if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + } /* end if */ else { - HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); - path->name[H5T_NAMELEN - 1] = '\0'; - path->func = H5T_g.soft[i].func; - path->is_hard = FALSE; - } /* end else */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); - src_id = dst_id = -1; + HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); + path->name[H5T_NAMELEN - 1] = '\0'; + path->func = H5T_g.soft[i].func; + path->is_hard = FALSE; + } /* end else */ + H5I_dec_ref(src_id); + H5I_dec_ref(dst_id); + src_id = dst_id = -1; } /* end for */ if(!path->func) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path") /* Check if paths were inserted into the table through a recursive call * and re-compute the correct location for this path if so. - QAK, 1/26/02 @@ -4584,34 +4560,35 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, /* Replace an existing table entry or add a new entry */ if(table && path != table) { - HDassert(table == H5T_g.path[md]); - H5T__print_stats(table, &nprint/*in,out*/); - table->cdata.command = H5T_CONV_FREE; - if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + HDassert(table == H5T_g.path[md]); + H5T__print_stats(table, &nprint/*in,out*/); + table->cdata.command = H5T_CONV_FREE; + if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " - "failed for %s (ignored)\n", - (unsigned long)(path->func), path->name); - } /* end if */ + if(H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " + "failed for %s (ignored)\n", + (unsigned long)(path->func), path->name); + } /* end if */ #endif - H5E_clear_stack(NULL); /*ignore the failure*/ - } /* end if */ - if(table->src) + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ + if(table->src) H5T_close(table->src); - if(table->dst) + if(table->dst) H5T_close(table->dst); table = H5FL_FREE(H5T_path_t, table); - table = path; - H5T_g.path[md] = path; - } else if(path != table) { - HDassert(cmp); + table = path; + H5T_g.path[md] = path; + } + else if(path != table) { + HDassert(cmp); if((size_t)H5T_g.npaths >= H5T_g.apaths) { size_t na = MAX(128, 2 * H5T_g.apaths); H5T_path_t **x; if(NULL == (x = (H5T_path_t **)H5MM_realloc(H5T_g.path, na * sizeof(H5T_path_t*)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5T_g.apaths = na; H5T_g.path = x; } /* end if */ @@ -4619,8 +4596,8 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, md++; HDmemmove(H5T_g.path + md + 1, H5T_g.path + md, (size_t) (H5T_g.npaths - md) * sizeof(H5T_path_t*)); H5T_g.npaths++; - H5T_g.path[md] = path; - table = path; + H5T_g.path[md] = path; + table = path; } /* end else-if */ /* Set the flag to indicate both source and destination types are compound types @@ -4633,9 +4610,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, done: if(!ret_value && path && path != table) { - if(path->src) + if(path->src) H5T_close(path->src); - if(path->dst) + if(path->dst) H5T_close(path->dst); path = H5FL_FREE(H5T_path_t, path); } /* end if */ @@ -4649,20 +4626,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_path_noop - * - * Purpose: Is the path the special no-op path? The no-op function can be - * set by the application and there might be more than one no-op - * path in a multi-threaded application if one thread is using - * the no-op path when some other thread changes its definition. + * Function: H5T_path_noop * - * Return: TRUE/FALSE (can't fail) + * Purpose: Is the path the special no-op path? The no-op function can be + * set by the application and there might be more than one no-op + * path in a multi-threaded application if one thread is using + * the no-op path when some other thread changes its definition. * - * Programmer: Quincey Koziol - * Thursday, May 8, 2003 - * - * Modifications: + * Return: TRUE/FALSE (can't fail) * + * Programmer: Quincey Koziol + * Thursday, May 8, 2003 *------------------------------------------------------------------------- */ hbool_t @@ -4677,12 +4651,12 @@ H5T_path_noop(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_path_compound_subset + * Function: H5T_path_compound_subset * - * Purpose: Checks if the source and destination types are both compound. - * Tells whether whether the source members are a subset of - * destination, and the order is the same, and no conversion - * is needed. For example: + * Purpose: Checks if the source and destination types are both compound. + * Tells whether whether the source members are a subset of + * destination, and the order is the same, and no conversion + * is needed. For example: * struct source { struct destination { * TYPE1 A; --> TYPE1 A; * TYPE2 B; --> TYPE2 B; @@ -4691,11 +4665,11 @@ H5T_path_noop(const H5T_path_t *p) * TYPE5 E; * }; * - * Return: A pointer to the subset info struct in p, or NULL if there are - * no compounds. Points directly into the H5T_path_t structure. + * Return: A pointer to the subset info struct in p, or NULL if there are + * no compounds. Points directly into the H5T_path_t structure. * - * Programmer: Raymond Lu - * 8 June 2007 + * Programmer: Raymond Lu + * 8 June 2007 * * Modifications: Neil Fortner * 19 September 2008 @@ -4721,17 +4695,14 @@ H5T_path_compound_subset(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_path_bkg + * Function: H5T_path_bkg * - * Purpose: Get the "background" flag for the conversion path. + * Purpose: Get the "background" flag for the conversion path. * - * Return: Background flag (can't fail) - * - * Programmer: Quincey Koziol - * Thursday, May 8, 2003 - * - * Modifications: + * Return: Background flag (can't fail) * + * Programmer: Quincey Koziol + * Thursday, May 8, 2003 *------------------------------------------------------------------------- */ H5T_bkg_t @@ -4746,34 +4717,31 @@ H5T_path_bkg(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_compiler_conv - * - * Purpose: Private function for H5Tcompiler_conv. Finds out whether the - * library's conversion function from type SRC to type DST - * is a hard conversion. - * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. - * FAIL: function failed. + * Function: H5T_compiler_conv * - * Programmer: Raymond Lu - * Friday, Sept 2, 2005 + * Purpose: Private function for H5Tcompiler_conv. Finds out whether the + * library's conversion function from type SRC to type DST + * is a hard conversion. * - * Modifications: + * Return: TRUE: hard conversion. + * FALSE: soft conversion. + * FAIL: function failed. * + * Programmer: Raymond Lu + * Friday, Sept 2, 2005 *------------------------------------------------------------------------- */ static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst) { - H5T_path_t *path; - htri_t ret_value = FAIL; /* Return value */ + H5T_path_t *path; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Find it */ if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") ret_value = (htri_t)path->is_hard; @@ -4783,28 +4751,28 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_convert + * Function: H5T_convert * - * Purpose: Call a conversion function to convert from source to - * destination data type and accumulate timing statistics. + * Purpose: Call a conversion function to convert from source to + * destination data type and accumulate timing statistics. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 15, 1998 * * Modifications: - * Robb Matzke, 1999-06-16 - * The timers are updated only if H5T debugging is enabled at - * runtime in addition to compile time. + * Robb Matzke, 1999-06-16 + * The timers are updated only if H5T debugging is enabled at + * runtime in addition to compile time. * - * 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, 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. * * Quincey Koziol, 1999-07-01 * Added dataset transfer properties, to allow custom VL @@ -4825,11 +4793,11 @@ done: */ herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist) { #ifdef H5T_DEBUG - H5_timer_t timer; + H5_timer_t timer; #endif herr_t ret_value=SUCCEED; /* Return value */ @@ -4841,12 +4809,12 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, tpath->cdata.command = H5T_CONV_CONV; if ((tpath->func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, dset_xfer_plist)<0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); #ifdef H5T_DEBUG if (H5DEBUG(T)) { - H5_timer_end(&(tpath->stats.timer), &timer); - tpath->stats.ncalls++; - tpath->stats.nelmts += nelmts; + H5_timer_end(&(tpath->stats.timer), &timer); + tpath->stats.ncalls++; + tpath->stats.nelmts += nelmts; } #endif @@ -4856,14 +4824,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_oloc + * Function: H5T_oloc * - * Purpose: Returns a pointer to the object location for a named datatype. + * Purpose: Returns a pointer to the object location for a named datatype. * - * Return: Success: Ptr directly into named datatype - * Failure: NULL + * Return: Success: Ptr directly into named datatype + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, June 5, 1998 * *------------------------------------------------------------------------- @@ -4897,14 +4865,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_nameof + * Function: H5T_nameof * - * Purpose: Returns a pointer to the path for a named datatype. + * Purpose: Returns a pointer to the path for a named datatype. * - * Return: Success: Ptr directly into named datatype - * Failure: NULL + * Return: Success: Ptr directly into named datatype + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, September 12, 2005 * *------------------------------------------------------------------------- @@ -4947,9 +4915,6 @@ done: * * Programmer: Raymond Lu * Friday, Dec 7, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -4980,9 +4945,6 @@ done: * * Programmer: Pedro Vicente * Tuesday, Sep 3, 2002 - * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -5005,9 +4967,9 @@ done: * Function: H5T_convert_committed_datatype * * Purpose: To convert the committed datatype "dt" to a transient embedded - * type if the file location associated with the committed datatype is - * different from the parameter "f". - * "f" is the file location where the dataset or attribute will be created. + * type if the file location associated with the committed datatype is + * different from the parameter "f". + * "f" is the file location where the dataset or attribute will be created. * * Notes: See HDFFV-9940 * @@ -5046,25 +5008,17 @@ done: /*-------------------------------------------------------------------------- - NAME - H5T_get_ref_type - PURPOSE - Retrieves the type of reference for a datatype - USAGE - H5R_type_t H5Tget_ref_type(dt) - H5T_t *dt; IN: datatype pointer for the reference datatype - - RETURNS - Success: A reference type defined in H5Rpublic.h - Failure: H5R_BADTYPE - DESCRIPTION - Given a reference datatype object, this function returns the reference type - of the datatype. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ + * Function: H5T_get_ref_type + * + * Purpose: Retrieves the type of reference for a datatype + * H5T_t *dt; IN: datatype pointer for the reference datatype + * + * Return: Success: A reference type defined in H5Rpublic.h + * Failure: H5R_BADTYPE + * Notes: Given a reference datatype object, this function returns the reference type + * of the datatype. + *-------------------------------------------------------------------------- + */ H5R_type_t H5T_get_ref_type(const H5T_t *dt) { @@ -5083,26 +5037,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_is_sensible - * - * Purpose: Determines if a data type is sensible to store on disk - * (i.e. not partially initialized) - * - * Return: Success: TRUE, FALSE + * Function: H5T_is_sensible * - * Failure: Negative + * Purpose: Determines if a data type is sensible to store on disk + * (i.e. not partially initialized) * - * Programmer: Quincey Koziol - * Tuesday, June 11, 2002 + * Return: Success: TRUE, FALSE * - * Modifications: + * Failure: Negative * + * Programmer: Quincey Koziol + * Tuesday, June 11, 2002 *------------------------------------------------------------------------- */ htri_t H5T_is_sensible(const H5T_t *dt) { - htri_t ret_value = FAIL; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5166,18 +5117,15 @@ done: DESCRIPTION Recursively descends any VL or compound datatypes to mark all VL datatypes as either on disk or in memory. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ + -------------------------------------------------------------------------- + */ htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) { - htri_t changed; /* Whether H5T_set_loc changed the type (even if the size didn't change) */ - htri_t ret_value = 0; /* Indicate that success, but no location change */ - unsigned i; /* Local index variable */ - size_t old_size; /* Previous size of a field */ + htri_t changed; /* Whether H5T_set_loc changed the type (even if the size didn't change) */ + htri_t ret_value = 0; /* Indicate that success, but no location change */ + unsigned i; /* Local index variable */ + size_t old_size; /* Previous size of a field */ FUNC_ENTER_NOAPI(FAIL) @@ -5211,53 +5159,53 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ { - ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - /* Sort the fields based on offsets */ - H5T__sort_value(dt, NULL); + /* Sort the fields based on offsets */ + H5T__sort_value(dt, NULL); - for (i=0; ishared->u.compnd.nmembs; i++) { - H5T_t *memb_type; /* Member's datatype pointer */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + H5T_t *memb_type; /* Member's datatype pointer */ - /* Range check against compound member's offset */ - if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); - /* Apply the accumulated size change to the offset of the field */ - dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; + /* Apply the accumulated size change to the offset of the field */ + dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; - /* Set the member type pointer (for convenience) */ - memb_type=dt->shared->u.compnd.memb[i].type; + /* Set the member type pointer (for convenience) */ + memb_type = dt->shared->u.compnd.memb[i].type; - /* Recurse if it's VL, compound, enum or array */ - /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ - if(memb_type->shared->force_conv && H5T_IS_COMPLEX(memb_type->shared->type)) { - /* Keep the old field size for later */ - old_size=memb_type->shared->size; + /* Recurse if it's VL, compound, enum or array */ + /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ + if(memb_type->shared->force_conv && H5T_IS_COMPLEX(memb_type->shared->type)) { + /* Keep the old field size for later */ + old_size = memb_type->shared->size; - /* Mark the VL, compound, enum or array type */ - if((changed=H5T_set_loc(memb_type,f,loc))<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + /* Mark the VL, compound, enum or array type */ + if((changed = H5T_set_loc(memb_type,f,loc)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); + if(changed > 0) + ret_value = changed; - /* Check if the field changed size */ - if(old_size != memb_type->shared->size) { - /* Adjust the size of the member */ - dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; + /* Check if the field changed size */ + if(old_size != memb_type->shared->size) { + /* Adjust the size of the member */ + dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; - /* Add that change to the accumulated size change */ - accum_change += (ssize_t) (memb_type->shared->size - old_size); + /* Add that change to the accumulated size change */ + accum_change += (ssize_t) (memb_type->shared->size - old_size); + } /* end if */ } /* end if */ - } /* end if */ - } /* end for */ + } /* end for */ - /* Range check against datatype size */ - if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); - /* Apply the accumulated size change to the datatype */ - dt->shared->size += (size_t) accum_change; + /* Apply the accumulated size change to the datatype */ + dt->shared->size += (size_t) accum_change; } break; @@ -5265,29 +5213,29 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Recurse if it's VL, compound, enum or array */ /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type)) { - if((changed=H5T_set_loc(dt->shared->parent,f,loc))<0) + if((changed = H5T_set_loc(dt->shared->parent,f,loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + if(changed > 0) + ret_value = changed; } /* end if */ /* Mark this VL sequence */ if((changed = H5T__vlen_set_loc(dt, f, loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + if(changed > 0) + ret_value = changed; break; case H5T_REFERENCE: /* Only need to change location of object references */ - if(dt->shared->u.atomic.u.r.rtype==H5R_OBJECT) { + if(dt->shared->u.atomic.u.r.rtype == H5R_OBJECT) { /* Mark this reference */ - if(loc!=dt->shared->u.atomic.u.r.loc) { + if(loc != dt->shared->u.atomic.u.r.loc) { /* Set the location */ dt->shared->u.atomic.u.r.loc = loc; /* Indicate that the location changed */ - ret_value=TRUE; + ret_value = TRUE; } /* end if */ } /* end if */ break; @@ -5356,11 +5304,11 @@ done: * Purpose: H5T__visit callback to Upgrade the version of a datatype * (if there's any benefit to doing so) * - * Note: The behavior below is tightly coupled with the "better" + * Note: The behavior below is tightly coupled with the "better" * encodings for datatype messages in the datatype message * encoding routine. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5415,7 +5363,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) * doing so) and recursively apply to compound members and/or * parent datatypes. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5446,7 +5394,7 @@ done: * * Purpose: Set the encoding for a datatype to the latest version. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5557,7 +5505,7 @@ H5Tflush(hid_t type_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); - + /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") @@ -5590,7 +5538,7 @@ H5Trefresh(hid_t type_id) { H5T_t * dt = NULL; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 7d6580c..1032d1b 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -33,15 +33,15 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if ( rank <= 0 ) + if ( rank <= 0 ) { parallel_print("H5S_SCALAR" ); } - else + else { if (!dims) parallel_print("dimension is NULL"); - else + else { parallel_print("["); for ( i = 0; i < rank-1; i++) @@ -351,12 +351,12 @@ void print_found(hsize_t nfound) /*----------------------------------------------------------------- * Function: match_up_memsize - * + * * Purpose: match smaller memory size up to bigger memory size *------------------------------------------------------------------ */ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, - hid_t *m_tid1, hid_t *m_tid2, + hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2) { herr_t ret = SUCCEED; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 86dca8b..2cc02e8 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -277,16 +277,16 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawattrstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "wb")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawattrstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } } } else { @@ -319,26 +319,26 @@ h5tools_set_input_file(const char *fname, int is_bin) if (HDfclose(rawinstream)) HDperror("closing rawinstream"); else - rawinstream = NULL; + rawinstream = NULL; } /* First check if filename is string "NULL" */ if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "rb")) != NULL) { - rawinstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "rb")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "r")) != NULL) { - rawinstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "r")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } } } else { - rawinstream = NULL; + rawinstream = NULL; retvalue = SUCCEED; } @@ -373,16 +373,16 @@ h5tools_set_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawoutstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "wb")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawoutstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } } } else { @@ -421,21 +421,21 @@ h5tools_set_error_file(const char *fname, int is_bin) /* First check if filename is string "NULL" */ if (fname != NULL) { /* binary output */ - if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawerrorstream = f; - retvalue = SUCCEED; - } + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawerrorstream = f; - retvalue = SUCCEED; - } - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } + } } else { - rawerrorstream = NULL; + rawerrorstream = NULL; retvalue = SUCCEED; } -- cgit v0.12 From 4f36f613a6de09d8ec197b7e5a4a72dbdb9417a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 May 2017 16:52:05 -0500 Subject: HDFFV-10186 Whitespace change Mostly tabs to spaces Remove Modifications comments --- hl/tools/gif2h5/gif2mem.c | 6 +- tools/lib/h5tools_type.c | 1 - tools/src/h5dump/h5dump_xml.c | 446 +++++++++----------- tools/src/h5repack/h5repack.c | 843 ++++++++++++++++++------------------- tools/src/h5repack/h5repack_copy.c | 215 +++++----- tools/src/h5repack/h5repack_refs.c | 38 +- tools/test/misc/talign.c | 4 +- 7 files changed, 746 insertions(+), 807 deletions(-) diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 40b5583..55aae86 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -218,7 +218,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) PlainTextCount++; if (PlainTextCount > PlainTextArray) - PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); + PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText , sizeof(GIFPLAINTEXT *) * PlainTextArray))) { printf("Out of memory!"); @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) CommentCount++; if (CommentCount > CommentArray) - CommentArray = (BYTE)((CommentArray << 1) + 1); + CommentArray = (BYTE)((CommentArray << 1) + 1); if (!(gifComment = (GIFCOMMENT **)realloc(gifComment , sizeof(GIFCOMMENT *) * CommentArray))) { printf("Out of memory!"); @@ -305,7 +305,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) ApplicationCount++; if (ApplicationCount > ApplicationArray) - ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); + ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index dcc994e..8c5592f 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -46,7 +46,6 @@ h5tools_get_native_type(hid_t type) return(p_type); } - /*------------------------------------------------------------------------- * Function: h5tools_get_little_endian_type * diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 49d1ba8..f4ec353 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -108,7 +108,7 @@ static h5tool_format_t xml_dataformat = { /* internal functions */ -static int xml_name_to_XID(const char *, char *, int , int ); +static int xml_name_to_XID(const char *, char *, int , int ); /* internal functions used by XML option */ static void xml_print_datatype(hid_t, unsigned); @@ -122,34 +122,26 @@ static char *xml_escape_the_name(const char *); * Function: xml_dump_all_cb * * Purpose: function callback called by H5Literate, - * displays everything in the specified object + * displays everything in the specified object * * Return: Success: SUCCEED * * Failure: FAIL * * Programmer: Ruey-Hsia Li - * - * Modifications: - * RMcG, November 2000 - * Added XML support. Also, optionally checks the op_data argument - * - * PVN, May 2008 - * Dump external links - * *------------------------------------------------------------------------- */ static herr_t xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR_UNUSED *op_data) { - hid_t obj; - herr_t ret = SUCCEED; - char *obj_path = NULL; /* Full path of object */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + hid_t obj; + herr_t ret = SUCCEED; + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -157,7 +149,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -180,7 +172,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ if(!obj_path) { ret = FAIL; goto done; - } + } HDstrcpy(obj_path, prefix); HDstrcat(obj_path, "/"); @@ -268,7 +260,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ret = FAIL; H5Dclose(obj); goto done; - } + } else if(found_obj->displayed) { /* the XML version */ char *t_obj_path = xml_escape_the_name(obj_path); @@ -330,14 +322,14 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ H5Dclose(obj); goto done; - } + } else found_obj->displayed = TRUE; } /* end if */ dump_function_table->dump_dataset_function(obj, name, NULL); H5Dclose(obj); - } + } else { error_msg("unable to dump dataset \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -350,7 +342,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("unable to dump datatype \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } + } else { dump_function_table->dump_named_datatype_function(obj, name); H5Tclose(obj); @@ -377,7 +369,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("unable to get link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } + } else { /* print the value of a soft link */ /* XML */ @@ -426,7 +418,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* dangling link -- omit from xml attributes */ ctx.need_prefix = TRUE; @@ -510,7 +502,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + HDfree(t_prefix); HDfree(t_name); HDfree(t_filename); @@ -556,7 +548,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + HDfree(t_prefix); HDfree(t_name); HDfree(t_obj_path); @@ -598,18 +590,18 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen) objno = ref_path_table_gen_fake(str); sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); return 0; - } + } else { return 1; } } - } + } else { if (gen) { objno = ref_path_table_gen_fake(str); sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); return 0; - } + } else { return 1; } @@ -636,9 +628,6 @@ static const char *apos = "'"; * Return: The revised string. * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -691,23 +680,23 @@ xml_escape_the_name(const char *str) if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); - } + } else if (*cp == '<') { HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); - } + } else if (*cp == '>') { HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); - } + } else if (*cp == '\"') { HDstrncpy(ncp, quote, ncp_len); esc_len = HDstrlen(quote); - } + } else if (*cp == '&') { HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); - } + } else { *ncp = *cp; esc_len = 1; @@ -730,9 +719,6 @@ xml_escape_the_name(const char *str) * Return: The revised string. * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -838,9 +824,6 @@ xml_escape_the_string(const char *str, int slen) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -865,12 +848,12 @@ xml_print_datatype(hid_t type, unsigned in_group) size_t mpos; size_t msize; int nmembs; - htri_t is_vlstr=FALSE; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + htri_t is_vlstr = FALSE; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -878,7 +861,7 @@ xml_print_datatype(hid_t type, unsigned in_group) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -923,7 +906,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>", xmlnsprefix, dtxid); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* point to the NDT by name */ char *t_objname = xml_escape_the_name(found_obj->objname); @@ -939,7 +922,7 @@ xml_print_datatype(hid_t type, unsigned in_group) HDfree(t_objname); } HDfree(dtxid); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -950,7 +933,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_setstatus(EXIT_FAILURE); } - } + } else { switch (H5Tget_class(type)) { case H5T_INTEGER: @@ -988,9 +971,9 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "ERROR_UNKNOWN"); break; } /* end switch */ - + h5tools_str_append(&buffer, "\" Sign=\""); - + switch (sgn) { case H5T_SGN_NONE: h5tools_str_append(&buffer, "false"); @@ -1004,7 +987,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "ERROR_UNKNOWN"); break; } /* end switch */ - + h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); h5tools_str_append(&buffer, "%lu", (unsigned long)sz); @@ -1043,7 +1026,7 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sFloatType ByteOrder=\"",xmlnsprefix); - + switch (ord) { case H5T_ORDER_LE: h5tools_str_append(&buffer, "LE"); @@ -1060,7 +1043,7 @@ xml_print_datatype(hid_t type, unsigned in_group) default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); } /* end switch */ - + h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); h5tools_str_append(&buffer, "%lu", (unsigned long)sz); @@ -1182,7 +1165,7 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sBitfieldType ByteOrder=\"",xmlnsprefix); - + switch (ord) { case H5T_ORDER_LE: h5tools_str_append(&buffer, "LE"); @@ -1197,7 +1180,7 @@ xml_print_datatype(hid_t type, unsigned in_group) default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); } /* end switch */ - + size = H5Tget_size(type); h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1559,19 +1542,16 @@ xml_print_datatype(hid_t type, unsigned in_group) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_datatype(hid_t type) { - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1579,7 +1559,7 @@ xml_dump_datatype(hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -1629,7 +1609,7 @@ xml_dump_datatype(hid_t type) h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\"/>", xmlnsprefix, dtxid); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* pointer to a named datatype already in XML */ char *t_objname = xml_escape_the_name(found_obj->objname); @@ -1645,7 +1625,7 @@ xml_dump_datatype(hid_t type) HDfree(t_objname); } HDfree(dtxid); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1692,25 +1672,22 @@ xml_dump_datatype(hid_t type) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_dataspace(hid_t space) { - hsize_t size[H5DUMP_MAX_RANK]; - hsize_t maxsize[H5DUMP_MAX_RANK]; - int i; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + hsize_t size[H5DUMP_MAX_RANK]; + hsize_t maxsize[H5DUMP_MAX_RANK]; + int i; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ - - int ndims = H5Sget_simple_extent_dims(space, size, maxsize); - H5S_class_t space_type = H5Sget_simple_extent_type(space); + hsize_t curr_pos = 0; /* total data element position */ + + int ndims = H5Sget_simple_extent_dims(space, size, maxsize); + H5S_class_t space_type = H5Sget_simple_extent_type(space); /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1718,7 +1695,7 @@ xml_dump_dataspace(hid_t space) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -1784,7 +1761,7 @@ xml_dump_dataspace(hid_t space) h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"UNLIMITED\"/>", xmlnsprefix,size[i]); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else if (maxsize[i] == (hsize_t) 0) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1794,7 +1771,7 @@ xml_dump_dataspace(hid_t space) h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", xmlnsprefix,size[i], size[i]); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1868,9 +1845,6 @@ xml_dump_dataspace(hid_t space) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -1886,19 +1860,19 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, int status = -1; void *buf = NULL; hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + /* Print all the values. */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - + string_dataformat = *outputformat; if (fp_format) { @@ -1922,7 +1896,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -1932,14 +1906,14 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.indent_level--; - + dump_indent += COL; ctx.indent_level++; @@ -1957,7 +1931,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, datactx.cur_column = ctx.cur_column; status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, NULL); } - } + } else { /* Attribute data */ type = H5Aget_type(obj_id); @@ -1970,10 +1944,10 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, */ status = xml_print_refs(obj_id, ATTRIBUTE_DATA); H5Tclose(type); - } + } else if (H5Tget_class(type) == H5T_STRING) { status = xml_print_strs(obj_id, ATTRIBUTE_DATA); - } + } else { /* all other data */ /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ @@ -1995,7 +1969,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); HDassert(buf); - + if (H5Aread(obj_id, p_type, buf) >= 0) { h5tools_context_t datactx; HDmemset(&datactx, 0, sizeof(datactx)); @@ -2020,7 +1994,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "Unable to print data."); @@ -2036,7 +2010,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2046,7 +2020,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2063,9 +2037,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, * Return: herr_t * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2077,11 +2048,11 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED hid_t space = -1; H5S_class_t space_type; hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - + char *t_aname = xml_escape_the_name(attr_name); /* setup */ @@ -2090,7 +2061,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2110,7 +2081,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname); @@ -2146,7 +2117,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2154,7 +2125,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2162,7 +2133,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2170,7 +2141,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2178,7 +2149,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2191,7 +2162,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_COMPOUND: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2202,7 +2173,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_REFERENCE: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2210,7 +2181,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2218,7 +2189,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); @@ -2227,7 +2198,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); @@ -2237,7 +2208,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2246,7 +2217,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2256,7 +2227,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_VLEN: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2271,7 +2242,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2279,7 +2250,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", H5Tget_class(type)); @@ -2287,7 +2258,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2295,7 +2266,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2308,7 +2279,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * Or dataspace is H5S_NULL. */ ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2318,7 +2289,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2328,7 +2299,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2343,7 +2314,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2358,7 +2329,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2368,14 +2339,14 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_str_close(&buffer); - + h5tools_setstatus(EXIT_FAILURE); return FAIL; } @@ -2389,17 +2360,14 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * Return: herr_t * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_named_datatype(hid_t type, const char *name) { hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; char *tmp; @@ -2420,7 +2388,7 @@ xml_dump_named_datatype(hid_t type, const char *name) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2458,7 +2426,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " @@ -2467,13 +2435,13 @@ xml_dump_named_datatype(hid_t type, const char *name) name, dtxid, parentxid, HDstrcmp(prefix,"") ? t_prefix : "/"); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { H5O_info_t oinfo; /* Object info */ ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " @@ -2496,7 +2464,7 @@ xml_dump_named_datatype(hid_t type, const char *name) error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; - } + } else if(found_obj->displayed) { /* We have already printed this named datatype, print it as a * NamedDatatypePtr @@ -2505,29 +2473,29 @@ xml_dump_named_datatype(hid_t type, const char *name) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.indent_level++; - + xml_name_to_XID(found_obj->objname, pointerxid, (int)sizeof(pointerxid), 1); ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid, t_objname); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + ctx.indent_level--; ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); HDfree(t_objname); goto done; - } + } else found_obj->displayed = TRUE; } @@ -2538,7 +2506,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); @@ -2549,10 +2517,10 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_print_datatype(type,1); ctx.indent_level--; dump_indent -= COL; - + ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2563,7 +2531,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2589,11 +2557,6 @@ done: * Return: void * * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5A(L)iterate to allow for other iteration orders - * *------------------------------------------------------------------------- */ void @@ -2611,11 +2574,11 @@ xml_dump_group(hid_t gid, const char *name) char *cp = NULL; char *tmp = NULL; char *par = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { error_msg("error in getting group creation property list ID\n"); @@ -2645,7 +2608,7 @@ xml_dump_group(hid_t gid, const char *name) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2733,7 +2696,7 @@ xml_dump_group(hid_t gid, const char *name) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); HDfree(t_objname); HDfree(par_name); - + ctx.indent_level++; t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */ @@ -2751,7 +2714,7 @@ xml_dump_group(hid_t gid, const char *name) xmlnsprefix, ptrstr, t_objname, parentxid, par_name); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + ctx.indent_level--; HDfree(t_objname); @@ -2797,7 +2760,7 @@ xml_dump_group(hid_t gid, const char *name) found_obj->displayed = TRUE; /* 1. do all the attributes of the group */ - + ctx.indent_level++; dump_indent += COL; @@ -2880,7 +2843,7 @@ xml_dump_group(hid_t gid, const char *name) HDfree(parentxid); /* 1. do all the attributes of the group */ - + ctx.indent_level++; dump_indent += COL; @@ -2936,7 +2899,7 @@ xml_dump_group(hid_t gid, const char *name) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_str_close(&buffer); - + if(par) HDfree(par); if(tmp) @@ -2951,27 +2914,24 @@ xml_dump_group(hid_t gid, const char *name) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static int xml_print_refs(hid_t did, int source) { - herr_t e; - hid_t type = -1; - hid_t space = -1; - hssize_t ssiz = -1; - hsize_t i; - size_t tsiz; - hobj_ref_t *refbuf = NULL; - char *buf = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + herr_t e; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; + hsize_t i; + size_t tsiz; + hobj_ref_t *refbuf = NULL; + char *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ if (source == DATASET_DATA) { type = H5Dget_type(did); @@ -3031,7 +2991,7 @@ xml_print_refs(hid_t did, int source) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3085,7 +3045,7 @@ xml_print_refs(hid_t did, int source) H5Tclose(type); H5Sclose(space); return SUCCEED; - + error: if(buf) HDfree(buf); @@ -3105,30 +3065,27 @@ error: * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static int xml_print_strs(hid_t did, int source) { - herr_t e; - hid_t type = -1; - hid_t space = -1; - hssize_t ssiz = -1; - htri_t is_vlstr = FALSE; - size_t tsiz = 0; - hsize_t i; - size_t str_size = 0; - char *bp = NULL; - char *onestring = NULL; - void *buf = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + herr_t e; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; + htri_t is_vlstr = FALSE; + size_t tsiz = 0; + hsize_t i; + size_t str_size = 0; + char *bp = NULL; + char *onestring = NULL; + void *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ if (source == DATASET_DATA) type = H5Dget_type(did); @@ -3184,7 +3141,7 @@ xml_print_strs(hid_t did, int source) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3252,7 +3209,7 @@ xml_print_strs(hid_t did, int source) H5Tclose(type); H5Sclose(space); return SUCCEED; - + error: if(buf) HDfree(buf); @@ -3273,26 +3230,23 @@ error: * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void check_filters(hid_t dcpl) { - int nfilt; - int i; - H5Z_filter_t filter; - char namebuf[120]; - size_t cd_nelmts = 20; - unsigned int cd_values[20]; - unsigned int flags; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + int nfilt; + int i; + H5Z_filter_t filter; + char namebuf[120]; + size_t cd_nelmts = 20; + unsigned int cd_values[20]; + unsigned int flags; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -3300,7 +3254,7 @@ check_filters(hid_t dcpl) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3423,16 +3377,16 @@ check_filters(hid_t dcpl) static void xml_dump_fill_value(hid_t dcpl, hid_t type) { - size_t sz; - size_t i; - hsize_t space; - void *buf; - char *name; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + size_t sz; + size_t i; + hsize_t space; + void *buf; + char *name; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -3440,7 +3394,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3452,7 +3406,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } - else + else string_dataformat.line_ncols = h5tools_nCols; string_dataformat.do_escape = display_escape; @@ -3764,11 +3718,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) * Return: void * * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5Aiterate2 to allow for other iteration orders - * *------------------------------------------------------------------------- */ void @@ -3791,11 +3740,11 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s char *t_prefix; unsigned attr_crt_order_flags; h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ - + hsize_t curr_pos = 0; /* total data element position */ + char *rstr = (char*) HDmalloc((size_t)100); char *pstr = (char*) HDmalloc((size_t)100); @@ -3814,7 +3763,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s t_name = xml_escape_the_name(name); t_tmp = xml_escape_the_name(tmp); t_prefix = xml_escape_the_name(prefix); - + string_dataformat = *outputformat; if (fp_format) { @@ -3925,7 +3874,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; dump_indent -= COL; - + ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -4376,9 +4325,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -4392,11 +4338,11 @@ xml_print_enum(hid_t type) size_t dst_size; /*destination value type size */ unsigned i; /*miscellaneous counters */ size_t j; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -4404,7 +4350,7 @@ xml_print_enum(hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -4455,11 +4401,11 @@ xml_print_enum(hid_t type) if (H5T_SGN_NONE == H5Tget_sign(type)) { native = H5T_NATIVE_ULLONG; - } + } else { native = H5T_NATIVE_LLONG; } - } + } else { dst_size = H5Tget_size(type); } @@ -4530,11 +4476,11 @@ xml_print_enum(hid_t type) for (j = 0; j < dst_size; j++) h5tools_str_append(&buffer, "%02x", value[i * dst_size + j]); - } + } else if (H5T_SGN_NONE == H5Tget_sign(native)) { h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *) (value + i * dst_size)))); - } + } else { h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "d", *((long long *) ((void *) (value + i * dst_size)))); diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index d047612..6f50cbc 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -51,19 +51,19 @@ static int have_request(pack_opt_t *options); *------------------------------------------------------------------------- */ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { - /* check input */ - if (check_options(options) < 0) - return -1; + /* check input */ + if (check_options(options) < 0) + return -1; - /* check for objects in input that are in the file */ - if (check_objects(infile, options) < 0) - return -1; + /* check for objects in input that are in the file */ + if (check_objects(infile, options) < 0) + return -1; - /* copy the objects */ - if (copy_objects(infile, outfile, options) < 0) - return -1; + /* copy the objects */ + if (copy_objects(infile, outfile, options) < 0) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- @@ -105,7 +105,7 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) */ int h5repack_end(pack_opt_t *options) { - return options_table_free(options->op_tbl); + return options_table_free(options->op_tbl); } /*------------------------------------------------------------------------- @@ -121,10 +121,10 @@ int h5repack_end(pack_opt_t *options) { int h5repack_addfilter(const char* str, pack_opt_t *options) { - obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ - filter_info_t filter; /* filter info for the current -f option entry */ - unsigned n_objs; /* number of objects in the current -f or -l option entry */ - int is_glb; /* is the filter global */ + obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ + filter_info_t filter; /* filter info for the current -f option entry */ + unsigned n_objs; /* number of objects in the current -f or -l option entry */ + int is_glb; /* is the filter global */ /* parse the -f option */ if (NULL == (obj_list = parse_filter(str, &n_objs, &filter, options, &is_glb))) @@ -163,10 +163,10 @@ int h5repack_addlayout(const char* str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /*one object list for the -t and -c option entry */ - unsigned n_objs; /*number of objects in the current -t or -c option entry */ - pack_info_t pack; /*info about layout to extract from parse */ - int j; - int ret_value = -1; + unsigned n_objs; /*number of objects in the current -t or -c option entry */ + pack_info_t pack; /*info about layout to extract from parse */ + int j; + int ret_value = -1; init_packobject(&pack); @@ -232,62 +232,62 @@ h5repack_addlayout(const char* str, pack_opt_t *options) *------------------------------------------------------------------------- */ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, - named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ - named_dt_t *dt_ret = NULL; /* Datatype to return */ - H5O_info_t oinfo; /* Object info of input dtype */ - hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ - - if (H5Oget_info(type_in, &oinfo) < 0) - goto done; - - if (*named_dt_head_p) { - /* Stack already exists, search for the datatype */ - while (dt && dt->addr_in != oinfo.addr) - dt = dt->next; - - dt_ret = dt; - } - else { - /* Create the stack */ - size_t i; - - for (i = 0; i < travt->nobjs; i++) { - if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { - /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { - goto done; - } - dt->next = *named_dt_head_p; - *named_dt_head_p = dt; - - /* Update the address and id */ - dt->addr_in = travt->objs[i].objno; - dt->id_out = -1; - - /* Check if this type is the one requested */ - if (oinfo.addr == dt->addr_in) { - HDassert(!dt_ret); - dt_ret = dt; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end else */ - - /* Handle the case that the requested datatype was not found. This is - * possible if the datatype was committed anonymously in the input file. */ - if (!dt_ret) { - /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { - goto done; - } - dt_ret->next = *named_dt_head_p; - *named_dt_head_p = dt_ret; + named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { + named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ + named_dt_t *dt_ret = NULL; /* Datatype to return */ + H5O_info_t oinfo; /* Object info of input dtype */ + hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ - /* Update the address and id */ - dt_ret->addr_in = oinfo.addr; - dt_ret->id_out = -1; - } /* end if */ + if (H5Oget_info(type_in, &oinfo) < 0) + goto done; + + if (*named_dt_head_p) { + /* Stack already exists, search for the datatype */ + while (dt && dt->addr_in != oinfo.addr) + dt = dt->next; + + dt_ret = dt; + } + else { + /* Create the stack */ + size_t i; + + for (i = 0; i < travt->nobjs; i++) { + if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { + /* Push onto the stack */ + if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + goto done; + } + dt->next = *named_dt_head_p; + *named_dt_head_p = dt; + + /* Update the address and id */ + dt->addr_in = travt->objs[i].objno; + dt->id_out = -1; + + /* Check if this type is the one requested */ + if (oinfo.addr == dt->addr_in) { + HDassert(!dt_ret); + dt_ret = dt; + } /* end if */ + } /* end if */ + } /* end for */ + } /* end else */ + + /* Handle the case that the requested datatype was not found. This is + * possible if the datatype was committed anonymously in the input file. */ + if (!dt_ret) { + /* Push the new datatype onto the stack */ + if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + goto done; + } + dt_ret->next = *named_dt_head_p; + *named_dt_head_p = dt_ret; + + /* Update the address and id */ + dt_ret->addr_in = oinfo.addr; + dt_ret->id_out = -1; + } /* end if */ /* If the requested datatype does not yet exist in the output file, copy it * anonymously */ @@ -302,17 +302,17 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, goto done; } /* end if */ - /* Set return value */ - ret_value = dt_ret->id_out; + /* Set return value */ + ret_value = dt_ret->id_out; - /* Increment the ref count on id_out, because the calling function will try - * to close it */ - if(H5Iinc_ref(ret_value) < 0) { - ret_value = -1; - } + /* Increment the ref count on id_out, because the calling function will try + * to close it */ + if(H5Iinc_ref(ret_value) < 0) { + ret_value = -1; + } done: - return (ret_value); + return (ret_value); } /* end copy_named_datatype */ /*------------------------------------------------------------------------- @@ -327,22 +327,22 @@ done: *------------------------------------------------------------------------- */ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { - named_dt_t *dt = *named_dt_head_p; - int ret_value = -1; + named_dt_t *dt = *named_dt_head_p; + int ret_value = -1; - while (dt) { - /* Pop the datatype off the stack and free it */ - if (H5Tclose(dt->id_out) < 0 && !ignore_err) - goto done; - dt = dt->next; - HDfree(*named_dt_head_p); - *named_dt_head_p = dt; - } /* end while */ + while (dt) { + /* Pop the datatype off the stack and free it */ + if (H5Tclose(dt->id_out) < 0 && !ignore_err) + goto done; + dt = dt->next; + HDfree(*named_dt_head_p); + *named_dt_head_p = dt; + } /* end while */ - ret_value = 0; + ret_value = 0; done: - return (ret_value); + return (ret_value); } /* end named_datatype_free */ /*------------------------------------------------------------------------- @@ -363,25 +363,25 @@ done: */ int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, - trav_table_t *travt, pack_opt_t *options) + trav_table_t *travt, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t attr_id = -1; /* attr ID */ - hid_t attr_out = -1; /* attr ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file type ID */ - hid_t wtype_id = -1; /* read/write type ID */ - size_t msize; /* size of type */ - void *buf = NULL; /* data buffer */ - hsize_t nelmts; /* number of elements in dataset */ - int rank; /* rank of dataset */ - htri_t is_named; /* Whether the datatype is named */ - hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - char name[255]; - H5O_info_t oinfo; /* object info */ - int j; - unsigned u; - hbool_t is_ref = 0; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t attr_id = -1; /* attr ID */ + hid_t attr_out = -1; /* attr ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file type ID */ + hid_t wtype_id = -1; /* read/write type ID */ + size_t msize; /* size of type */ + void *buf = NULL; /* data buffer */ + hsize_t nelmts; /* number of elements in dataset */ + int rank; /* rank of dataset */ + htri_t is_named; /* Whether the datatype is named */ + hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ + char name[255]; + H5O_info_t oinfo; /* object info */ + int j; + unsigned u; + hbool_t is_ref = 0; H5T_class_t type_class = -1; if (H5Oget_info(loc_in, &oinfo) < 0) @@ -568,193 +568,188 @@ done: * Programmer: pvn@ncsa.uiuc.edu * * Date: September, 22, 2003 - * - * Modification: - * Peter Cao, July 9, 2007 - * Add "-L, --latest" and other options to pack a file with the latest file format - * *------------------------------------------------------------------------- */ static int check_options(pack_opt_t *options) { - unsigned int i; - int k, j, has_cp = 0, has_ck = 0; - char slayout[30]; - - /*------------------------------------------------------------------------- - * objects to layout - *------------------------------------------------------------------------- - */ - if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to modify layout are...\n"); - if (options->all_layout == 1) { - switch (options->layout_g) { - case H5D_COMPACT: - strcpy(slayout, "compact"); - break; - case H5D_CONTIGUOUS: - strcpy(slayout, "contiguous"); - break; - case H5D_CHUNKED: - strcpy(slayout, "chunked"); - break; - case H5D_VIRTUAL: - strcpy(slayout, "virtual"); - break; - case H5D_LAYOUT_ERROR: - case H5D_NLAYOUTS: - error_msg("invalid layout\n"); - return -1; - default: - strcpy(slayout, "invalid layout\n"); - return -1; - } - printf(" Apply %s layout to all\n", slayout); - if (H5D_CHUNKED == options->layout_g) { - printf("with dimension ["); - for (j = 0; j < options->chunk_g.rank; j++) - printf("%d ", (int) options->chunk_g.chunk_lengths[j]); - printf("]\n"); - } - } - }/* verbose */ - - for (i = 0; i < options->op_tbl->nelems; i++) { - char* name = options->op_tbl->objs[i].path; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - if (options->verbose) { - printf(" <%s> with chunk size ", name); - for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - printf("%d ", - (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); - printf("\n"); - } - has_ck = 1; - } - else if (options->op_tbl->objs[i].chunk.rank == -2) { - if (options->verbose) - printf(" <%s> %s\n", name, "NONE (contigous)"); - has_ck = 1; - } - } - - if (options->all_layout == 1 && has_ck) { - error_msg( - "invalid chunking input: 'all' option\ + unsigned int i; + int k, j, has_cp = 0, has_ck = 0; + char slayout[30]; + + /*------------------------------------------------------------------------- + * objects to layout + *------------------------------------------------------------------------- + */ + if (options->verbose && have_request(options) /* only print if requested */) { + printf("Objects to modify layout are...\n"); + if (options->all_layout == 1) { + switch (options->layout_g) { + case H5D_COMPACT: + strcpy(slayout, "compact"); + break; + case H5D_CONTIGUOUS: + strcpy(slayout, "contiguous"); + break; + case H5D_CHUNKED: + strcpy(slayout, "chunked"); + break; + case H5D_VIRTUAL: + strcpy(slayout, "virtual"); + break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: + error_msg("invalid layout\n"); + return -1; + default: + strcpy(slayout, "invalid layout\n"); + return -1; + } + printf(" Apply %s layout to all\n", slayout); + if (H5D_CHUNKED == options->layout_g) { + printf("with dimension ["); + for (j = 0; j < options->chunk_g.rank; j++) + printf("%d ", (int) options->chunk_g.chunk_lengths[j]); + printf("]\n"); + } + } + }/* verbose */ + + for (i = 0; i < options->op_tbl->nelems; i++) { + char* name = options->op_tbl->objs[i].path; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + if (options->verbose) { + printf(" <%s> with chunk size ", name); + for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) + printf("%d ", + (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); + printf("\n"); + } + has_ck = 1; + } + else if (options->op_tbl->objs[i].chunk.rank == -2) { + if (options->verbose) + printf(" <%s> %s\n", name, "NONE (contigous)"); + has_ck = 1; + } + } + + if (options->all_layout == 1 && has_ck) { + error_msg( + "invalid chunking input: 'all' option\ is present with other objects\n"); - return -1; - } - - /*------------------------------------------------------------------------- - * objects to filter - *------------------------------------------------------------------------- - */ - - if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to apply filter are...\n"); - if (options->all_filter == 1) { - for (k = 0; k < options->n_filter_g; k++) { - H5Z_filter_t filtn = options->filter_g[k].filtn; - switch (filtn) { - case H5Z_FILTER_NONE: - printf(" Uncompress all\n"); - break; - case H5Z_FILTER_SHUFFLE: - case H5Z_FILTER_FLETCHER32: - printf(" All with %s\n", get_sfilter(filtn)); - break; - case H5Z_FILTER_SZIP: - case H5Z_FILTER_DEFLATE: - printf(" All with %s, parameter %d\n", get_sfilter(filtn), - options->filter_g[k].cd_values[0]); - break; - default: - printf(" User Defined %d\n", filtn); - break; - } /* k */ - }; - } - } /* verbose */ - - for (i = 0; i < options->op_tbl->nelems; i++) { - pack_info_t pack = options->op_tbl->objs[i]; - char* name = pack.path; - - for (j = 0; j < pack.nfilters; j++) { - if (options->verbose) { - printf(" <%s> with %s filter\n", name, - get_sfilter(pack.filter[j].filtn)); - } - - has_cp = 1; - - } /* j */ - } /* i */ - - if (options->all_filter == 1 && has_cp) { - error_msg( - "invalid compression input: 'all' option\ + return -1; + } + + /*------------------------------------------------------------------------- + * objects to filter + *------------------------------------------------------------------------- + */ + + if (options->verbose && have_request(options) /* only print if requested */) { + printf("Objects to apply filter are...\n"); + if (options->all_filter == 1) { + for (k = 0; k < options->n_filter_g; k++) { + H5Z_filter_t filtn = options->filter_g[k].filtn; + switch (filtn) { + case H5Z_FILTER_NONE: + printf(" Uncompress all\n"); + break; + case H5Z_FILTER_SHUFFLE: + case H5Z_FILTER_FLETCHER32: + printf(" All with %s\n", get_sfilter(filtn)); + break; + case H5Z_FILTER_SZIP: + case H5Z_FILTER_DEFLATE: + printf(" All with %s, parameter %d\n", get_sfilter(filtn), + options->filter_g[k].cd_values[0]); + break; + default: + printf(" User Defined %d\n", filtn); + break; + } /* k */ + }; + } + } /* verbose */ + + for (i = 0; i < options->op_tbl->nelems; i++) { + pack_info_t pack = options->op_tbl->objs[i]; + char* name = pack.path; + + for (j = 0; j < pack.nfilters; j++) { + if (options->verbose) { + printf(" <%s> with %s filter\n", name, + get_sfilter(pack.filter[j].filtn)); + } + + has_cp = 1; + + } /* j */ + } /* i */ + + if (options->all_filter == 1 && has_cp) { + error_msg( + "invalid compression input: 'all' option\ is present with other objects\n"); - return -1; - } - - /*------------------------------------------------------------------------- - * check options for the latest format - *------------------------------------------------------------------------- - */ - - if (options->grp_compact < 0) { - error_msg( - "invalid maximum number of links to store as header messages\n"); - return -1; - } - if (options->grp_indexed < 0) { - error_msg( - "invalid minimum number of links to store in the indexed format\n"); - return -1; - } - if (options->grp_indexed > options->grp_compact) { - error_msg( - "minimum indexed size is greater than the maximum compact size\n"); - return -1; - } - for (i = 0; i < 8; i++) { - if (options->msg_size[i] < 0) { - error_msg("invalid shared message size\n"); - return -1; - } - } - - /*-------------------------------------------------------------------------------- - * verify new user userblock options; file name must be present - *--------------------------------------------------------------------------------- - */ - if (options->ublock_filename != NULL && options->ublock_size == 0) { - if (options->verbose) { - printf( - "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", - options->ublock_filename); - options->ublock_size = 1024; - } - } - - if (options->ublock_filename == NULL && options->ublock_size != 0) { - error_msg("file name missing for user block\n", - options->ublock_filename); - return -1; - } - - /*-------------------------------------------------------------------------------- - * verify alignment options; threshold is zero default but alignment not - *--------------------------------------------------------------------------------- - */ - - if (options->alignment == 0 && options->threshold != 0) { - error_msg("alignment for H5Pset_alignment missing\n"); - return -1; - } - - return 0; + return -1; + } + + /*------------------------------------------------------------------------- + * check options for the latest format + *------------------------------------------------------------------------- + */ + + if (options->grp_compact < 0) { + error_msg( + "invalid maximum number of links to store as header messages\n"); + return -1; + } + if (options->grp_indexed < 0) { + error_msg( + "invalid minimum number of links to store in the indexed format\n"); + return -1; + } + if (options->grp_indexed > options->grp_compact) { + error_msg( + "minimum indexed size is greater than the maximum compact size\n"); + return -1; + } + for (i = 0; i < 8; i++) { + if (options->msg_size[i] < 0) { + error_msg("invalid shared message size\n"); + return -1; + } + } + + /*-------------------------------------------------------------------------------- + * verify new user userblock options; file name must be present + *--------------------------------------------------------------------------------- + */ + if (options->ublock_filename != NULL && options->ublock_size == 0) { + if (options->verbose) { + printf( + "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", + options->ublock_filename); + options->ublock_size = 1024; + } + } + + if (options->ublock_filename == NULL && options->ublock_size != 0) { + error_msg("file name missing for user block\n", + options->ublock_filename); + return -1; + } + + /*-------------------------------------------------------------------------------- + * verify alignment options; threshold is zero default but alignment not + *--------------------------------------------------------------------------------- + */ + + if (options->alignment == 0 && options->threshold != 0) { + error_msg("alignment for H5Pset_alignment missing\n"); + return -1; + } + + return 0; } /*------------------------------------------------------------------------- @@ -772,119 +767,119 @@ static int check_options(pack_opt_t *options) { *------------------------------------------------------------------------- */ static int check_objects(const char* fname, pack_opt_t *options) { - hid_t fid; - unsigned int i; - trav_table_t *travt = NULL; - - /* nothing to do */ - if (options->op_tbl->nelems == 0) - return 0; - - /*------------------------------------------------------------------------- - * open the file - *------------------------------------------------------------------------- - */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) - < 0) { - printf("<%s>: %s\n", fname, H5FOPENERROR); - return -1; - } - - /*------------------------------------------------------------------------- - * get the list of objects in the file - *------------------------------------------------------------------------- - */ - - /* init table */ - trav_table_init(&travt); - - /* get the list of objects in the file */ - if (h5trav_gettable(fid, travt) < 0) - goto out; - - /*------------------------------------------------------------------------- - * compare with user supplied list - *------------------------------------------------------------------------- - */ - - if (options->verbose) - printf("Opening file <%s>. Searching for objects to modify...\n", - fname); - - for (i = 0; i < options->op_tbl->nelems; i++) { - char* name = options->op_tbl->objs[i].path; - if (options->verbose) - printf(" <%s>", name); - - /* the input object names are present in the file and are valid */ - if (h5trav_getindext(name, travt) < 0) { - error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", - (options->verbose ? "\n" : ""), name, fname); - goto out; - } - if (options->verbose) - printf("...Found\n"); - - /* check for extra filter conditions */ - switch (options->op_tbl->objs[i].filter->filtn) { - /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: - { - int j; - hsize_t csize = 1; - unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; - hsize_t dims[H5S_MAX_RANK]; - int rank; - hid_t did; - hid_t sid; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - rank = options->op_tbl->objs[i].chunk.rank; - for (j = 0; j < rank; j++) - csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; - } - else { - if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - goto out; - if ((sid = H5Dget_space(did)) < 0) - goto out; - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; - HDmemset(dims, 0, sizeof dims); - if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - goto out; - for (j = 0; j < rank; j++) - csize *= dims[j]; - if (H5Sclose(sid) < 0) - goto out; - if (H5Dclose(did) < 0) - goto out; - } - - if (csize < ppb) { - printf( - " \n"); - goto out; - } - } - break; - default: - break; - } - } /* i */ - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - H5Fclose(fid); - trav_table_free(travt); - return 0; + hid_t fid; + unsigned int i; + trav_table_t *travt = NULL; + + /* nothing to do */ + if (options->op_tbl->nelems == 0) + return 0; + + /*------------------------------------------------------------------------- + * open the file + *------------------------------------------------------------------------- + */ + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) + < 0) { + printf("<%s>: %s\n", fname, H5FOPENERROR); + return -1; + } + + /*------------------------------------------------------------------------- + * get the list of objects in the file + *------------------------------------------------------------------------- + */ + + /* init table */ + trav_table_init(&travt); + + /* get the list of objects in the file */ + if (h5trav_gettable(fid, travt) < 0) + goto out; + + /*------------------------------------------------------------------------- + * compare with user supplied list + *------------------------------------------------------------------------- + */ + + if (options->verbose) + printf("Opening file <%s>. Searching for objects to modify...\n", + fname); + + for (i = 0; i < options->op_tbl->nelems; i++) { + char* name = options->op_tbl->objs[i].path; + if (options->verbose) + printf(" <%s>", name); + + /* the input object names are present in the file and are valid */ + if (h5trav_getindext(name, travt) < 0) { + error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", + (options->verbose ? "\n" : ""), name, fname); + goto out; + } + if (options->verbose) + printf("...Found\n"); + + /* check for extra filter conditions */ + switch (options->op_tbl->objs[i].filter->filtn) { + /* chunk size must be smaller than pixels per block */ + case H5Z_FILTER_SZIP: + { + int j; + hsize_t csize = 1; + unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; + hsize_t dims[H5S_MAX_RANK]; + int rank; + hid_t did; + hid_t sid; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + rank = options->op_tbl->objs[i].chunk.rank; + for (j = 0; j < rank; j++) + csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; + } + else { + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + goto out; + if ((sid = H5Dget_space(did)) < 0) + goto out; + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + goto out; + HDmemset(dims, 0, sizeof dims); + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) + goto out; + for (j = 0; j < rank; j++) + csize *= dims[j]; + if (H5Sclose(sid) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + } + + if (csize < ppb) { + printf( + " \n"); + goto out; + } + } + break; + default: + break; + } + } /* i */ + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + H5Fclose(fid); + trav_table_free(travt); + return 0; out: - H5Fclose(fid); - trav_table_free(travt); - return -1; + H5Fclose(fid); + trav_table_free(travt); + return -1; } /*------------------------------------------------------------------------- @@ -900,10 +895,10 @@ out: */ static int have_request(pack_opt_t *options) { - if (options->all_filter || options->all_layout || options->op_tbl->nelems) - return 1; + if (options->all_filter || options->all_layout || options->op_tbl->nelems) + return 1; - return 0; + return 0; } @@ -918,21 +913,21 @@ static int have_request(pack_opt_t *options) { */ static const char* get_sfilter(H5Z_filter_t filtn) { - if (filtn == H5Z_FILTER_NONE) - return "NONE"; - else if (filtn == H5Z_FILTER_DEFLATE) - return "GZIP"; - else if (filtn == H5Z_FILTER_SZIP) - return "SZIP"; - else if (filtn == H5Z_FILTER_SHUFFLE) - return "SHUFFLE"; - else if (filtn == H5Z_FILTER_FLETCHER32) - return "FLETCHER32"; - else if (filtn == H5Z_FILTER_NBIT) - return "NBIT"; - else if (filtn == H5Z_FILTER_SCALEOFFSET) - return "SOFF"; - else - return "UD"; + if (filtn == H5Z_FILTER_NONE) + return "NONE"; + else if (filtn == H5Z_FILTER_DEFLATE) + return "GZIP"; + else if (filtn == H5Z_FILTER_SZIP) + return "SZIP"; + else if (filtn == H5Z_FILTER_SHUFFLE) + return "SHUFFLE"; + else if (filtn == H5Z_FILTER_FLETCHER32) + return "FLETCHER32"; + else if (filtn == H5Z_FILTER_NBIT) + return "NBIT"; + else if (filtn == H5Z_FILTER_SCALEOFFSET) + return "SOFF"; + else + return "UD"; } diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 604e85f..5ec77a7 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -31,7 +31,7 @@ */ /* size of buffer/# of bytes to xfer at a time when copying userblock */ -#define USERBLOCK_XFER_SIZE 512 +#define USERBLOCK_XFER_SIZE 512 /* check H5Dread()/H5Dwrite() error, e.g. memory allocation error inside the library. */ #define CHECK_H5DRW_ERROR(_fun, _fail, _did, _mtid, _msid, _fsid, _pid, _buf) { \ @@ -52,12 +52,12 @@ *------------------------------------------------------------------------- */ static int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], - size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); + size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr); static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options); + pack_opt_t *options); static int copy_user_block(const char *infile, const char *outfile, - hsize_t size); + hsize_t size); #if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif @@ -65,18 +65,19 @@ static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void /* get the major number from the error stack. */ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) { - if (err_desc) - *((hid_t *) udata) = err_desc->maj_num; + if (err_desc) + *((hid_t *) udata) = err_desc->maj_num; - return 0; + return 0; } /*------------------------------------------------------------------------- * Function: copy_objects * - * Purpose: duplicate all HDF5 objects in the file + * Purpose: duplicate all HDF5 objects in the file * - * Return: 0, ok, -1 no + * Return: 0, ok, + * -1 no * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -87,21 +88,21 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fidin; hid_t fidout = -1; trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ - hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ - H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */ - hbool_t set_persist; /* Persist free-space status to be set in output file */ - hsize_t set_threshold; /* Free-space section threshold to be set in output file */ - hsize_t set_pagesize; /* File space page size to be set in output file */ - H5F_fspace_strategy_t in_strategy; /* Strategy from input file */ - hbool_t in_persist; /* Persist free-space status from input file */ - hsize_t in_threshold; /* Free-space section threshold from input file */ - hsize_t in_pagesize; /* File space page size from input file */ + hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ + hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */ + hbool_t set_persist; /* Persist free-space status to be set in output file */ + hsize_t set_threshold; /* Free-space section threshold to be set in output file */ + hsize_t set_pagesize; /* File space page size to be set in output file */ + H5F_fspace_strategy_t in_strategy; /* Strategy from input file */ + hbool_t in_persist; /* Persist free-space status from input file */ + hsize_t in_threshold; /* Free-space section threshold from input file */ + hsize_t in_pagesize; /* File space page size from input file */ /*------------------------------------------------------------------------- * open input file @@ -126,17 +127,17 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } - /* If the -S option is not set, get "strategy" from the input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -S option is not set, get "strategy" from the input file */ + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + error_msg("failed to retrieve file space strategy\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } - /* If the -G option is not set, get "pagesize" from the input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -G option is not set, get "pagesize" from the input file */ + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + error_msg("failed to retrieve file space threshold\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } if (H5Pclose(fcpl_in) < 0) { error_msg("failed to close property list\n"); @@ -295,9 +296,9 @@ print_user_block(fnamein, fidin); } /*------------------------------------------------------------------------- - * Set file space information - *------------------------------------------------------------------------- - */ + * Set file space information + *------------------------------------------------------------------------- + */ /* either use the FCPL already created or create a new one */ if (fcpl == H5P_DEFAULT) { @@ -323,7 +324,7 @@ print_user_block(fnamein, fidin); set_persist = FS_PERSIST_DEF; else if(options->fs_persist != 0) /* Set "persist" as specified by user */ set_persist = (hbool_t)options->fs_persist; - + if(options->fs_threshold == -1) /* A "0" threshold is specified by user */ set_threshold = (hsize_t)0; else if(options->fs_threshold != 0) /* Set threshold as specified by user */ @@ -331,7 +332,7 @@ print_user_block(fnamein, fidin); /* Set file space information as specified */ if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) { - error_msg("failed to set file space strategy\n"); + error_msg("failed to set file space strategy\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } @@ -343,7 +344,7 @@ print_user_block(fnamein, fidin); if(set_pagesize != FS_PAGESIZE_DEF) /* Set non-default file space page size as specified */ if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) { error_msg("failed to set file space page size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } /*------------------------------------------------------------------------- @@ -490,10 +491,10 @@ done: int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - int k; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int k; H5D_layout_t dset_layout; - int rank_chunk; + int rank_chunk; hsize_t dims_chunk[H5S_MAX_RANK]; hsize_t size_chunk = 1; hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ @@ -705,36 +706,36 @@ done: */ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options) /* repack options */ + pack_opt_t *options) /* repack options */ { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t grp_in = -1; /* group ID */ - hid_t grp_out = -1; /* group ID */ - hid_t dset_in = -1; /* read dataset ID */ + hid_t grp_in = -1; /* group ID */ + hid_t grp_out = -1; /* group ID */ + hid_t dset_in = -1; /* read dataset ID */ hid_t dset_out = -1; /* write dataset ID */ - hid_t gcpl_in = -1; /* group creation property list */ + hid_t gcpl_in = -1; /* group creation property list */ hid_t gcpl_out = -1; /* group creation property list */ - hid_t type_in = -1; /* named type ID */ + hid_t type_in = -1; /* named type ID */ hid_t type_out = -1; /* named type ID */ - hid_t dcpl_in = -1; /* dataset creation property list ID */ + hid_t dcpl_in = -1; /* dataset creation property list ID */ hid_t dcpl_out = -1; /* dataset creation property list ID */ hid_t f_space_id = -1; /* file space ID */ hid_t ftype_id = -1; /* file type ID */ hid_t wtype_id = -1; /* read/write type ID */ named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ - size_t msize; /* size of type */ - hsize_t nelmts; /* number of elements in dataset */ + size_t msize; /* size of type */ + hsize_t nelmts; /* number of elements in dataset */ H5D_space_status_t space_status; /* determines whether space has been allocated for the dataset */ - int rank; /* rank of dataset */ + int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - hsize_t dsize_in; /* input dataset size before filter */ - hsize_t dsize_out; /* output dataset size after filter */ - int apply_s; /* flag for apply filter to small dataset sizes */ - int apply_f; /* flag for apply filter to return error on H5Dcreate */ - void *buf = NULL; /* buffer for raw data */ + hsize_t dsize_in; /* input dataset size before filter */ + hsize_t dsize_out; /* output dataset size after filter */ + int apply_s; /* flag for apply filter to small dataset sizes */ + int apply_f; /* flag for apply filter to return error on H5Dcreate */ + void *buf = NULL; /* buffer for raw data */ void *hslab_buf = NULL; /* hyperslab buffer for raw data */ - int has_filter; /* current object has a filter */ - int req_filter; /* there was a request for a filter */ + int has_filter; /* current object has a filter */ + int req_filter; /* there was a request for a filter */ int req_obj_layout = 0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ unsigned i; @@ -1349,20 +1350,19 @@ done: * *------------------------------------------------------------------------- */ -static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, - int pr) +static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) { - char strfilter[255]; + char strfilter[255]; #if defined (PRINT_DEBUG ) - char temp[255]; + char temp[255]; #endif - int nfilters; /* number of filters */ - unsigned filt_flags; /* filter flags */ - H5Z_filter_t filtn; /* filter identification number */ - unsigned cd_values[20]; /* filter client data values */ - size_t cd_nelmts; /* filter client number of values */ - char f_objname[256]; /* filter objname */ - int i; + int nfilters; /* number of filters */ + unsigned filt_flags; /* filter flags */ + H5Z_filter_t filtn; /* filter identification number */ + unsigned cd_values[20]; /* filter client data values */ + size_t cd_nelmts; /* filter client number of values */ + char f_objname[256]; /* filter objname */ + int i; HDstrcpy(strfilter, "\0"); @@ -1461,10 +1461,9 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, * *------------------------------------------------------------------------- */ -static int copy_user_block(const char *infile, const char *outfile, - hsize_t size) +static int copy_user_block(const char *infile, const char *outfile, hsize_t size) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ @@ -1541,67 +1540,67 @@ done: static void print_user_block(const char *filename, hid_t fid) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - int fh; /* file handle */ - hsize_t ub_size; /* user block size */ - hsize_t size; /* size read */ - hid_t fcpl; /* file creation property list ID for HDF5 file */ - int i; - - /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg("failed to retrieve file creation property list\n"); + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int fh; /* file handle */ + hsize_t ub_size; /* user block size */ + hsize_t size; /* size read */ + hid_t fcpl; /* file creation property list ID for HDF5 file */ + int i; + + /* get user block size */ + if(( fcpl = H5Fget_create_plist(fid)) < 0) { + error_msg("failed to retrieve file creation property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed"); } - if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); + if(H5Pget_userblock(fcpl, &ub_size) < 0) { + error_msg("failed to retrieve userblock size\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed"); } - if(H5Pclose(fcpl) < 0) { - error_msg("failed to close property list\n"); + if(H5Pclose(fcpl) < 0) { + error_msg("failed to close property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed"); } - /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + /* open file */ + if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); } - size = ub_size; + size = ub_size; - /* read file */ - while(size > 0) { - ssize_t nread; /* # of bytes read */ - char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ + /* read file */ + while(size > 0) { + ssize_t nread; /* # of bytes read */ + char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ - /* read buffer */ - if(size > USERBLOCK_XFER_SIZE) - nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); - else - nread = HDread(fh, rbuf, (size_t)size); + /* read buffer */ + if(size > USERBLOCK_XFER_SIZE) + nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); + else + nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) { + for(i = 0; i < nread; i++) { - printf("%c ", rbuf[i]); + printf("%c ", rbuf[i]); - } - printf("\n"); + } + printf("\n"); - if(nread < 0) { + if(nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); } - /* update size of userblock left to transfer */ - size -= nread; - } + /* update size of userblock left to transfer */ + size -= nread; + } done: - if(fh > 0) - HDclose(fh); + if(fh > 0) + HDclose(fh); - return; + return; } #endif diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 2c38d94..3245af0 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -25,7 +25,7 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, hid_t fidout); static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, - hid_t fid_out, void *ref_out, trav_table_t *travt); + hid_t fid_out, void *ref_out, trav_table_t *travt); /*------------------------------------------------------------------------- * Function: do_copy_refobjs @@ -425,13 +425,13 @@ done: * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Modifier: xcao@hdfgroup.org, 9/12/2011 - * Update values of references(object and region) for the following types: + * Update values of references(object and region) for the following types: * 1) References, * 2) ARRAY of reference, * 3) VLEN of references. * 4) COMPOUND of references. * This function does not handle references in other complicated structures, - * such as references in nested compound datatypes. + * such as references in nested compound datatypes. * * Date: October, 28, 2003 * @@ -472,7 +472,7 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { - is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; + is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; /* open attribute */ if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -528,9 +528,9 @@ static int copy_refs_attr(hid_t loc_in, } H5Tclose(mtid); } - - /* if compound don't contain reference type member, free the above - * mallocs. Otherwise there can be memory leaks by the 'continue' + + /* if compound don't contain reference type member, free the above + * mallocs. Otherwise there can be memory leaks by the 'continue' * statement below. */ if (!ref_comp_field_n) { if (ref_comp_index) { @@ -539,7 +539,7 @@ static int copy_refs_attr(hid_t loc_in, } if (ref_comp_size) { - HDfree(ref_comp_size); + HDfree(ref_comp_size); ref_comp_size = NULL; } } @@ -588,7 +588,7 @@ static int copy_refs_attr(hid_t loc_in, array_rank = (unsigned)H5Tget_array_ndims(mtype_id); H5Tget_array_dims2(mtype_id, array_dims); for(j = 0; j #include -/*#include *//* Required for unlink() */ +/*#include *//* Required for unlink() */ #include "hdf5.h" #include "H5private.h" @@ -106,7 +106,7 @@ int main(void) H5Tclose(array_dt); plist = H5Pcreate(H5P_DATASET_XFER); - if((error = H5Pset_preserve(plist, 1)) < 0) + if((error = H5Pset_preserve(plist, 1)) < 0) goto out; /* -- cgit v0.12 From 8482314d7db83c47947af8ca50457cdb1ddae366 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 9 May 2017 17:30:20 -0500 Subject: Fix for HDFFV-10051 Fix missing declaration for H5D__layout_compact_dirty_test(). Tested on mayll and osx1010test. --- src/H5Dpkg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index b123b81..a6857b9 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -777,6 +777,7 @@ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, #ifdef H5D_TESTING H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); +H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty); H5_DLL herr_t H5D__layout_idx_type_test(hid_t did, H5D_chunk_index_t *idx_type); H5_DLL herr_t H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); -- cgit v0.12 From e4e261173f85de6f83651abd6950793d7b930a20 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 10:12:19 -0500 Subject: HDFFV-10186 more whitespace formatting --- hl/tools/gif2h5/gif2mem.c | 6 +- tools/lib/h5tools_str.c | 454 +++++++++++++++++++----------------------- tools/src/h5dump/h5dump_xml.c | 6 +- tools/src/h5repack/h5repack.c | 44 ++-- 4 files changed, 229 insertions(+), 281 deletions(-) diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 55aae86..0308783 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -218,7 +218,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) PlainTextCount++; if (PlainTextCount > PlainTextArray) - PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); + PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText , sizeof(GIFPLAINTEXT *) * PlainTextArray))) { printf("Out of memory!"); @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) CommentCount++; if (CommentCount > CommentArray) - CommentArray = (BYTE)((CommentArray << 1) + 1); + CommentArray = (BYTE)((CommentArray << 1) + 1); if (!(gifComment = (GIFCOMMENT **)realloc(gifComment , sizeof(GIFCOMMENT *) * CommentArray))) { printf("Out of memory!"); @@ -305,7 +305,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) ApplicationCount++; if (ApplicationCount > ApplicationArray) - ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); + ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 88f6cc5..b7a2c1e 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -23,24 +23,24 @@ #include #include "H5private.h" -#include "h5tools.h" /*for h5tool_format_t structure */ +#include "h5tools.h" /* for h5tool_format_t structure */ #include "h5tools_ref.h" -#include "h5tools_str.h" /*function prototypes */ +#include "h5tools_str.h" /* function prototypes */ /* Copied from hl/src/H5LDprivate.h */ /* Info about the list of comma-separated compound fields */ typedef struct H5LD_memb_t { - size_t tot_offset; - size_t last_tsize; - hid_t last_tid; - char **names; + size_t tot_offset; + size_t last_tsize; + hid_t last_tid; + char **names; } H5LD_memb_t; /* * If REPEAT_VERBOSE is defined then character strings will be printed so * that repeated character sequences like "AAAAAAAAAA" are displayed as * - * 'A' repeates 9 times + * 'A' repeats 9 times * * Otherwise the format is more Perl-like * @@ -61,15 +61,12 @@ void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *in * Function: h5tools_str_close * * Purpose: Closes a string by releasing it's memory and setting the size - * information to zero. + * information to zero. * * Return: void * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -85,17 +82,14 @@ h5tools_str_close(h5tools_str_t *str) * Function: h5tools_str_len * * Purpose: Returns the length of the string, not counting the null - * terminator. + * terminator. * * Return: Success: Length of string * - * Failure: 0 + * Failure: 0 * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_PURE size_t @@ -108,43 +102,34 @@ h5tools_str_len(h5tools_str_t *str) * Function: h5tools_str_append * * Purpose: Formats variable arguments according to printf() format - * string and appends the result to variable length string STR. + * string and appends the result to variable length string STR. * * Return: Success: Pointer to buffer containing result. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * - * Major change: need to check results of vsnprintf to - * handle errors, empty format, and overflows. - * - * Programmer: REMcG Matzke - * June 16, 2004 - * *------------------------------------------------------------------------- */ char * h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) { - va_list ap; + va_list ap; /* Make sure we have some memory into which to print */ - if (!str->s || str->nalloc <= 0) + if(!str->s || str->nalloc <= 0) h5tools_str_reset(str); - if (HDstrlen(fmt) == 0) + if(HDstrlen(fmt) == 0) /* nothing to print */ return str->s; /* Format the arguments and append to the value already in `str' */ - while (1) { + while(1) { /* How many bytes available for new value, counting the new NUL */ + int nchars = -1; size_t avail = str->nalloc - str->len; - int nchars = -1; HDva_start(ap, fmt); nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); @@ -161,11 +146,11 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * to lack of buffer size, so try one more time after realloc more * buffer size before return NULL. */ - if (nchars < 0) + if(nchars < 0) /* failure, such as bad format */ return NULL; - if ((size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { + if((size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is @@ -191,24 +176,21 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * Function: h5tools_str_reset * * Purpose: Reset the string to the empty value. If no memory is - * allocated yet then initialize the h5tools_str_t struct. + * allocated yet then initialize the h5tools_str_t struct. * * Return: Success: Ptr to the buffer which contains a null - * character as the first element. + * character as the first element. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_reset(h5tools_str_t *str/*in,out*/) { - if (!str->s || str->nalloc <= 0) { + if(!str->s || str->nalloc <= 0) { str->nalloc = STR_INIT_LEN; str->s = (char*)HDmalloc(str->nalloc); HDassert(str->s); @@ -226,19 +208,16 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/) * * Return: Success: Pointer to the string * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size) { - if (size < str->len) { + if(size < str->len) { str->len = size; str->s[size] = '\0'; } @@ -250,41 +229,38 @@ h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size) * Function: h5tools_str_fmt * * Purpose: Reformat a string contents beginning at character START - * according to printf format FMT. FMT should contain no format - * specifiers except possibly the `%s' variety. For example, if - * the input string is `hello' and the format is "<<%s>>" then - * the output value will be "<>". + * according to printf format FMT. FMT should contain no format + * specifiers except possibly the `%s' variety. For example, if + * the input string is `hello' and the format is "<<%s>>" then + * the output value will be "<>". * * Return: Success: A pointer to the resulting string. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) { - char _temp[1024], *temp = _temp; + char _temp[1024], *temp = _temp; HDassert(str); HDassert(fmt); /* If the format string is simply "%s" then don't bother doing anything */ - if (!HDstrcmp(fmt, "%s")) + if(!HDstrcmp(fmt, "%s")) return str->s; /* * Save the input value if there is a `%' anywhere in FMT. Otherwise * don't bother because we don't need a temporary copy. */ - if (HDstrchr(fmt, '%')) { + if(HDstrchr(fmt, '%')) { size_t n = sizeof(_temp); - if (str->len - start + 1 > n) { + if(str->len - start + 1 > n) { n = str->len - start + 1; temp = (char*)HDmalloc(n); HDassert(temp); @@ -298,7 +274,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) h5tools_str_append(str, fmt, temp); /* Free the temp buffer if we allocated one */ - if (temp != _temp) + if(temp != _temp) HDfree(temp); return str->s; @@ -311,37 +287,34 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) * * Return: Success: Pointer to the prefix. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Thursday, July 23, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx) { - size_t i = 0; - hsize_t curr_pos = elmtno; + size_t i = 0; + hsize_t curr_pos = elmtno; h5tools_str_reset(str); - if (ndims > 0) { + if(ndims > 0) { /* * Calculate the number of elements represented by a unit change in a * certain index position. */ - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { ctx->pos[i] = curr_pos / ctx->acc[i]; curr_pos -= ctx->acc[i] * ctx->pos[i]; } HDassert(curr_pos == 0); /* Print the index values */ - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); @@ -350,10 +323,8 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, } } - else { - /* Scalar */ + else /* Scalar */ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0); - } /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); @@ -377,21 +348,21 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx) { - hsize_t p_prod[H5S_MAX_RANK]; - size_t i = 0; - hsize_t curr_pos = elmtno; + size_t i = 0; + hsize_t curr_pos = elmtno; + hsize_t p_prod[H5S_MAX_RANK]; h5tools_str_reset(str); - if (ndims > 0) { + if(ndims > 0) { /* * Calculate the number of elements represented by a unit change in a * certain index position. */ - for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) + for(i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) p_prod[i - 1] = (max_idx[i]) * p_prod[i]; - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { if(curr_pos > 0) { ctx->pos[i] = curr_pos / p_prod[i]; curr_pos -= p_prod[i] * ctx->pos[i]; @@ -402,18 +373,16 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, } /* Print the index values */ - for (i = 0; i < (size_t) ndims; i++) { - if (i) + for(i = 0; i < (size_t) ndims; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) ctx->pos[i]); } } /* if (ndims > 0) */ - else { - /* Scalar */ + else /* Scalar */ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0); - } /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); @@ -449,7 +418,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Start coordinates */ h5tools_str_append(str, "%s%s ", info->line_indent, START); - for (j = 0; j < ndims; j++) + for(j = 0; j < ndims; j++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", start[j]); h5tools_str_append(str, ")"); h5tools_str_append(str, "%s", "\n"); @@ -457,7 +426,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Stride coordinates */ h5tools_str_append(str, "%s ", STRIDE); - for (j = 0; j < ndims; j++) + for(j = 0; j < ndims; j++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", stride[j]); h5tools_str_append(str, ")"); h5tools_str_append(str, "%s", "\n"); @@ -465,7 +434,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Count coordinates */ h5tools_str_append(str, "%s ", COUNT); - for (j = 0; j < ndims; j++) { + for(j = 0; j < ndims; j++) { if(count[j] == H5S_UNLIMITED) h5tools_str_append(str, "%s%s", j ? "," : "(","H5S_UNLIMITED"); else @@ -477,7 +446,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Block coordinates */ h5tools_str_append(str, "%s ", BLOCK); - for (j = 0; j < ndims; j++) { + for(j = 0; j < ndims; j++) { if(block[j] == H5S_UNLIMITED) h5tools_str_append(str, "%s%s", j ? "," : "(","H5S_UNLIMITED"); else @@ -494,8 +463,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, * * Return: none * - * In/Out: - * h5tools_str_t *str + * In/Out: h5tools_str_t *str *------------------------------------------------------------------------- */ void @@ -512,12 +480,12 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, } H5E_END_TRY; /* Print block information */ - if (snblocks > 0) { + if(snblocks > 0) { + hsize_t alloc_size; hsize_t nblocks; hsize_t *ptdata; - hsize_t alloc_size; + hsize_t u; unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); - hsize_t u; nblocks = (hsize_t)snblocks; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); @@ -525,17 +493,17 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata); - for (u = 0; u < nblocks; u++) { + for(u = 0; u < nblocks; u++) { unsigned v; h5tools_str_append(str, info->dset_blockformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); /* Start coordinates and opposite corner */ - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", ptdata[u * 2 * ndims + v]); - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : ")-(", ptdata[u * 2 * ndims + v + ndims]); @@ -554,8 +522,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, * * Return: none * - * In/Out: - * h5tools_str_t *str + * In/Out: h5tools_str_t *str *------------------------------------------------------------------------- */ void @@ -573,11 +540,11 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, /* Print point information */ if (snpoints > 0) { - hsize_t npoints; hsize_t alloc_size; + hsize_t npoints; hsize_t *ptdata; - unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); - hsize_t u; + hsize_t u; + unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); npoints = (hsize_t)snpoints; alloc_size = npoints * ndims * sizeof(ptdata[0]); @@ -585,13 +552,13 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata); - for (u = 0; u < npoints; u++) { + for(u = 0; u < npoints; u++) { unsigned v; h5tools_str_append(str, info->dset_ptformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", (ptdata[u * ndims + v])); @@ -614,16 +581,16 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) { - if (info->str_locale == ESCAPE_HTML) { - if (ch <= ' ' || ch > '~') + if(info->str_locale == ESCAPE_HTML) { + if(ch <= ' ' || ch > '~') h5tools_str_append(str, "%%%02x", ch); else h5tools_str_append(str, "%c", ch); } else { - switch (ch) { + switch(ch) { case '"': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\""); else h5tools_str_append(str, "\\\""); @@ -635,19 +602,19 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\\\"); break; case '\b': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\b"); else h5tools_str_append(str, "\\b"); break; case '\f': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\f"); else h5tools_str_append(str, "\\f"); break; case '\n': - if (!info->do_escape) { + if(!info->do_escape) { h5tools_str_append(str, "\n"); h5tools_str_append(str, " "); } @@ -655,7 +622,7 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\n"); break; case '\r': - if (!info->do_escape) { + if(!info->do_escape) { h5tools_str_append(str, "\r"); h5tools_str_append(str, " "); } @@ -663,13 +630,13 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\r"); break; case '\t': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\t"); else h5tools_str_append(str, "\\t"); break; default: - if (isprint(ch)) + if(isprint(ch)) h5tools_str_append(str, "%c", ch); else h5tools_str_append(str, "\\%03o", ch); @@ -685,7 +652,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, unsigned u, indentlevel = 0; /* Write new prefix */ - if (ctx->indent_level > 0) + if(ctx->indent_level > 0) indentlevel = ctx->indent_level; else /* @@ -696,7 +663,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, */ indentlevel = ctx->default_indent_level; - for (u = 0; u < indentlevel; u++) + for(u = 0; u < indentlevel; u++) h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } @@ -738,7 +705,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, * added H5T_NATIVE_LDOUBLE case * * Vailin Choi; August 2010 - * Modified to handle printing of selected compound fields for h5watch. + * Modified to handle printing of selected compound fields for h5watch. * * Raymond Lu, 2011-09-01 * CLANG compiler complained about the line (about 800): @@ -765,7 +732,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5T_class_t type_class; /* Build default formats for long long types */ - if (!fmt_llong[0]) { + if(!fmt_llong[0]) { HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH); HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH); } @@ -775,33 +742,31 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai nsize = H5Tget_size(type); nsign = H5Tget_sign(type); - if (info->raw) { + if(info->raw) { size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) { - if (i) + else + for(i = 0; i < nsize; i++) { + if(i) h5tools_str_append(str, ":"); h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]); } - } } else { if((type_class = H5Tget_class(type)) < 0) return NULL; switch (type_class) { case H5T_FLOAT: - if (sizeof(float) == nsize) { + if(sizeof(float) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */ float tempfloat; HDmemcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat); } - else if (sizeof(double) == nsize) { + else if(sizeof(double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ double tempdouble; @@ -809,7 +774,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); #if H5_SIZEOF_LONG_DOUBLE !=0 } - else if (sizeof(long double) == nsize) { + else if(sizeof(long double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */ long double templdouble; @@ -822,15 +787,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_STRING: { unsigned int i; - char quote = '\0'; - char *s; + char quote = '\0'; + char *s; quote = '\0'; - if (H5Tis_variable_str(type)) { + if(H5Tis_variable_str(type)) { /* cp_vp is the pointer into the struct where a `char*' is stored. So we have * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ s = *(char**) cp_vp; - if (s != NULL) size = HDstrlen(s); + if(s != NULL) size = HDstrlen(s); } else { s = cp_vp; @@ -839,10 +804,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai pad = H5Tget_strpad(type); /* Check for NULL pointer for string */ - if (s == NULL) + if(s == NULL) h5tools_str_append(str, "NULL"); else { - for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { + for(i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { unsigned j = 1; /* @@ -850,7 +815,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * threshold is zero then that means it can repeat any number * of times. */ - if (info->str_repeat > 0) while (i + j < size && s[i] == s[i + j]) + if(info->str_repeat > 0) while (i + j < size && s[i] == s[i + j]) j++; /* @@ -859,14 +824,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * the characters, then make sure the character to be repeated is * in it's own quote. */ - if (info->str_repeat > 0 && j > info->str_repeat) { - if (quote) + if(info->str_repeat > 0 && j > info->str_repeat) { + if(quote) h5tools_str_append(str, "%c", quote); quote = '\''; h5tools_str_append(str, "%s%c", i ? " " : "", quote); } - else if (!quote) { + else if(!quote) { quote = '"'; h5tools_str_append(str, "%s%c", i ? " " : "", quote); } @@ -875,7 +840,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_print_char(str, info, s[i]); /* Print the repeat count */ - if (info->str_repeat && j > info->str_repeat) { + if(info->str_repeat && j > info->str_repeat) { #ifdef REPEAT_VERBOSE h5tools_str_append(str, "%c repeats %d times", quote, j - 1); #else @@ -886,10 +851,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } - if (quote) + if(quote) h5tools_str_append(str, "%c", quote); - if (i == 0) + if(i == 0) /*empty string*/ h5tools_str_append(str, "\"\""); } /* end else */ @@ -897,15 +862,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai break; case H5T_INTEGER: - if (sizeof(char) == nsize) { - if (info->ascii) + if(sizeof(char) == nsize) { + if(info->ascii) h5tools_print_char(str, info, (char) (*ucp_vp)); else if(H5T_SGN_NONE == nsign) { unsigned char tempuchar; HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned char)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned char)) tempuchar = 0; else tempuchar = (unsigned char)((unsigned long long)(tempuchar >> packed_data_offset) & packed_data_mask); @@ -916,8 +881,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai signed char tempchar; HDmemcpy(&tempchar, cp_vp, sizeof(char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(char)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(char)) tempchar = 0; else tempchar = (signed char)((unsigned long long)(tempchar >> packed_data_offset) & packed_data_mask); @@ -925,13 +890,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); } } /* end if (sizeof(char) == nsize) */ - else if (sizeof(int) == nsize) { + else if(sizeof(int) == nsize) { if(H5T_SGN_NONE == nsign) { - unsigned int tempuint; + unsigned int tempuint; HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned int)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned int)) tempuint = 0; else tempuint = (unsigned)((tempuint >> packed_data_offset) & packed_data_mask); @@ -939,11 +904,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } else { - int tempint; + int tempint; HDmemcpy(&tempint, vp, sizeof(int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(int)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(int)) tempint = 0; else tempint = (int)((unsigned long long)(tempint >> packed_data_offset) & packed_data_mask); @@ -951,13 +916,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } } /* end if (sizeof(int) == nsize) */ - else if (sizeof(short) == nsize) { + else if(sizeof(short) == nsize) { if(H5T_SGN_NONE == nsign) { unsigned short tempushort; HDmemcpy(&tempushort, vp, sizeof(unsigned short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned short)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned short)) tempushort = 0; else tempushort = (unsigned short)((unsigned long long)(tempushort >> packed_data_offset) & packed_data_mask); @@ -968,8 +933,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai short tempshort; HDmemcpy(&tempshort, vp, sizeof(short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(short)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(short)) tempshort = 0; else tempshort = (short)((unsigned long long)(tempshort >> packed_data_offset) & packed_data_mask); @@ -977,13 +942,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_short, "%hd"), tempshort); } } /* end if (sizeof(short) == nsize) */ - else if (sizeof(long) == nsize) { + else if(sizeof(long) == nsize) { if(H5T_SGN_NONE == nsign) { - unsigned long tempulong; + unsigned long tempulong; HDmemcpy(&tempulong, vp, sizeof(unsigned long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned long)) tempulong = 0; else tempulong = (tempulong >> packed_data_offset) & packed_data_mask; @@ -991,11 +956,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { - long templong; + long templong; HDmemcpy(&templong, vp, sizeof(long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(long)) templong = 0; else templong = (long)((unsigned long long)(templong >> packed_data_offset) & packed_data_mask); @@ -1004,13 +969,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } /* end if (sizeof(long) == nsize) */ #if H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG - else if (sizeof(long long) == nsize) { + else if(sizeof(long long) == nsize) { if(H5T_SGN_NONE == nsign) { unsigned long long tempullong; HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned long long)) tempullong = 0; else tempullong = (tempullong >> packed_data_offset) & packed_data_mask; @@ -1018,11 +983,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } else { - long long templlong; + long long templlong; HDmemcpy(&templlong, vp, sizeof(long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(long long)) templlong = 0; else templlong = (templlong >> packed_data_offset) & packed_data_mask; @@ -1035,31 +1000,31 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_COMPOUND: if(ctx->cmpd_listv) { /* there is */ - int save_indent_level; /* The indentation level */ - size_t curr_field; /* Current field to display */ - int i = 0, x = 0; /* Local index variable */ - H5LD_memb_t **listv; /* Vector of information for */ + int save_indent_level; /* The indentation level */ + size_t curr_field; /* Current field to display */ + int i = 0, x = 0; /* Local index variable */ + H5LD_memb_t **listv; /* Vector of information for */ - listv = ctx->cmpd_listv; + listv = ctx->cmpd_listv; ctx->cmpd_listv = NULL; h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); - /* + /* * Go through the vector containing info about the comma-separated list of - * compound fields and then members in each field: - * put in "{", "}", ",", member name and value accordingly. + * compound fields and then members in each field: + * put in "{", "}", ",", member name and value accordingly. */ save_indent_level = ctx->indent_level; for(curr_field = 0; listv[curr_field] != NULL; curr_field++) { - if (curr_field) + if(curr_field) h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); - else + else h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); if(info->arr_linebreak) h5tools_str_indent(str, info, ctx); - + /* Process members of each field */ for(i = 0; listv[curr_field]->names[i] != NULL; i++) { h5tools_str_append(str, OPT(info->cmpd_name, ""), listv[curr_field]->names[i]); @@ -1084,7 +1049,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->cmpd_listv = info->cmpd_listv; - } else { + } + else { unsigned nmembs; unsigned j; @@ -1093,13 +1059,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->indent_level++; - for (j = 0; j < nmembs; j++) { - if (j) + for(j = 0; j < nmembs; j++) { + if(j) h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); else h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - if (info->arr_linebreak) + if(info->arr_linebreak) h5tools_str_indent(str, info, ctx); /* The name */ @@ -1117,7 +1083,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } ctx->indent_level--; - if (info->arr_linebreak) { + if(info->arr_linebreak) { h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); h5tools_str_indent(str, info, ctx); } @@ -1129,27 +1095,24 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { char enum_name[1024]; - if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) { + if(H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name))); - } else { size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, "0x%02x", ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) + else + for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); - } } } break; case H5T_REFERENCE: - if (h5tools_str_is_zero(vp, nsize)) + if(h5tools_str_is_zero(vp, nsize)) h5tools_str_append(str, "NULL"); else { - if (nsize == H5R_DSET_REG_REF_BUF_SIZE) { + if(nsize == H5R_DSET_REG_REF_BUF_SIZE) { /* if (H5Tequal(type, H5T_STD_REF_DSETREG)) */ h5tools_str_sprint_region(str, info, container, vp); } @@ -1159,14 +1122,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * Object references -- show the type and OID of the referenced * object. */ - H5O_info_t oi; + H5O_info_t oi; const char *path; obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); H5Oget_info(obj, &oi); /* Print object type and close object */ - switch (oi.type) { + switch(oi.type) { case H5O_TYPE_GROUP: h5tools_str_append(str, H5_TOOLS_GROUP); break; @@ -1188,14 +1151,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5Oclose(obj); /* Print OID */ - if (info->obj_hidefileno) + if(info->obj_hidefileno) h5tools_str_append(str, info->obj_format, oi.addr); else h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); /* Print name */ path = lookup_ref_path(*(haddr_t *) vp); - if (path) { + if(path) { h5tools_str_append(str, " "); h5tools_str_append(str, path); h5tools_str_append(str, " "); @@ -1206,8 +1169,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_ARRAY: { - int k, ndims; - hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; + int k, ndims; + hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; static int is_next_arry_elmt = 0; /* Get the array's base datatype for each element */ @@ -1218,7 +1181,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* Calculate the number of array elements */ - for (k = 0, nelmts = 1; k < ndims; k++) { + for(k = 0, nelmts = 1; k < ndims; k++) { temp_nelmts = nelmts; temp_nelmts *= dims[k]; HDassert(temp_nelmts == (hsize_t) ((size_t) temp_nelmts)); @@ -1229,18 +1192,18 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->indent_level++; - for (i = 0; i < nelmts; i++) { - if (i) + for(i = 0; i < nelmts; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK)); - if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) { + if(info->arr_linebreak && i && i % dims[ndims - 1] == 0) { h5tools_str_append(str, "%s", "\n"); h5tools_str_indent(str, info, ctx); } /* end if */ - else if (i && info->arr_sep) { + else if(i && info->arr_sep) { /* if next element begin, add next line with indent */ - if (is_next_arry_elmt) { + if(is_next_arry_elmt) { is_next_arry_elmt = 0; h5tools_str_append(str, "%s", "\n "); @@ -1281,21 +1244,21 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Get the number of sequence elements */ nelmts = ((hvl_t *) cp_vp)->len; - for (i = 0; i < nelmts; i++) { - if (i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK)); + for(i = 0; i < nelmts; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK)); #ifdef LATER /* Need to fix so VL data breaks at correct location on end of line -QAK */ - if (info->arr_linebreak && h5tools_str_len(str)>=info->line_ncols) { + if(info->arr_linebreak && h5tools_str_len(str)>=info->line_ncols) { int x; h5tools_str_append(str, "%s", "\n"); /* need to indent some more here */ - if (ctx->indent_level >= 0) + if(ctx->indent_level >= 0) h5tools_str_append(str, "%s", OPT(info->line_pre, "")); - for (x = 0; x < ctx->indent_level + 1; x++) + for(x = 0; x < ctx->indent_level + 1; x++) h5tools_str_append(str,"%s",OPT(info->line_indent,"")); } /* end if */ #endif /* LATER */ @@ -1319,13 +1282,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { /* All other types get printed as hexadecimal */ size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, "0x%02x", ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) + else + for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); - } } break; @@ -1352,14 +1313,14 @@ void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, void *vp) { - hid_t obj, region; - char ref_name[1024]; + hid_t obj, region; + char ref_name[1024]; H5S_sel_type region_type; obj = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, vp); - if (obj >= 0) { + if(obj >= 0) { region = H5Rget_region(container, H5R_DATASET_REGION, vp); - if (region >= 0) { + if(region >= 0) { H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*) ref_name, 1024); h5tools_str_append(str, info->dset_format, ref_name); @@ -1381,33 +1342,30 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Function: h5tools_escape + * Function: h5tools_escape * - * Purpose: Changes all "funny" characters in S into standard C escape - * sequences. + * Purpose: Changes all "funny" characters in S into standard C escape + * sequences. * - * Return: Success: S + * Return: Success: S * - * Failure: NULL if the buffer would overflow. The + * Failure: NULL if the buffer would overflow. The * buffer has as many left-to-right escapes as * possible before overflow would have happened. * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * h5tools_escape(char *s/*in,out*/, size_t size) { - register size_t i; - size_t n = HDstrlen(s); + register size_t i; const char *escape; - char octal[8]; + char octal[8]; + size_t n = HDstrlen(s); - for (i = 0; i < n; i++) { + for(i = 0; i < n; i++) { switch (s[i]) { case '\'': escape = "\\\'"; @@ -1443,21 +1401,20 @@ h5tools_escape(char *s/*in,out*/, size_t size) escape = "\\v"; break; default: - if (!isprint(s[i])) { + if(!isprint(s[i])) { HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char) s[i]); escape = octal; } - else { + else escape = NULL; - } break; } - if (escape) { + if(escape) { size_t esc_size = HDstrlen(escape); - if (n + esc_size + 1 > size) + if(n + esc_size + 1 > size) /*would overflow*/ return NULL; @@ -1474,15 +1431,12 @@ h5tools_escape(char *s/*in,out*/, size_t size) /*------------------------------------------------------------------------- * Function: h5tools_str_is_zero * - * Purpose: Determines if memory is initialized to all zero bytes. + * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: TRUE if all bytes are zero; FALSE otherwise * * Programmer: Robb Matzke * Monday, June 7, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static hbool_t @@ -1490,8 +1444,8 @@ h5tools_str_is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *) _mem; - while (size-- > 0) - if (mem[size]) + while(size-- > 0) + if(mem[size]) return FALSE; return TRUE; @@ -1516,11 +1470,11 @@ h5tools_str_is_zero(const void *_mem, size_t size) char * h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) { - char *tok = NULL; + char *tok = NULL; char *newstr = NULL; - char *head = NULL; - - if(substr == NULL || replacement == NULL) + char *head = NULL; + + if(substr == NULL || replacement == NULL) return HDstrdup(string); newstr = HDstrdup(string); head = newstr; @@ -1531,8 +1485,8 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac newstr = (char *)HDmalloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); if(newstr == NULL) { - HDfree(oldstr); - return NULL; + HDfree(oldstr); + return NULL; } HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr)); HDmemcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index f4ec353..c29ea5d 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -136,8 +136,8 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ { hid_t obj; herr_t ret = SUCCEED; - char *obj_path = NULL; /* Full path of object */ - h5tools_str_t buffer; /* string into which to render */ + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; @@ -1951,7 +1951,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, else { /* all other data */ /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ - + p_type = h5tools_get_native_type(type); /* Check if we have VL data in the dataset's datatype */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 6f50cbc..7c8e055 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -236,7 +236,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ named_dt_t *dt_ret = NULL; /* Datatype to return */ H5O_info_t oinfo; /* Object info of input dtype */ - hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ + hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ if (H5Oget_info(type_in, &oinfo) < 0) goto done; @@ -255,9 +255,8 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, for (i = 0; i < travt->nobjs; i++) { if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) goto done; - } dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -278,9 +277,8 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, * possible if the datatype was committed anonymously in the input file. */ if (!dt_ret) { /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) goto done; - } dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -289,27 +287,26 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, dt_ret->id_out = -1; } /* end if */ - /* If the requested datatype does not yet exist in the output file, copy it - * anonymously */ - if (dt_ret->id_out < 0) { - if (options->use_native == 1) - dt_ret->id_out = h5tools_get_native_type(type_in); - else - dt_ret->id_out = H5Tcopy(type_in); - if (dt_ret->id_out < 0) - goto done; - if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) - goto done; - } /* end if */ + /* If the requested datatype does not yet exist in the output file, copy it + * anonymously */ + if (dt_ret->id_out < 0) { + if (options->use_native == 1) + dt_ret->id_out = h5tools_get_native_type(type_in); + else + dt_ret->id_out = H5Tcopy(type_in); + if (dt_ret->id_out < 0) + goto done; + if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto done; + } /* end if */ /* Set return value */ ret_value = dt_ret->id_out; /* Increment the ref count on id_out, because the calling function will try * to close it */ - if(H5Iinc_ref(ret_value) < 0) { + if(H5Iinc_ref(ret_value) < 0) ret_value = -1; - } done: return (ret_value); @@ -466,7 +463,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, int nmembers = H5Tget_nmembers(wtype_id); for (j = 0; j < nmembers; j++) { - hid_t mtid = H5Tget_member_type(wtype_id, (unsigned) j); + hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j); H5T_class_t mtclass = H5Tget_class(mtid); H5Tclose(mtid); @@ -477,16 +474,13 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, } /* for (j=0; i Date: Wed, 10 May 2017 10:59:13 -0500 Subject: HDFFV-10186 Add endianess to bitfield and fix tests --- .gitattributes | 3 +- MANIFEST | 3 +- hl/tools/gif2h5/gif2mem.c | 4 +- java/src/jni/h5util.c | 32 +++- src/H5T.c | 29 +++- tools/lib/h5diff_attr.c | 4 +- tools/lib/h5diff_dset.c | 4 +- tools/lib/h5diff_util.c | 27 +++- tools/lib/h5tools.c | 2 +- tools/lib/h5tools.h | 1 - tools/lib/h5tools_dump.c | 8 +- tools/lib/h5tools_str.c | 6 +- tools/lib/h5tools_type.c | 24 ++- tools/src/h5dump/h5dump_xml.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5repack/h5repack.c | 4 +- tools/src/h5repack/h5repack_copy.c | 2 +- tools/src/h5repack/h5repack_refs.c | 8 +- tools/test/h5dump/CMakeTests.cmake | 15 +- tools/test/h5dump/testh5dump.sh.in | 9 +- tools/test/misc/talign.c | 35 +---- tools/testfiles/tbitnopaque.ddl | 293 ------------------------------------- tools/testfiles/tbitnopaque_be.ddl | 293 +++++++++++++++++++++++++++++++++++++ tools/testfiles/tbitnopaque_le.ddl | 293 +++++++++++++++++++++++++++++++++++++ 24 files changed, 727 insertions(+), 376 deletions(-) delete mode 100644 tools/testfiles/tbitnopaque.ddl create mode 100644 tools/testfiles/tbitnopaque_be.ddl create mode 100644 tools/testfiles/tbitnopaque_le.ddl diff --git a/.gitattributes b/.gitattributes index d18f9b9..3c7dae1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -726,7 +726,8 @@ tools/testfiles/tattrreg.h5 -text tools/testfiles/tbigdims.h5 -text tools/testfiles/tbinary.h5 -text tools/testfiles/tbitfields.h5 -text -tools/testfiles/tbitnopaque.ddl -text +tools/testfiles/tbitnopaque_be.ddl -text +tools/testfiles/tbitnopaque_le.ddl -text tools/testfiles/tbitnopaque.h5 -text svneol=unset#application/x-hdf tools/testfiles/tchar.h5 -text tools/testfiles/tcmpdattrintsize.h5 -text diff --git a/MANIFEST b/MANIFEST index 35d3c2e..9e7fa72 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1629,7 +1629,8 @@ ./tools/testfiles/tbinregR.exp ./tools/testfiles/tbinregR.ddl ./tools/testfiles/tbitfields.h5 -./tools/testfiles/tbitnopaque.ddl +./tools/testfiles/tbitnopaque_be.ddl +./tools/testfiles/tbitnopaque_le.ddl ./tools/testfiles/tbitnopaque.h5 ./tools/testfiles/tboot1.ddl ./tools/testfiles/tboot2.ddl diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 0308783..ec029ea 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -325,7 +325,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) break; default: - printf("Unknown Extension Label: 0x%02x\n", Label); + printf("Unknown Extension Label: %#02x\n", Label); break; } @@ -333,7 +333,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) default: fprintf(stderr, - "Unknown Block Separator Character: 0x%02x\n", Identifier); + "Unknown Block Separator Character: %#02x\n", Identifier); } } } diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 8454815..bd9fc0f 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -350,7 +350,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -481,7 +481,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -1051,8 +1051,20 @@ h5str_get_little_endian_type p_type=H5Tcopy(H5T_IEEE_F64LE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8LE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16LE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64LE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: @@ -1122,8 +1134,20 @@ h5str_get_big_endian_type p_type=H5Tcopy(H5T_IEEE_F64BE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8BE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16BE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64BE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: diff --git a/src/H5T.c b/src/H5T.c index 2433137..a525cd5 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -67,6 +67,19 @@ dt->shared->type = H5T_BITFIELD; \ } +#define H5T_INIT_TYPE_BITFIELD_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + H5T_INIT_TYPE_BITFIELD_CORE; \ +} + +#define H5T_INIT_TYPE_BITFIELDLE_CORE { \ + H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_LE) \ +} + +#define H5T_INIT_TYPE_BITFIELDBE_CORE { \ + H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_BE) \ +} + /* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */ #define H5T_INIT_TYPE_TIME_CORE { \ dt->shared->type = H5T_TIME; \ @@ -896,29 +909,29 @@ H5T__init_package(void) */ /* little-endian (order is irrelevant) 8-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -) bitfield=dt; /* Keep type for later */ /* big-endian (order is irrelevant) 8-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -) /* Little-endian 16-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -) /* Big-endian 16-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -) /* Little-endian 32-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -) /* Big-endian 32-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -) /* Little-endian 64-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -) /* Big-endian 64-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -) /*------------------------------------------------------------ * The Unix architecture for dates and times. diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 5642a9b..004672e 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -395,9 +395,9 @@ hsize_t diff_attr(hid_t loc1_id, continue; } - if((mtype1_id = h5tools_get_native_type(ftype1_id)) < 0) + if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) goto error; - if((mtype2_id = h5tools_get_native_type(ftype2_id)) < 0) + if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0) goto error; if((msize1 = H5Tget_size(mtype1_id)) == 0) goto error; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index d8eadda..9f70299 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -329,10 +329,10 @@ hsize_t diff_datasetid( hid_t did1, *------------------------------------------------------------------------- */ h5difftrace("check for memory type and sizes\n"); - if ((m_tid1=h5tools_get_native_type(f_tid1)) < 0) + if ((m_tid1=H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) goto error; - if ((m_tid2=h5tools_get_native_type(f_tid2)) < 0) + if ((m_tid2=H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) goto error; m_size1 = H5Tget_size( m_tid1 ); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 1032d1b..6a512ac 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -156,9 +156,30 @@ void print_type(hid_t type) } break; + case H5T_BITFIELD: + if (H5Tequal(type, H5T_STD_B8BE)) { + parallel_print("H5T_STD_B8BE"); + } else if (H5Tequal(type, H5T_STD_B8LE)) { + parallel_print("H5T_STD_B8LE"); + } else if (H5Tequal(type, H5T_STD_B16BE)) { + parallel_print("H5T_STD_B16BE"); + } else if (H5Tequal(type, H5T_STD_B16LE)) { + parallel_print("H5T_STD_B16LE"); + } else if (H5Tequal(type, H5T_STD_B32BE)) { + parallel_print("H5T_STD_B32BE"); + } else if (H5Tequal(type, H5T_STD_B32LE)) { + parallel_print("H5T_STD_B32LE"); + } else if (H5Tequal(type, H5T_STD_B64BE)) { + parallel_print("H5T_STD_B64BE"); + } else if (H5Tequal(type, H5T_STD_B64LE)) { + parallel_print("H5T_STD_B64LE"); + } else { + parallel_print("undefined bitfield"); + } + break; + case H5T_TIME: case H5T_STRING: - case H5T_BITFIELD: case H5T_OPAQUE: case H5T_COMPOUND: case H5T_REFERENCE: @@ -367,7 +388,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, { H5Tclose( *m_tid1 ); - if(( (*m_tid1) = h5tools_get_native_type(f_tid2_id)) < 0) + if(( (*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; @@ -378,7 +399,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, else { H5Tclose(*m_tid2); - if(( (*m_tid2) = h5tools_get_native_type(f_tid1_id)) < 0) + if(( (*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 2cc02e8..a74fdd2 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1322,6 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t case H5T_INTEGER: case H5T_FLOAT: case H5T_ENUM: + case H5T_BITFIELD: block_index = block_nelmts * size; while(block_index > 0) { size_t bytes_in = 0; /* # of bytes to write */ @@ -1488,7 +1489,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_TIME: - case H5T_BITFIELD: case H5T_OPAQUE: for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char*)_mem) + block_index * size; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 2bafdfc..c5e750a 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -586,7 +586,6 @@ H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, char *drivername, size_t drivername_len); -H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 381a253..1a57512 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1795,7 +1795,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * else if (bin_form == 3) p_type = h5tools_get_big_endian_type(f_type); else - p_type = h5tools_get_native_type(f_type); + p_type = H5Tget_native_type(f_type, H5T_DIR_DEFAULT); if (p_type < 0) goto done; @@ -2957,7 +2957,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t hid_t n_type; void *buf = NULL; - n_type = h5tools_get_native_type(type_id); + n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); size = H5Tget_size(n_type); buf = HDmalloc(size); @@ -3785,7 +3785,7 @@ void h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) { unsigned packed_bits_size = 0; - hid_t n_type = h5tools_get_native_type(type); + hid_t n_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(H5Tget_class(n_type) == H5T_INTEGER) { if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) @@ -4043,7 +4043,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, unsigned int vl_data = 0; /* contains VL datatypes */ type = H5Aget_type(obj_id); - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); ndims = H5Sget_simple_extent_dims(space, size, NULL); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b7a2c1e..7396e8c 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -746,7 +746,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai size_t i; if(1 == nsize) - h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); + h5tools_str_append(str, OPT(info->fmt_raw, "%#02x"), ucp_vp[0]); else for(i = 0; i < nsize; i++) { if(i) @@ -1100,7 +1100,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { size_t i; if(1 == nsize) - h5tools_str_append(str, "0x%02x", ucp_vp[0]); + h5tools_str_append(str, "%#02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); @@ -1283,7 +1283,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* All other types get printed as hexadecimal */ size_t i; if(1 == nsize) - h5tools_str_append(str, "0x%02x", ucp_vp[0]); + h5tools_str_append(str, "%#02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index 8c5592f..b57e274 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -100,8 +100,18 @@ h5tools_get_little_endian_type(hid_t tid) p_type=H5Tcopy(H5T_IEEE_F64LE); break; - case H5T_TIME: case H5T_BITFIELD: + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8LE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16LE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64LE); + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: @@ -177,8 +187,18 @@ h5tools_get_big_endian_type(hid_t tid) p_type=H5Tcopy(H5T_IEEE_F64BE); break; - case H5T_TIME: case H5T_BITFIELD: + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8BE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16BE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64BE); + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index c29ea5d..1c3978d 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -1952,7 +1952,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); /* Check if we have VL data in the dataset's datatype */ if (h5tools_detect_vlen(p_type) == TRUE) diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 8e28d82..8c18794 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1620,7 +1620,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if(hexdump_g) p_type = H5Tcopy(type); else - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(p_type >= 0) { /* VL data special information */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 7c8e055..3c9ce90 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -291,7 +291,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, * anonymously */ if (dt_ret->id_out < 0) { if (options->use_native == 1) - dt_ret->id_out = h5tools_get_native_type(type_in); + dt_ret->id_out = H5Tget_native_type(type_in, H5T_DIR_DEFAULT); else dt_ret->id_out = H5Tcopy(type_in); if (dt_ret->id_out < 0) @@ -422,7 +422,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, } /* end if */ else { if (options->use_native == 1) - wtype_id = h5tools_get_native_type(ftype_id); + wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT); else wtype_id = H5Tcopy(ftype_id); } /* end else */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 5ec77a7..ec3e287 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -916,7 +916,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, /* wtype_id will have already been set if using a named dtype */ if (!is_named) { if (options->use_native == 1) - wtype_id = h5tools_get_native_type(ftype_id); + wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT); else wtype_id = H5Tcopy(ftype_id); } /* end if */ diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 3245af0..408142c 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -126,8 +126,8 @@ int do_copy_refobjs(hid_t fidin, for(k = 0; k < rank; k++) nelmts *= dims[k]; - if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed"); + if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); @@ -484,8 +484,8 @@ static int copy_refs_attr(hid_t loc_in, type_class = H5Tget_class(ftype_id); - if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed"); + if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index f17b116..ae4649a 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -62,7 +62,8 @@ ${HDF5_TOOLS_DIR}/testfiles/tbin4.ddl ${HDF5_TOOLS_DIR}/testfiles/tbinregR.ddl ${HDF5_TOOLS_DIR}/testfiles/tbigdims.ddl - ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque.ddl + ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_be.ddl + ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_le.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot1.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot2.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot2A.ddl @@ -810,8 +811,10 @@ tbinregR.out.err tbigdims.out tbigdims.out.err - tbitnopaque.out - tbitnopaque.out.err + tbitnopaque_be.out + tbitnopaque_be.out.err + tbitnopaque_le.out + tbitnopaque_le.out.err tboot1.out tboot1.out.err tboot2.out @@ -1172,7 +1175,11 @@ ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) ADD_H5_TEST (tcompound_complex2 0 --enable-error-stack tcompound_complex2.h5) # tests for bitfields and opaque data types - ADD_H5_TEST (tbitnopaque 0 --enable-error-stack tbitnopaque.h5) + if (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tbitnopaque_be 0 --enable-error-stack tbitnopaque.h5) + else () + ADD_H5_TEST (tbitnopaque_le 0 --enable-error-stack tbitnopaque.h5) + endif () #test for the nested compound type ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 7edaedd..ef6c4d8 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -218,7 +218,8 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl -$SRC_H5DUMP_TESTFILES/tbitnopaque.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque_be.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque_le.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl @@ -1062,7 +1063,11 @@ TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types -TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5 +if test $WORDS_BIGENDIAN != "yes"; then +TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 +else +TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 +fi #test for the nested compound type TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5 diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index d905e37..9a72557 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -86,8 +86,7 @@ int main(void) H5Tinsert(cmp, "Not Ok", sizeof(fok) + sizeof(string5), array_dt); H5Tclose(array_dt); - fix = h5tools_get_native_type(cmp); - + fix = H5Tget_native_type(cmp, H5T_DIR_DEFAULT); cmp1 = H5Tcreate(H5T_COMPOUND, sizeof(fok)); cdim[0] = sizeof(fok) / sizeof(float); @@ -208,35 +207,3 @@ out: return result; } -/*------------------------------------------------------------------------- - * Function: h5tools_get_native_type - * - * Purpose: Wrapper around H5Tget_native_type() to work around - * Problems with bitfields. - * - * Return: Success: datatype ID - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, October 5, 2004 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -hid_t -h5tools_get_native_type(hid_t type) -{ - hid_t p_type; - H5T_class_t type_class; - - type_class = H5Tget_class(type); - if(type_class==H5T_BITFIELD) - p_type=H5Tcopy(type); - else - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); - - return(p_type); -} - diff --git a/tools/testfiles/tbitnopaque.ddl b/tools/testfiles/tbitnopaque.ddl deleted file mode 100644 index 0c59c0b..0000000 --- a/tools/testfiles/tbitnopaque.ddl +++ /dev/null @@ -1,293 +0,0 @@ -HDF5 "tbitnopaque.h5" { -GROUP "/" { - GROUP "bittypetests" { - DATASET "bitfield_1" { - DATATYPE H5T_STD_B8LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, - (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, - (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, - (30): 0xe1, 0xe0 - } - } - DATASET "bitfield_2" { - DATATYPE H5T_STD_B16LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, - (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, - (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, - (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe - } - } - DATASET "bitfield_3" { - DATATYPE H5T_STD_B32LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, - (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, - (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, - (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, - (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, - (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, - (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, - (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff - } - } - DATASET "bitfield_4" { - DATATYPE H5T_STD_B64LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff:ff:ff:ff:ff:ff:ff, bf:ff:ff:ff:ff:ff:ff:ff, - (2): 7f:ff:ff:ff:ff:ff:ff:ff, 3f:ff:ff:ff:ff:ff:ff:ff, - (4): ff:fe:ff:ff:ff:ff:ff:ff, bf:fe:ff:ff:ff:ff:ff:ff, - (6): 7f:fe:ff:ff:ff:ff:ff:ff, 3f:fe:ff:ff:ff:ff:ff:ff, - (8): ff:fd:ff:ff:ff:ff:ff:ff, bf:fd:ff:ff:ff:ff:ff:ff, - (10): 7f:fd:ff:ff:ff:ff:ff:ff, 3f:fd:ff:ff:ff:ff:ff:ff, - (12): ff:fc:ff:ff:ff:ff:ff:ff, bf:fc:ff:ff:ff:ff:ff:ff, - (14): 7f:fc:ff:ff:ff:ff:ff:ff, 3f:fc:ff:ff:ff:ff:ff:ff, - (16): ff:fb:ff:ff:ff:ff:ff:ff, bf:fb:ff:ff:ff:ff:ff:ff, - (18): 7f:fb:ff:ff:ff:ff:ff:ff, 3f:fb:ff:ff:ff:ff:ff:ff, - (20): ff:fa:ff:ff:ff:ff:ff:ff, bf:fa:ff:ff:ff:ff:ff:ff, - (22): 7f:fa:ff:ff:ff:ff:ff:ff, 3f:fa:ff:ff:ff:ff:ff:ff, - (24): ff:f9:ff:ff:ff:ff:ff:ff, bf:f9:ff:ff:ff:ff:ff:ff, - (26): 7f:f9:ff:ff:ff:ff:ff:ff, 3f:f9:ff:ff:ff:ff:ff:ff, - (28): ff:f8:ff:ff:ff:ff:ff:ff, bf:f8:ff:ff:ff:ff:ff:ff, - (30): 7f:f8:ff:ff:ff:ff:ff:ff, 3f:f8:ff:ff:ff:ff:ff:ff - } - } - } - GROUP "cmpdtypetests" { - DATASET "compound_1" { - DATATYPE H5T_COMPOUND { - H5T_STD_B8LE "a"; - H5T_STD_B16LE "b"; - H5T_STD_B32LE "c"; - H5T_STD_B64LE "d"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): { - 0xff, - ff:ff, - ff:ff:ff:ff, - ff:ff:ff:ff:ff:ff:ff:ff - }, - (1): { - 0xfe, - ef:ff, - df:ff:ff:ff, - bf:ff:ff:ff:ff:ff:ff:ff - }, - (2): { - 0xfd, - df:ff, - bf:ff:ff:ff, - 7f:ff:ff:ff:ff:ff:ff:ff - }, - (3): { - 0xfc, - cf:ff, - 9f:ff:ff:ff, - 3f:ff:ff:ff:ff:ff:ff:ff - }, - (4): { - 0xfb, - bf:ff, - 7f:ff:ff:ff, - ff:fe:ff:ff:ff:ff:ff:ff - }, - (5): { - 0xfa, - af:ff, - 5f:ff:ff:ff, - bf:fe:ff:ff:ff:ff:ff:ff - }, - (6): { - 0xf9, - 9f:ff, - 3f:ff:ff:ff, - 7f:fe:ff:ff:ff:ff:ff:ff - }, - (7): { - 0xf8, - 8f:ff, - 1f:ff:ff:ff, - 3f:fe:ff:ff:ff:ff:ff:ff - }, - (8): { - 0xf7, - 7f:ff, - ff:fe:ff:ff, - ff:fd:ff:ff:ff:ff:ff:ff - }, - (9): { - 0xf6, - 6f:ff, - df:fe:ff:ff, - bf:fd:ff:ff:ff:ff:ff:ff - }, - (10): { - 0xf5, - 5f:ff, - bf:fe:ff:ff, - 7f:fd:ff:ff:ff:ff:ff:ff - }, - (11): { - 0xf4, - 4f:ff, - 9f:fe:ff:ff, - 3f:fd:ff:ff:ff:ff:ff:ff - }, - (12): { - 0xf3, - 3f:ff, - 7f:fe:ff:ff, - ff:fc:ff:ff:ff:ff:ff:ff - }, - (13): { - 0xf2, - 2f:ff, - 5f:fe:ff:ff, - bf:fc:ff:ff:ff:ff:ff:ff - }, - (14): { - 0xf1, - 1f:ff, - 3f:fe:ff:ff, - 7f:fc:ff:ff:ff:ff:ff:ff - }, - (15): { - 0xf0, - 0f:ff, - 1f:fe:ff:ff, - 3f:fc:ff:ff:ff:ff:ff:ff - }, - (16): { - 0xef, - ff:fe, - ff:fd:ff:ff, - ff:fb:ff:ff:ff:ff:ff:ff - }, - (17): { - 0xee, - ef:fe, - df:fd:ff:ff, - bf:fb:ff:ff:ff:ff:ff:ff - }, - (18): { - 0xed, - df:fe, - bf:fd:ff:ff, - 7f:fb:ff:ff:ff:ff:ff:ff - }, - (19): { - 0xec, - cf:fe, - 9f:fd:ff:ff, - 3f:fb:ff:ff:ff:ff:ff:ff - }, - (20): { - 0xeb, - bf:fe, - 7f:fd:ff:ff, - ff:fa:ff:ff:ff:ff:ff:ff - }, - (21): { - 0xea, - af:fe, - 5f:fd:ff:ff, - bf:fa:ff:ff:ff:ff:ff:ff - }, - (22): { - 0xe9, - 9f:fe, - 3f:fd:ff:ff, - 7f:fa:ff:ff:ff:ff:ff:ff - }, - (23): { - 0xe8, - 8f:fe, - 1f:fd:ff:ff, - 3f:fa:ff:ff:ff:ff:ff:ff - }, - (24): { - 0xe7, - 7f:fe, - ff:fc:ff:ff, - ff:f9:ff:ff:ff:ff:ff:ff - }, - (25): { - 0xe6, - 6f:fe, - df:fc:ff:ff, - bf:f9:ff:ff:ff:ff:ff:ff - }, - (26): { - 0xe5, - 5f:fe, - bf:fc:ff:ff, - 7f:f9:ff:ff:ff:ff:ff:ff - }, - (27): { - 0xe4, - 4f:fe, - 9f:fc:ff:ff, - 3f:f9:ff:ff:ff:ff:ff:ff - }, - (28): { - 0xe3, - 3f:fe, - 7f:fc:ff:ff, - ff:f8:ff:ff:ff:ff:ff:ff - }, - (29): { - 0xe2, - 2f:fe, - 5f:fc:ff:ff, - bf:f8:ff:ff:ff:ff:ff:ff - }, - (30): { - 0xe1, - 1f:fe, - 3f:fc:ff:ff, - 7f:f8:ff:ff:ff:ff:ff:ff - }, - (31): { - 0xe0, - 0f:fe, - 1f:fc:ff:ff, - 3f:f8:ff:ff:ff:ff:ff:ff - } - } - } - } - GROUP "opaquetypetests" { - DATASET "opaque_1" { - DATATYPE H5T_OPAQUE { - OPAQUE_TAG "1-byte opaque type"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, - (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, - (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, - (30): 0xe1, 0xe0 - } - } - DATASET "opaque_2" { - DATATYPE H5T_OPAQUE { - OPAQUE_TAG "2-byte opaque type"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, - (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, - (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, - (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe - } - } - } -} -} diff --git a/tools/testfiles/tbitnopaque_be.ddl b/tools/testfiles/tbitnopaque_be.ddl new file mode 100644 index 0000000..b57cd21 --- /dev/null +++ b/tools/testfiles/tbitnopaque_be.ddl @@ -0,0 +1,293 @@ +HDF5 "./tools/test/h5dump/testfiles/std/tbitnopaque.h5" { +GROUP "/" { + GROUP "bittypetests" { + DATASET "bitfield_1" { + DATATYPE H5T_STD_B8LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "bitfield_2" { + DATATYPE H5T_STD_B16LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ff:ef, ff:df, ff:cf, ff:bf, ff:af, ff:9f, ff:8f, ff:7f, + (9): ff:6f, ff:5f, ff:4f, ff:3f, ff:2f, ff:1f, ff:0f, fe:ff, fe:ef, + (18): fe:df, fe:cf, fe:bf, fe:af, fe:9f, fe:8f, fe:7f, fe:6f, fe:5f, + (27): fe:4f, fe:3f, fe:2f, fe:1f, fe:0f + } + } + DATASET "bitfield_3" { + DATATYPE H5T_STD_B32LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff, ff:ff:ff:df, ff:ff:ff:bf, ff:ff:ff:9f, + (4): ff:ff:ff:7f, ff:ff:ff:5f, ff:ff:ff:3f, ff:ff:ff:1f, + (8): ff:ff:fe:ff, ff:ff:fe:df, ff:ff:fe:bf, ff:ff:fe:9f, + (12): ff:ff:fe:7f, ff:ff:fe:5f, ff:ff:fe:3f, ff:ff:fe:1f, + (16): ff:ff:fd:ff, ff:ff:fd:df, ff:ff:fd:bf, ff:ff:fd:9f, + (20): ff:ff:fd:7f, ff:ff:fd:5f, ff:ff:fd:3f, ff:ff:fd:1f, + (24): ff:ff:fc:ff, ff:ff:fc:df, ff:ff:fc:bf, ff:ff:fc:9f, + (28): ff:ff:fc:7f, ff:ff:fc:5f, ff:ff:fc:3f, ff:ff:fc:1f + } + } + DATASET "bitfield_4" { + DATATYPE H5T_STD_B64LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff:ff:ff:ff:ff, ff:ff:ff:ff:ff:ff:ff:bf, + (2): ff:ff:ff:ff:ff:ff:ff:7f, ff:ff:ff:ff:ff:ff:ff:3f, + (4): ff:ff:ff:ff:ff:ff:fe:ff, ff:ff:ff:ff:ff:ff:fe:bf, + (6): ff:ff:ff:ff:ff:ff:fe:7f, ff:ff:ff:ff:ff:ff:fe:3f, + (8): ff:ff:ff:ff:ff:ff:fd:ff, ff:ff:ff:ff:ff:ff:fd:bf, + (10): ff:ff:ff:ff:ff:ff:fd:7f, ff:ff:ff:ff:ff:ff:fd:3f, + (12): ff:ff:ff:ff:ff:ff:fc:ff, ff:ff:ff:ff:ff:ff:fc:bf, + (14): ff:ff:ff:ff:ff:ff:fc:7f, ff:ff:ff:ff:ff:ff:fc:3f, + (16): ff:ff:ff:ff:ff:ff:fb:ff, ff:ff:ff:ff:ff:ff:fb:bf, + (18): ff:ff:ff:ff:ff:ff:fb:7f, ff:ff:ff:ff:ff:ff:fb:3f, + (20): ff:ff:ff:ff:ff:ff:fa:ff, ff:ff:ff:ff:ff:ff:fa:bf, + (22): ff:ff:ff:ff:ff:ff:fa:7f, ff:ff:ff:ff:ff:ff:fa:3f, + (24): ff:ff:ff:ff:ff:ff:f9:ff, ff:ff:ff:ff:ff:ff:f9:bf, + (26): ff:ff:ff:ff:ff:ff:f9:7f, ff:ff:ff:ff:ff:ff:f9:3f, + (28): ff:ff:ff:ff:ff:ff:f8:ff, ff:ff:ff:ff:ff:ff:f8:bf, + (30): ff:ff:ff:ff:ff:ff:f8:7f, ff:ff:ff:ff:ff:ff:f8:3f + } + } + } + GROUP "cmpdtypetests" { + DATASET "compound_1" { + DATATYPE H5T_COMPOUND { + H5T_STD_B8LE "a"; + H5T_STD_B16LE "b"; + H5T_STD_B32LE "c"; + H5T_STD_B64LE "d"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): { + 0xff, + ff:ff, + ff:ff:ff:ff, + ff:ff:ff:ff:ff:ff:ff:ff + }, + (1): { + 0xfe, + ff:ef, + ff:ff:ff:df, + ff:ff:ff:ff:ff:ff:ff:bf + }, + (2): { + 0xfd, + ff:df, + ff:ff:ff:bf, + ff:ff:ff:ff:ff:ff:ff:7f + }, + (3): { + 0xfc, + ff:cf, + ff:ff:ff:9f, + ff:ff:ff:ff:ff:ff:ff:3f + }, + (4): { + 0xfb, + ff:bf, + ff:ff:ff:7f, + ff:ff:ff:ff:ff:ff:fe:ff + }, + (5): { + 0xfa, + ff:af, + ff:ff:ff:5f, + ff:ff:ff:ff:ff:ff:fe:bf + }, + (6): { + 0xf9, + ff:9f, + ff:ff:ff:3f, + ff:ff:ff:ff:ff:ff:fe:7f + }, + (7): { + 0xf8, + ff:8f, + ff:ff:ff:1f, + ff:ff:ff:ff:ff:ff:fe:3f + }, + (8): { + 0xf7, + ff:7f, + ff:ff:fe:ff, + ff:ff:ff:ff:ff:ff:fd:ff + }, + (9): { + 0xf6, + ff:6f, + ff:ff:fe:df, + ff:ff:ff:ff:ff:ff:fd:bf + }, + (10): { + 0xf5, + ff:5f, + ff:ff:fe:bf, + ff:ff:ff:ff:ff:ff:fd:7f + }, + (11): { + 0xf4, + ff:4f, + ff:ff:fe:9f, + ff:ff:ff:ff:ff:ff:fd:3f + }, + (12): { + 0xf3, + ff:3f, + ff:ff:fe:7f, + ff:ff:ff:ff:ff:ff:fc:ff + }, + (13): { + 0xf2, + ff:2f, + ff:ff:fe:5f, + ff:ff:ff:ff:ff:ff:fc:bf + }, + (14): { + 0xf1, + ff:1f, + ff:ff:fe:3f, + ff:ff:ff:ff:ff:ff:fc:7f + }, + (15): { + 0xf0, + ff:0f, + ff:ff:fe:1f, + ff:ff:ff:ff:ff:ff:fc:3f + }, + (16): { + 0xef, + fe:ff, + ff:ff:fd:ff, + ff:ff:ff:ff:ff:ff:fb:ff + }, + (17): { + 0xee, + fe:ef, + ff:ff:fd:df, + ff:ff:ff:ff:ff:ff:fb:bf + }, + (18): { + 0xed, + fe:df, + ff:ff:fd:bf, + ff:ff:ff:ff:ff:ff:fb:7f + }, + (19): { + 0xec, + fe:cf, + ff:ff:fd:9f, + ff:ff:ff:ff:ff:ff:fb:3f + }, + (20): { + 0xeb, + fe:bf, + ff:ff:fd:7f, + ff:ff:ff:ff:ff:ff:fa:ff + }, + (21): { + 0xea, + fe:af, + ff:ff:fd:5f, + ff:ff:ff:ff:ff:ff:fa:bf + }, + (22): { + 0xe9, + fe:9f, + ff:ff:fd:3f, + ff:ff:ff:ff:ff:ff:fa:7f + }, + (23): { + 0xe8, + fe:8f, + ff:ff:fd:1f, + ff:ff:ff:ff:ff:ff:fa:3f + }, + (24): { + 0xe7, + fe:7f, + ff:ff:fc:ff, + ff:ff:ff:ff:ff:ff:f9:ff + }, + (25): { + 0xe6, + fe:6f, + ff:ff:fc:df, + ff:ff:ff:ff:ff:ff:f9:bf + }, + (26): { + 0xe5, + fe:5f, + ff:ff:fc:bf, + ff:ff:ff:ff:ff:ff:f9:7f + }, + (27): { + 0xe4, + fe:4f, + ff:ff:fc:9f, + ff:ff:ff:ff:ff:ff:f9:3f + }, + (28): { + 0xe3, + fe:3f, + ff:ff:fc:7f, + ff:ff:ff:ff:ff:ff:f8:ff + }, + (29): { + 0xe2, + fe:2f, + ff:ff:fc:5f, + ff:ff:ff:ff:ff:ff:f8:bf + }, + (30): { + 0xe1, + fe:1f, + ff:ff:fc:3f, + ff:ff:ff:ff:ff:ff:f8:7f + }, + (31): { + 0xe0, + fe:0f, + ff:ff:fc:1f, + ff:ff:ff:ff:ff:ff:f8:3f + } + } + } + } + GROUP "opaquetypetests" { + DATASET "opaque_1" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "1-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "opaque_2" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "2-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + } +} +} diff --git a/tools/testfiles/tbitnopaque_le.ddl b/tools/testfiles/tbitnopaque_le.ddl new file mode 100644 index 0000000..0c59c0b --- /dev/null +++ b/tools/testfiles/tbitnopaque_le.ddl @@ -0,0 +1,293 @@ +HDF5 "tbitnopaque.h5" { +GROUP "/" { + GROUP "bittypetests" { + DATASET "bitfield_1" { + DATATYPE H5T_STD_B8LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "bitfield_2" { + DATATYPE H5T_STD_B16LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + DATASET "bitfield_3" { + DATATYPE H5T_STD_B32LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, + (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, + (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, + (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, + (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, + (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, + (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, + (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff + } + } + DATASET "bitfield_4" { + DATATYPE H5T_STD_B64LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff:ff:ff:ff:ff, bf:ff:ff:ff:ff:ff:ff:ff, + (2): 7f:ff:ff:ff:ff:ff:ff:ff, 3f:ff:ff:ff:ff:ff:ff:ff, + (4): ff:fe:ff:ff:ff:ff:ff:ff, bf:fe:ff:ff:ff:ff:ff:ff, + (6): 7f:fe:ff:ff:ff:ff:ff:ff, 3f:fe:ff:ff:ff:ff:ff:ff, + (8): ff:fd:ff:ff:ff:ff:ff:ff, bf:fd:ff:ff:ff:ff:ff:ff, + (10): 7f:fd:ff:ff:ff:ff:ff:ff, 3f:fd:ff:ff:ff:ff:ff:ff, + (12): ff:fc:ff:ff:ff:ff:ff:ff, bf:fc:ff:ff:ff:ff:ff:ff, + (14): 7f:fc:ff:ff:ff:ff:ff:ff, 3f:fc:ff:ff:ff:ff:ff:ff, + (16): ff:fb:ff:ff:ff:ff:ff:ff, bf:fb:ff:ff:ff:ff:ff:ff, + (18): 7f:fb:ff:ff:ff:ff:ff:ff, 3f:fb:ff:ff:ff:ff:ff:ff, + (20): ff:fa:ff:ff:ff:ff:ff:ff, bf:fa:ff:ff:ff:ff:ff:ff, + (22): 7f:fa:ff:ff:ff:ff:ff:ff, 3f:fa:ff:ff:ff:ff:ff:ff, + (24): ff:f9:ff:ff:ff:ff:ff:ff, bf:f9:ff:ff:ff:ff:ff:ff, + (26): 7f:f9:ff:ff:ff:ff:ff:ff, 3f:f9:ff:ff:ff:ff:ff:ff, + (28): ff:f8:ff:ff:ff:ff:ff:ff, bf:f8:ff:ff:ff:ff:ff:ff, + (30): 7f:f8:ff:ff:ff:ff:ff:ff, 3f:f8:ff:ff:ff:ff:ff:ff + } + } + } + GROUP "cmpdtypetests" { + DATASET "compound_1" { + DATATYPE H5T_COMPOUND { + H5T_STD_B8LE "a"; + H5T_STD_B16LE "b"; + H5T_STD_B32LE "c"; + H5T_STD_B64LE "d"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): { + 0xff, + ff:ff, + ff:ff:ff:ff, + ff:ff:ff:ff:ff:ff:ff:ff + }, + (1): { + 0xfe, + ef:ff, + df:ff:ff:ff, + bf:ff:ff:ff:ff:ff:ff:ff + }, + (2): { + 0xfd, + df:ff, + bf:ff:ff:ff, + 7f:ff:ff:ff:ff:ff:ff:ff + }, + (3): { + 0xfc, + cf:ff, + 9f:ff:ff:ff, + 3f:ff:ff:ff:ff:ff:ff:ff + }, + (4): { + 0xfb, + bf:ff, + 7f:ff:ff:ff, + ff:fe:ff:ff:ff:ff:ff:ff + }, + (5): { + 0xfa, + af:ff, + 5f:ff:ff:ff, + bf:fe:ff:ff:ff:ff:ff:ff + }, + (6): { + 0xf9, + 9f:ff, + 3f:ff:ff:ff, + 7f:fe:ff:ff:ff:ff:ff:ff + }, + (7): { + 0xf8, + 8f:ff, + 1f:ff:ff:ff, + 3f:fe:ff:ff:ff:ff:ff:ff + }, + (8): { + 0xf7, + 7f:ff, + ff:fe:ff:ff, + ff:fd:ff:ff:ff:ff:ff:ff + }, + (9): { + 0xf6, + 6f:ff, + df:fe:ff:ff, + bf:fd:ff:ff:ff:ff:ff:ff + }, + (10): { + 0xf5, + 5f:ff, + bf:fe:ff:ff, + 7f:fd:ff:ff:ff:ff:ff:ff + }, + (11): { + 0xf4, + 4f:ff, + 9f:fe:ff:ff, + 3f:fd:ff:ff:ff:ff:ff:ff + }, + (12): { + 0xf3, + 3f:ff, + 7f:fe:ff:ff, + ff:fc:ff:ff:ff:ff:ff:ff + }, + (13): { + 0xf2, + 2f:ff, + 5f:fe:ff:ff, + bf:fc:ff:ff:ff:ff:ff:ff + }, + (14): { + 0xf1, + 1f:ff, + 3f:fe:ff:ff, + 7f:fc:ff:ff:ff:ff:ff:ff + }, + (15): { + 0xf0, + 0f:ff, + 1f:fe:ff:ff, + 3f:fc:ff:ff:ff:ff:ff:ff + }, + (16): { + 0xef, + ff:fe, + ff:fd:ff:ff, + ff:fb:ff:ff:ff:ff:ff:ff + }, + (17): { + 0xee, + ef:fe, + df:fd:ff:ff, + bf:fb:ff:ff:ff:ff:ff:ff + }, + (18): { + 0xed, + df:fe, + bf:fd:ff:ff, + 7f:fb:ff:ff:ff:ff:ff:ff + }, + (19): { + 0xec, + cf:fe, + 9f:fd:ff:ff, + 3f:fb:ff:ff:ff:ff:ff:ff + }, + (20): { + 0xeb, + bf:fe, + 7f:fd:ff:ff, + ff:fa:ff:ff:ff:ff:ff:ff + }, + (21): { + 0xea, + af:fe, + 5f:fd:ff:ff, + bf:fa:ff:ff:ff:ff:ff:ff + }, + (22): { + 0xe9, + 9f:fe, + 3f:fd:ff:ff, + 7f:fa:ff:ff:ff:ff:ff:ff + }, + (23): { + 0xe8, + 8f:fe, + 1f:fd:ff:ff, + 3f:fa:ff:ff:ff:ff:ff:ff + }, + (24): { + 0xe7, + 7f:fe, + ff:fc:ff:ff, + ff:f9:ff:ff:ff:ff:ff:ff + }, + (25): { + 0xe6, + 6f:fe, + df:fc:ff:ff, + bf:f9:ff:ff:ff:ff:ff:ff + }, + (26): { + 0xe5, + 5f:fe, + bf:fc:ff:ff, + 7f:f9:ff:ff:ff:ff:ff:ff + }, + (27): { + 0xe4, + 4f:fe, + 9f:fc:ff:ff, + 3f:f9:ff:ff:ff:ff:ff:ff + }, + (28): { + 0xe3, + 3f:fe, + 7f:fc:ff:ff, + ff:f8:ff:ff:ff:ff:ff:ff + }, + (29): { + 0xe2, + 2f:fe, + 5f:fc:ff:ff, + bf:f8:ff:ff:ff:ff:ff:ff + }, + (30): { + 0xe1, + 1f:fe, + 3f:fc:ff:ff, + 7f:f8:ff:ff:ff:ff:ff:ff + }, + (31): { + 0xe0, + 0f:fe, + 1f:fc:ff:ff, + 3f:f8:ff:ff:ff:ff:ff:ff + } + } + } + } + GROUP "opaquetypetests" { + DATASET "opaque_1" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "1-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "opaque_2" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "2-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + } +} +} -- cgit v0.12 From 772e6e9a7f5a5b01cfb6198830a41a4a0323a0a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 11:00:37 -0500 Subject: Fix reference file contents --- tools/testfiles/tbitnopaque_be.ddl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testfiles/tbitnopaque_be.ddl b/tools/testfiles/tbitnopaque_be.ddl index b57cd21..b0de7c4 100644 --- a/tools/testfiles/tbitnopaque_be.ddl +++ b/tools/testfiles/tbitnopaque_be.ddl @@ -1,4 +1,4 @@ -HDF5 "./tools/test/h5dump/testfiles/std/tbitnopaque.h5" { +HDF5 "tbitnopaque.h5" { GROUP "/" { GROUP "bittypetests" { DATASET "bitfield_1" { -- cgit v0.12 From dd45c3694ffc423170b513f8be339d5bc4484476 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 11:09:55 -0500 Subject: HDFFV-10186 braces formatting --- tools/lib/h5diff_util.c | 131 ++++++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 72 deletions(-) diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 6a512ac..454f993 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -33,19 +33,14 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if ( rank <= 0 ) - { + if( rank <= 0 ) parallel_print("H5S_SCALAR" ); - } - else - { + else { if (!dims) parallel_print("dimension is NULL"); - else - { + else { parallel_print("["); - for ( i = 0; i < rank-1; i++) - { + for ( i = 0; i < rank-1; i++) { parallel_print(HSIZE_T_FORMAT, dims[i]); parallel_print("x"); } @@ -74,108 +69,104 @@ print_dimensions (int rank, hsize_t *dims) */ void print_type(hid_t type) { - switch (H5Tget_class(type)) - { + switch (H5Tget_class(type)) { case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE)) { + if(H5Tequal(type, H5T_STD_I8BE)) parallel_print("H5T_STD_I8BE"); - } else if (H5Tequal(type, H5T_STD_I8LE)) { + else if(H5Tequal(type, H5T_STD_I8LE)) parallel_print("H5T_STD_I8LE"); - } else if (H5Tequal(type, H5T_STD_I16BE)) { + else if(H5Tequal(type, H5T_STD_I16BE)) parallel_print("H5T_STD_I16BE"); - } else if (H5Tequal(type, H5T_STD_I16LE)) { + else if(H5Tequal(type, H5T_STD_I16LE)) parallel_print("H5T_STD_I16LE"); - } else if (H5Tequal(type, H5T_STD_I32BE)) { + else if(H5Tequal(type, H5T_STD_I32BE)) parallel_print("H5T_STD_I32BE"); - } else if (H5Tequal(type, H5T_STD_I32LE)) { + else if(H5Tequal(type, H5T_STD_I32LE)) parallel_print("H5T_STD_I32LE"); - } else if (H5Tequal(type, H5T_STD_I64BE)) { + else if(H5Tequal(type, H5T_STD_I64BE)) parallel_print("H5T_STD_I64BE"); - } else if (H5Tequal(type, H5T_STD_I64LE)) { + else if(H5Tequal(type, H5T_STD_I64LE)) parallel_print("H5T_STD_I64LE"); - } else if (H5Tequal(type, H5T_STD_U8BE)) { + else if(H5Tequal(type, H5T_STD_U8BE)) parallel_print("H5T_STD_U8BE"); - } else if (H5Tequal(type, H5T_STD_U8LE)) { + else if(H5Tequal(type, H5T_STD_U8LE)) parallel_print("H5T_STD_U8LE"); - } else if (H5Tequal(type, H5T_STD_U16BE)) { + else if(H5Tequal(type, H5T_STD_U16BE)) parallel_print("H5T_STD_U16BE"); - } else if (H5Tequal(type, H5T_STD_U16LE)) { + else if(H5Tequal(type, H5T_STD_U16LE)) parallel_print("H5T_STD_U16LE"); - } else if (H5Tequal(type, H5T_STD_U32BE)) { + else if(H5Tequal(type, H5T_STD_U32BE)) parallel_print("H5T_STD_U32BE"); - } else if (H5Tequal(type, H5T_STD_U32LE)) { + else if(H5Tequal(type, H5T_STD_U32LE)) parallel_print("H5T_STD_U32LE"); - } else if (H5Tequal(type, H5T_STD_U64BE)) { + else if(H5Tequal(type, H5T_STD_U64BE)) parallel_print("H5T_STD_U64BE"); - } else if (H5Tequal(type, H5T_STD_U64LE)) { + else if(H5Tequal(type, H5T_STD_U64LE)) parallel_print("H5T_STD_U64LE"); - } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { + else if(H5Tequal(type, H5T_NATIVE_SCHAR)) parallel_print("H5T_NATIVE_SCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { + else if(H5Tequal(type, H5T_NATIVE_UCHAR)) parallel_print("H5T_NATIVE_UCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { + else if(H5Tequal(type, H5T_NATIVE_SHORT)) parallel_print("H5T_NATIVE_SHORT"); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { + else if(H5Tequal(type, H5T_NATIVE_USHORT)) parallel_print("H5T_NATIVE_USHORT"); - } else if (H5Tequal(type, H5T_NATIVE_INT)) { + else if(H5Tequal(type, H5T_NATIVE_INT)) parallel_print("H5T_NATIVE_INT"); - } else if (H5Tequal(type, H5T_NATIVE_UINT)) { + else if(H5Tequal(type, H5T_NATIVE_UINT)) parallel_print("H5T_NATIVE_UINT"); - } else if (H5Tequal(type, H5T_NATIVE_LONG)) { + else if(H5Tequal(type, H5T_NATIVE_LONG)) parallel_print("H5T_NATIVE_LONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { + else if(H5Tequal(type, H5T_NATIVE_ULONG)) parallel_print("H5T_NATIVE_ULONG"); - } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { + else if(H5Tequal(type, H5T_NATIVE_LLONG)) parallel_print("H5T_NATIVE_LLONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { + else if(H5Tequal(type, H5T_NATIVE_ULLONG)) parallel_print("H5T_NATIVE_ULLONG"); - } else { + else parallel_print("undefined integer"); - } break; case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE)) { + if(H5Tequal(type, H5T_IEEE_F32BE)) parallel_print("H5T_IEEE_F32BE"); - } else if (H5Tequal(type, H5T_IEEE_F32LE)) { + else if(H5Tequal(type, H5T_IEEE_F32LE)) parallel_print("H5T_IEEE_F32LE"); - } else if (H5Tequal(type, H5T_IEEE_F64BE)) { + else if(H5Tequal(type, H5T_IEEE_F64BE)) parallel_print("H5T_IEEE_F64BE"); - } else if (H5Tequal(type, H5T_IEEE_F64LE)) { + else if(H5Tequal(type, H5T_IEEE_F64LE)) parallel_print("H5T_IEEE_F64LE"); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { + else if(H5Tequal(type, H5T_NATIVE_FLOAT)) parallel_print("H5T_NATIVE_FLOAT"); - } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { + else if(H5Tequal(type, H5T_NATIVE_DOUBLE)) parallel_print("H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 - } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { + else if(H5Tequal(type, H5T_NATIVE_LDOUBLE)) parallel_print("H5T_NATIVE_LDOUBLE"); #endif - } else { + else parallel_print("undefined float"); - } break; case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE)) { + if(H5Tequal(type, H5T_STD_B8BE)) parallel_print("H5T_STD_B8BE"); - } else if (H5Tequal(type, H5T_STD_B8LE)) { + else if(H5Tequal(type, H5T_STD_B8LE)) parallel_print("H5T_STD_B8LE"); - } else if (H5Tequal(type, H5T_STD_B16BE)) { + else if(H5Tequal(type, H5T_STD_B16BE)) parallel_print("H5T_STD_B16BE"); - } else if (H5Tequal(type, H5T_STD_B16LE)) { + else if(H5Tequal(type, H5T_STD_B16LE)) parallel_print("H5T_STD_B16LE"); - } else if (H5Tequal(type, H5T_STD_B32BE)) { + else if(H5Tequal(type, H5T_STD_B32BE)) parallel_print("H5T_STD_B32BE"); - } else if (H5Tequal(type, H5T_STD_B32LE)) { + else if(H5Tequal(type, H5T_STD_B32LE)) parallel_print("H5T_STD_B32LE"); - } else if (H5Tequal(type, H5T_STD_B64BE)) { + else if(H5Tequal(type, H5T_STD_B64BE)) parallel_print("H5T_STD_B64BE"); - } else if (H5Tequal(type, H5T_STD_B64LE)) { + else if(H5Tequal(type, H5T_STD_B64LE)) parallel_print("H5T_STD_B64LE"); - } else { + else parallel_print("undefined bitfield"); - } break; case H5T_TIME: @@ -210,16 +201,16 @@ diff_basename(const char *name) { size_t i; - if (name == NULL) + if(name == NULL) return NULL; /* Find the end of the base name */ i = HDstrlen(name); - while (i > 0 && '/' == name[i - 1]) + while(i > 0 && '/' == name[i - 1]) --i; /* Skip backward over base name */ - while (i > 0 && '/' != name[i - 1]) + while(i > 0 && '/' != name[i - 1]) --i; return(name+i); @@ -277,7 +268,7 @@ get_type(h5trav_type_t type) H5_ATTR_PURE const char* get_sign(H5T_sign_t sign) { - switch (sign) + switch(sign) { case H5T_SGN_NONE: return "H5T_SGN_NONE"; @@ -312,7 +303,7 @@ get_sign(H5T_sign_t sign) H5_ATTR_PURE const char* get_class(H5T_class_t tclass) { - switch (tclass) { + switch(tclass) { case H5T_TIME: return("H5T_TIME"); @@ -382,14 +373,11 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, { herr_t ret = SUCCEED; - if( (*m_size1) != (*m_size2) ) - { - if( (*m_size1) < (*m_size2) ) - { + if((*m_size1) != (*m_size2)) { + if((*m_size1) < (*m_size2)) { H5Tclose( *m_tid1 ); - if(( (*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) - { + if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; } @@ -399,8 +387,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, else { H5Tclose(*m_tid2); - if(( (*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) - { + if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; } @@ -408,7 +395,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, *m_size2 = H5Tget_size(*m_tid2); } /* end else */ } /* end if */ - HDassert( (*m_size1) == (*m_size2) ); + HDassert((*m_size1) == (*m_size2)); out: return ret; -- cgit v0.12 From 7dc0c79c543321b1a22a35926b90f10cb3ad8e9c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 12:20:15 -0500 Subject: HDFFV-10186 - h5tools_str_append is not printf --- tools/lib/h5tools_str.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 7396e8c..b7a2c1e 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -746,7 +746,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai size_t i; if(1 == nsize) - h5tools_str_append(str, OPT(info->fmt_raw, "%#02x"), ucp_vp[0]); + h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); else for(i = 0; i < nsize; i++) { if(i) @@ -1100,7 +1100,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { size_t i; if(1 == nsize) - h5tools_str_append(str, "%#02x", ucp_vp[0]); + h5tools_str_append(str, "0x%02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); @@ -1283,7 +1283,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* All other types get printed as hexadecimal */ size_t i; if(1 == nsize) - h5tools_str_append(str, "%#02x", ucp_vp[0]); + h5tools_str_append(str, "0x%02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); -- cgit v0.12 From ec0935a924a84b18b29473b4fcec7c3f4e1aca76 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 12:45:06 -0500 Subject: HDFFV-10186 xml test also needs endianess aware files --- MANIFEST | 3 +- tools/test/h5dump/CMakeTestsXML.cmake | 15 +++-- tools/test/h5dump/testh5dumpxml.sh.in | 9 ++- tools/testfiles/tbitfields.h5.xml | 103 ---------------------------------- tools/testfiles/tbitfields_be.h5.xml | 103 ++++++++++++++++++++++++++++++++++ tools/testfiles/tbitfields_le.h5.xml | 103 ++++++++++++++++++++++++++++++++++ 6 files changed, 226 insertions(+), 110 deletions(-) delete mode 100644 tools/testfiles/tbitfields.h5.xml create mode 100644 tools/testfiles/tbitfields_be.h5.xml create mode 100644 tools/testfiles/tbitfields_le.h5.xml diff --git a/MANIFEST b/MANIFEST index 9e7fa72..e448a44 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2080,7 +2080,8 @@ ./tools/testfiles/tarray6.h5.xml ./tools/testfiles/tarray7.h5.xml ./tools/testfiles/tattr.h5.xml -./tools/testfiles/tbitfields.h5.xml +./tools/testfiles/tbitfields_be.h5.xml +./tools/testfiles/tbitfields_le.h5.xml ./tools/testfiles/tcompound.h5.xml ./tools/testfiles/tcompound2.h5.xml ./tools/testfiles/tcompound_complex.h5.xml diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index c353e48..92e08a0 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -81,7 +81,8 @@ ${HDF5_TOOLS_DIR}/testfiles/tarray6.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tarray7.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tattr.h5.xml - ${HDF5_TOOLS_DIR}/testfiles/tbitfields.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/tbitfields_be.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/tbitfields_le.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound_complex.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound2.h5.xml @@ -221,8 +222,10 @@ tarray7.h5.out.err tattr.h5.out tattr.h5.out.err - tbitfields.h5.out - tbitfields.h5.out.err + tbitfields_be.h5.out + tbitfields_be.h5.out.err + tbitfields_le.h5.out + tbitfields_le.h5.out.err tcompound.h5.out tcompound.h5.out.err tcompound2.h5.out @@ -344,7 +347,11 @@ ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) ADD_XML_H5_TEST (tattr.h5 0 tattr.h5) - ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5) + if (H5_WORDS_BIGENDIAN) + ADD_XML_H5_TEST (tbitfields_be.h5 0 tbitfields.h5) + else () + ADD_XML_H5_TEST (tbitfields_le.h5 0 tbitfields.h5) + endif () ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5) ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5) ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index a33f5bc..d0fad63 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -124,7 +124,8 @@ $SRC_H5DUMP_TESTFILES/tarray3.h5.xml $SRC_H5DUMP_TESTFILES/tarray6.h5.xml $SRC_H5DUMP_TESTFILES/tarray7.h5.xml $SRC_H5DUMP_TESTFILES/tattr.h5.xml -$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields_be.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields_le.h5.xml $SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml $SRC_H5DUMP_TESTFILES/tcompound.h5.xml $SRC_H5DUMP_TESTFILES/tcompound2.h5.xml @@ -299,7 +300,11 @@ COPY_TESTFILES_TO_TESTDIR # test XML TOOLTEST tall.h5.xml --xml tall.h5 TOOLTEST tattr.h5.xml --xml tattr.h5 -TOOLTEST tbitfields.h5.xml --xml tbitfields.h5 +if test $WORDS_BIGENDIAN != "yes"; then +TOOLTEST tbitfields_le.h5.xml --xml tbitfields.h5 +else +TOOLTEST tbitfields_be.h5.xml --xml tbitfields.h5 +fi TOOLTEST tcompound.h5.xml --xml tcompound.h5 TOOLTEST tcompound2.h5.xml --xml tcompound2.h5 TOOLTEST tdatareg.h5.xml --xml tdatareg.h5 diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml deleted file mode 100644 index c8ba026..0000000 --- a/tools/testfiles/tbitfields.h5.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - 0xff - 0xfe - 0xfd - 0xfc - 0xfb - 0xfa - 0xf9 - 0xf8 - 0xf7 - 0xf6 - 0xf5 - 0xf4 - 0xf3 - 0xf2 - 0xf1 - 0xf0 - 0xef - 0xee - 0xed - 0xec - 0xeb - 0xea - 0xe9 - 0xe8 - 0xe7 - 0xe6 - 0xe5 - 0xe4 - 0xe3 - 0xe2 - 0xe1 - 0xe0 - - - - - - - - - - - - - - - - - - - - - - - - - ff:fe - fd:fc - fb:fa - f9:f8 - f7:f6 - f5:f4 - f3:f2 - f1:f0 - ef:ee - ed:ec - eb:ea - e9:e8 - e7:e6 - e5:e4 - e3:e2 - e1:e0 - - - - - - diff --git a/tools/testfiles/tbitfields_be.h5.xml b/tools/testfiles/tbitfields_be.h5.xml new file mode 100644 index 0000000..26bbd91 --- /dev/null +++ b/tools/testfiles/tbitfields_be.h5.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 0xff + 0xfe + 0xfd + 0xfc + 0xfb + 0xfa + 0xf9 + 0xf8 + 0xf7 + 0xf6 + 0xf5 + 0xf4 + 0xf3 + 0xf2 + 0xf1 + 0xf0 + 0xef + 0xee + 0xed + 0xec + 0xeb + 0xea + 0xe9 + 0xe8 + 0xe7 + 0xe6 + 0xe5 + 0xe4 + 0xe3 + 0xe2 + 0xe1 + 0xe0 + + + + + + + + + + + + + + + + + + + + + + + + + fe:ff + fc:fd + fa:fb + f8:f9 + f6:f7 + f4:f5 + f2:f3 + f0:f1 + ee:ef + ec:ed + ea:eb + e8:e9 + e6:e7 + e4:e5 + e2:e3 + e0:e1 + + + + + + diff --git a/tools/testfiles/tbitfields_le.h5.xml b/tools/testfiles/tbitfields_le.h5.xml new file mode 100644 index 0000000..c8ba026 --- /dev/null +++ b/tools/testfiles/tbitfields_le.h5.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 0xff + 0xfe + 0xfd + 0xfc + 0xfb + 0xfa + 0xf9 + 0xf8 + 0xf7 + 0xf6 + 0xf5 + 0xf4 + 0xf3 + 0xf2 + 0xf1 + 0xf0 + 0xef + 0xee + 0xed + 0xec + 0xeb + 0xea + 0xe9 + 0xe8 + 0xe7 + 0xe6 + 0xe5 + 0xe4 + 0xe3 + 0xe2 + 0xe1 + 0xe0 + + + + + + + + + + + + + + + + + + + + + + + + + ff:fe + fd:fc + fb:fa + f9:f8 + f7:f6 + f5:f4 + f3:f2 + f1:f0 + ef:ee + ed:ec + eb:ea + e9:e8 + e7:e6 + e5:e4 + e3:e2 + e1:e0 + + + + + + -- cgit v0.12 From c8a5520d3aa3a526460c81507f2f985dc534b14f Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 10 May 2017 14:44:58 -0500 Subject: Call to H5Dopen has H5dopen2 arguments at line 12704 of test/dsets.c - changed to H5Dopen2 to fix failure with --with-default-api-version=v16 configure option. --- test/dsets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dsets.c b/test/dsets.c index ad014a6..ba0ad82 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12701,7 +12701,7 @@ test_compact_open_close_dirty(hid_t fapl) /* Verify the repeated open/close of the dataset will not fail */ for(i = 0; i < 20;i++) { H5E_BEGIN_TRY { - did = H5Dopen (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); + did = H5Dopen2 (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); } H5E_END_TRY; if(did < 0) TEST_ERROR -- cgit v0.12 From 0cb8152b8e97d659e076b42340509c41b3919754 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 11 May 2017 09:03:21 -0500 Subject: HDFFV-10186 Need to pull the flag into the script --- tools/test/h5dump/testh5dump.sh.in | 2 ++ tools/test/h5dump/testh5dumpxml.sh.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index ef6c4d8..1136742 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -42,6 +42,8 @@ AWK='awk' # Skip plugin module to test missing filter ENVCMD="env HDF5_PLUGIN_PRELOAD=::" +WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" + nerrors=0 verbose=yes diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index d0fad63..5f62946 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -30,6 +30,8 @@ DIRNAME='dirname' LS='ls' AWK='awk' +WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" + nerrors=0 verbose=yes -- cgit v0.12 From f95ef72a5e9827dfa63e4722938a58a8c9d686c0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 11 May 2017 23:31:57 -0400 Subject: Merged HDFFV-10187 direct chunk overwrite bugfix to develop from 1.10 branch. --- hl/test/test_dset_opt.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Dchunk.c | 16 ++++--- 2 files changed, 125 insertions(+), 5 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index d3a6b5c..b868a2a 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -32,6 +32,7 @@ #define DATASETNAME4 "data_conv" #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" +#define DATASETNAME7 "overwrite_chunk" #define RANK 2 #define NX 16 #define NY 16 @@ -46,6 +47,13 @@ #define ADD_ON 7 #define FACTOR 3 +/* Constants for the overwrite test */ +#define OVERWRITE_NDIMS 3 +#define OVERWRITE_CHUNK_NX 3 +#define OVERWRITE_CHUNK_2NX 6 +#define OVERWRITE_CHUNK_NY 2 +#define OVERWRITE_VALUE 42 + /* Local prototypes for filter functions */ static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -499,6 +507,111 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- + * Function: test_direct_chunk_overwrite_data + * + * Purpose: Test overwriting a chunk with new data. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Dana Robinson + * Spring 2017 + * + *------------------------------------------------------------------------- + */ +static int +test_direct_chunk_overwrite_data(hid_t fid) +{ + size_t buf_size = OVERWRITE_CHUNK_NX * OVERWRITE_CHUNK_NY * sizeof(int16_t); + int16_t data_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + int16_t overwrite_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + uint32_t filter_mask = 0; + hid_t tid = H5T_NATIVE_UINT16; + hid_t dcpl_id = -1; + hid_t sid = -1; + hid_t did = -1; + uint16_t fill_value = 0; + hsize_t dset_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t dset_max_dims[] = {H5S_UNLIMITED, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t chunk_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_NX}; + hsize_t offset[] = {0, 0, 0}; + hsize_t i, j; + int16_t n; + int16_t read_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_2NX]; + + TESTING("overwriting existing data with H5DOwrite_chunk"); + + /* Create the dataset's data space */ + if ((sid = H5Screate_simple(OVERWRITE_NDIMS, dset_dims, dset_max_dims)) < 0) + FAIL_STACK_ERROR + + /* Set chunk size and filll value */ + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + FAIL_STACK_ERROR + if (H5Pset_fill_value(dcpl_id, tid, &fill_value) < 0) + FAIL_STACK_ERROR + if (H5Pset_chunk(dcpl_id, OVERWRITE_NDIMS, chunk_dims) < 0) + FAIL_STACK_ERROR + + /* Create dataset */ + if ((did = H5Dcreate2(fid, DATASETNAME7, tid, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Initialize data buffers */ + n = 0; + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) { + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + data_buf[i][j] = n++; + overwrite_buf[i][j] = OVERWRITE_VALUE; + } + } + + /* Write chunk data using the direct write function. */ + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Write second chunk. */ + offset[2] = OVERWRITE_CHUNK_NX; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Overwrite first chunk. */ + offset[2] = 0; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, overwrite_buf) < 0) + FAIL_STACK_ERROR + + /* Read the data back out */ + if (H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) + FAIL_STACK_ERROR + + /* Ensure that the data are correct in chunk 1 */ + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + if (read_buf[i][j] != OVERWRITE_VALUE) + TEST_ERROR + } + + if (H5Pclose(dcpl_id) < 0) + FAIL_STACK_ERROR + if (H5Sclose(sid) < 0) + FAIL_STACK_ERROR + if (H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl_id); + H5Sclose(sid); + H5Dclose(did); + } H5E_END_TRY; + + return 1; +} /* end test_direct_chunk_overwrite_data() */ + +/*------------------------------------------------------------------------- * Function: test_skip_compress_write1 * * Purpose: Test skipping compression filter when it is the only filter @@ -1409,6 +1522,7 @@ int main( void ) #ifdef H5_HAVE_FILTER_DEFLATE nerrors += test_direct_chunk_write(file_id); #endif /* H5_HAVE_FILTER_DEFLATE */ + nerrors += test_direct_chunk_overwrite_data(file_id); nerrors += test_skip_compress_write1(file_id); nerrors += test_skip_compress_write2(file_id); nerrors += test_data_conv(file_id); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2523c5d..f02c69f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -445,11 +445,17 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Set up the size of chunk for user data */ udata.chunk_block.length = data_size; - /* Create the chunk it if it doesn't exist, or reallocate the chunk - * if its size changed. - */ - if(H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + if (0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) { + /* If there are no filters and we are overwriting the chunk we can just set values */ + need_insert = FALSE; + } + else { + /* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk + * if its size has changed. + */ + if (H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + } /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) -- cgit v0.12 From 7078993d63aab4e239e4ae9c970b4b19d38352fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 May 2017 14:40:39 -0500 Subject: HDFFV-10128 Fix null term strings --- tools/lib/h5diff_array.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 49f41dc..bb2cd8a 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -623,6 +623,7 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_COMPOUND: + h5difftrace("diff_datum H5T_COMPOUND\n"); nmembs = members->n; @@ -655,18 +656,19 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_STRING: - + h5difftrace("diff_datum H5T_STRING\n"); { - H5T_str_t pad; char *s; char *s1; char *s2; size_t size1; size_t size2; - + H5T_str_t pad = H5Tget_strpad(m_type); + /* if variable length string */ if(H5Tis_variable_str(m_type)) { + h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; size1 = HDstrlen(s1); @@ -674,6 +676,15 @@ static hsize_t diff_datum(void *_mem1, s2 = *(char**) mem2; size2 = HDstrlen(s2); } + else if (H5T_STR_NULLTERM == pad) { + h5difftrace("diff_datum H5T_STRING null term\n"); + /* Get pointer to first string */ + s1 = (char*) mem1; + size1 = HDstrlen(s1); + /* Get pointer to second string */ + s2 = (char*) mem2; + size2 = HDstrlen(s2); + } else { /* Get pointer to first string */ @@ -714,9 +725,6 @@ static hsize_t diff_datum(void *_mem1, /* try fast compare first */ if (HDmemcmp(s1, s2, size)==0) break; - - pad = H5Tget_strpad(m_type); - for (u=0; u Date: Mon, 15 May 2017 10:25:15 -0500 Subject: Incorporate additional code changes for the H5DOread_chunk patch from GE Heathcare (HDFFV-9934) This is the similar set of changes that was checked in to 1.8 branch: Incorporate the code changes that were missing from the original patch: (1) Additional tests in hl/test/test_dset_opt.c (2) Fix in src/H5Dchunk.c for direct access when an entry is in chunk cache but not dirty Tested on platypus, ostrich, kituo, mayll, osx1010test, moohan, quail, emu. --- hl/test/test_dset_opt.c | 1188 +++++++++++++++++++++++++++++++++-------------- src/H5Dchunk.c | 43 +- 2 files changed, 859 insertions(+), 372 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index b868a2a..4b5fa19 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -26,6 +26,7 @@ #define FILE_NAME "test_dectris.h5" +/* Datasets for Direct Write tests */ #define DATASETNAME1 "direct_write" #define DATASETNAME2 "skip_one_filter" #define DATASETNAME3 "skip_two_filters" @@ -33,13 +34,20 @@ #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" #define DATASETNAME7 "overwrite_chunk" +/* Datasets for Direct Read tests */ +#define DATASETNAME8 "disabled_chunk_cache" +#define DATASETNAME9 "flush_chunk_cache" +#define DATASETNAME10 "read_w_valid_cache" +#define DATASETNAME11 "unallocated_chunk" +#define DATASETNAME12 "unfiltered_data" + #define RANK 2 #define NX 16 #define NY 16 #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*(double)1.001F)+12) +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 @@ -84,10 +92,10 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ /*------------------------------------------------------------------------- * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk/H5DOread_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -110,31 +118,24 @@ test_direct_chunk_write (hid_t file) int i, j, n; unsigned filter_mask = 0; - unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst = NULL; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ - - /* For H5DOread_chunk() */ - void *readbuf = NULL; /* Buffer for reading data */ - const Bytef *pt_readbuf; /* Point to the buffer for data read */ - hsize_t read_chunk_nbytes; /* Size of chunk on disk */ - int read_dst_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to hold un-compressed data */ + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("basic functionality of H5DOwrite_chunk/H5DOread_chunk"); + TESTING("basic functionality of H5DOwrite_chunk"); /* * Create the data space with unlimited dimensions. @@ -165,76 +166,26 @@ test_direct_chunk_write (hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; + /* Initialize the dataset */ + for(i = n = 0; i < NX; i++) + for(j = 0; j < NY; j++) + data[i][j] = n++; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; - HDmemset(data, 0, sizeof(data)); - /* Initialize data for the first chunk */ - for(i = n = 0; i < CHUNK_NX; i++) - for(j = 0; j < CHUNK_NY; j++) - data[i][j] = n++; - /* - * Write the data for the dataset. */ + * Write the data for the dataset. It should stay in the chunk cache. + * It will be evicted from the cache by the H5DOwrite_chunk calls. + */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, data)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) - goto error; - - if(H5Dclose(dataset) < 0) - goto error; - - if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) - goto error; - - offset[0] = offset[1] = 0; - - /* Get the size of the compressed chunk */ - ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - - readbuf = HDmalloc(read_chunk_nbytes); - pt_readbuf = (const Bytef *)readbuf; - - /* Test to use H5DOread_chunk() to read the chunk back */ - if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) - goto error; - - /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ - ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); - - /* Check for various zlib errors */ - if(Z_BUF_ERROR == ret) { - HDfprintf(stderr, "error: not enough room in output buffer"); - goto error; - } else if(Z_MEM_ERROR == ret) { - HDfprintf(stderr, "error: not enough memory"); - goto error; - } else if(Z_OK != ret) { - HDfprintf(stderr, "error: corrupted input data"); - goto error; - } - - /* Check that the values read are the same as the values written */ - for(i = 0; i < CHUNK_NX; i++) { - for(j = 0; j < CHUNK_NY; j++) { - if(data[i][j] != read_dst_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" data=%d, read_dst_buf=%d\n", data[i][j], read_dst_buf[i][j]); - goto error; - } - } - } - - if(readbuf) - HDfree(readbuf); - /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -255,8 +206,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; islot[udata.idx_hint]; + hbool_t flush; /* Sanity checks */ HDassert(udata.idx_hint < rdcc->nslots); HDassert(rdcc->slot[udata.idx_hint]); - /* If the cached chunk is dirty, it must be flushed to get accurate size */ - if( ent->dirty == TRUE ) { + flush = (ent->dirty == TRUE) ? TRUE : FALSE; - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], flush) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") - /* Reset fields about the chunk we are looking for */ - udata.filter_mask = 0; - udata.chunk_block.offset = HADDR_UNDEF; - udata.chunk_block.length = 0; - udata.idx_hint = UINT_MAX; + /* Reset fields about the chunk we are looking for */ + udata.filter_mask = 0; + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; - /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") } /* Make sure the address of the chunk is returned. */ @@ -648,6 +649,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h HDassert(offset); HDassert(storage_size); + *storage_size = 0; + io_info.dset = dset; io_info.raw_dxpl_id = dxpl_id; io_info.md_dxpl_id = dxpl_id; @@ -660,10 +663,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h #endif /* H5_DEBUG_BUILD */ /* Allocate dataspace and initialize it if it hasn't been. */ - if(!(*layout->ops->is_space_alloc)(&layout->storage)) { - *storage_size = 0; + if(!(*layout->ops->is_space_alloc)(&layout->storage)) HGOTO_DONE(SUCCEED) - } /* Calculate the index of this chunk */ H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); @@ -2955,7 +2956,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, /* Check for chunk in cache */ if(dset->shared->cache.chunk.nslots > 0) { /* Determine the chunk's location in the hash table */ - idx = H5D__chunk_hash_val(dset->shared, scaled); + idx = H5D__chunk_hash_val(dset->shared, scaled); /* Get the chunk cache entry for that location */ ent = dset->shared->cache.chunk.slot[idx]; @@ -2979,7 +2980,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, udata->idx_hint = idx; udata->chunk_block.offset = ent->chunk_block.offset; udata->chunk_block.length = ent->chunk_block.length;; - udata->chunk_idx = ent->chunk_idx; + udata->chunk_idx = ent->chunk_idx; } /* end if */ else { /* Invalidate idx_hint, to signal that the chunk is not in cache */ -- cgit v0.12 From 56c3ec98207bb6c4b3e6a7b9523c2a1e849879c3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 May 2017 12:33:58 -0500 Subject: HDFFV-10128 add test to check null term Test is another dataset --- tools/lib/h5diff_array.c | 87 ++++++++++++++++----------- tools/test/h5diff/CMakeTests.cmake | 2 +- tools/test/h5diff/h5diffgentest.c | 28 +++++++++ tools/test/h5diff/testfiles/diff_strings1.h5 | Bin 4464 -> 4640 bytes tools/test/h5diff/testfiles/diff_strings2.h5 | Bin 4464 -> 4640 bytes tools/test/h5diff/testfiles/h5diff_tmp1.txt | 14 ++++- 6 files changed, 94 insertions(+), 37 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index bb2cd8a..0a9d18a 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -658,16 +658,17 @@ static hsize_t diff_datum(void *_mem1, case H5T_STRING: h5difftrace("diff_datum H5T_STRING\n"); { - char *s; - char *s1; - char *s2; - size_t size1; - size_t size2; - H5T_str_t pad = H5Tget_strpad(m_type); - + char *s = NULL; + char *sx = NULL; + char *s1 = NULL; + char *s2 = NULL; + size_t size1; + size_t size2; + size_t sizex; + H5T_str_t pad = H5Tget_strpad(m_type); + /* if variable length string */ - if(H5Tis_variable_str(m_type)) - { + if(H5Tis_variable_str(m_type)) { h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; @@ -685,8 +686,7 @@ static hsize_t diff_datum(void *_mem1, s2 = (char*) mem2; size2 = HDstrlen(s2); } - else - { + else { /* Get pointer to first string */ s1 = (char *)mem1; size1 = H5Tget_size(m_type); @@ -703,42 +703,59 @@ static hsize_t diff_datum(void *_mem1, */ h5diffdebug2("diff_datum string size:%d\n",size1); h5diffdebug2("diff_datum string size:%d\n",size2); - if(size1 != size2) - { + if(size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; } - if(size1 < size2) - { + if(size1 < size2) { size = size1; s = s1; + sizex = size2; + sx = s2; } - else - { + else { size = size2; s = s2; + sizex = size1; + sx = s1; } /* check for NULL pointer for string */ - if(s!=NULL) - { + if(s!=NULL) { /* try fast compare first */ - if (HDmemcmp(s1, s2, size)==0) - break; - for (u=0; u> and > +3 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found -------------------------------- Some objects are not comparable -------------------------------- Use -c for a list of objects. -EXIT CODE: 0 +EXIT CODE: 1 -- cgit v0.12 From 2e6d95a1a1dd32a6809b4a584e07b4803b3e4c5d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 16 May 2017 00:27:30 -0400 Subject: Updated the gnu-flags config file to remove gcc 3.x and 4.0 configurations as well as other minor rework and cleanup. --- config/gnu-flags | 695 +++++++------------------------------------------------ 1 file changed, 88 insertions(+), 607 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 44ed480..74cf76f 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -91,13 +91,27 @@ case "$cc_vendor-$cc_version" in ;; esac - # General - H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs" + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it from the + # environment variable at configure time. + H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" + H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" + H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" + H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" + H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros-Wunsafe -loop-optimizations -Wwrite-strings" # Production # NDEBUG is handled explicitly by the configure script case "$cc_vendor-$cc_version" in - gcc-[34].*) + gcc-4.*) PROD_CFLAGS= ;; gcc-[56].*) @@ -112,7 +126,7 @@ case "$cc_vendor-$cc_version" in # Debug # NDEBUG is handled explicitly by the configure script - # -g is hanled by the symbols flags + # -g is handled by the symbols flags case "$cc_vendor-$cc_version" in gcc-[56].*) DEBUG_CFLAGS="-ftrapv -fno-common" @@ -121,11 +135,10 @@ case "$cc_vendor-$cc_version" in DEBUG_CFLAGS= ;; esac - #DEBUG_CFLAGS="-fsanitize=undefined" # Developer warnings (suggestions from gcc, not code problems) - DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return" - NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return" + DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn" + NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn" # Symbols NO_SYMBOLS_CFLAGS="-s" @@ -136,7 +149,7 @@ case "$cc_vendor-$cc_version" in # Optimization case "$cc_vendor-$cc_version" in - gcc-[34].*) + gcc-4.*) HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS= ;; @@ -151,10 +164,6 @@ case "$cc_vendor-$cc_version" in esac NO_OPT_CFLAGS="-O0" - # Try out the new "stack protector" feature introduced in gcc 4.1 - # (We should also think about adding some of the other memory protection options) - #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" - # Flags are set cc_flags_set=yes ;; @@ -170,375 +179,169 @@ case "$cc_vendor-$cc_version" in # include and break it out into it's own section, like the other versions # below. -QAK gcc-6*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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 - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wnormalized" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" - # Append more extra warning flags that only gcc 5.x+ know about + # Append warning flags that only gcc 5.x+ knows about H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" - # Append more extra warning flags that only gcc 6.x+ know about + # Append warning flags that only gcc 6.x+ knows about H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa" ;; gcc-5*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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 - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wnormalized" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" - # Append more extra warning flags that only gcc 5.x+ know about + # Append warning flags that only gcc 5.x+ knows about H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" ;; gcc-4.9*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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 - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" ;; gcc-4.8*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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 - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" ;; gcc-4.7*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -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 - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" @@ -548,57 +351,22 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" @@ -608,54 +376,19 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" ;; @@ -663,50 +396,16 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" ;; @@ -714,44 +413,15 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK @@ -762,41 +432,12 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" ;; @@ -804,172 +445,12 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - ;; - - gcc-4.0*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - ;; - - gcc-3.4*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append more extra warning flags that only gcc3.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" ;; - gcc-3.3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append more extra warning flags that only gcc3.3+ know about - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - ;; - - gcc-3.2*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # 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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append more extra warning flags that only gcc3.2+ know about - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - ;; - - gcc-3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append some extra warning flags that only gcc3+ know about - # (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) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - ;; esac # Clear cc info if no flags set -- cgit v0.12 From 4f0b92bdd5d35395b3ee0d90a84133032b85e8ff Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 09:28:49 -0500 Subject: HDFFV-10128 Fixed string length with no null fixed --- tools/lib/h5diff_array.c | 9 +++++++-- tools/test/h5diff/CMakeTests.cmake | 2 +- tools/test/h5diff/testfiles/h5diff_tmp1.txt | 14 +------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0a9d18a..499d5eb 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -665,6 +665,7 @@ static hsize_t diff_datum(void *_mem1, size_t size1; size_t size2; size_t sizex; + size_t size_mtype = H5Tget_size(m_type); H5T_str_t pad = H5Tget_strpad(m_type); /* if variable length string */ @@ -682,17 +683,21 @@ static hsize_t diff_datum(void *_mem1, /* Get pointer to first string */ s1 = (char*) mem1; size1 = HDstrlen(s1); + if (size1 > size_mtype) + size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; size2 = HDstrlen(s2); + if (size2 > size_mtype) + size2 = size_mtype; } else { /* Get pointer to first string */ s1 = (char *)mem1; - size1 = H5Tget_size(m_type); + size1 = size_mtype; /* Get pointer to second string */ s2 = (char *)mem2; - size2 = H5Tget_size(m_type); + size2 = size_mtype; } /* diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 5759c2b..f6cd2dd 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1130,7 +1130,7 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) # temporary test to verify HDF5-8625 -ADD_H5_TEST (h5diff_tmp1 1 tmptest2.he5 tmptest.he5) +ADD_H5_TEST (h5diff_tmp1 0 tmptest2.he5 tmptest.he5) # temporary test to verify HDF5-8639 ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) diff --git a/tools/test/h5diff/testfiles/h5diff_tmp1.txt b/tools/test/h5diff/testfiles/h5diff_tmp1.txt index e2bb247..40e3fb6 100644 --- a/tools/test/h5diff/testfiles/h5diff_tmp1.txt +++ b/tools/test/h5diff/testfiles/h5diff_tmp1.txt @@ -1,17 +1,5 @@ -attribute: > and > -3 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -------------------------------- Some objects are not comparable -------------------------------- Use -c for a list of objects. -EXIT CODE: 1 +EXIT CODE: 0 -- cgit v0.12 From 71637634ac96b6167b384ebb461ce3b9ea66b4f8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 10:16:44 -0500 Subject: HDFFV-9995 Clarify help text --- tools/src/h5diff/h5diff_common.c | 45 ++++++++++++++++-------------- tools/test/h5diff/testfiles/h5diff_10.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_600.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_603.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_606.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_612.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_615.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_621.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_622.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_623.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_624.txt | 21 ++++++++------ 11 files changed, 144 insertions(+), 111 deletions(-) diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 5437803..0537b9f 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -56,7 +56,7 @@ static struct long_options l_opts[] = { static void check_options(diff_opt_t* options) { /*-------------------------------------------------------------- - * check for mutually exclusive options + * check for mutually exclusive options *--------------------------------------------------------------*/ /* check between -d , -p, --use-system-epsilon. @@ -127,13 +127,13 @@ void parse_command_line(int argc, h5diff_exit(EXIT_SUCCESS); case 'v': options->m_verbose = 1; - /* This for loop is for handling style like + /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ for (i = 1; i < argc; i++) - { - /* - * short opt + { + /* + * short opt */ if (!strcmp (argv[i], "-v")) /* no arg */ { @@ -145,10 +145,10 @@ void parse_command_line(int argc, { options->m_verbose_level = atoi(&argv[i][2]); break; - } + } - /* - * long opt + /* + * long opt */ if (!strcmp (argv[i], "--verbose")) /* no arg */ { @@ -177,7 +177,7 @@ void parse_command_line(int argc, break; case 'E': options->exclude_path = 1; - + /* create linked list of excluding objects */ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { @@ -189,8 +189,8 @@ void parse_command_line(int argc, exclude_node->obj_path = (char*)opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; - - if (NULL == exclude_head) + + if (NULL == exclude_head) { exclude_head = exclude_node; exclude_head->next = NULL; @@ -202,7 +202,7 @@ void parse_command_line(int argc, exclude_node->next = NULL; exclude_prev->next = exclude_node; - } + } break; case 'd': options->d=1; @@ -458,7 +458,7 @@ check_d_input( const char *str ) void usage(void) { - printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] \n"); + printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); printf(" file1 File name of the first HDF5 file\n"); printf(" file2 File name of the second HDF5 file\n"); printf(" [obj1] Name of an HDF5 object, in absolute path\n"); @@ -519,19 +519,22 @@ void usage(void) printf(" -n C, --count=C\n"); printf(" Print differences up to C. C must be a positive integer.\n"); printf(" -d D, --delta=D\n"); - printf(" Print difference if (|a-b| > D). D must be a positive number.\n"); + printf(" Print difference if (|a-b| > D). D must be a positive number. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" Can not use with '-p' or '--use-system-epsilon'.\n"); printf(" -p R, --relative=R\n"); - printf(" Print difference if (|(a-b)/b| > R). R must be a positive number.\n"); + printf(" Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" Can not use with '-d' or '--use-system-epsilon'.\n"); printf(" --use-system-epsilon\n"); - printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value.\n"); + printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" If the system epsilon is not defined,one of the following predefined\n"); printf(" values will be used:\n"); printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); printf(" DBL_EPSILON = 2.22045E-16 for double precision type\n"); printf(" Can not use with '-p' or '-d'.\n"); - printf(" --exclude-path \"path\" \n"); + printf(" --exclude-path \"path\"\n"); printf(" Exclude the specified path to an object when comparing files or groups.\n"); printf(" If a group is excluded, all member objects will also be excluded.\n"); printf(" The specified path is excluded wherever it occurs.\n"); @@ -570,15 +573,15 @@ void usage(void) printf("\n"); printf(" Object comparison:\n"); - printf(" 1) Groups \n"); + printf(" 1) Groups\n"); printf(" First compares the names of member objects (relative path, from the\n"); printf(" specified group) and generates a report of objects that appear in only\n"); printf(" one group or in both groups. Common objects are then compared recursively.\n"); - printf(" 2) Datasets \n"); + printf(" 2) Datasets\n"); printf(" Array rank and dimensions, datatypes, and data values are compared.\n"); - printf(" 3) Datatypes \n"); + printf(" 3) Datatypes\n"); printf(" The comparison is based on the return value of H5Tequal.\n"); - printf(" 4) Symbolic links \n"); + printf(" 4) Symbolic links\n"); printf(" The paths to the target objects are compared.\n"); printf(" (The option --follow-symlinks overrides the default behavior when\n"); printf(" symbolic links are compared.).\n"); diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index a699f00..0a0ee22 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -1,4 +1,4 @@ -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -59,19 +59,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -106,15 +109,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index 3c3ad9f..4362711 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -1,4 +1,4 @@ -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -59,19 +59,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -106,15 +109,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 087764a..9ab3204 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -1,5 +1,5 @@ <-d -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index c31a67e..afe0e72 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -1,5 +1,5 @@ <-d 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 05318bd..97a1747 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -1,5 +1,5 @@ <-p -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index fd756b3..78770f0 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -1,5 +1,5 @@ <-p 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index fd8c680..b2a5881 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -1,5 +1,5 @@ <-n -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index f0d38af..66a3025 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -1,5 +1,5 @@ <-n 0> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 4ab66a5..f9258d1 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -1,5 +1,5 @@ <-n u> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index f5e7ee3..57a4ddd 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -1,5 +1,5 @@ <-n 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). -- cgit v0.12 From 3ee87f72add3e46a751806def2721afd7218b910 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 15:56:51 -0500 Subject: HDFFV-9055 Handle H5T_ARRAY types Create variables just for diff_array function Whitespace updates --- tools/lib/h5diff_dset.c | 428 +++++++++++++++++++----------------------------- 1 file changed, 171 insertions(+), 257 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 9f70299..2ac93ab 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -44,6 +44,7 @@ hsize_t diff_dataset( hid_t file1_id, hid_t dcpl2 = -1; hsize_t nfound = 0; + h5difftrace("diff_dataset start\n"); /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -52,13 +53,11 @@ hsize_t diff_dataset( hid_t file1_id, H5E_BEGIN_TRY { /* Open the datasets */ - if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) - { + if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj1_name); goto error; } - if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) - { + if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj2_name); goto error; } @@ -78,15 +77,9 @@ hsize_t diff_dataset( hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1)==1) && - (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2)==1)) - { - nfound=diff_datasetid(did1, - did2, - obj1_name, - obj2_name, - options); - } + if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) && + (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options); else goto error; @@ -94,20 +87,12 @@ hsize_t diff_dataset( hid_t file1_id, * close *------------------------------------------------------------------------- */ - /* disable error reporting */ - H5E_BEGIN_TRY { - H5Pclose(dcpl1); - H5Pclose(dcpl2); - H5Dclose(did1); - H5Dclose(did2); - /* enable error reporting */ - } H5E_END_TRY; - - - return nfound; + goto done; error: - options->err_stat=1; + options->err_stat = 1; + +done: /* disable error reporting */ H5E_BEGIN_TRY { H5Pclose(dcpl1); @@ -117,6 +102,7 @@ error: /* enable error reporting */ } H5E_END_TRY; + h5difftrace("diff_dataset end\n"); return nfound; } @@ -188,20 +174,24 @@ hsize_t diff_datasetid( hid_t did1, hid_t sid2=-1; hid_t f_tid1=-1; hid_t f_tid2=-1; + hid_t dam_tid=-1; /* m_tid for diff_array function */ hid_t m_tid1=-1; hid_t m_tid2=-1; hid_t dcpl1 = -1; hid_t dcpl2 = -1; H5D_layout_t stl1 = -1; H5D_layout_t stl2 = -1; + size_t dam_size; /* m_size for diff_array function */ size_t m_size1; size_t m_size2; H5T_sign_t sign1; H5T_sign_t sign2; int rank1; int rank2; + hsize_t danelmts; /* nelmts for diff_array function */ hsize_t nelmts1; hsize_t nelmts2; + hsize_t *dadims; /* dims for diff_array function */ hsize_t dims1[H5S_MAX_RANK]; hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; @@ -223,30 +213,29 @@ hsize_t diff_datasetid( hid_t did1, h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ - if ( (sid1 = H5Dget_space(did1)) < 0 ) + if((sid1 = H5Dget_space(did1)) < 0) goto error; /* Get rank */ - if ( (rank1 = H5Sget_simple_extent_ndims(sid1)) < 0 ) + if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) goto error; /* Get the dataspace handle */ - if ( (sid2 = H5Dget_space(did2)) < 0 ) + if((sid2 = H5Dget_space(did2)) < 0 ) goto error; /* Get rank */ - if ( (rank2 = H5Sget_simple_extent_ndims(sid2)) < 0 ) + if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(sid1,dims1,maxdim1) < 0 ) + if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(sid2,dims2,maxdim2) < 0 ) - { + if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) goto error; - } + h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- * get the file data type @@ -254,15 +243,12 @@ hsize_t diff_datasetid( hid_t did1, */ /* Get the data type */ - if ( (f_tid1 = H5Dget_type(did1)) < 0 ) + if((f_tid1 = H5Dget_type(did1)) < 0) goto error; /* Get the data type */ - if ( (f_tid2 = H5Dget_type(did2)) < 0 ) - { + if((f_tid2 = H5Dget_type(did2)) < 0) goto error; - } - /*------------------------------------------------------------------------- * get the storage layout type @@ -284,22 +270,20 @@ hsize_t diff_datasetid( hid_t did1, */ h5difftrace("check for empty datasets\n"); - storage_size1=H5Dget_storage_size(did1); - storage_size2=H5Dget_storage_size(did2); + storage_size1 = H5Dget_storage_size(did1); + storage_size2 = H5Dget_storage_size(did2); + h5diffdebug3("storage size: %ld - %ld\n", storage_size1, storage_size2); - if (storage_size1==0 || storage_size2==0) - { - if (stl1==H5D_VIRTUAL || stl2==H5D_VIRTUAL) - { - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + if(storage_size1 == 0 || storage_size2 == 0) { + if(stl1 == H5D_VIRTUAL || stl2 == H5D_VIRTUAL) { + if((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name); } - else - { - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + else { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); - can_compare=0; - options->not_cmp=1; + can_compare = 0; + options->not_cmp = 1; } } @@ -307,72 +291,59 @@ hsize_t diff_datasetid( hid_t did1, * check for comparable TYPE and SPACE *------------------------------------------------------------------------- */ - - if (diff_can_type(f_tid1, - f_tid2, - rank1, - rank2, - dims1, - dims2, - maxdim1, - maxdim2, - obj1_name, - obj2_name, - options, - 0)!=1) - { - can_compare=0; - } + if (diff_can_type(f_tid1, f_tid2, rank1, rank2, + dims1, dims2, maxdim1, maxdim2, + obj1_name, obj2_name, + options, 0) != 1) + can_compare = 0; /*------------------------------------------------------------------------- * memory type and sizes *------------------------------------------------------------------------- */ h5difftrace("check for memory type and sizes\n"); - if ((m_tid1=H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) + if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) goto error; - if ((m_tid2=H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) + if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) goto error; - m_size1 = H5Tget_size( m_tid1 ); - m_size2 = H5Tget_size( m_tid2 ); + m_size1 = H5Tget_size(m_tid1); + m_size2 = H5Tget_size(m_tid2); + h5diffdebug3("type size: %ld - %ld\n", m_size1, m_size2); /*------------------------------------------------------------------------- * check for different signed/unsigned types *------------------------------------------------------------------------- */ - if (can_compare) - { + if(can_compare) { h5difftrace("can_compare for sign\n"); - sign1=H5Tget_sign(m_tid1); - sign2=H5Tget_sign(m_tid2); - if ( sign1 != sign2 ) - { + sign1 = H5Tget_sign(m_tid1); + sign2 = H5Tget_sign(m_tid2); + if(sign1 != sign2) { h5difftrace("sign1 != sign2\n"); - if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } - can_compare=0; - options->not_cmp=1; + can_compare = 0; + options->not_cmp = 1; } } /* Check if type is either VLEN-data or VLEN-string to reclaim any * VLEN memory buffer later */ - if( TRUE == h5tools_detect_vlen(m_tid1) ) + if(TRUE == h5tools_detect_vlen(m_tid1)) vl_data = TRUE; /*------------------------------------------------------------------------ * only attempt to compare if possible *------------------------------------------------------------------------- */ - if(can_compare) /* it is possible to compare */ - { + if(can_compare) { /* it is possible to compare */ h5difftrace("can_compare attempt\n"); + H5T_class_t tclass = H5Tget_class(f_tid1); /*----------------------------------------------------------------- * get number of elements @@ -386,19 +357,44 @@ hsize_t diff_datasetid( hid_t did1, for(i = 0; i < rank2; i++) nelmts2 *= dims2[i]; + h5diffdebug3("nelmts: %ld - %ld\n", nelmts1, nelmts2); HDassert(nelmts1 == nelmts2); - /*----------------------------------------------------------------- - * "upgrade" the smaller memory size - *------------------------------------------------------------------ - */ - h5difftrace("upgrade the smaller memory size?\n"); - - if (FAIL == match_up_memsize (f_tid1, f_tid2, - &m_tid1, &m_tid2, - &m_size1, &m_size2)) - goto error; - + if(tclass != H5T_ARRAY) { + /*----------------------------------------------------------------- + * "upgrade" the smaller memory size + *------------------------------------------------------------------ + */ + h5difftrace("upgrade the smaller memory size?\n"); + if (FAIL == match_up_memsize (f_tid1, f_tid2, + &m_tid1, &m_tid2, + &m_size1, &m_size2)) + goto error; + h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); + dadims = dims1; + dam_size = m_size1; + dam_tid = m_tid1; + danelmts = nelmts1; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + } + else { + h5diffdebug3("Array dims: %d - %d\n", dims1[0], dims2[0]); + /* Compare the smallest array, but create the largest buffer */ + if(m_size1 <= m_size2) { + dadims = dims1; + dam_size = m_size1; + dam_tid = m_tid1; + danelmts = nelmts1; + need = (size_t)(nelmts2 * m_size2); /* bytes needed */ + } + else { + dadims = dims2; + dam_size = m_size2; + dam_tid = m_tid2; + danelmts = nelmts2; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + } + } /* print names */ if(obj1_name) name1 = diff_basename(obj1_name); @@ -410,7 +406,6 @@ hsize_t diff_datasetid( hid_t did1, * read/compare *----------------------------------------------------------------- */ - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); buf2 = HDmalloc(need); @@ -420,12 +415,13 @@ hsize_t diff_datasetid( hid_t did1, h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) goto error; + h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) goto error; /* array diff */ - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, - options, name1, name2, m_tid1, did1, did2); + nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, + options, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -433,10 +429,9 @@ hsize_t diff_datasetid( hid_t did1, H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ } /* end if */ - else /* possibly not enough memory, read/compare by hyperslabs */ - { - size_t p_type_nbytes = m_size1; /*size of memory type */ - hsize_t p_nelmts = nelmts1; /*total selected elmts */ + else { /* possibly not enough memory, read/compare by hyperslabs */ + size_t p_type_nbytes = dam_size; /*size of memory type */ + hsize_t p_nelmts = danelmts; /*total selected elmts */ hsize_t elmtno; /*counter */ int carry; /*counter carry value */ @@ -462,7 +457,7 @@ hsize_t diff_datasetid( hid_t did1, if(size == 0) /* datum size > H5TOOLS_BUFSIZE */ size = 1; - sm_size[i - 1] = MIN(dims1[i - 1], size); + sm_size[i - 1] = MIN(dadims[i - 1], size); sm_nbytes *= sm_size[i - 1]; HDassert(sm_nbytes > 0); } /* end for */ @@ -490,7 +485,7 @@ hsize_t diff_datasetid( hid_t did1, /* calculate the hyperslab size */ if(rank1 > 0) { for(i = 0, hs_nelmts = 1; i < rank1; i++) { - hs_size[i] = MIN(dims1[i] - hs_offset[i], sm_size[i]); + hs_size[i] = MIN(dadims[i] - hs_offset[i], sm_size[i]); hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) @@ -503,15 +498,15 @@ hsize_t diff_datasetid( hid_t did1, else hs_nelmts = 1; - if(H5Dread(did1,m_tid1,sm_space,sid1,H5P_DEFAULT,sm_buf1) < 0) + if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) goto error; - if(H5Dread(did2,m_tid2,sm_space,sid2,H5P_DEFAULT,sm_buf2) < 0) + if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) goto error; /* get array differences. in the case of hyperslab read, increment the number of differences - found in each hyperslab and pass the position at the beggining for printing */ + found in each hyperslab and pass the position at the beginning for printing */ nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, - dims1, options, name1, name2, m_tid1, did1, did2); + dadims, options, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -522,7 +517,7 @@ hsize_t diff_datasetid( hid_t did1, /* calculate the next hyperslab offset */ for(i = rank1, carry = 1; i > 0 && carry; --i) { hs_offset[i - 1] += hs_size[i - 1]; - if(hs_offset[i - 1] == dims1[i - 1]) + if(hs_offset[i - 1] == dadims[i - 1]) hs_offset[i - 1] = 0; else carry = 0; @@ -574,37 +569,33 @@ error: options->err_stat=1; /* free */ - if (buf1!=NULL) - { + if(buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); HDfree(buf1); - buf1=NULL; + buf1 = NULL; } - if (buf2!=NULL) - { + if(buf2 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); HDfree(buf2); - buf2=NULL; + buf2 = NULL; } - if (sm_buf1!=NULL) - { + if(sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); - sm_buf1=NULL; + sm_buf1 = NULL; } - if (sm_buf2!=NULL) - { + if(sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); - sm_buf2=NULL; + sm_buf2 = NULL; } /* disable error reporting */ @@ -652,75 +643,55 @@ int diff_can_type( hid_t f_tid1, /* file data type */ diff_opt_t *options, int is_compound) { - - H5T_class_t tclass1; H5T_class_t tclass2; - int maxdim_diff=0; /* maximum dimensions are different */ - int dim_diff=0; /* current dimensions are different */ + int maxdim_diff = 0; /* maximum dimensions are different */ + int dim_diff = 0; /* current dimensions are different */ int i; - int can_compare = 1; /* return value */ + int can_compare = 1; /* return value */ + h5difftrace("diff_can_type start\n"); /*------------------------------------------------------------------------- * check for the same class *------------------------------------------------------------------------- */ - - if ((tclass1=H5Tget_class(f_tid1)) < 0) + if((tclass1 = H5Tget_class(f_tid1)) < 0) return -1; - - if ((tclass2=H5Tget_class(f_tid2)) < 0) + if((tclass2 = H5Tget_class(f_tid2)) < 0) return -1; - if ( tclass1 != tclass2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { - - if ( is_compound ) - { - + if(tclass1 != tclass2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if(is_compound) { parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); - + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2)); } - - else - - { - + else { parallel_print("Not comparable: <%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); - + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2)); } - } - - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } /*------------------------------------------------------------------------- * check for non supported classes *------------------------------------------------------------------------- */ - - HDassert(tclass1==tclass2); - switch (tclass1) - { + HDassert(tclass1 == tclass2); + switch (tclass1) { case H5T_TIME: - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", - obj1_name,obj2_name,get_class(tclass2) ); + obj1_name, obj2_name, get_class(tclass2)); } /* end if */ can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; case H5T_INTEGER: case H5T_FLOAT: @@ -735,6 +706,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ case H5T_NO_CLASS: case H5T_NCLASSES: default: + h5diffdebug2("diff_can_type class - %s\n", get_class(tclass1)); break; } /* end switch */ @@ -742,17 +714,11 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - - if ( (H5Tequal(f_tid1, f_tid2)==0) && - (options->m_verbose) && obj1_name && obj2_name) - { - + if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) { H5T_class_t cl = H5Tget_class(f_tid1); - parallel_print("Warning: different storage datatype\n"); - if ( cl == H5T_INTEGER || cl == H5T_FLOAT ) - { + if(cl == H5T_INTEGER || cl == H5T_FLOAT) { parallel_print("<%s> has file datatype ", obj1_name); print_type(f_tid1); parallel_print("\n"); @@ -760,110 +726,85 @@ int diff_can_type( hid_t f_tid1, /* file data type */ print_type(f_tid2); parallel_print("\n"); } - - - } /*------------------------------------------------------------------------- * check for the same rank *------------------------------------------------------------------------- */ - - - if ( rank1 != rank2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(rank1 != rank2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); - print_dimensions(rank1,dims1); + print_dimensions(rank1, dims1); parallel_print(", max dimensions "); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n" ); parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); - print_dimensions(rank2,dims2); + print_dimensions(rank2, dims2); parallel_print(", max dimensions "); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } /*------------------------------------------------------------------------- * check for different dimensions *------------------------------------------------------------------------- */ - - HDassert(rank1==rank2); - for ( i=0; im_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(dim_diff == 1) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); - print_dimensions(rank1,dims1); - if (maxdim1 && maxdim2) - { + print_dimensions(rank1, dims1); + if(maxdim1 && maxdim2) { parallel_print(", max dimensions "); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n" ); parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); - print_dimensions(rank2,dims2); + print_dimensions(rank2, dims2); parallel_print(", max dimensions "); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } } - - can_compare = 0; options->not_cmp = 1; - return can_compare; - - - + goto done; } /*------------------------------------------------------------------------- * maximum dimensions; just give a warning *------------------------------------------------------------------------- */ - if (maxdim1 && maxdim2 && maxdim_diff==1 && obj1_name ) - { - if (options->m_verbose) { + if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { + if(options->m_verbose) { parallel_print( "Warning: different maximum dimensions\n"); parallel_print("<%s> has max dimensions ", obj1_name); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n"); parallel_print("<%s> has max dimensions ", obj2_name); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } } - - if ( tclass1 == H5T_COMPOUND ) - { - + if(tclass1 == H5T_COMPOUND) { int nmembs1; int nmembs2; int j; @@ -873,67 +814,40 @@ int diff_can_type( hid_t f_tid1, /* file data type */ nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); - if ( nmembs1 != nmembs2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(nmembs1 != nmembs2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } - for (j = 0; j < nmembs1; j++) - { + for (j = 0; j < nmembs1; j++) { memb_type1 = H5Tget_member_type(f_tid1, (unsigned)j); memb_type2 = H5Tget_member_type(f_tid2, (unsigned)j); - if (diff_can_type(memb_type1, - memb_type2, - rank1, - rank2, - dims1, - dims2, - maxdim1, - maxdim2, - obj1_name, - obj2_name, - options, - 1)!=1) - { + if (diff_can_type(memb_type1, memb_type2, rank1, rank2, + dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, + options, 1) != 1) { can_compare = 0; options->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); - return can_compare; + goto done; } - H5Tclose(memb_type1); H5Tclose(memb_type2); - } - - - - - } - - - - - +done: + h5diffdebug2("diff_can_type end - %d\n", can_compare); return can_compare; } - - /*------------------------------------------------------------------------- * Function: print_sizes * -- cgit v0.12 From 23d9fe26495904dcaa1489bd4d4f8a698d87511e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 10:06:17 -0500 Subject: HDFFV-9055 add test files --- MANIFEST | 3 +++ tools/test/h5diff/CMakeTests.cmake | 16 ++++++++++++++++ tools/test/h5diff/h5diffgentest.c | 19 ++++++++++--------- tools/test/h5diff/testfiles/h5diff_800.txt | 12 ++++++++++++ tools/test/h5diff/testfiles/h5diff_801.txt | 13 +++++++++++++ tools/test/h5diff/testfiles/h5diff_dset3.h5 | Bin 0 -> 23416 bytes 6 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_800.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_801.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_dset3.h5 diff --git a/MANIFEST b/MANIFEST index e448a44..dde7632 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2240,6 +2240,8 @@ ./tools/test/h5diff/testfiles/h5diff_709.txt ./tools/test/h5diff/testfiles/h5diff_710.txt ./tools/test/h5diff/testfiles/h5diff_80.txt +./tools/test/h5diff/testfiles/h5diff_800.txt +./tools/test/h5diff/testfiles/h5diff_801.txt ./tools/test/h5diff/testfiles/h5diff_90.txt ./tools/test/h5diff/testfiles/h5diff_100.txt ./tools/test/h5diff/testfiles/h5diff_101.txt @@ -2350,6 +2352,7 @@ ./tools/test/h5diff/testfiles/h5diff_basic2.h5 ./tools/test/h5diff/testfiles/h5diff_dset1.h5 ./tools/test/h5diff/testfiles/h5diff_dset2.h5 +./tools/test/h5diff/testfiles/h5diff_dset3.h5 ./tools/test/h5diff/testfiles/h5diff_dtypes.h5 ./tools/test/h5diff/testfiles/h5diff_empty.h5 ./tools/test/h5diff/testfiles/h5diff_hyper1.h5 diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index f6cd2dd..72dda6b 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -28,6 +28,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset3.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 @@ -275,6 +276,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt @@ -464,6 +467,7 @@ set (FILE6 h5diff_attr2.h5) set (FILE7 h5diff_dset1.h5) set (FILE8 h5diff_dset2.h5) + set (FILE8A h5diff_dset3.h5) set (FILE9 h5diff_hyper1.h5) set (FILE10 h5diff_hyper2.h5) set (FILE11 h5diff_empty.h5) @@ -872,6 +876,10 @@ h5diff_710.out.err h5diff_80.out h5diff_80.out.err + h5diff_800.out + h5diff_800.out.err + h5diff_801.out + h5diff_801.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1478,6 +1486,14 @@ ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) # ############################################################################## +# # Test array variances +# ############################################################################## +# +# Test with -d , -p and --use-system-epsilon. +ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) +ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) + +# ############################################################################## # VDS tests # ############################################################################## ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 4a929ae..6a84365 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -48,6 +48,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define FILE6 "h5diff_attr2.h5" #define FILE7 "h5diff_dset1.h5" #define FILE8 "h5diff_dset2.h5" +#define FILE8A "h5diff_dset3.h5" #define FILE9 "h5diff_hyper1.h5" #define FILE10 "h5diff_hyper2.h5" #define FILE11 "h5diff_empty.h5" @@ -197,6 +198,7 @@ int main(void) /* generate 2 files, the second call creates a similar file with differences */ test_datasets(FILE7,0); test_datasets(FILE8,1); + test_datasets(FILE8A,2); /* generate 2 files, the second call creates a similar file with differences */ test_hyperslab(FILE9,0); @@ -1328,7 +1330,7 @@ int test_datasets(const char *file, herr_t status; int buf[2]={1,2}; - if(make_diffs) + if(make_diffs > 0) memset(buf, 0, sizeof buf); /* Create a file */ @@ -1399,9 +1401,8 @@ int test_special_datasets(const char *file, /* Create a dataset with zero dimension size in one file but the other one * has a dataset with a non-zero dimension size */ - if(make_diffs) { + if(make_diffs) dims[1] = SPACE1_DIM2 + 4; - } sid = H5Screate_simple(SPACE1_RANK, dims, NULL); did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -5470,12 +5471,12 @@ static void test_objs_strings(const char *fname1, const char *fname2) string4A[0][10] = 0; string4A[0][11] = 0; string4B[0][10] = 0; - + string4A[1][10] = 0; string4A[1][11] = 'Z'; string4B[1][10] = 0; string4B[1][11] = 'x'; - + string4A[2][10] = 0; string4B[2][10] = 0; string4B[2][11] = 'a'; @@ -6641,6 +6642,9 @@ void write_dset_in(hid_t loc_id, int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ + if(make_diffs == 2) { + dimarray[0] = 4; + } /*------------------------------------------------------------------------- * H5S_SCALAR @@ -6649,11 +6653,8 @@ void write_dset_in(hid_t loc_id, - if ( make_diffs ) - { - + if(make_diffs) scalar_data = 1; - } /* create a space */ sid = H5Screate(H5S_SCALAR); diff --git a/tools/test/h5diff/testfiles/h5diff_800.txt b/tools/test/h5diff/testfiles/h5diff_800.txt new file mode 100644 index 0000000..e43e7b4 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_800.txt @@ -0,0 +1,12 @@ +dataset: and +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_801.txt b/tools/test/h5diff/testfiles/h5diff_801.txt new file mode 100644 index 0000000..043e7e3 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_801.txt @@ -0,0 +1,13 @@ +dataset: and +Warning: different storage datatype +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_dset3.h5 b/tools/test/h5diff/testfiles/h5diff_dset3.h5 new file mode 100644 index 0000000..7a1f3dd Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_dset3.h5 differ -- cgit v0.12 From 71c223c082f1777046419f98e6159bda2cb59cc9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 13:09:13 -0500 Subject: Move execeutable command after declaration --- tools/lib/h5diff_dset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 2ac93ab..991ef48 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -342,8 +342,8 @@ hsize_t diff_datasetid( hid_t did1, *------------------------------------------------------------------------- */ if(can_compare) { /* it is possible to compare */ - h5difftrace("can_compare attempt\n"); H5T_class_t tclass = H5Tget_class(f_tid1); + h5difftrace("can_compare attempt\n"); /*----------------------------------------------------------------- * get number of elements -- cgit v0.12 From fcc56184f1699fc1d35b042acb1388cc76b8ea16 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 15:09:13 -0500 Subject: Whitespace --- tools/test/h5copy/h5copygentest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index ed41998..bda0686 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -33,12 +33,12 @@ #define DATASET_COMPRESSED "compressed" #define DATASET_NAMED_VL "named_vl" #define DATASET_NESTED_VL "nested_vl" -#define DATASET_ATTR "dset_attr" -#define ATTR "attr" +#define DATASET_ATTR "dset_attr" +#define ATTR "attr" #define GROUP_EMPTY "grp_empty" #define GROUP_DATASETS "grp_dsets" #define GROUP_NESTED "grp_nested" -#define GROUP_ATTR "grp_attr" +#define GROUP_ATTR "grp_attr" /* Obj reference */ #define OBJ_REF_DS "Dset1" @@ -327,8 +327,8 @@ static void gent_nested_vl(hid_t loc_id) * Function: gent_att_compound_vlstr * * Purpose: Generate a dataset and a group. - * Both has an attribute with a compound datatype consisting - * of a variable length string + * Both has an attribute with a compound datatype consisting + * of a variable length string * *------------------------------------------------------------------------- */ @@ -347,7 +347,7 @@ static void gent_att_compound_vlstr(hid_t loc_id) hid_t vl_str_tid = -1; /* Variable length datatype ID */ hid_t cmpd_tid = -1; /* Compound datatype ID */ hid_t null_sid = -1; /* Null dataspace ID */ - s1 buf; /* Buffer */ + s1 buf; /* Buffer */ buf.i = 9; buf.v = "ThisIsAString"; -- cgit v0.12 From 9b8ffee145e41abf35d57c747ff8e1a6ba3aaa89 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 May 2017 09:12:47 -0500 Subject: Added note about 9055 and 10128, 9995 not needed --- release_docs/RELEASE.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c670066..8fb56cc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -74,15 +74,15 @@ New Features Tools: ------ - - + - High-Level APIs: --------------- - - + - C Packet Table API ------------------ - - + - Internal header file -------------------- @@ -105,7 +105,7 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- - - + - Performance ------------- @@ -117,7 +117,9 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- - - + - Improved h5diff compare of strings and arrays. + + (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) High-Level APIs: ------ @@ -302,16 +304,16 @@ The following platforms are not supported but have been tested for this release. (cmake and autotools) Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc, g++ (GCC) 6.1.1 20160621 + gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) - GNU Fortran (GCC) 6.1.1 20160621 + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) (cmake and autotools) Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux - gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 - GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 (cmake and autotools) -- cgit v0.12 From e60bf13c76e8e9bc831d4a47d22631f201383560 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 May 2017 15:35:05 -0500 Subject: HDFFV-9055 Correct file generator --- tools/test/h5diff/h5diffgentest.c | 2 +- tools/test/h5diff/testfiles/h5diff_58.txt | 2 +- tools/test/h5diff/testfiles/h5diff_80.txt | 2 +- tools/test/h5diff/testfiles/h5diff_dset1.h5 | Bin 23624 -> 23416 bytes tools/test/h5diff/testfiles/h5diff_dset2.h5 | Bin 23624 -> 23416 bytes tools/test/h5diff/testfiles/h5diff_dset3.h5 | Bin 23416 -> 23416 bytes 6 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 6a84365..708f371 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -7237,7 +7237,7 @@ void write_dset_in(hid_t loc_id, n=1; for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for (j = 0; j < 3; j++) { if (make_diffs) buf63[i][j]=0; else buf63[i][j]=n++; } diff --git a/tools/test/h5diff/testfiles/h5diff_58.txt b/tools/test/h5diff/testfiles/h5diff_58.txt index 768dd97..d27a0c9 100644 --- a/tools/test/h5diff/testfiles/h5diff_58.txt +++ b/tools/test/h5diff/testfiles/h5diff_58.txt @@ -1,5 +1,5 @@ dataset: and -Referenced dataset 10720 10720 +Referenced dataset 10784 10784 ------------------------------------------------------------ Region blocks block #0 (2,2)-(7,7) (0,0)-(2,2) diff --git a/tools/test/h5diff/testfiles/h5diff_80.txt b/tools/test/h5diff/testfiles/h5diff_80.txt index 5957d72..836e073 100644 --- a/tools/test/h5diff/testfiles/h5diff_80.txt +++ b/tools/test/h5diff/testfiles/h5diff_80.txt @@ -865,7 +865,7 @@ position vlen3D vlen3D difference [ 3 2 1 ] 59 0 59 59 differences found dataset: and -Referenced dataset 10720 10720 +Referenced dataset 10784 10784 ------------------------------------------------------------ Region blocks block #0 (2,2)-(7,7) (0,0)-(2,2) diff --git a/tools/test/h5diff/testfiles/h5diff_dset1.h5 b/tools/test/h5diff/testfiles/h5diff_dset1.h5 index 123e141..fefd86a 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset1.h5 and b/tools/test/h5diff/testfiles/h5diff_dset1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_dset2.h5 b/tools/test/h5diff/testfiles/h5diff_dset2.h5 index 3ae6993..598e481 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset2.h5 and b/tools/test/h5diff/testfiles/h5diff_dset2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_dset3.h5 b/tools/test/h5diff/testfiles/h5diff_dset3.h5 index 7a1f3dd..893c135 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset3.h5 and b/tools/test/h5diff/testfiles/h5diff_dset3.h5 differ -- cgit v0.12 From 2b2a1d605e0f556fcdf38345420047b5776c7ba2 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 18 May 2017 16:32:26 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 6 ++---- fortran/test/fortranlib_test.F90 | 6 +++--- fortran/test/fortranlib_test_1_8.F90 | 6 +++--- fortran/test/fortranlib_test_F03.F90 | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index d0aeda9..458a3d2 100644 --- a/configure.ac +++ b/configure.ac @@ -919,12 +919,10 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - ## Disable fortran shared libraries on Mac. (MAM - 03/30/11) - + ## tell libtool to do the right thing with COMMON symbols case "`uname`" in Darwin*) - H5_FORTRAN_SHARED="no" - CHECK_WARN="Shared Fortran libraries not currently supported on Mac." + H5_LDFLAGS="$H5_LDFLAGS -Wl,-commons,use_dylibs" ;; esac diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 94b084e..8d5b32b 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -50,11 +50,11 @@ PROGRAM fortranlibtest IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF diff --git a/fortran/test/fortranlib_test_1_8.F90 b/fortran/test/fortranlib_test_1_8.F90 index 850cab9..1306da5 100644 --- a/fortran/test/fortranlib_test_1_8.F90 +++ b/fortran/test/fortranlib_test_1_8.F90 @@ -46,11 +46,11 @@ PROGRAM fortranlibtest CALL h5get_libversion_f(majnum, minnum, relnum, total_error) IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 index ae12dba..9a74120 100644 --- a/fortran/test/fortranlib_test_F03.F90 +++ b/fortran/test/fortranlib_test_F03.F90 @@ -47,11 +47,11 @@ PROGRAM fortranlibtest_F03 CALL h5get_libversion_f(majnum, minnum, relnum, total_error) IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF -- cgit v0.12 From 973aebe25f87b84ff6dd3d9eca51b76643090564 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 May 2017 11:35:07 -0500 Subject: Add debug trace commands --- tools/lib/h5diff_attr.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 004672e..74607da 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -91,7 +91,7 @@ static void table_attrs_free( table_attrs_t *table ) /*------------------------------------------------------------------------- * Function: table_attr_mark_exist * - * Purpose: mark given attribute name to table as sign of exsit + * Purpose: mark given attribute name to table as sign of exist * * Parameter: * - exist [IN] @@ -155,6 +155,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t unsigned i; table_attrs_t *table_lp = NULL; + h5difftrace("build_match_list_attrs start\n"); if(H5Oget_info(loc1_id, &oinfo1) < 0) goto error; if(H5Oget_info(loc2_id, &oinfo2) < 0) @@ -162,6 +163,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t table_attrs_init( &table_lp ); + h5diffdebug3("build_match_list_attrs: %ld - %ld\n", curr1 < oinfo1.num_attrs, curr2 < oinfo2.num_attrs); /*-------------------------------------------------- * build the list @@ -226,6 +228,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) goto error; + h5diffdebug2("build_match_list_attrs #1 name - %s\n", name1); table_attr_mark_exist(infile, name1, table_lp); table_lp->nattrs_only1++; @@ -247,6 +250,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) goto error; + h5diffdebug2("build_match_list_attrs #2 name - %s\n", name2); table_attr_mark_exist(infile, name2, table_lp); table_lp->nattrs_only2++; @@ -278,6 +282,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t *table_out = table_lp; + h5difftrace("build_match_list_attrs end\n"); return 0; error: @@ -286,6 +291,7 @@ error: if (0 < attr2_id) H5Aclose(attr2_id); + h5difftrace("build_match_list_attrs end with error\n"); return -1; } @@ -322,8 +328,8 @@ hsize_t diff_attr(hid_t loc1_id, hid_t space2_id=-1; /* space ID */ hid_t ftype1_id=-1; /* file data type ID */ hid_t ftype2_id=-1; /* file data type ID */ - int vstrtype1=0; /* ftype1 is a variable string */ - int vstrtype2=0; /* ftype2 is a variable string */ + int vstrtype1=0; /* ftype1 is a variable string */ + int vstrtype2=0; /* ftype2 is a variable string */ hid_t mtype1_id=-1; /* memory data type ID */ hid_t mtype2_id=-1; /* memory data type ID */ size_t msize1; /* memory size of memory type */ @@ -346,12 +352,15 @@ hsize_t diff_attr(hid_t loc1_id, hsize_t nfound_total = 0; int j; - table_attrs_t * match_list_attrs = NULL; + table_attrs_t *match_list_attrs = NULL; + h5difftrace("diff_attr start\n"); + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) goto error; /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { + h5difftrace("diff_attr attributes only in one file\n"); /* exit will be 1 */ options->contents = 0; } @@ -359,6 +368,7 @@ hsize_t diff_attr(hid_t loc1_id, for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; + h5diffdebug2("diff_attr name - %s\n", name1); /*-------------- * attribute 1 */ @@ -370,6 +380,7 @@ hsize_t diff_attr(hid_t loc1_id, if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) goto error; + h5difftrace("diff_attr got attributes\n"); /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) goto error; @@ -556,6 +567,7 @@ hsize_t diff_attr(hid_t loc1_id, table_attrs_free(match_list_attrs); + h5difftrace("diff_attr end\n"); return nfound_total; error: @@ -584,6 +596,7 @@ error: } H5E_END_TRY; options->err_stat = 1; + h5difftrace("diff_attr end with error\n"); return nfound_total; } -- cgit v0.12 From 14c286d51a13658ea26673efa3f197af06757cee Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 19 May 2017 14:58:34 -0700 Subject: Fixed HDFFV-10214: * Updated comments in the library to accurately reflect the semantics of the H5FD_FEAT_POSIX_COMPAT_HANDLE flag. * Removed the check for the POSIX compatible handle feature flag when determining if a VFD supports SWMR. Partial work for HDFFV-10197: * Added a new H5FD_FEAT_DEFAULT_VFD_COMPATIBLE feature flag that is set when a VFD creates output that is compatible with the default VFD. Will be used in the testing but might also be generally useful to users. --- src/H5FDcore.c | 8 +++++--- src/H5FDdirect.c | 1 + src/H5FDlog.c | 3 ++- src/H5FDmpio.c | 9 +++++---- src/H5FDpublic.h | 8 ++++++++ src/H5FDsec2.c | 3 ++- src/H5FDstdio.c | 9 +++++---- src/H5Fint.c | 4 ---- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index d100a8b..b980b7e 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -982,9 +982,11 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */ *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */ - /* If the backing store is open, a POSIX file handle is available */ - if(file && file->fd >= 0 && file->backing_store) - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + /* These feature flags are only applicable if the backing store is enabled */ + if(file && file->fd >= 0 && file->backing_store) { + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ + } } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 1487cda..7a4c99c 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -698,6 +698,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75333c2..7c6bbd4 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -895,8 +895,9 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index ace91f8..f594d8e 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1150,10 +1150,11 @@ H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ - *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ + *flags |= H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 3032e8a..45b1237 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -250,6 +250,14 @@ typedef enum H5F_mem_t H5FD_mem_t; * This is specifically used for the multi/split driver. */ #define H5FD_FEAT_PAGED_AGGR 0x00004000 + /* + * Defining H5FD_FEAT_DEFAULT_VFD_COMPATIBLE for a VFL driver + * that creates a file which is compatible with the default VFD. + * Generally, this means that the VFD creates a single file that follows + * the canonical HDF5 file format. + */ +#define H5FD_FEAT_DEFAULT_VFD_COMPATIBLE 0x00008000 + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 26913e2..b6385fb 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -527,8 +527,9 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 5023af3..861c6a6 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -555,10 +555,11 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long /*OUT*/ *flags) */ if(flags) { *flags = 0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ - *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } return 0; diff --git a/src/H5Fint.c b/src/H5Fint.c index fe532b2..e52d539 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -715,10 +715,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use a SWMR-compatible VFD when SWMR is specified") - /* Require a POSIX compatible VFD to use SWMR feature */ - /* (It's reasonable to try to expand this to other VFDs eventually -QAK) */ - if(!H5F_HAS_FEATURE(f, H5FD_FEAT_POSIX_COMPAT_HANDLE) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use POSIX compatible VFD with SWMR write access") if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get free space type mapping from VFD") if(H5MF_init_merge_flags(f) < 0) -- cgit v0.12 From cdcef539a3d359c8a7082923b947d920d738cd56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 May 2017 13:10:40 -0500 Subject: HDFFV-8611 change h5repack to save the root group creation order Added test and new arguments to control the the input file parsing. --- MANIFEST | 1 + tools/lib/h5tools.c | 4 + tools/lib/h5tools.h | 4 + tools/src/h5dump/h5dump.h | 4 - tools/src/h5dump/h5dump_extern.h | 4 - tools/src/h5repack/h5repack.c | 2 + tools/src/h5repack/h5repack.h | 24 +++--- tools/src/h5repack/h5repack_copy.c | 39 +++++++--- tools/src/h5repack/h5repack_main.c | 87 ++++++++++++++++++++-- tools/src/h5repack/h5repack_verify.c | 17 +++-- tools/test/h5repack/CMakeTests.cmake | 9 ++- .../h5repack/testfiles/crtorder.tordergr.h5.ddl | 36 +++++++++ tools/test/h5repack/testfiles/h5repack-help.txt | 4 + 13 files changed, 191 insertions(+), 44 deletions(-) create mode 100644 tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl diff --git a/MANIFEST b/MANIFEST index dde7632..c34e614 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2432,6 +2432,7 @@ ./tools/test/h5repack/testfiles/h5repack_soffset.h5 ./tools/test/h5repack/testfiles/h5repack_szip.h5 ./tools/test/h5repack/testfiles/ublock.bin +./tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl ./tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl ./tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst ./tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index a74fdd2..22fd863 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -51,6 +51,10 @@ unsigned packed_data_length; /* length of packed bits to display */ unsigned long long packed_data_mask; /* mask in which packed bits to display */ int enable_error_stack= FALSE; /* re-enable error stack */ +/* sort parameters */ +H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ +H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ + /* module-scoped variables */ static int h5tools_init_g; /* if h5tools lib has been initialized */ diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index c5e750a..3d38dd0 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -568,6 +568,10 @@ H5TOOLS_DLLVAR int oid_output; /* oid output */ H5TOOLS_DLLVAR int data_output; /* data output */ H5TOOLS_DLLVAR int attr_data_output; /* attribute data output */ +/* sort parameters */ +H5TOOLS_DLLVAR H5_index_t sort_by; /*sort_by [creation_order | name] */ +H5TOOLS_DLLVAR H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ + /* things to display or which are set via command line parameters */ H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack */ diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index 211fd14..801f60d 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -78,10 +78,6 @@ int include_attrs = TRUE; /* Display attributes */ int display_vds_first = FALSE; /* vds display to all by default*/ int vds_gap_size = 0; /* vds skip missing files default is none */ -/* sort parameters */ -H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ -H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ - #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX (8*sizeof(long long)) /* Maximum bits size of integer types of packed-bits */ /* mask list for packed bits */ diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h index 22aca73..00d3bd2 100644 --- a/tools/src/h5dump/h5dump_extern.h +++ b/tools/src/h5dump/h5dump_extern.h @@ -77,10 +77,6 @@ extern int include_attrs; /* Display attributes */ extern int display_vds_first; /* vds display to first missing */ extern int vds_gap_size; /* vds skip missing files */ -/* sort parameters */ -extern H5_index_t sort_by; /*sort_by [creation_order | name] */ -extern H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ - #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX 8*sizeof(long long) /* Maximum bits size of integer types of packed-bits */ /* mask list for packed bits */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 3c9ce90..bc8527b 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -784,6 +784,8 @@ static int check_objects(const char* fname, pack_opt_t *options) { *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index e36f0ef..e5ae03f 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -29,10 +29,10 @@ #define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */ /* File space default information */ -#define FS_PAGESIZE_DEF 4096 -#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR -#define FS_PERSIST_DEF FALSE -#define FS_THRESHOLD_DEF 1 +#define FS_PAGESIZE_DEF 4096 +#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define FS_PERSIST_DEF FALSE +#define FS_THRESHOLD_DEF 1 /*------------------------------------------------------------------------- @@ -120,10 +120,10 @@ typedef struct { hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ hsize_t threshold; /* alignment threshold for H5Pset_alignment */ hsize_t alignment; /* alignment for H5Pset_alignment */ - H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ - int fs_persist; /* Free space section threshold */ - long fs_threshold; /* Free space section threshold */ - long long fs_pagesize; /* File space page size */ + H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ + int fs_persist; /* Free space section threshold */ + long fs_threshold; /* Free space section threshold */ + long long fs_pagesize; /* File space page size */ } pack_opt_t; @@ -150,10 +150,10 @@ int h5repack_end(pack_opt_t *options); int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options); int h5repack_cmp_pl(const char *fname1, const char *fname2); -/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() - * and struct named_dt_t were located in h5repack_copy.c as static prior to - * bugfix1726. - * Made shared functions as copy_attr() was needed in h5repack_refs.c. +/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() + * and struct named_dt_t were located in h5repack_copy.c as static prior to + * bugfix1726. + * Made shared functions as copy_attr() was needed in h5repack_refs.c. * However copy_attr() may be obsoleted when H5Acopy is available and put back * others to static in h5repack_copy.c. */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index ec3e287..42fedbc 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -103,6 +103,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) hbool_t in_persist; /* Persist free-space status from input file */ hsize_t in_threshold; /* Free-space section threshold from input file */ hsize_t in_pagesize; /* File space page size from input file */ + unsigned crt_order_flags; /* group creation order flag */ /*------------------------------------------------------------------------- * open input file @@ -116,6 +117,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* get user block size and file space strategy/persist/threshold */ { hid_t fcpl_in; /* file creation property list ID for input file */ + hid_t grp_in = -1; /* group ID */ + hid_t gcpl_in = -1; /* group creation property list */ if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) { error_msg("failed to retrieve file creation property list\n"); @@ -127,17 +130,28 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } - /* If the -S option is not set, get "strategy" from the input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -S option is not set, get "strategy" from the input file */ + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + error_msg("failed to retrieve file space strategy\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } - /* If the -G option is not set, get "pagesize" from the input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -G option is not set, get "pagesize" from the input file */ + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + error_msg("failed to retrieve file space threshold\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } + /* open root group */ + if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + + /* get root group creation property list */ + if ((gcpl_in = H5Gget_create_plist(grp_in)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); + + /* query and set the group creation properties */ + if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed"); if (H5Pclose(fcpl_in) < 0) { error_msg("failed to close property list\n"); @@ -309,6 +323,9 @@ print_user_block(fnamein, fidin); } } + if(H5Pset_link_creation_order(fcpl, crt_order_flags ) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_creation_order failed"); + /* Set file space info to those from input file */ set_strategy = in_strategy; set_persist = in_persist; @@ -375,6 +392,8 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 339dc83..31b1e14 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -31,7 +31,7 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:E"; +static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -56,6 +56,8 @@ static struct long_options l_opts[] = { { "fs_persist", require_arg, 'P' }, { "fs_threshold", require_arg, 'T' }, { "fs_pagesize", require_arg, 'G' }, + { "sort_by", require_arg, 'q' }, + { "sort_order", require_arg, 'z' }, { "enable-error-stack", no_arg, 'E' }, { NULL, 0, '\0' } }; @@ -90,6 +92,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size\n"); PRINTVALSTREAM(rawoutstream, " -t T, --threshold=T Threshold value for H5Pset_alignment\n"); PRINTVALSTREAM(rawoutstream, " -a A, --alignment=A Alignment value for H5Pset_alignment\n"); + PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); + PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); PRINTVALSTREAM(rawoutstream, " -f FILT, --filter=FILT Filter type\n"); PRINTVALSTREAM(rawoutstream, " -l LAYT, --layout=LAYT Layout type\n"); PRINTVALSTREAM(rawoutstream, " -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy\n"); @@ -103,6 +107,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " U - is a filename.\n"); PRINTVALSTREAM(rawoutstream, " T - is an integer\n"); PRINTVALSTREAM(rawoutstream, " A - is an integer greater than zero\n"); + PRINTVALSTREAM(rawoutstream, " Q - is the sort index type for the input file. It can be \"name\" or \"creation_order\" (default)\n"); + PRINTVALSTREAM(rawoutstream, " Z - is the sort order type for the input file. It can be \"descending\" or \"ascending\" (default)\n"); PRINTVALSTREAM(rawoutstream, " B - is the user block size, any value that is 512 or greater and is\n"); PRINTVALSTREAM(rawoutstream, " a power of 2 (1024 default)\n"); PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of fs_persist = HDatoi( opt_arg ); + options->fs_persist = HDatoi(opt_arg); if(options->fs_persist == 0) /* To distinguish the "specified" zero value */ options->fs_persist = -1; break; case 'T': - options->fs_threshold = HDatol( opt_arg ); + options->fs_threshold = HDatol(opt_arg); if(options->fs_threshold == 0) /* To distinguish the "specified" zero value */ options->fs_threshold = -1; @@ -570,12 +622,30 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0); if(options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ - options->fs_pagesize = -1; + options->fs_pagesize = -1; break; - case 'E': - enable_error_stack = TRUE; - break; + case 'q': + if((sort_by = set_sort_by(opt_arg)) < 0) { + error_msg(" failed to set sort by form <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'z': + if((sort_order = set_sort_order(opt_arg)) < 0) { + error_msg(" failed to set sort order form <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'E': + enable_error_stack = TRUE; + break; default: break; @@ -644,6 +714,9 @@ int main(int argc, const char **argv) /* initialize options */ h5repack_init(&options, 0, FALSE); + /* Initialize default indexing options */ + sort_by = H5_INDEX_CRT_ORDER; + if (parse_command_line(argc, argv, &options) < 0) goto done; diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 7e79aa7..4ff4875 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -55,11 +55,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options trav_table_t *travt = NULL; int ok = 1; hid_t fcpl_in = -1; /* file creation property for input file */ - hid_t fcpl_out = -1; /* file creation property for output file */ - H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */ - hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ - hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ - hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ + hid_t fcpl_out = -1; /* file creation property for output file */ + H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */ + hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ + hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ + hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ /* open the output file */ if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) @@ -122,6 +122,8 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if(options->all_filter == 1 || options->all_layout == 1) { + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); @@ -455,6 +457,9 @@ int h5repack_cmp_pl(const char *fname1, * get file table list of objects *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); + /* init table */ trav_table_init(&trav); if(h5trav_gettable(fid1, trav) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); @@ -643,7 +648,7 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) { case H5Z_FILTER_NONE: - break; + break; case H5Z_FILTER_SHUFFLE: /* 1 private client value is returned by DCPL */ diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 04e405f..897209c 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -90,6 +90,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tfamily00008.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00009.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00010.h5 + ${HDF5_TOOLS_DIR}/testfiles/tordergr.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -137,6 +138,7 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v.ddl ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v.ddl ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5.ddl ) foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) @@ -312,7 +314,7 @@ NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" + -D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" @@ -965,6 +967,11 @@ endif () ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) +#crtorder + set (arg tordergr.h5 -L) + set (TESTTYPE "TEST") + ADD_H5_DMP_TEST (crtorder ${TESTTYPE} 0 ${arg}) + ######################################################### # layout options (these files have no filters) ######################################################### diff --git a/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl b/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl new file mode 100644 index 0000000..870d154 --- /dev/null +++ b/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl @@ -0,0 +1,36 @@ +HDF5 "out-crtorder.tordergr.h5" { +GROUP "/" { + GROUP "2" { + GROUP "a" { + GROUP "a1" { + } + GROUP "a2" { + GROUP "a21" { + } + GROUP "a22" { + } + } + } + GROUP "b" { + } + GROUP "c" { + } + } + GROUP "1" { + GROUP "c" { + } + GROUP "b" { + } + GROUP "a" { + GROUP "a1" { + } + GROUP "a2" { + GROUP "a22" { + } + GROUP "a21" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 69b1644..65edd89 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -17,6 +17,8 @@ usage: h5repack [OPTIONS] file1 file2 -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size -t T, --threshold=T Threshold value for H5Pset_alignment -a A, --alignment=A Alignment value for H5Pset_alignment + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z -f FILT, --filter=FILT Filter type -l LAYT, --layout=LAYT Layout type -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy @@ -30,6 +32,8 @@ usage: h5repack [OPTIONS] file1 file2 U - is a filename. T - is an integer A - is an integer greater than zero + Q - is the sort index type for the input file. It can be "name" or "creation_order" (default) + Z - is the sort order type for the input file. It can be "descending" or "ascending" (default) B - is the user block size, any value that is 512 or greater and is a power of 2 (1024 default) F - is the shared object header message type, any of Date: Mon, 22 May 2017 13:24:53 -0500 Subject: Remove obsolete function --- tools/lib/h5tools_type.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index b57e274..ae7160b 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -15,38 +15,6 @@ #include "h5tools.h" /*------------------------------------------------------------------------- - * Function: h5tools_get_native_type - * - * Purpose: Wrapper around H5Tget_native_type() to work around - * Problems with bitfields. - * - * Return: Success: datatype ID - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, October 5, 2004 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -hid_t -h5tools_get_native_type(hid_t type) -{ - hid_t p_type; - H5T_class_t type_class; - - type_class = H5Tget_class(type); - if(type_class==H5T_BITFIELD) - p_type=H5Tcopy(type); - else - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); - - return(p_type); -} - -/*------------------------------------------------------------------------- * Function: h5tools_get_little_endian_type * * Purpose: Get a little endian type from a file type -- cgit v0.12 From 0f81f23d69f64d2a508200e6f927e977333c8ba1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 May 2017 13:55:15 -0500 Subject: HDFFV-8611 add autotools test --- tools/test/h5repack/h5repack.sh.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e479031..bc6b527 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -113,6 +113,7 @@ $SRC_TOOLS_TESTFILES/tfamily00007.h5 $SRC_TOOLS_TESTFILES/tfamily00008.h5 $SRC_TOOLS_TESTFILES/tfamily00009.h5 $SRC_TOOLS_TESTFILES/tfamily00010.h5 +$SRC_TOOLS_TESTFILES/tordergr.h5 $SRC_TOOLS_TESTFILES/vds/1_a.h5 $SRC_TOOLS_TESTFILES/vds/1_b.h5 $SRC_TOOLS_TESTFILES/vds/1_c.h5 @@ -143,6 +144,7 @@ $SRC_H5REPACK_TESTFILES/h5repack-help.txt $SRC_H5REPACK_TESTFILES/h5repack_ext.bin $SRC_H5REPACK_TESTFILES/ublock.bin $SRC_H5REPACK_TESTFILES/h5repack.info +$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl $SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl $SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl $SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst @@ -684,7 +686,7 @@ TOOLTEST_DUMP() VERIFY h5dump output $@ ( cd $TESTDIR - $RUNSERIAL $H5DUMP_BIN -pH $outfile + $RUNSERIAL $H5DUMP_BIN -q creation_order -pH $outfile ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -1051,6 +1053,10 @@ else TOOLTEST deflate_file $arg fi +#crtorder +arg="tordergr.h5 -L" +TOOLTEST_DUMP crtorder $arg + ######################################################### # layout options (these files have no filters) ######################################################### -- cgit v0.12 From 97ac37592b75b1f799f9b24a71ced0fa85925086 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 22 May 2017 15:45:17 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 458a3d2..d8e9b9e 100644 --- a/configure.ac +++ b/configure.ac @@ -3482,6 +3482,12 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc + ## tell libtool to pass the correct argument linker, needed only for intel compiler. + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv libtool.tmp libtool && chmod 755 libtool + ;; + esac fi if test "X$HDF_CXX" = "Xyes"; then -- cgit v0.12 From 6301d5a6cb7527f7f2eed0d60d1faaf154ed9976 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 22 May 2017 16:03:56 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d8e9b9e..b6f37bc 100644 --- a/configure.ac +++ b/configure.ac @@ -3482,10 +3482,11 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## tell libtool to pass the correct argument linker, needed only for intel compiler. + ## tell libtool to pass the correct argument linker, needed only for intel compiler. This script + ## replaces the 3rd occurance, which is for Fortran, of wl="" with wl="-Wl," case "`uname`" in Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool ;; esac fi -- cgit v0.12 From 69ccaee00a2778c7334587b6f6d51e16ff674ec9 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 23 May 2017 09:53:59 -0500 Subject: add documention comments for shared Fortran Fix on OSX --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b6f37bc..9695fe3 100644 --- a/configure.ac +++ b/configure.ac @@ -918,12 +918,13 @@ H5_FORTRAN_SHARED="no" if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - - ## tell libtool to do the right thing with COMMON symbols + ## tell libtool to do the right thing with COMMON symbols, this fixes + ## corrupt values with COMMON and EQUIVALENCE when building shared + ## Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). case "`uname`" in Darwin*) H5_LDFLAGS="$H5_LDFLAGS -Wl,-commons,use_dylibs" - ;; + ;; esac ## Report results of check(s) @@ -3482,8 +3483,9 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## tell libtool to pass the correct argument linker, needed only for intel compiler. This script - ## replaces the 3rd occurance, which is for Fortran, of wl="" with wl="-Wl," + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) case "`uname`" in Darwin*) cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool -- cgit v0.12 From 8f25e21e105c2ed625c60e92f4d24ac4c0965219 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 10:14:35 -0700 Subject: enabled MPI error handling --- src/H5FDmpi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index fdc4eca..2b10151 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -278,6 +278,11 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf info_dup = info; } + /* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal, + and return codes can be checked and handled. May 23, 2017 FTW */ + if (MPI_SUCCESS != (mpi_code = MPI_Errhandler_set(comm_dup, MPI_ERRORS_RETURN))) + HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) + /* copy them to the return arguments */ *comm_new = comm_dup; *info_new = info_dup; -- cgit v0.12 From 364fe58feab9ae7296b204df2ecce388975da57e Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 10:20:37 -0700 Subject: cleanup --- this_is_a_test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 this_is_a_test diff --git a/this_is_a_test b/this_is_a_test deleted file mode 100644 index e69de29..0000000 -- cgit v0.12 From 57ab1e7d6945c45107ebdd945bb89951ec90b8f1 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 23 May 2017 17:14:21 -0500 Subject: add linking flag to cmake, does not fix the issue, still disabled shared with fortran --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce91052..b84cc7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -851,6 +851,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) if (BUILD_SHARED_LIBS AND APPLE) + # Tell cmake to do the right thing with COMMON symbols, this fixes + # corrupt values with COMMON and EQUIVALENCE when building shared + # Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). + # *** NOTE: Fix does not work with Cmake. *** + # set (HDF5_LINKER_FLAGS "-Wl,-commons,use_dylibs") if (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") set (SKIP_HDF5_FORTRAN_SHARED ON) -- cgit v0.12 From 1ee90786196c10c2c616a9fb4b8b1f92ebefa1f2 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 19:01:52 -0700 Subject: updated MPI error handling call for MPICH2 standard --- src/H5FDmpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 2b10151..3f0160e 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -280,7 +280,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf /* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal, and return codes can be checked and handled. May 23, 2017 FTW */ - if (MPI_SUCCESS != (mpi_code = MPI_Errhandler_set(comm_dup, MPI_ERRORS_RETURN))) + if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN))) HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) /* copy them to the return arguments */ -- cgit v0.12 From e3b22b8fa45697d6f73330b33cd201c37e0335d6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 06:51:45 -0400 Subject: Initialized IDs to -1 and minor code tidy. --- test/swmr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/swmr.c b/test/swmr.c index 399a9ec..5b50d63 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,12 +116,12 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl; /* File access property list */ - hid_t file_fapl; /* The file's access property list */ - hid_t fid, fid1, fid2; /* File IDs */ - unsigned attempts; /* The # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; /* File access property list */ + hid_t file_fapl = -1; /* The file's access property list */ + hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ + unsigned attempts; /* The # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ TESTING("H5Pget/set_metadata_read_attempts()"); -- cgit v0.12 From e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 07:44:18 -0400 Subject: * Made H5FD_driver_query() a private function instead of static. * Moved H5FD_driver_query() to H5FDint.c. * Minor typo fixes in H5I.c. * Updated swmr.c to check the VFD feature flags and skip the retries test when the VFD is not compatible with H5P_DEFAULT. --- src/H5FD.c | 37 ------------------------------------- src/H5FDint.c | 37 +++++++++++++++++++++++++++++++++++++ src/H5FDprivate.h | 1 + src/H5I.c | 4 ++-- test/swmr.c | 36 ++++++++++++++++++++++++++++++------ 5 files changed, 70 insertions(+), 45 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index dcfaa6d..d3cb77c 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -62,7 +62,6 @@ /********************/ static herr_t H5FD_free_cls(H5FD_class_t *cls); static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/); -static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); /*********************/ /* Package Variables */ @@ -1085,42 +1084,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) /*------------------------------------------------------------------------- -* Function: H5FD_driver_query -* -* Purpose: Similar to H5FD_query(), but intended for cases when we don't -* have a file available (e.g. before one is opened). Since we -* can't use the file to get the driver, the driver is passed in -* as a parameter. -* -* Return: Success: non-negative -* Failure: negative -* -* Programmer: Jacob Gruber -* Wednesday, August 17, 2011 -* -*------------------------------------------------------------------------- -*/ -static int -H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) -{ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(driver); - HDassert(flags); - - /* Check for the driver to query and then query it */ - if(driver->query) - ret_value = (driver->query)(NULL, flags); - else - *flags = 0; - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_driver_query() */ - - -/*------------------------------------------------------------------------- * Function: H5FDalloc * * Purpose: Allocates SIZE bytes of memory from the FILE. The memory will diff --git a/src/H5FDint.c b/src/H5FDint.c index bc322d6..ccf0f2e 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -433,3 +433,40 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_get_eof() */ + +/*------------------------------------------------------------------------- +* Function: H5FD_driver_query +* +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver is passed in +* as a parameter. +* +* Return: Success: non-negative +* Failure: negative +* +* Programmer: Jacob Gruber +* Wednesday, August 17, 2011 +* +*------------------------------------------------------------------------- +*/ +int +H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) +{ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(driver); + HDassert(flags); + + /* Check for the driver to query and then query it */ + if(driver->query) + ret_value = (driver->query)(NULL, flags); + else + *flags = 0; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_driver_query() */ + + diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 0fc2135..589e391 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -153,6 +153,7 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); +H5_DLL int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, diff --git a/src/H5I.c b/src/H5I.c index ce4ecdc..42edf58 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -888,7 +888,7 @@ H5I_subst(hid_t id, const void *new_object) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end if */ +} /* end H5I_subst() */ /*------------------------------------------------------------------------- @@ -920,7 +920,7 @@ H5I_object(hid_t id) } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end if */ +} /* end H5I_object() */ /*------------------------------------------------------------------------- diff --git a/test/swmr.c b/test/swmr.c index 5b50d63..9239ca2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,16 +116,40 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl = -1; /* File access property list */ - hid_t file_fapl = -1; /* The file's access property list */ - hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ - unsigned attempts; /* The # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; /* File access property list */ + hid_t file_fapl = -1; /* The file's access property list */ + hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ + hid_t driver_id = -1; /* ID for this VFD */ + H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ + unsigned long driver_flags = 0; /* VFD feature flags */ + hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ + unsigned attempts; /* The # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ TESTING("H5Pget/set_metadata_read_attempts()"); + /* Check if the driver is compatible with the default VFD. + * Most of the tests will attempt to create and open files with both the + * VFD specified in the passed-in fapl and the default VFD. Since this + * will clearly not work with VFDs that are not compatible with the default + * fapl (e.g.: split/multi), we just skip this entire test. + */ + if ((driver_id = H5Pget_driver(in_fapl)) < 0) + FAIL_STACK_ERROR + if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) + FAIL_STACK_ERROR + if (H5FD_driver_query(driver, &driver_flags) < 0) + FAIL_STACK_ERROR + compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE; + + if (!compat_w_default_vfd) { + SKIPPED() + HDputs(" The current VFD is not compatible with the default VFD."); + return 0; + } + /* Get a copy of the parameter fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR -- cgit v0.12 From 479f326a267ca5ffacc2012f33674c66cf2907d8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 09:41:26 -0400 Subject: * Added new public H5FDdriver_query() API call. * Changed return type of H5FD_driver_query() to herr_t. * Updated swmr.c to use H5FDdriver_query() instead of the private call. * Added some flags tests to vfd.c. --- src/H5FD.c | 42 +++++++++++++++++++++++++++++++++++++++++- src/H5FDint.c | 8 +++----- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 3 +++ test/swmr.c | 5 +---- test/vfd.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 11 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index d3cb77c..67cf963 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -789,7 +789,8 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") /* Query driver flag */ - H5FD_driver_query(driver, &driver_flags); + if(H5FD_driver_query(driver, &driver_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't query VFD flags") /* Get initial file image info */ if(H5P_peek(plist, H5F_ACS_FILE_IMAGE_INFO_NAME, &file_image_info) < 0) @@ -2039,3 +2040,42 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_set_paged_aggr() */ + + +/*------------------------------------------------------------------------- +* Function: H5FDdriver_query +* +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver ID is passed +* in as a parameter. +* +* Return: SUCCEED/FAIL +* +* Programmer: Jacob Gruber +* Wednesday, August 17, 2011 +* +*------------------------------------------------------------------------- +*/ +herr_t +H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/) +{ + H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ix", driver_id, flags); + + if(NULL == flags) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flags parameter cannot be NULL") + + /* Check for the driver to query and then query it */ + if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a VFL ID") + if (H5FD_driver_query(driver, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "driver flag query failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5FDdriver_query() */ + diff --git a/src/H5FDint.c b/src/H5FDint.c index ccf0f2e..52fbc23 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -442,18 +442,17 @@ done: * can't use the file to get the driver, the driver is passed in * as a parameter. * -* Return: Success: non-negative -* Failure: negative +* Return: SUCCEED/FAIL * * Programmer: Jacob Gruber * Wednesday, August 17, 2011 * *------------------------------------------------------------------------- */ -int +herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) { - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -469,4 +468,3 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_driver_query() */ - diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 589e391..e758951 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -153,7 +153,7 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); -H5_DLL int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); +H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 45b1237..514d1bf 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -384,6 +384,9 @@ H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw); H5_DLL herr_t H5FDunlock(H5FD_t *file); +/* Allows querying a VFD ID for features before the file is opened */ +H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/); + #ifdef __cplusplus } #endif diff --git a/test/swmr.c b/test/swmr.c index 9239ca2..3b1bd09 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -120,7 +120,6 @@ test_metadata_read_attempts(hid_t in_fapl) hid_t file_fapl = -1; /* The file's access property list */ hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ hid_t driver_id = -1; /* ID for this VFD */ - H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ unsigned long driver_flags = 0; /* VFD feature flags */ hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ unsigned attempts; /* The # of read attempts */ @@ -138,9 +137,7 @@ test_metadata_read_attempts(hid_t in_fapl) */ if ((driver_id = H5Pget_driver(in_fapl)) < 0) FAIL_STACK_ERROR - if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) - FAIL_STACK_ERROR - if (H5FD_driver_query(driver, &driver_flags) < 0) + if (H5FDdriver_query(driver_id, &driver_flags) < 0) FAIL_STACK_ERROR compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE; diff --git a/test/vfd.c b/test/vfd.c index 1932d2c..213cd9c 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -86,6 +86,8 @@ test_sec2(void) hid_t fid = -1; /* file ID */ hid_t fapl_id = -1; /* file access property list ID */ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; /* filename */ void *os_file_handle = NULL; /* OS file handle */ hsize_t file_size; /* file size */ @@ -102,6 +104,28 @@ test_sec2(void) if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + /* Retrieve the access property list... */ if((fapl_id_out = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -174,6 +198,8 @@ test_core(void) hid_t fid = -1; /* file ID */ hid_t fapl_id = -1; /* file access property list ID */ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ hid_t did = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ char filename[1024]; /* filename */ @@ -219,6 +245,28 @@ test_core(void) if(HDaccess(filename, F_OK) != -1) FAIL_PUTS_ERROR("file created when backing store set to FALSE"); + /* Check that the VFD feature flags are correct. + * Note that the H5FDdriver_query() API call does not require a file + * so backing-store related flags will not be returned here. + */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_ALLOW_FILE_IMAGE + | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) + TEST_ERROR /************************************************************************ * Check basic core VFD operation and properties. This is done with the -- cgit v0.12 From 8807f918b9b00916efa822dda0301d3aa9debd80 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 16:13:12 -0400 Subject: Added missing casts for the return value of H5I_object_verify(). --- src/H5S.c | 2 +- src/H5Shyper.c | 12 ++++++------ src/H5Zszip.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/H5S.c b/src/H5S.c index dd390d9..9ac40a7 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1544,7 +1544,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) H5TRACE3("e", "i*x*z", obj_id, buf, nalloc); /* Check argument and retrieve object */ - if (NULL==(dspace=(H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE))) + if (NULL == (dspace = (H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(H5S_encode(dspace, (unsigned char **)&buf, nalloc)<0) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index e6e6cff..9263cd8 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -7571,7 +7571,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ - if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if (H5S_SCALAR==H5S_GET_EXTENT_TYPE(space)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space") @@ -7640,7 +7640,7 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ - if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(start==NULL || count==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified") @@ -7768,9 +7768,9 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5TRACE3("i", "iSsi", space1_id, op, space2_id); /* Check args */ - if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE))) + if (NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE))) + if (NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(!(op>H5S_SELECT_NOOP && opH5S_SELECT_NOOP && op Date: Thu, 25 May 2017 06:45:53 -0400 Subject: Fixed many minor warnings. --- hl/test/test_dset_opt.c | 2 +- hl/test/test_packet_vlen.c | 77 +++++++------- hl/tools/h5watch/extend_dset.c | 60 +++++------ src/H5Dint.c | 200 ++++++++++++++++++----------------- src/H5Dio.c | 1 - src/H5FDspace.c | 2 - src/H5MFdbg.c | 50 ++++----- src/H5MFsection.c | 2 +- src/H5Ocache_image.c | 2 +- test/flushrefresh.c | 1 + test/mf.c | 4 + test/plugin.c | 8 +- test/swmr_remove_writer.c | 2 +- test/use_common.c | 14 ++- tools/lib/h5diff_array.c | 12 +-- tools/src/h5repack/h5repack_verify.c | 2 +- 16 files changed, 225 insertions(+), 214 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 4b5fa19..383a87a 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -47,7 +47,7 @@ #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) +#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0)) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 35bd43a..1d6231e 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -928,64 +928,60 @@ error: /* An error has occurred. Clean up and exit. */ * 2016/01/27 -BMR *------------------------------------------------------------------------- */ -static herr_t verify_accessors(hid_t fid, const char *table_name, herr_t expected_value) +static herr_t verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) { - hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */ - hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */ - hid_t dtype_id=H5I_INVALID_HID; /* Dataset identifier */ + hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */ + hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */ + hid_t dtype_id = H5I_INVALID_HID; /* Dataset identifier */ char buf[NAME_BUF_SIZE]; ssize_t name_size; - herr_t is_varlen = 0; - herr_t ret = FAIL; /* Returned status from a callee */ + htri_t vlen_check_result = -1; /* Open the named packet table. */ - ptable = H5PTopen(fid, table_name); - if (ptable < 0) - goto error; + if((ptable = H5PTopen(fid, table_name)) < 0) + goto error; /* Get the associated dataset ID. */ - dset_id = H5PTget_dataset(ptable); - if (dset_id < 0) - goto error; + if((dset_id = H5PTget_dataset(ptable)) < 0) + goto error; /* Check if the packet table's name matches its associated dataset's. */ *buf = '\0'; - name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE); - if (name_size < 0) - goto error; + if((name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE)) < 0) + goto error; VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match"); /* Get the packet table's datatype ID */ - dtype_id = H5PTget_type(ptable); - if (dtype_id < 0) - goto error; + if((dtype_id = H5PTget_type(ptable)) < 0) + goto error; /* Check if the type class matches that of the packet table. */ - is_varlen = H5Tdetect_class(dtype_id, H5T_VLEN); - if (is_varlen == FAIL) /* failure occurred */ - goto error; - else if (is_varlen == expected_value) /* length types match */ - ret = SUCCEED; - else /* length types don't match */ - { - /* Give lengthtype "fixed-length" or "variable-length" depending on the - expected_value passed in, then print the error message. */ - char lenthtype[20]; - HDstrcpy(lenthtype, "fixed-length"); - if (expected_value == 1) - HDstrcpy(lenthtype, "variable-length"); - fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); - ret = FAIL; + if((vlen_check_result = H5Tdetect_class(dtype_id, H5T_VLEN)) < 0) + goto error; + + /* Check if length types match */ + if (vlen_check_result != (htri_t)uses_vlen_type) { + /* Give lengthtype "fixed-length" or "variable-length" depending on the + * expected_value passed in, then print the error message. + */ + char lenthtype[20]; + if (uses_vlen_type == TRUE) + HDstrcpy(lenthtype, "variable-length"); + else + HDstrcpy(lenthtype, "fixed-length"); + HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); + goto error; } /* Close the packet table */ if (H5PTclose(ptable) < 0) - goto error; + goto error; return SUCCEED; error: /* An error has occurred. Clean up and exit. */ - if (H5PTis_valid(ptable) > 0) H5PTclose(ptable); + if (H5PTis_valid(ptable) > 0) + H5PTclose(ptable); H5_FAILED(); return FAIL; } /* verify_accessors */ @@ -1010,25 +1006,26 @@ static int test_accessors(void) /* Open the file */ fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); if (fid < 0) - goto error; + goto error; ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE); if (ret < 0) - goto error; + goto error; ret = verify_accessors(fid, PT_FIXED_LEN, FALSE); if (ret < 0) - goto error; + goto error; /* Close the file */ if (H5Fclose(fid) < 0) - goto error; + goto error; PASSED(); return SUCCEED; error: /* An error has occurred. Clean up and exit. */ - if (fid > 0) H5Fclose(fid); + if (fid > 0) + H5Fclose(fid); H5_FAILED(); return FAIL; } /* test_accessors */ diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 957db10..4299586 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -78,7 +78,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) hid_t sid = -1; /* dataspace id */ hid_t dtid = -1; /* dataset's datatype id */ int ndims; /* # of dimension sizes */ - unsigned i, j; /* local index variable */ + unsigned i; /* local index variable */ hsize_t ext_dims[2]; /* new dimension sizes after extension */ hsize_t cur_dims[2]; /* current dimension sizes */ size_t dtype_size; /* size of the dataset's datatype */ @@ -144,23 +144,23 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) goto error; num_elmts = 1; - for(j = 0; j < (unsigned)ndims; j++) - num_elmts *= (unsigned)ext_dims[j]; + for(i = 0; i < (unsigned)ndims; i++) + num_elmts *= (unsigned)ext_dims[i]; /* Compound type */ if(!HDstrcmp(dname, DSET_CMPD_TWO)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < num_elmts; j++) { - cbuf[j].field1 = action1; - cbuf[j].field2.a = action1; - cbuf[j].field2.c = action1; - cbuf[j].field2.b.a = action1; - cbuf[j].field2.b.b = action1; - cbuf[j].field2.b.c = action1; - cbuf[j].field3 = action1; - cbuf[j].field4.a = action1; - cbuf[j].field4.b = action1; + for(i = 0; i < num_elmts; i++) { + cbuf[i].field1 = action1; + cbuf[i].field2.a = action1; + cbuf[i].field2.c = action1; + cbuf[i].field2.b.a = action1; + cbuf[i].field2.b.b = action1; + cbuf[i].field2.b.c = action1; + cbuf[i].field3 = action1; + cbuf[i].field4.a = action1; + cbuf[i].field4.b = action1; } /* end for */ /* Write to the dataset */ @@ -169,8 +169,8 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < num_elmts; j++) - ibuf[j] = action1; + for(i = 0; i < num_elmts; i++) + ibuf[i] = action1; /* Write to the dataset */ if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) @@ -225,7 +225,7 @@ extend_dset_one(const char *file, char *dname, int action) hid_t dtid = -1; /* dataset's datatype id */ hid_t sid = -1; /* dataspace id */ hid_t mid = -1; /* memory space id */ - unsigned i, j; /* local index variable */ + unsigned i; /* local index variable */ hsize_t cur_dims[1]; /* current dimension sizes */ hsize_t ext_dims[1]; /* new dimension sizes after extension */ hsize_t offset[1]; /* starting offsets of appended data */ @@ -304,18 +304,18 @@ extend_dset_one(const char *file, char *dname, int action) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < (unsigned)action; j++) { - cbuf[j].field1 = j + 1; - cbuf[j].field2.a = j + 2; - cbuf[j].field2.b.a = j + 2; - cbuf[j].field2.b.b = j + 2; - cbuf[j].field2.b.c = j + 2; - cbuf[j].field2.c = j + 2; - - cbuf[j].field3 = j + 3; - - cbuf[j].field4.a = j + 4; - cbuf[j].field4.b = j + 4; + for(i = 0; i < (unsigned)action; i++) { + cbuf[i].field1 = i + 1; + cbuf[i].field2.a = i + 2; + cbuf[i].field2.b.a = i + 2; + cbuf[i].field2.b.b = i + 2; + cbuf[i].field2.b.c = i + 2; + cbuf[i].field2.c = i + 2; + + cbuf[i].field3 = i + 3; + + cbuf[i].field4.a = i + 4; + cbuf[i].field4.b = i + 4; } /* end for */ /* Write to the extended region of the dataset */ @@ -324,8 +324,8 @@ extend_dset_one(const char *file, char *dname, int action) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < (unsigned)action; j++) - ibuf[j] = (int)j; + for(i = 0; i < (unsigned)action; i++) + ibuf[i] = (int)i; /* Write to the extended region of the dataset */ if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) diff --git a/src/H5Dint.c b/src/H5Dint.c index 1813ca6..08b3eb8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -3004,10 +3004,10 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) { H5D_chk_idx_info_t new_idx_info; /* Index info for the new layout */ H5D_chk_idx_info_t idx_info; /* Index info for the current layout */ - H5O_layout_t newlayout; /* The new layout */ - hbool_t init_new_index = FALSE; /* Indicate that the new chunk index is initialized */ + H5O_layout_t *newlayout = NULL; /* The new layout */ + hbool_t init_new_index = FALSE; /* Indicate that the new chunk index is initialized */ hbool_t delete_old_layout = FALSE; /* Indicate that the old layout message is deleted */ - hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ + hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) @@ -3017,121 +3017,127 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) switch(dataset->shared->layout.type) { case H5D_CHUNKED: - HDassert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); - - /* Set up the current index info */ - idx_info.f = dataset->oloc.file; - idx_info.dxpl_id = dxpl_id; - idx_info.pline = &dataset->shared->dcpl_cache.pline; - idx_info.layout = &dataset->shared->layout.u.chunk; - idx_info.storage = &dataset->shared->layout.storage.u.chunk; - - /* Copy the current layout info to the new layout */ - HDmemcpy(&newlayout, &dataset->shared->layout, sizeof(H5O_layout_t)); - - /* Set up info for version 1 B-tree in the new layout */ - newlayout.version = H5O_LAYOUT_VERSION_3; - newlayout.storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE; - newlayout.storage.u.chunk.idx_addr = HADDR_UNDEF; - newlayout.storage.u.chunk.ops = H5D_COPS_BTREE; - newlayout.storage.u.chunk.u.btree.shared = NULL; - - /* Set up the index info to version 1 B-tree */ - new_idx_info.f = dataset->oloc.file; - new_idx_info.dxpl_id = dxpl_id; - new_idx_info.pline = &dataset->shared->dcpl_cache.pline; - new_idx_info.layout = &newlayout.u.chunk; - new_idx_info.storage = &newlayout.storage.u.chunk; - - /* Initialize version 1 B-tree */ - if(new_idx_info.storage->ops->init && - (new_idx_info.storage->ops->init)(&new_idx_info, dataset->shared->space, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") - init_new_index = TRUE; - - /* If the current chunk index exists */ - if(H5F_addr_defined(idx_info.storage->idx_addr)) { - - /* Create v1 B-tree chunk index */ - if((new_idx_info.storage->ops->create)(&new_idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") - - /* Iterate over the chunks in the current index and insert the chunk addresses - * into the version 1 B-tree chunk index */ - if(H5D__chunk_format_convert(dataset, &idx_info, &new_idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate/convert chunk index") - } /* end if */ + HDassert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); + + if(NULL == (newlayout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") + + /* Set up the current index info */ + idx_info.f = dataset->oloc.file; + idx_info.dxpl_id = dxpl_id; + idx_info.pline = &dataset->shared->dcpl_cache.pline; + idx_info.layout = &dataset->shared->layout.u.chunk; + idx_info.storage = &dataset->shared->layout.storage.u.chunk; + + /* Copy the current layout info to the new layout */ + HDmemcpy(newlayout, &dataset->shared->layout, sizeof(H5O_layout_t)); + + /* Set up info for version 1 B-tree in the new layout */ + newlayout->version = H5O_LAYOUT_VERSION_3; + newlayout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE; + newlayout->storage.u.chunk.idx_addr = HADDR_UNDEF; + newlayout->storage.u.chunk.ops = H5D_COPS_BTREE; + newlayout->storage.u.chunk.u.btree.shared = NULL; + + /* Set up the index info to version 1 B-tree */ + new_idx_info.f = dataset->oloc.file; + new_idx_info.dxpl_id = dxpl_id; + new_idx_info.pline = &dataset->shared->dcpl_cache.pline; + new_idx_info.layout = &(newlayout->u).chunk; + new_idx_info.storage = &(newlayout->storage).u.chunk; + + /* Initialize version 1 B-tree */ + if(new_idx_info.storage->ops->init && (new_idx_info.storage->ops->init)(&new_idx_info, dataset->shared->space, dataset->oloc.addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + init_new_index = TRUE; + + /* If the current chunk index exists */ + if(H5F_addr_defined(idx_info.storage->idx_addr)) { + + /* Create v1 B-tree chunk index */ + if((new_idx_info.storage->ops->create)(&new_idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") + + /* Iterate over the chunks in the current index and insert the chunk addresses + * into the version 1 B-tree chunk index + */ + if(H5D__chunk_format_convert(dataset, &idx_info, &new_idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate/convert chunk index") + } /* end if */ - /* Delete the old "current" layout message */ - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") + /* Delete the old "current" layout message */ + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") - delete_old_layout = TRUE; + delete_old_layout = TRUE; - /* Append the new layout message to the object header */ - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &newlayout, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") + /* Append the new layout message to the object header */ + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") - add_new_layout = TRUE; + add_new_layout = TRUE; - /* Release the old (current) chunk index */ - if(idx_info.storage->ops->dest && (idx_info.storage->ops->dest)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + /* Release the old (current) chunk index */ + if(idx_info.storage->ops->dest && (idx_info.storage->ops->dest)(&idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") - /* Copy the new layout to the dataset's layout */ - HDmemcpy(&dataset->shared->layout, &newlayout, sizeof(H5O_layout_t)); + /* Copy the new layout to the dataset's layout */ + HDmemcpy(&dataset->shared->layout, newlayout, sizeof(H5O_layout_t)); - break; + break; - case H5D_CONTIGUOUS: + case H5D_CONTIGUOUS: case H5D_COMPACT: - HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); - dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; - if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") - break; + HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); + dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; + if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + break; - case H5D_VIRTUAL: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "virtual dataset layout not supported") + case H5D_VIRTUAL: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "virtual dataset layout not supported") case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset layout type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset layout type") - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown dataset layout type") + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown dataset layout type") } /* end switch */ done: if(ret_value < 0 && dataset->shared->layout.type == H5D_CHUNKED) { - /* Remove new layout message */ - if(add_new_layout) - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") - - /* Add back old layout message */ - if(delete_old_layout) - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout, dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") - - /* Clean up v1 b-tree chunk index */ - if(init_new_index) { - if(H5F_addr_defined(new_idx_info.storage->idx_addr)) { - /* Check for valid address i.e. tag */ - if(!H5F_addr_defined(dataset->oloc.addr)) - HDONE_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "address undefined") - - /* Expunge from cache all v1 B-tree type entries associated with tag */ - if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dxpl_id, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) - HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") - } /* end if */ + /* Remove new layout message */ + if(add_new_layout) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") + + /* Add back old layout message */ + if(delete_old_layout) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout, dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") + + /* Clean up v1 b-tree chunk index */ + if(init_new_index) { + if(H5F_addr_defined(new_idx_info.storage->idx_addr)) { + /* Check for valid address i.e. tag */ + if(!H5F_addr_defined(dataset->oloc.addr)) + HDONE_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "address undefined") + + /* Expunge from cache all v1 B-tree type entries associated with tag */ + if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dxpl_id, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) + HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") + } /* end if */ - /* Delete v1 B-tree chunk index */ - if(new_idx_info.storage->ops->dest && (new_idx_info.storage->ops->dest)(&new_idx_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") - } /* end if */ + /* Delete v1 B-tree chunk index */ + if(new_idx_info.storage->ops->dest && (new_idx_info.storage->ops->dest)(&new_idx_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + } /* end if */ } /* end if */ + if(newlayout != NULL) + newlayout = (H5O_layout_t *)H5MM_xfree(newlayout); + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5D__format_convert() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 572e6cf..1766422 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -181,7 +181,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(direct_read) { unsigned u; - hsize_t dims[H5O_LAYOUT_NDIMS]; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; if(H5D_CHUNKED != dset->shared->layout.type) diff --git a/src/H5FDspace.c b/src/H5FDspace.c index e451d6b..0af755f 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -99,9 +99,7 @@ H5FL_DEFINE(H5FD_free_t); static haddr_t H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) { - hsize_t orig_size = size; /* Original allocation size */ haddr_t eoa; /* Address of end-of-allocated space */ - hsize_t extra; /* Extra space to allocate, to align request */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 49cfbfc..1ae902f 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -156,7 +156,7 @@ herr_t H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) { herr_t ret_value = SUCCEED; /* Return value */ - H5FD_mem_t type; /* Memory type for iteration */ + H5F_mem_page_t type; /* Memory type for iteration */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) @@ -168,31 +168,31 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind HDassert(indent >= 0); HDassert(fwidth >= 0); - for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { - if(!f->shared->fs_man[type]) + for(type = H5F_MEM_PAGE_DEFAULT; type < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, type)) + if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { + if(!f->shared->fs_man[type]) if(H5MF_open_fstype(f, dxpl_id, type) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") - - if(f->shared->fs_man[type]) { - H5MF_debug_iter_ud_t udata; /* User data for callbacks */ - - /* Prepare user data for section iteration callback */ - udata.fspace = f->shared->fs_man[type]; - udata.stream = stream; - udata.indent = indent; - udata.fwidth = fwidth; - - /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") - - /* Close the free space information */ - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") - } /* end if */ - break; - } /* end if */ + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") + + if(f->shared->fs_man[type]) { + H5MF_debug_iter_ud_t udata; /* User data for callbacks */ + + /* Prepare user data for section iteration callback */ + udata.fspace = f->shared->fs_man[type]; + udata.stream = stream; + udata.indent = indent; + udata.fwidth = fwidth; + + /* Iterate over all the free space sections */ + if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") + + /* Close the free space information */ + if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") + } /* end if */ + break; + } /* end if */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 0dd26b3..02fc2d9 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -360,7 +360,7 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, static H5FS_section_info_t * H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size) { - H5MF_free_section_t *ret_value; /* Return value */ + H5MF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 29b2503..a427b49 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -323,7 +323,7 @@ H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) * time constraints, I don't want to go there now. */ if(H5F_FIRST_ALLOC_DEALLOC(f)) { - HDassert(HADDR_UNDEF !=H5F_EOA_PRE_FSM_FSALLOC(f)); + HDassert(HADDR_UNDEF != H5F_EOA_PRE_FSM_FSALLOC(f)); HDassert(H5F_addr_ge(mesg->addr, H5F_EOA_PRE_FSM_FSALLOC(f))); if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") diff --git a/test/flushrefresh.c b/test/flushrefresh.c index f35ed5e..0775dee 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -9,6 +9,7 @@ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Mike McGreevy diff --git a/test/mf.c b/test/mf.c index 3197989..60b74c4 100644 --- a/test/mf.c +++ b/test/mf.c @@ -138,8 +138,10 @@ static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); +#ifdef PB_OUT static unsigned test_mf_fs_persist_split(void); static unsigned test_mf_fs_persist_multi(void); +#endif static unsigned test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl); static unsigned test_page_small(const char *env_h5_drvr, hid_t fapl); static unsigned test_page_large(const char *env_h5_drvr, hid_t fapl); @@ -6091,6 +6093,7 @@ error: * Verify that the file's free-space manager(s) are persistent for a split-file *------------------------------------------------------------------------- */ +#ifdef PB_OUT static unsigned test_mf_fs_persist_split(void) { @@ -6716,6 +6719,7 @@ error: } H5E_END_TRY; return(1); } /* test_mf_fs_persist_multi() */ +#endif /* PB_OUT */ /* *------------------------------------------------------------------------- diff --git a/test/plugin.c b/test/plugin.c index 8b4324d..1254e9a 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -574,7 +574,9 @@ test_noread_with_filters(hid_t file) /* disable filter plugin */ if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR - plugin_state = plugin_state & ~H5PL_FILTER_PLUGIN; + + plugin_state = plugin_state & (unsigned)(~H5PL_FILTER_PLUGIN); + if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR @@ -672,8 +674,8 @@ static herr_t test_groups_with_filters(hid_t file) { herr_t ret_value = -1; - hid_t gid; - hid_t group; + hid_t gid = -1; + hid_t group = -1; int i; char gname[256]; diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 82c2f8b..43743d9 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -187,7 +187,7 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon symbol->nrecords = 0; else symbol->nrecords -= remove_size; - dim[1] = symbol->nrecords; + dim[1] = symbol->nrecords; if(H5Dset_extent(symbol->dsid, dim) < 0) return -1; diff --git a/test/use_common.c b/test/use_common.c index 908cac9..5aa6692 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -48,6 +48,8 @@ parse_option(int argc, char * const argv[]) { int ret_value=0; int c; + int use_swmr; /* Need an int to detect errors */ + /* command line options: See function usage for a description */ const char *nagg_options = "f:hi:l:n:s:y:z:"; @@ -96,11 +98,13 @@ parse_option(int argc, char * const argv[]) }; break; case 's': /* use swmr file open mode */ - if ((UC_opts.use_swmr = HDatoi(optarg)) < 0) { - fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); - usage(progname_g); - Hgoto_error(-1); - }; + use_swmr = HDatoi(optarg); + if (use_swmr != 0 && use_swmr != 1) { + HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); + usage(progname_g); + Hgoto_error(-1); + } + UC_opts.use_swmr = (hbool_t)use_swmr; break; case 'y': /* Number of planes per chunk */ if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 499d5eb..0b1a96e 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -140,7 +140,7 @@ typedef struct mcomp_t static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); +static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,size_t u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); static hbool_t equal_double(double value, double expected, diff_opt_t *options); @@ -149,7 +149,7 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t #endif static int print_data(diff_opt_t *options); static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); -static void print_char_pos(int *ph,int pp,hsize_t curr_pos,unsigned u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); +static void print_char_pos(int *ph,int pp,hsize_t curr_pos,size_t u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); static void h5diff_print_char(char ch); static hsize_t diff_datum(void *_mem1, void *_mem2, @@ -575,7 +575,7 @@ static hsize_t diff_datum(void *_mem1, { unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; - unsigned u; + size_t u; hid_t memb_type; size_t type_size; H5T_sign_t type_sign; @@ -2813,7 +2813,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, - unsigned u, + size_t u, int rank, hsize_t *dims, hsize_t *acc, @@ -5906,7 +5906,7 @@ static void print_char_pos( int *ph, /* print header */ int pp, /* print percentage */ hsize_t curr_pos, - unsigned u, + size_t u, hsize_t *acc, hsize_t *pos, int rank, @@ -5944,7 +5944,7 @@ void print_char_pos( int *ph, /* print header */ } else { - parallel_print("%u", (unsigned)u); + parallel_print("%zu", u); } parallel_print("]" ); } diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 4ff4875..1a0dab7 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -249,7 +249,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * the same as the input file's strategy. */ if(options->fs_strategy) { - if(out_strategy != (options->fs_strategy == (-1) ? 0 : options->fs_strategy)) { + if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) { error_msg("file space strategy not set as unexpected\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); } -- cgit v0.12 From 18ae45027c40ecf539260216a04ba1cfdf8b50d9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 08:42:18 -0400 Subject: Fixed additional minor warnings. --- test/dsets.c | 3 +++ tools/test/h5copy/h5copygentest.c | 2 +- tools/test/h5diff/h5diffgentest.c | 41 ++++++++++++++++++--------------------- tools/test/h5dump/h5dumpgentest.c | 2 +- tools/test/h5repack/h5repacktst.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index ba0ad82..12d2e83 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -17,6 +17,8 @@ * * Purpose: Tests the dataset interface (H5D) */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_TESTING #define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING @@ -24,6 +26,7 @@ #include "h5test.h" #include "H5srcdir.h" +#include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" #include "H5Zpkg.h" diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index bda0686..d4d6a08 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -336,7 +336,7 @@ static void gent_att_compound_vlstr(hid_t loc_id) { typedef struct { /* Compound structure for the attribute */ int i; - char *v; + const char *v; } s1; hsize_t dim[1] = {1}; /* Dimension size */ hid_t sid = -1; /* Dataspace ID */ diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 708f371..459a37e 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -3632,8 +3632,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char *str_vlen_repeat; /* vlen string */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp1_t; @@ -3645,9 +3645,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen_repeat; /* vlen string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp2_t; @@ -3660,8 +3660,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char *str_vlen_repeat; /* vlen string */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp3_t; /* compound4 datatype */ @@ -3672,16 +3672,16 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen_repeat; /* vlen string */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp4_t; /* compound5 datatype */ typedef struct comp5_t { - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char *str_vlen; /* vlen string */ @@ -3693,9 +3693,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* compound6 datatype */ typedef struct comp6_t { - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char *str_vlen; /* vlen string */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ @@ -3708,8 +3708,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen; /* vlen string */ @@ -3720,9 +3720,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int typedef struct comp8_t { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen; /* vlen string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ @@ -3734,8 +3734,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ int int_data1; hobj_ref_t objref1; /* reference */ @@ -3768,7 +3768,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int hid_t sid_vlen_str_array=0; /* dataspace ID */ hid_t tid_vlen_str_array_pre=0; /* datatype ID */ hid_t tid_vlen_str_array=0; /* datatype ID */ - char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { + const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { "1 - Variable length string Array", "2 - Testing variable length string array in compound type", "3 - Four score and seven\n years ago our forefathers brought forth on this continent a new nation," @@ -5343,7 +5343,6 @@ static hid_t mkstr(int size, H5T_str_t pad) { *-------------------------------------------------------------------------*/ static void test_objs_strings(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; hid_t fid1=0; hid_t fid2=0; hid_t dataset=0; @@ -5398,7 +5397,6 @@ static void test_objs_strings(const char *fname1, const char *fname2) if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); - status = FAIL; goto out; } @@ -5407,7 +5405,6 @@ static void test_objs_strings(const char *fname1, const char *fname2) if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); - status = FAIL; goto out; } diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 169eddb..55a754d 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -3479,7 +3479,7 @@ static void gent_array8(void) unsigned int i; /* Allocate data buffer */ - wdata = HDmalloc(F64_DIM1 * sizeof(int)); + wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); HDassert(wdata); /* diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 3b82383..efce43f 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -266,7 +266,7 @@ int main (void) fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - pack_options.fs_strategy = -1; /* "FSM_AGGR" specified via -S FSM_AGGR */ + pack_options.fs_strategy = (H5F_fspace_strategy_t)-1; /* "FSM_AGGR" specified via -S FSM_AGGR */ pack_options.fs_threshold = -1; /* "0" specified via -T 0 */ if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; -- cgit v0.12 From 65e2e8f87cc9b5235b19faefa23f76c2c6ea6da9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:06:49 -0400 Subject: A few more warnings fixed. --- test/tfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tfile.c b/test/tfile.c index 7274c82..c59e756 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4929,9 +4929,9 @@ test_libver_bounds(void) static void test_libver_macros(void) { - unsigned major = H5_VERS_MAJOR; - unsigned minor = H5_VERS_MINOR; - unsigned release = H5_VERS_RELEASE; + int major = H5_VERS_MAJOR; + int minor = H5_VERS_MINOR; + int release = H5_VERS_RELEASE; /* Output message about test being performed */ MESSAGE(5, ("Testing macros for library version comparison\n")); -- cgit v0.12 From a33859d6774f73c0bb31386eedfde2aaf222427b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:24:24 -0400 Subject: Minor type fixes to h5watch. --- hl/tools/h5watch/extend_dset.c | 22 +++++++++++----------- hl/tools/h5watch/h5watchgentest.c | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 4299586..4dcf25e 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -38,24 +38,24 @@ static herr_t extend_dset_one(const char *file, char *dname, int action); /* Data structures for datasets with compound data type */ typedef struct sub22_t { - unsigned int a; - unsigned int b; - unsigned int c; + int a; + int b; + int c; } sub22_t; typedef struct sub2_t { - unsigned int a; + int a; sub22_t b; - unsigned int c; + int c; } sub2_t; typedef struct sub4_t { - unsigned int a; - unsigned int b; + int a; + int b; } sub4_t; typedef struct set_t { - unsigned int field1; + int field1; sub2_t field2; double field3; sub4_t field4; @@ -225,7 +225,7 @@ extend_dset_one(const char *file, char *dname, int action) hid_t dtid = -1; /* dataset's datatype id */ hid_t sid = -1; /* dataspace id */ hid_t mid = -1; /* memory space id */ - unsigned i; /* local index variable */ + int i; /* local index variable */ hsize_t cur_dims[1]; /* current dimension sizes */ hsize_t ext_dims[1]; /* new dimension sizes after extension */ hsize_t offset[1]; /* starting offsets of appended data */ @@ -304,7 +304,7 @@ extend_dset_one(const char *file, char *dname, int action) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(i = 0; i < (unsigned)action; i++) { + for(i = 0; i < action; i++) { cbuf[i].field1 = i + 1; cbuf[i].field2.a = i + 2; cbuf[i].field2.b.a = i + 2; @@ -324,7 +324,7 @@ extend_dset_one(const char *file, char *dname, int action) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(i = 0; i < (unsigned)action; i++) + for(i = 0; i < action; i++) ibuf[i] = (int)i; /* Write to the extended region of the dataset */ diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index c5b76de..18e15fc 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -58,24 +58,24 @@ /* Data structures for datasets with compound types */ typedef struct sub22_t { - unsigned int a; - unsigned int b; - unsigned int c; + int a; + int b; + int c; } sub22_t; typedef struct sub2_t { - unsigned int a; + int a; sub22_t b; - unsigned int c; + int c; } sub2_t; typedef struct sub4_t { - unsigned int a; - unsigned int b; + int a; + int b; } sub4_t; typedef struct set_t { - unsigned int field1; + int field1; sub2_t field2; double field3; sub4_t field4; -- cgit v0.12 From 291b107d4d56528082db5344d8783941154e8374 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:47:20 -0400 Subject: Minor warning fixes in the tools. --- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_str.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 3d38dd0..6383df5 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -522,7 +522,7 @@ typedef struct h5tools_context_t { hsize_t acc[H5S_MAX_RANK]; /* accumulator position */ hsize_t pos[H5S_MAX_RANK]; /* matrix position */ hsize_t sm_pos; /* current stripmine element position */ - struct H5LD_memb_t **cmpd_listv; /* h5watch: vector containing info about the list of compound fields to be printed */ + const struct H5LD_memb_t * const *cmpd_listv; /* h5watch: vector containing info about the list of compound fields to be printed */ } h5tools_context_t; typedef struct subset_d { diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b7a2c1e..fa15785 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1000,10 +1000,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_COMPOUND: if(ctx->cmpd_listv) { /* there is */ - int save_indent_level; /* The indentation level */ + unsigned save_indent_level; /* The indentation level */ size_t curr_field; /* Current field to display */ - int i = 0, x = 0; /* Local index variable */ - H5LD_memb_t **listv; /* Vector of information for */ + int i = 0; /* Local index variable */ + unsigned x = 0; /* Local index variable */ + const H5LD_memb_t * const *listv; /* Vector of information for */ listv = ctx->cmpd_listv; ctx->cmpd_listv = NULL; -- cgit v0.12 From 1b74c5ca95efa3ebc14bb98ca48e4bf052398a81 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 10:11:26 -0400 Subject: More minor warning fixes. --- src/H5Ofsinfo.c | 2 +- test/mf.c | 2 ++ test/swmr_remove_reader.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 89dc8ee..4d62f49 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -85,7 +85,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fsinfo_t *fsinfo = NULL; /* File space info message */ diff --git a/test/mf.c b/test/mf.c index 60b74c4..fea5ee2 100644 --- a/test/mf.c +++ b/test/mf.c @@ -45,8 +45,10 @@ #define TBLOCK_SIZE4 4 #define TBLOCK_SIZE5 5 #define TBLOCK_SIZE6 6 +#ifdef PB_OUT #define TBLOCK_SIZE7 7 #define TBLOCK_SIZE8 8 +#endif /* PB_OUT */ #define TBLOCK_SIZE10 10 #define TBLOCK_SIZE11 11 #define TBLOCK_SIZE20 20 diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 11649e3..1fae5e7 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -227,7 +227,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, /* Determine the offset of the symbol, within level 0 symbols */ /* (level 0 symbols are the most common symbols) */ - offset = (unsigned)(HDrandom() % symbol_count[0]); + offset = (unsigned)HDrandom() % symbol_count[0]; sym_com[v] = &symbol_info[0][offset]; /* Emit informational message */ -- cgit v0.12 From 57f0a296c0b727e3d86cea312ba46efc98d76227 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 10:25:30 -0400 Subject: Minor warning fix. --- tools/test/h5dump/h5dumpgentest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 55a754d..44c4369 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -10318,7 +10318,6 @@ static void gent_udfilter(void) hid_t dcpl; /* dataset creation property list */ hid_t dsid; /* dataset ID */ hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; -- cgit v0.12 From db2da9f4b4b582d644d4b2e976040fce4dd1d665 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 May 2017 15:57:18 -0500 Subject: Reduce warnings --- java/src/jni/h5Constants.c | 1 + java/src/jni/h5lImp.c | 2 +- java/src/jni/h5pImp.c | 4 ++-- java/src/jni/h5plImp.c | 8 ++++---- java/src/jni/h5sImp.c | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index cd1c2f0..d4511e1 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -24,6 +24,7 @@ extern "C" { #include #include "hdf5.h" +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-prototypes" JNIEXPORT jlong JNICALL diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index bf2d7b1..ac71845 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -457,7 +457,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx } /* end if */ else { buf_size = infobuf.u.val_size; - if(buf_size < 0) { + if(buf_size == 0) { h5libraryError(env); } /* end if */ else { diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index df8b3c9..dcfcd82 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5127,8 +5127,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options else { /* get the length of the filename */ H5Pget_mdc_log_options((hid_t)fapl_id, &is_enabled, NULL, &location_size, &start_on_access); - if (location_size < 0) { - h5badArgument(env, "H5Pget_mdc_log_options: location_size < 0"); + if (location_size == 0) { + h5badArgument(env, "H5Pget_mdc_log_options: location_size is 0"); }/* end if */ else if (location_size > 0) { location_size++; /* add extra space for the null terminator */ diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index f064634..ffd5b7a 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -68,7 +68,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLappend (JNIEnv *env, jclass clss, jobjectArray plugin_path) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -90,7 +90,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLprepend (JNIEnv *env, jclass clss, jobjectArray plugin_path) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -113,7 +113,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLreplace (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -136,7 +136,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLinsert (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index c578ab8..10f69eb 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -1206,8 +1206,8 @@ Java_hdf_hdf5lib_H5_H5Sencode if (status < 0) { h5libraryError(env); } /* end else if */ - else if (buf_size < 0) { - h5badArgument(env, "H5Sencode: buf_size < 0"); + else if (buf_size == 0) { + h5badArgument(env, "H5Sencode: buf_size = 0"); } /* end if */ else { bufPtr = (unsigned char*)HDcalloc((size_t) 1, buf_size); -- cgit v0.12 From d809de2ebe1c9f4f2cf60e3a79bf6dcc27adc68a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 11:16:20 -0500 Subject: Note HDFFV-8611 change --- release_docs/RELEASE.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8fb56cc..7ff4036 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,6 +117,11 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - Improved h5repack by retaining creation order and adding + arguments to set the order and index direction. + + (ADB, 2017/05/26, HDFFV-8611) + - Improved h5diff compare of strings and arrays. (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) -- cgit v0.12 From 742e1d5541a488ca1a1772c05833c16a6a73d3ab Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 12:56:55 -0400 Subject: Fixed misplaced space in config/gnu-flags. --- config/gnu-flags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index 74cf76f..b4d5e8d 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -106,7 +106,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" - H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros-Wunsafe -loop-optimizations -Wwrite-strings" + H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" # Production # NDEBUG is handled explicitly by the configure script -- cgit v0.12 From 7f6443cc0d1b3d09f104b076ecc5ced758d3c1a1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 13:05:18 -0500 Subject: Enhanced the release note using 'Writing Notes in a RELEASE.txt File' --- release_docs/RELEASE.txt | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ff4036..b6ef74f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,14 +117,29 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- - - Improved h5repack by retaining creation order and adding - arguments to set the order and index direction. + - h5repack - (ADB, 2017/05/26, HDFFV-8611) + h5repack did not maintain the creation order flag of the root + group. - - Improved h5diff compare of strings and arrays. + Improved h5repack by reading the creation order and applying the + flag to the new root group. Also added arguments to set the + order and index direction, which applys to the traversing of the + original file, on the command line. - (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) + (ADB - 2017/05/26, HDFFV-8611) + + - h5diff + + h5diff failed to account for strpad type and null terminators + of char strings. Also, h5diff failed to account for string length + differences and would give a different result depending on file + order in the command line. + + Improved h5diff compare of strings and arrays by adding a check for + string lengths and if the strpad was null filled. + + (ADB - 2017/05/18, HDFFV-9055, HDFFV-10128) High-Level APIs: ------ -- cgit v0.12 From b6de142cf4a863787dceaa333684615fc190d6d5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 14:56:23 -0400 Subject: Chagned gfortran40 to gfortran in a few config files. --- config/freebsd | 4 ++-- config/gnu-fflags | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/freebsd b/config/freebsd index 936c29f..9a9348b 100644 --- a/config/freebsd +++ b/config/freebsd @@ -34,8 +34,8 @@ fi if test "X-" = "X-$FC"; then case $CC_BASENAME in gcc*|pgcc*) - FC=gfortran40 - FC_BASENAME=gfortran40 + FC=gfortran + FC_BASENAME=gfortran ;; icc*) FC=ifort diff --git a/config/gnu-fflags b/config/gnu-fflags index e92e054..6b5e6a1 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -71,7 +71,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then #esac # General - FC_BASENAME=gfortran40 + FC_BASENAME=gfortran F9XSUFFIXFLAG="" FSEARCH_DIRS="" H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising" -- cgit v0.12 From c059e6ecf7bafc6b5c1c9b8a39e8515e23f52303 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 13:59:00 -0500 Subject: Spelling --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b6ef74f..e52913f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -124,7 +124,7 @@ Bug Fixes since HDF5-1.10.1 release Improved h5repack by reading the creation order and applying the flag to the new root group. Also added arguments to set the - order and index direction, which applys to the traversing of the + order and index direction, which applies to the traversing of the original file, on the command line. (ADB - 2017/05/26, HDFFV-8611) -- cgit v0.12 From 13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 18:22:07 -0400 Subject: Added feature flag checks for a few other VFDs in test/vfd.c. --- test/vfd.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 116 insertions(+), 10 deletions(-) diff --git a/test/vfd.c b/test/vfd.c index 213cd9c..f8e5761 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -101,9 +101,6 @@ test_sec2(void) TEST_ERROR; h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename)); - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) - TEST_ERROR; - /* Check that the VFD feature flags are correct */ if ((driver_id = H5Pget_driver(fapl_id)) < 0) TEST_ERROR @@ -126,6 +123,9 @@ test_sec2(void) | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR; + /* Retrieve the access property list... */ if((fapl_id_out = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -234,16 +234,10 @@ test_core(void) if(HDaccess(filename, F_OK) != -1) if(HDremove(filename) < 0) FAIL_PUTS_ERROR("unable to remove backing store file"); + /* Create and close file w/ backing store off */ if(H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0) TEST_ERROR; - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) - TEST_ERROR; - if(H5Fclose(fid) < 0) - TEST_ERROR; - /* Check for the backing store file */ - if(HDaccess(filename, F_OK) != -1) - FAIL_PUTS_ERROR("file created when backing store set to FALSE"); /* Check that the VFD feature flags are correct. * Note that the H5FDdriver_query() API call does not require a file @@ -268,6 +262,14 @@ test_core(void) | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR; + if(H5Fclose(fid) < 0) + TEST_ERROR; + /* Check for the backing store file */ + if(HDaccess(filename, F_OK) != -1) + FAIL_PUTS_ERROR("file created when backing store set to FALSE"); + /************************************************************************ * Check basic core VFD operation and properties. This is done with the * backing store on so a file will be created for later use. @@ -843,6 +845,8 @@ test_family(void) { hid_t file=-1, fapl=-1, fapl2=-1, space=-1, dset=-1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; char dname[]="dataset"; unsigned int i, j; @@ -860,6 +864,22 @@ test_family(void) TEST_ERROR; h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA)) + TEST_ERROR + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1144,6 +1164,8 @@ test_multi(void) hid_t file=-1, fapl=-1, fapl2=-1, dset=-1, space=-1; hid_t root=-1, attr=-1, aspace=-1, atype=-1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle2=NULL, *fhandle=NULL; hsize_t file_size; @@ -1200,6 +1222,22 @@ test_multi(void) TEST_ERROR; h5_fixname(FILENAME[4], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_USE_ALLOC_SIZE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_PAGED_AGGR)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_USE_ALLOC_SIZE + | H5FD_FEAT_PAGED_AGGR)) + TEST_ERROR + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1532,6 +1570,8 @@ test_log(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -1547,6 +1587,28 @@ test_log(void) TEST_ERROR; h5_fixname(FILENAME[6], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + /* Create the test file */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1619,6 +1681,8 @@ test_stdio(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; FILE *fhandle = NULL; hsize_t file_size = 0; @@ -1632,6 +1696,24 @@ test_stdio(void) TEST_ERROR; h5_fixname(FILENAME[7], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1706,6 +1788,8 @@ test_windows(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -1728,6 +1812,28 @@ test_windows(void) TEST_ERROR; h5_fixname(FILENAME[8], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; -- cgit v0.12 From 5efda2babf7f4bd7424d147e20b72b0f227f1704 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 30 May 2017 16:33:20 -0700 Subject: Fixed typo in vfd.c from 'updated VFD feature flag' checkin. --- test/vfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vfd.c b/test/vfd.c index f8e5761..5d5ebfc 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -1813,7 +1813,7 @@ test_windows(void) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); /* Check that the VFD feature flags are correct */ - if ((driver_id = H5Pget_driver(fapl_id)) < 0) + if ((driver_id = H5Pget_driver(fapl)) < 0) TEST_ERROR if (H5FDdriver_query(driver_id, &driver_flags) < 0) TEST_ERROR -- cgit v0.12