From 9edd184ae9771c83b3569f3411babdcdd4170b3e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Sep 2015 15:05:23 -0500 Subject: [svn-r27846] Fix generated files process. Add script for post processing of flex/bison files. --- MANIFEST | 1 + config/cmake/HDF5Macros.cmake | 71 -------------------------- config/cmake/HDF5_Process_Flex_Files.cmake | 81 ++++++++++++++++++++++++++++++ config/cmake/cacheinit.cmake | 2 - config/cmake/mccacheinit.cmake | 2 - config/cmake/userblockTest.cmake | 8 +-- hl/src/CMakeLists.txt | 39 ++++++++++++++ src/CMakeLists.txt | 14 +++++- 8 files changed, 137 insertions(+), 81 deletions(-) create mode 100644 config/cmake/HDF5_Process_Flex_Files.cmake diff --git a/MANIFEST b/MANIFEST index 0fcea78..634b733 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2330,6 +2330,7 @@ ./config/cmake/hdf5-config.cmake.in ./config/cmake/hdf5-config-version.cmake.in ./config/cmake/HDFCompilerFlags.cmake +./config/cmake/HDF5_Process_Flex_Files.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/libhdf5.settings.cmake.in diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 9b36f53..bd86f34 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -39,75 +39,4 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) endif (${libtype} MATCHES "SHARED") endif (HDF5_BUILD_FRAMEWORKS) endif (APPLE) - endmacro (H5_SET_LIB_OPTIONS) - -macro (H5_GEN_PERL_FILES) - find_package (Perl) - if (PERL_FOUND) - add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/H5Edefin.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt - DEPENDS ${HDF5_SOURCE_DIR}/src/H5err.txt - COMMENT " Creating err header" - ) - - add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/H5version.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt - DEPENDS ${HDF5_SOURCE_DIR}/src/H5vers.txt - COMMENT " Creating API version macro" - ) - - add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/H5overflow.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt - DEPENDS ${HDF5_SOURCE_DIR}/src/H5overflow.txt - COMMENT " Creating Assignment overflow macro" - ) - - add_custom_target(run_perl_scripts ALL - DEPENDS ${HDF5_BINARY_DIR}/H5Edefin.h ${HDF5_BINARY_DIR}/H5version.h ${HDF5_BINARY_DIR}/H5overflow.h - ) - else (PERL_FOUND) - message (STATUS "Cannot generate headers - perl not found") - endif (PERL_FOUND) -endmacro (H5_GEN_PERL_FILES) - -macro (H5_GEN_FLEX_FILES) - find_package (BISON) - if (BISON_FOUND) - find_package (FLEX) - if (FLEX_FOUND) - BISON_TARGET (H5LT_PARSER H5LTparse.y ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c COMPILE_FLAGS -d) - if (WIN32) - FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c COMPILE_FLAGS --wincompat) - else (WIN32) - FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c) - endif (WIN32) - ADD_FLEX_BISON_DEPENDENCY(H5LT_SCANNER H5LT_PARSER) - - if (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED) - set_source_files_properties (${FLEX_H5LT_SCANNER_OUTPUTS} - PROPERTIES OBJECT_DEPENDS ${BISON_H5LT_PARSER_OUTPUTS}) - set (HL_SRCS - ${BISON_H5LT_PARSER_OUTPUTS} - ${FLEX_H5LT_SCANNER_OUTPUTS} - ) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - else (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED) - message (STATUS "Error during generate of files") - endif (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED) - else (FLEX_FOUND) - message (STATUS "Cannot generate files - flex not found") - endif (FLEX_FOUND) - else (BISON_FOUND) - message (STATUS "Cannot generate files - bison not found") - endif (BISON_FOUND) -endmacro (H5_GEN_FLEX_FILES) diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake new file mode 100644 index 0000000..da1a842 --- /dev/null +++ b/config/cmake/HDF5_Process_Flex_Files.cmake @@ -0,0 +1,81 @@ +# post process flex/bison files + +message (STATUS "File: ${FILE_PARSE} ${FILE_ANALYZE}") + +if (FILE_PARSE) + # fix H5LTparse.c to declare H5LTyyparse return type as an hid_t + # instead of int. Currently the generated function H5LTyyparse is + # generated with a return value of type int, which is a mapping to the + # flex yyparse function. The return value in the HL library should be + # an hid_t. + # I propose to not use flex to generate this function, but for now I am + # adding a perl command to find and replace this function declaration in + # H5LTparse.c. + file (READ ${FILE_PARSE} TEST_STREAM) + string (REGEX REPLACE "int\nyyparse" "hid_t\nyyparse" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "int H5LTyyparse" "hid_t H5LTyyparse" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${FILE_PARSE} "${TEST_STREAM}") + message (STATUS "replacing signature in H5LTparse.c") + + # Add code that disables warnings in the flex/bison-generated code. + # + # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions + # will simply ignore them, but we want to avoid those warnings. + file (READ ${FILE_PARSE} TEST_STREAM) + file (WRITE ${FILE_PARSE} " +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n +#pragma GCC diagnostic ignored \"-Wconversion\"\n +#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n +#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n +#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n +#pragma GCC diagnostic ignored \"-Wnested-externs\"\n +#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n +#pragma GCC diagnostic ignored \"-Wsign-compare\"\n +#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n +#pragma GCC diagnostic ignored \"-Wswitch-default\"\n +#pragma GCC diagnostic ignored \"-Wunused-function\"\n +#pragma GCC diagnostic ignored \"-Wunused-macros\"\n +#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n +#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n +#elif defined __SUNPRO_CC\n +#pragma disable_warn\n +#elif defined _MSC_VER\n +#pragma warning(push, 1)\n +#endif\n + ") + file (APPEND ${FILE_PARSE} "${TEST_STREAM}") + message (STATUS "processing pragma in ${FILE_PARSE}") +endif (FILE_PARSE) + +if (FILE_ANALYZE) + # Add code that disables warnings in the flex/bison-generated code. + # + # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions + # will simply ignore them, but we want to avoid those warnings. + file (READ ${FILE_ANALYZE} TEST_STREAM) + file (WRITE ${FILE_ANALYZE} " +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n +#pragma GCC diagnostic ignored \"-Wconversion\"\n +#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n +#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n +#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n +#pragma GCC diagnostic ignored \"-Wnested-externs\"\n +#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n +#pragma GCC diagnostic ignored \"-Wsign-compare\"\n +#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n +#pragma GCC diagnostic ignored \"-Wswitch-default\"\n +#pragma GCC diagnostic ignored \"-Wunused-function\"\n +#pragma GCC diagnostic ignored \"-Wunused-macros\"\n +#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n +#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n +#elif defined __SUNPRO_CC\n +#pragma disable_warn\n +#elif defined _MSC_VER\n +#pragma warning(push, 1)\n +#endif\n + ") + file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") + message (STATUS "processing pragma in ${FILE_ANALYZE}") +endif (FILE_ANALYZE) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index e4ba880..4bef99f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -8,8 +8,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 7f981df..19ecc15 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -12,8 +12,6 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 2e0740b..fab470c 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -1,4 +1,4 @@ -# runTest.cmake executes a command and captures the output in a file. File is then compared +# userblockTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. # arguments checking @@ -56,9 +56,9 @@ if (TEST_CHECKUB STREQUAL "YES") endif (NOT ${TEST_RESULT} STREQUAL "0") file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) endif (TEST_OFILE) - + MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - + if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( @@ -72,7 +72,7 @@ if (TEST_CHECKUB STREQUAL "YES") ) #cat $ufile >> $cmpfile file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - file (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") + file (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") else (NOT TEST_O_STRING_LEN STREQUAL "0") file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 8d1a37f..25f3cb5 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -26,6 +26,35 @@ if (HDF5_GENERATE_HEADERS) set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c GENERATED) set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c GENERATED) set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h GENERATED) + + add_custom_command ( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.timestamp + COMMAND "${CMAKE_COMMAND}" + -D "FILE_PARSE=H5LTparse.c" + -P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake" + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.timestamp + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_command ( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.timestamp + COMMAND "${CMAKE_COMMAND}" + -D "FILE_ANALYZE=H5LTanalyze.c" + -P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake" + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.timestamp + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target (process_gen_H5LT DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.timestamp ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.timestamp) + +# add_custom_target (process_gen_H5LT +# COMMAND "${CMAKE_COMMAND}" +# -D "FILE_PARSE=${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c" +# -D "FILE_ANALYSE=${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c" +# -P "${HDF5_RESOURCE_DIR}/HDF5_Process_Flex_Files.cmake" +# DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c" +# COMMENT "Prepending pragma statements" +# ) else (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED) message (STATUS "Error during generate of files") endif (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED) @@ -82,6 +111,11 @@ set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") set (install_targets ${HDF5_HL_LIB_TARGET}) +if (HDF5_GENERATE_HEADERS) + add_dependencies(${HDF5_HL_LIB_TARGET} process_gen_H5LT) +else (HDF5_GENERATE_HEADERS) + add_dependencies(${HDF5_HL_LIB_TARGET} "${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c;${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c") +endif (HDF5_GENERATE_HEADERS) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SRCS} ${HL_HEADERS}) @@ -96,6 +130,11 @@ if (BUILD_SHARED_LIBS) ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIBSH_TARGET}") set (install_targets ${install_targets} ${HDF5_HL_LIBSH_TARGET}) + if (HDF5_GENERATE_HEADERS) + add_dependencies(${HDF5_HL_LIBSH_TARGET} process_gen_H5LT) + else (HDF5_GENERATE_HEADERS) + add_dependencies(${HDF5_HL_LIBSH_TARGET} "${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c;${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c") + endif (HDF5_GENERATE_HEADERS) endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3940c60..be0bf27 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -776,6 +776,8 @@ set (H5_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) +mark_as_advanced (HDF5_GENERATE_HEADERS) if (HDF5_GENERATE_HEADERS) find_package (Perl) if (PERL_FOUND) @@ -826,7 +828,11 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif (MSVC OR MINGW) -add_dependencies(H5detect generate_precompiled) +if (HDF5_GENERATE_HEADERS) + add_dependencies(H5detect generate_precompiled) +else (HDF5_GENERATE_HEADERS) + add_dependencies(H5detect "${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h") +endif (HDF5_GENERATE_HEADERS) set (CMD $) add_custom_command ( @@ -841,7 +847,11 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif (MSVC OR MINGW) -add_dependencies(H5make_libsettings generate_precompiled) +if (HDF5_GENERATE_HEADERS) + add_dependencies(H5detect generate_precompiled) +else (HDF5_GENERATE_HEADERS) + add_dependencies(H5make_libsettings "${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h") +endif (HDF5_GENERATE_HEADERS) set (CMD $) add_custom_command ( -- cgit v0.12 From 0be8c1687945eb0e55fac84c7aa9901ca9898a26 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Sep 2015 15:52:35 -0500 Subject: [svn-r27847] Add Not early in document about CMAKE_INSTALL_PREFIX. --- release_docs/INSTALL_CMake.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index df6291f..5cc9baf 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -33,6 +33,10 @@ CMake version The HDF5 1.8."X" product requires a minimum CMake version 3.1.0, where "X" is the current HDF5 release version. +Note: + To change the install prefix from the platform defaults initialize + the CMake variable, CMAKE_INSTALL_PREFIX. + ======================================================================== II. Quick Step Building HDF5 Libraries with CMake Script Mode -- cgit v0.12 From fb238c24a5c6679c7555c95f887b7f4a49dbb640 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 21 Sep 2015 19:26:51 -0500 Subject: [svn-r27849] Description: Normalize against incoming changes on VDS branch. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (h5committest forthcoming) --- src/H5Dlayout.c | 8 +-- src/H5FL.c | 4 +- src/H5Pdapl.c | 2 +- src/H5Pdcpl.c | 1 + src/H5Shyper.c | 27 ++++---- src/H5Spkg.h | 2 +- src/H5Sselect.c | 2 +- tools/h5diff/testh5diff.sh.in | 110 ++++++++++++++--------------- tools/h5repack/h5repack.sh.in | 128 +++++++++++++++++----------------- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_dump.c | 157 ++++++++++++++++++++---------------------- tools/lib/h5tools_error.h | 2 +- tools/lib/h5tools_str.c | 10 ++- tools/misc/Makefile.am | 2 +- 14 files changed, 227 insertions(+), 230 deletions(-) diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index d0e9d07..c2d547f 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -370,6 +370,10 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t /* Sanity check that the layout operations are set up */ HDassert(dataset->shared->layout.ops); + /* Initialize the layout information for the dataset */ + if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") + /* Adjust chunk dimensions to omit datatype size (in last dimension) for creation property */ if(H5D_CHUNKED == dataset->shared->layout.type) dataset->shared->layout.u.chunk.ndims--; @@ -380,10 +384,6 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t if(H5D_CHUNKED == dataset->shared->layout.type) dataset->shared->layout.u.chunk.ndims++; - /* Initialize the layout information for the dataset */ - if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_oh_read() */ diff --git a/src/H5FL.c b/src/H5FL.c index 2b8b11b..fb355ad 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -204,8 +204,8 @@ H5FL_term_package(void) /* Dump information about all the outstanding allocations */ while(trk != NULL) { /* Print information about the outstanding block */ - HDfprintf(stderr,"%s: Outstanding allocation:\n", "H5FL_term_package"); - HDfprintf(stderr,"\tFile: %s, Function: %s, Line: %d\n", trk->file, trk->func, trk->line); + HDfprintf(stderr,"%s: Outstanding allocation:\n", FUNC); + HDfprintf(stderr,"\tPtr: %p, File: %s, Function: %s, Line: %d\n", (((unsigned char *)trk) + sizeof(H5FL_track_t)), trk->file, trk->func, trk->line); H5CS_print_stack(trk->stack, stderr); /* Advance to next node */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index fc009fb..dd9c24d 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -289,7 +289,7 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, doub done: FUNC_LEAVE_API(ret_value) -} /* end H5Pget_chunk_cache */ +} /* end H5Pget_chunk_cache() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 29f92ec..5c64ccb 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -280,6 +280,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 12e23fa..6b943d3 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1994,7 +1994,8 @@ H5S_hyper_serial_size(const H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **p) +H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, + hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **p) { H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */ hsize_t u; /* Index variable */ @@ -2091,7 +2092,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) HDassert(space); /* Store the preamble information */ - UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ UINT32ENCODE(*p, (uint32_t)1); /* Store the version number */ UINT32ENCODE(*p, (uint32_t)0); /* Store the un-used padding */ lenp = *p; /* keep the pointer to the length location for later */ @@ -2235,7 +2236,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_deserialize (H5S_t *space, const uint8_t **p) +H5S_hyper_deserialize(H5S_t *space, const uint8_t **p) { unsigned rank; /* rank of points */ size_t num_elem=0; /* number of elements in selection */ @@ -3194,13 +3195,15 @@ H5S_hyper_release(H5S_t *space) space->select.num_elem = 0; /* Release irregular hyperslab information */ - if(space->select.sel_info.hslab->span_lst != NULL) { - if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") - } /* end if */ + if(space->select.sel_info.hslab) { + if(space->select.sel_info.hslab->span_lst != NULL) { + if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") + } /* end if */ - /* Release space for the hyperslab selection information */ - space->select.sel_info.hslab = H5FL_FREE(H5S_hyper_sel_t, space->select.sel_info.hslab); + /* Release space for the hyperslab selection information */ + space->select.sel_info.hslab = H5FL_FREE(H5S_hyper_sel_t, space->select.sel_info.hslab); + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -7134,12 +7137,12 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, if(H5S_hyper_generate_spans(space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") + /* Indicate that the regular dimensions are no longer valid */ + space->select.sel_info.hslab->diminfo_valid = FALSE; + /* Add in the new hyperslab information */ if(H5S_generate_hyperslab (space, op, start, opt_stride, opt_count, opt_block)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs") - - /* Indicate that the regular dimensions are no longer valid */ - space->select.sel_info.hslab->diminfo_valid=FALSE; } /* end if */ else HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 8213919..0f2adf1 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -131,7 +131,7 @@ typedef htri_t (*H5S_sel_is_valid_func_t)(const H5S_t *space); typedef hssize_t (*H5S_sel_serial_size_func_t)(const H5S_t *space); /* Method to store current selection in "serialized" form (a byte sequence suitable for storing on disk) */ typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t **p); -/* Method to store create selection from "serialized" form (a byte sequence suitable for storing on disk) */ +/* Method to create selection from "serialized" form (a byte sequence suitable for storing on disk) */ typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t *space, const uint8_t **p); /* Method to determine smallest n-D bounding box containing the current selection */ typedef herr_t (*H5S_sel_bounds_func_t)(const H5S_t *space, hsize_t *start, hsize_t *end); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 3f0bc4f..a9c0aa1 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -450,7 +450,7 @@ H5S_select_valid(const H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_deserialize (H5S_t **space, const uint8_t **p) +H5S_select_deserialize(H5S_t **space, const uint8_t **p) { H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either *space or a newly allocated one */ diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 3be0b80..373558e 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -331,10 +331,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 @@ -442,9 +442,9 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err cat $actual_err >> $actual - # don't add exit code check in pmode, as it causes failure. (exit code + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) - # if any problem occurs relate to an exit code, it will be caught in + # if any problem occurs relate to an exit code, it will be caught in # serial mode, so the test is fullfilled. if test $h5haveexitcode = 'yes' -a -z "$pmode"; then echo "EXIT CODE: $EXIT_CODE" >> $actual @@ -462,7 +462,7 @@ TOOLTEST() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' else - # parallel mode output are often of different ordering from serial + # parallel mode output are often of different ordering from serial # output. If the sorted expected and actual files compare the same, # it is safe to assume the actual output match the expected file. expect_sorted=expect_sorted @@ -493,24 +493,24 @@ TOOLTEST() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav - rm -f $actual_sorted $expect_sorted + rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual_sorted $expect_sorted fi } # Print a "SKIP" message SKIP() { - TESTING $H5DIFF $@ - echo " -SKIP-" + TESTING $H5DIFF $@ + echo " -SKIP-" } ############################################################################## -# The tests +# The tests # To avoid the printing of the complete full path of the test file, that hides -# all the other parameters for long paths, the printing of the command line +# all the other parameters for long paths, the printing of the command line # is done first in # TESTING with the name only of the test file $TOOL, not its full path $TESTFILE ############################################################################## @@ -525,13 +525,13 @@ COPY_TESTFILES_TO_TESTDIR TOOLTEST h5diff_10.txt -h # 1.1 normal mode -TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5 # 1.2 normal mode with objects TOOLTEST h5diff_12.txt h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 # 1.3 report mode -TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5 # 1.4 report mode with objects TOOLTEST h5diff_14.txt -r h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 @@ -549,7 +549,7 @@ TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 h5diff_basic1.h5 h5diff_basic TOOLTEST h5diff_16_3.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10 # 1.7 verbose mode -TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5 +TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5 # 1.7 test 32-bit INFINITY TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_COPY @@ -557,8 +557,8 @@ TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_C # 1.7 test 64-bit INFINITY TOOLTEST h5diff_172.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp20 /g1/fp20_COPY -# 1.8 quiet mode -TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5 +# 1.8 quiet mode +TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5 # 1.8 -v and -q TOOLTEST h5diff_18_1.txt -v -q h5diff_basic1.h5 h5diff_basic2.h5 @@ -588,7 +588,7 @@ TOOLTEST h5diff_23.txt -v h5diff_types.h5 h5diff_types.h5 g1 g1 TOOLTEST h5diff_24.txt -v h5diff_types.h5 h5diff_types.h5 t1 t1 # 2.5 -TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1 +TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1 # 2.6 TOOLTEST h5diff_26.txt -v h5diff_types.h5 h5diff_types.h5 g1 g2 @@ -642,7 +642,7 @@ TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b # 5.8 (region reference) TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg -# test for both dset and attr with same type but with different size +# test for both dset and attr with same type but with different size # ( HDDFV-7942 ) TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b @@ -652,14 +652,14 @@ TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b # 6.0: Check if the command line number of arguments is less than 3 -TOOLTEST h5diff_600.txt h5diff_basic1.h5 +TOOLTEST h5diff_600.txt h5diff_basic1.h5 -# 6.1: Check if non-exist object name is specified +# 6.1: Check if non-exist object name is specified TOOLTEST h5diff_601.txt h5diff_basic1.h5 h5diff_basic1.h5 nono_obj # ############################################################################## -# # -d +# # -d # ############################################################################## @@ -678,7 +678,7 @@ TOOLTEST h5diff_606.txt -d 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse # 6.7: string TOOLTEST h5diff_607.txt -d "1" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 -# 6.8: use system epsilon +# 6.8: use system epsilon TOOLTEST h5diff_608.txt --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.9: number larger than biggest difference @@ -762,7 +762,7 @@ TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # ############################################################################## # 7. attributes # ############################################################################## -TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 # temporary test to verify HDF5-8625 TOOLTEST h5diff_tmp1.txt tmptest2.he5 tmptest.he5 # temporary test to verify HDF5-8639 @@ -772,10 +772,10 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen # attrs with verbose option level # ################################################## -TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 -TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5 # same attr number , all same attr name TOOLTEST h5diff_704.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g @@ -789,7 +789,7 @@ TOOLTEST h5diff_706.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /nty # different attr number , same attr name (intersected) TOOLTEST h5diff_707.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g2 -# different attr number , all different attr name +# different attr number , all different attr name TOOLTEST h5diff_708.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g3 # when no attributes exist in both objects @@ -801,32 +801,32 @@ TOOLTEST h5diff_710.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 # ############################################################################## # 8. all dataset datatypes # ############################################################################## -TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5 +TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5 # 9. compare a file with itself TOOLTEST h5diff_90.txt -v h5diff_basic2.h5 h5diff_basic2.h5 # 10. read by hyperslab, print indexes -TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5 +TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5 # 11. floating point comparison # double value -TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 +TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # float value -TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 +TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 -# with --use-system-epsilon for double value -TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 +# with --use-system-epsilon for double value +TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # with --use-system-epsilon for float value -TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 +TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 # not comparable -c flag -TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 +TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 -TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 +TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 TOOLTEST h5diff_202.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset2 g2/dset3 @@ -842,9 +842,9 @@ TOOLTEST h5diff_206.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset7 g2/dset8 TOOLTEST h5diff_207.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset8 g2/dset9 # not comparable in dataspace of zero dimension size -TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5 +TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5 -# non-comparable dataset with comparable attribute, and other comparable datasets. +# non-comparable dataset with comparable attribute, and other comparable datasets. # Also test non-compatible attributes with different type, dimention, rank. # All the comparables should display differences. TOOLTEST h5diff_220.txt -c non_comparables1.h5 non_comparables2.h5 /g1 @@ -862,7 +862,7 @@ TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 TOOLTEST h5diff_223.txt -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes # swap files TOOLTEST h5diff_224.txt -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes - + # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## @@ -958,28 +958,28 @@ TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_e TOOLTEST h5diff_450.txt --follow-symlinks -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) -TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 +TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # try --no-dangling-links without --follow-symlinks options TOOLTEST h5diff_452.txt --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (FILE to FILE) -TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 +TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (obj to obj) -TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist # dangling link found for soft links (obj to obj) Both dangle links -TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist +TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist # dangling link found for ext links (FILE to FILE) -TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 +TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 # dangling link found for ext links (obj to obj). target file exist -TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1 +TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1 # dangling link found for ext links (obj to obj). target file NOT exist -TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2 +TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2 # dangling link found for ext links (obj to obj). Both dangle links TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_noexist2 @@ -993,14 +993,14 @@ TOOLTEST h5diff_466.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangl # soft link vs. soft dangling TOOLTEST h5diff_467.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2 # ext dangling vs. ext dangling -TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 # ext link vs. ext dangling TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 #---------------------------------------- -# dangling links without follow symlink +# dangling links without follow symlink # (HDFFV-7998) -# test - soft dangle links (same and different paths), +# test - soft dangle links (same and different paths), # - external dangle links (same and different paths) TOOLTEST h5diff_471.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 TOOLTEST h5diff_472.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 @@ -1011,7 +1011,7 @@ TOOLTEST h5diff_475.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_li # ############################################################################## # # test for group diff recursivly # ############################################################################## -# root +# root TOOLTEST h5diff_500.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / TOOLTEST h5diff_501.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / @@ -1045,7 +1045,7 @@ TOOLTEST h5diff_513.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_ TOOLTEST h5diff_514.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11 ############################################################################### -# Test for group recursive diff via multi-linked external links +# Test for group recursive diff via multi-linked external links # With follow-symlinks, file h5diff_grp_recurse_ext1.h5 and h5diff_grp_recurse_ext2-1.h5 should # be same with the external links. ############################################################################### @@ -1068,7 +1068,7 @@ TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 h5diff_exclude1-1.h5 h5d TOOLTEST h5diff_481.txt -v h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 # -# Different structure, different names. +# Different structure, different names. # # Exclude all the different objects. Expect return - same TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5 @@ -1099,9 +1099,9 @@ TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 # ############################################################################## -# # Test mutually exclusive options +# # Test mutually exclusive options # ############################################################################## -# Test with -d , -p and --use-system-epsilon. +# Test with -d , -p and --use-system-epsilon. TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_642.txt -v -p 0.05 -d 5 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 4a32491..1796151 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -18,7 +18,7 @@ # Modification: # Pedro Vicente Nunes, 11/15/2006 # Added $FILEN variables for file names -# +# srcdir=@srcdir@ @@ -32,7 +32,7 @@ EXIT_FAILURE=1 H5REPACK=h5repack # The tool name H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary -H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary H5DUMP=../h5dump/h5dump # The h5dump tool name @@ -45,8 +45,8 @@ DIRNAME='dirname' LS='ls' AWK='awk' -H5DETECTSZIP=testh5repack_detect_szip -H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP +H5DETECTSZIP=testh5repack_detect_szip +H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP nerrors=0 @@ -151,7 +151,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 @@ -203,12 +203,12 @@ SKIP() { # Call the h5diff tool # -DIFFTEST() +DIFFTEST() { VERIFY h5diff output $@ ( cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN -q "$@" + $RUNSERIAL $H5DIFF_BIN -q "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -217,7 +217,7 @@ DIFFTEST() else echo " PASSED" fi - + } # Call h5repack @@ -225,7 +225,7 @@ DIFFTEST() # call TOOLTEST_MAIN and delete $output file -TOOLTEST() +TOOLTEST() { echo $@ infile=$2 @@ -251,7 +251,7 @@ TOOLTEST() } #------------------------------------------ -# Verifying layouts of a dataset +# Verifying layouts of a dataset VERIFY_LAYOUT_DSET() { layoutfile=layout-$1.$2 @@ -263,9 +263,9 @@ VERIFY_LAYOUT_DSET() shift shift shift - + TESTING $H5REPACK $@ - ( + ( cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) @@ -277,7 +277,7 @@ VERIFY_LAYOUT_DSET() echo " PASSED" DIFFTEST $infile $outfile fi - + #--------------------------------- # check the layout from a dataset VERIFY "a dataset layout" @@ -309,9 +309,9 @@ VERIFY_LAYOUT_ALL() shift shift shift - + TESTING $H5REPACK $@ - ( + ( cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) @@ -323,8 +323,8 @@ VERIFY_LAYOUT_ALL() echo " PASSED" DIFFTEST $infile $outfile fi - - + + #--------------------------------- # check the layout from a dataset # check if the other layouts still exsit @@ -351,7 +351,7 @@ VERIFY_LAYOUT_ALL() echo " PASSED" fi fi - else + else # if COMPACT if [ $expectlayout = "COMPACT" ]; then TESTING $H5DUMP_BIN -pH $outfile @@ -403,7 +403,7 @@ VERIFY_LAYOUT_ALL() # same as TOOLTEST, but it uses the old syntax -i input_file -o output_file # -TOOLTEST0() +TOOLTEST0() { infile=$2 outfile=out-$1.$2 @@ -431,7 +431,7 @@ TOOLTEST0() # same as TOOLTEST, but it uses without -i -o options # used to test the family driver, where these files reside # -TOOLTEST1() +TOOLTEST1() { infile=$2 outfile=out-$1.$2 @@ -454,11 +454,11 @@ TOOLTEST1() fi rm -f $outfile } - + # This is same as TOOLTEST() with comparing display output # from -v option # -TOOLTESTV() +TOOLTESTV() { expect="$TESTDIR/$2.tst" actual="$TESTDIR/`basename $2 .ddl`.out" @@ -468,7 +468,7 @@ TOOLTESTV() outfile=out-$1.$2 shift shift - + # Run test. TESTING $H5REPACK $@ ( @@ -497,15 +497,15 @@ TOOLTESTV() nerrors="`expr $nerrors + 1`" test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' fi - + rm -f $actual $actual_err rm -f $outfile } - + # This is same as TOOLTESTV() with comparing h5dump output # from -pH option # -TOOLTEST_DUMP() +TOOLTEST_DUMP() { infile=$2 outfile=out-$1.$2 @@ -515,7 +515,7 @@ TOOLTEST_DUMP() shift shift - + # Run test. TESTING $H5REPACK $@ ( @@ -531,12 +531,12 @@ TOOLTEST_DUMP() VERIFY h5dump output $@ ( cd $TESTDIR - $RUNSERIAL $H5DUMP_BIN -pH $outfile + $RUNSERIAL $H5DUMP_BIN -pH $outfile ) >$actual 2>$actual_err cat $actual_err >> $actual RET=$? - + fi if cmp -s $expect $actual; then @@ -547,7 +547,7 @@ TOOLTEST_DUMP() nerrors="`expr $nerrors + 1`" test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' fi - + rm -f $actual $actual_err rm -f $outfile } @@ -618,7 +618,7 @@ TOOLTEST_META() echo "*FAILED*" nerrors="`expr $nerrors + 1`" fi - + rm -f $outfile } # ADD_HELP_TEST @@ -648,7 +648,7 @@ TOOLTEST_HELP() { echo " Expected output (*.txt) differs from actual output (*.out)" nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actual_err @@ -674,28 +674,28 @@ STDOUT_FILTER() { # Each run generates ".out.h5" and the tool h5diff is used to # compare the input and output files # -# the tests are the same as the program h5repacktst, but run from the CLI +# the tests are the same as the program h5repacktst, but run from the CLI # # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which # filters are defined. -# detect whether the encoder is present. +# detect whether the encoder is present. USE_FILTER_SZIP_ENCODER="no"; if test $USE_FILTER_SZIP = "yes"; then 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 TOOLTEST_HELP h5repack-help.txt -h -# copy files (these files have no filters) +# copy files (these files have no filters) TOOLTEST fill h5repack_fill.h5 TOOLTEST objs h5repack_objs.h5 TOOLTEST attr h5repack_attr.h5 @@ -719,8 +719,8 @@ if test $USE_FILTER_DEFLATE != "yes" ; then else TOOLTEST gzip_individual $arg fi - -# gzip for all + +# gzip for all arg="h5repack_layout.h5 -f GZIP=1" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg @@ -733,7 +733,7 @@ arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST szip_individual $arg + TOOLTEST szip_individual $arg fi # szip for all @@ -741,18 +741,18 @@ arg="h5repack_layout.h5 -f SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST szip_all $arg + TOOLTEST szip_all $arg fi # shuffle with individual object arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10" -TOOLTEST shuffle_individual $arg - +TOOLTEST shuffle_individual $arg + # shuffle for all arg="h5repack_layout.h5 -f SHUF" TOOLTEST shuffle_all $arg - + # fletcher32 with individual object arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10" TOOLTEST fletcher_individual $arg @@ -777,7 +777,7 @@ else # compare output TOOLTESTV gzip_verbose_filters $arg fi - + ########################################################### # the following tests assume the input files have filters ########################################################### @@ -789,7 +789,7 @@ if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then else TOOLTEST szip_copy $arg fi - + # szip remove arg="h5repack_szip.h5 --filter=dset_szip:NONE" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then @@ -797,7 +797,7 @@ if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then else TOOLTEST szip_remove $arg fi - + # deflate copy arg="h5repack_deflate.h5" if test $USE_FILTER_DEFLATE != "yes" ; then @@ -813,7 +813,7 @@ if test $USE_FILTER_DEFLATE != "yes" ; then else TOOLTEST deflate_remove $arg fi - + # shuffle copy arg="h5repack_shuffle.h5" TOOLTEST shuffle_copy $arg @@ -868,14 +868,14 @@ arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST deflate_convert $arg + TOOLTEST deflate_convert $arg fi arg="h5repack_szip.h5 -f dset_szip:GZIP=1" if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST szip_convert $arg + TOOLTEST szip_convert $arg fi @@ -890,9 +890,9 @@ fi #file arg="h5repack_layout.h5 -e h5repack.info" if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP $arg + SKIP $arg else - TOOLTEST deflate_file $arg + TOOLTEST deflate_file $arg fi ######################################################### @@ -937,18 +937,18 @@ VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT - VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA -#--------------------------------------------------------------------------- -# Test file contains chunked datasets (need multiple dsets) with +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with # unlimited max dims. (HDFFV-7933) # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim VERIFY_LAYOUT_DSET chunk2chunk h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300 -# chunk to contiguous +# chunk to contiguous VERIFY_LAYOUT_DSET chunk2conti h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI -# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# chunk to compact - convert big dataset (should be > 64k) for this purpose, # should remain as original layout (chunk) VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA @@ -956,7 +956,7 @@ VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk # Test -f for some specific cases. Chunked dataset with unlimited max dims. # (HDFFV-8012) #-------------------------------------------------------------------------- -# - should not fail +# - should not fail # - should not change max dims from unlimit # chunk dim is bigger than dataset dim. ( dset size < 64k ) @@ -972,14 +972,14 @@ VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f ch TOOLTEST error4 h5repack_layout3.h5 -f NONE #-------------------------------------------------------------------------- -# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset +# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset # (dset size < 64K) and with unlimited max dims on a condition as follow. # (HDFFV-8214) #-------------------------------------------------------------------------- # chunk dim is bigger than dataset dim. should succeed. VERIFY_LAYOUT_DSET ckdim_biger h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI -# chunk dim is smaller than dataset dim. should succeed. +# chunk dim is smaller than dataset dim. should succeed. VERIFY_LAYOUT_DSET ckdim_smaller h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI @@ -1022,7 +1022,7 @@ if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST0 old_style_layout_short_switches $arg -fi +fi # add a userblock to file arg="h5repack_objs.h5 -u ublock.bin -b 2048" @@ -1049,17 +1049,17 @@ TOOLTEST1 family tfamily%05d.h5 TOOLTEST bug1814 h5repack_refs.h5 # test attribute with various references (bug1797 / HDFFV-5932) -# the references in attribute of compund or vlen datatype -TOOLTEST HDFFV-5932 h5repack_attr_refs.h5 +# the references in attribute of compund or vlen datatype +TOOLTEST HDFFV-5932 h5repack_attr_refs.h5 -# Add test for memory leak in attirbute. This test is verified by CTEST. -# 1. leak from vlen string +# Add test for memory leak in attirbute. This test is verified by CTEST. +# 1. leak from vlen string # 2. leak from compound type without reference member # (HDFFV-7840, ) # Note: this test is experimental for sharing test file among tools TOOLTEST HDFFV-7840 h5diff_attr1.h5 -# tests for metadata block size option +# tests for metadata block size option TOOLTEST_META meta_short h5repack_layout.h5 -M 8192 TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 49f2dc9..ff7cf12 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -81,7 +81,7 @@ #define FLETCHER32 "CHECKSUM FLETCHER32" #define SZIP "COMPRESSION SZIP" #define NBIT "COMPRESSION NBIT" -#define SCALEOFFSET "COMPRESSION SCALEOFFSET" +#define SCALEOFFSET "COMPRESSION SCALEOFFSET" #define SCALEOFFSET_MINBIT "MIN BITS" #define STORAGE_LAYOUT "STORAGE_LAYOUT" #define CONTIGUOUS "CONTIGUOUS" diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index a007882..1e6e9d6 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -368,7 +368,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai } ctx->need_prefix = TRUE; - + if(FALSE == dimension_break) elmt_counter = 0; } /* end for (i = 0; i < nelmts... */ @@ -803,14 +803,15 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, HDassert(cur_ctx); HDassert(buffer); HDassert(ptdata); + HDassert(ndims > 0); HDmemset(&ctx, 0, sizeof(ctx)); /* Allocate space for the dimension array */ - if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); dims1[0] = npoints; - + /* Create dataspace for reading buffer */ if((mem_space = H5Screate_simple(1, dims1, NULL)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); @@ -1457,7 +1458,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co if((f_space = H5Dget_space(dset)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); - + if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); ctx->ndims = (unsigned)sndims; @@ -1743,7 +1744,7 @@ CATCH *------------------------------------------------------------------------- */ int -h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, +h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, struct subset_t *sset) { hid_t f_space = -1; @@ -1819,7 +1820,7 @@ done: *------------------------------------------------------------------------- */ int -h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, +h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, hid_t type, hid_t space, void *mem) { HERR_INIT(int, SUCCEED) @@ -1898,18 +1899,18 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ } else h5tools_str_append(buffer, "\"%s\"", obj->objname); - } + } else { error_msg("unknown committed type.\n"); h5tools_setstatus(EXIT_FAILURE); } return ret_value; - } - + } + if (info->line_ncols > 0) ncols = info->line_ncols; - + switch (type_class) { case H5T_INTEGER: if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { @@ -2231,7 +2232,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ else if(order == H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ @@ -2262,7 +2263,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ else if(order == H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ @@ -2336,9 +2337,9 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + H5free_memory(ttag); - } + } ctx->indent_level--; ctx->need_prefix = TRUE; @@ -2352,7 +2353,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ if((snmembers = H5Tget_nmembers(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); nmembers = (unsigned)snmembers; - + h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2407,7 +2408,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); - + if(H5Tclose(super) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); @@ -2597,7 +2598,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i if (info->line_ncols > 0) ncols = info->line_ncols; - + if((snmembs = H5Tget_nmembers(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); nmembs = (unsigned)snmembs; @@ -2737,7 +2738,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->datatypebegin, @@ -2759,7 +2760,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, /*------------------------------------------------------------------------- * Function: dump_dataspace * - * Purpose: Dump the dataspace. + * Purpose: Dump the dataspace. * * Return: void * @@ -2785,7 +2786,7 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", h5tools_dump_header_format->dataspacebegin); @@ -2835,7 +2836,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2926,7 +2927,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3105,7 +3106,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3117,13 +3118,13 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); - - if (filtn < 0) - continue; /* nothing to print for invalid filter */ + + if(filtn < 0) + continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); switch(filtn) { case H5Z_FILTER_DEFLATE: @@ -3187,7 +3188,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "HEADER %s", "RAW"); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3211,12 +3212,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; default: - /* filters do not have to be available for showing registered filter info. - see HDFFV-8346 for details. --xcao@hdfgroup.org - if(H5Zfilter_avail(filtn)) - h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN); - else - */ h5tools_str_append(&buffer, "%s %s", "USER_DEFINED_FILTER", BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3224,15 +3219,15 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILTER_ID %d", filtn); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + if(f_name[0] != '\0') { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT %s", f_name); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3240,7 +3235,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if (cd_nelmts) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN); for (j=0; jneed_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3264,7 +3259,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NONE"); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3273,7 +3268,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3284,7 +3279,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3293,10 +3288,10 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILL_TIME "); - + H5Pget_fill_time(dcpl_id, &ft); switch(ft) { case H5D_FILL_TIME_ALLOC: @@ -3317,7 +3312,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", "VALUE "); H5Pfill_value_defined(dcpl_id, &fvstatus); @@ -3333,7 +3328,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3344,7 +3339,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3353,7 +3348,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); H5Pget_alloc_time(dcpl_id, &at); switch(at) { @@ -3378,7 +3373,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3428,7 +3423,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, comment[cmt_bufsize] = '\0'; /* necessary because null char is not returned */ ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT \"%s\"", comment); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3443,7 +3438,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, /*------------------------------------------------------------------------- * Function: dump_attribute * - * Purpose: Dump the attribute. + * Purpose: Dump the attribute. * * Return: void * @@ -3452,7 +3447,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, */ void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, const char *attr_name, hid_t attr_id, + h5tools_context_t *ctx, const char *attr_name, hid_t attr_id, int display_index, int display_char) { h5tools_str_t buffer; /* string into which to render */ @@ -3471,7 +3466,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->attributebegin, attr_name, @@ -3480,7 +3475,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, if(attr_id < 0) { error_msg("unable to open attribute \"%s\"\n", attr_name); - } + } else { hid_t type, space; @@ -3507,7 +3502,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { @@ -3563,36 +3558,36 @@ void h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) { int packed_bits_size = 0; - + hid_t n_type = h5tools_get_native_type(type); if(H5Tget_class(n_type)==H5T_INTEGER) { if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) { packed_bits_size = 8 * sizeof(char); - } + } else if(H5Tequal(n_type, H5T_NATIVE_UCHAR) == TRUE) { packed_bits_size = 8 * sizeof(unsigned char); - } + } else if(H5Tequal(n_type, H5T_NATIVE_SHORT) == TRUE) { packed_bits_size = 8 * sizeof(short); - } + } else if(H5Tequal(n_type, H5T_NATIVE_USHORT) == TRUE) { packed_bits_size = 8 * sizeof(unsigned short); - } + } else if(H5Tequal(n_type, H5T_NATIVE_INT) == TRUE) { packed_bits_size = 8 * sizeof(int); - } + } else if(H5Tequal(n_type, H5T_NATIVE_UINT) == TRUE) { packed_bits_size = 8 * sizeof(unsigned int); - } + } else if(H5Tequal(n_type, H5T_NATIVE_LONG) == TRUE) { packed_bits_size = 8 * sizeof(long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_ULONG) == TRUE) { packed_bits_size = 8 * sizeof(unsigned long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_LLONG) == TRUE) { packed_bits_size = 8 * sizeof(long long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_ULLONG) == TRUE) { packed_bits_size = 8 * sizeof(unsigned long long); } @@ -3633,25 +3628,25 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, HDmemset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin); h5tools_print_dims(&buffer, sset->start.data, dims); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->startend, h5tools_dump_header_format->startblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3660,7 +3655,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_print_dims(&buffer, sset->stride.data, dims); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->strideend, h5tools_dump_header_format->strideblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3674,7 +3669,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->countend, h5tools_dump_header_format->countblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3688,7 +3683,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->blockend, h5tools_dump_header_format->blockblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->indent_level--; h5tools_str_close(&buffer); @@ -3705,7 +3700,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, */ void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t obj_id, int obj_data, struct subset_t *sset, + h5tools_context_t *ctx, hid_t obj_id, int obj_data, struct subset_t *sset, int display_index, int display_char) { H5S_class_t space_type; @@ -3768,10 +3763,10 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_dump_subsetting_header(stream, &outputformat, ctx, sset, H5Sget_simple_extent_ndims(f_space)); H5Sclose(f_space); - + ctx->indent_level++; } - + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->databegin, h5tools_dump_header_format->datablockbegin); @@ -3797,7 +3792,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, datactx.indent_level++; datactx.need_prefix = TRUE; h5tools_simple_prefix(stream, info, &datactx, (hsize_t)0, 0); - + string_dataformat = *info; string_dataformat.idx_fmt = "\""; string_dataformat.line_multi_new = 1; @@ -3865,7 +3860,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, datactx.indent_level++; datactx.need_prefix = TRUE; h5tools_simple_prefix(stream, info, &datactx, (hsize_t)0, 0); - + string_dataformat = *info; string_dataformat.idx_fmt = "\""; string_dataformat.line_multi_new = 1; @@ -3892,7 +3887,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); HDfree(buf); - } + } else status = SUCCEED; @@ -3922,10 +3917,10 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, if (sset && obj_data) { ctx->indent_level--; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->subsettingblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingblockend); diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index ae549fd..749157e 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -98,7 +98,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * to the `catch_except' label, if we're not already past it. */ #define H5E_THROW(fail_value, min_id, str) { \ - HERROR(H5E_tools_g, min_id, str); \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ H5_LEAVE(fail_value) \ } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 88308ed..9d151d0 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -454,8 +454,7 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, for (i = 0; i < nblocks; i++) { int j; - h5tools_str_append(str, info->dset_blockformat_pre, i ? "," OPTIONAL_LINE_BREAK " " : "", - (unsigned long)i); + h5tools_str_append(str, info->dset_blockformat_pre, i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)i); /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) @@ -1398,8 +1397,7 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac char *head = NULL; if ( substr == NULL || replacement == NULL ) - return HDstrdup (string); - + return HDstrdup (string); newstr = HDstrdup (string); head = newstr; while ( (tok = HDstrstr ( head, substr ))){ @@ -1407,8 +1405,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, tok - oldstr ); HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); diff --git a/tools/misc/Makefile.am b/tools/misc/Makefile.am index 882f8f2..53b1872 100644 --- a/tools/misc/Makefile.am +++ b/tools/misc/Makefile.am @@ -23,7 +23,7 @@ include $(top_srcdir)/config/commence.am # Include src directory AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -#test script and program +#test scripts and programs TEST_PROG=h5repart_gentest talign TEST_SCRIPT=testh5repart.sh testh5mkgrp.sh -- cgit v0.12