From 3a4c43cbd4a58a527c802cc36651ac252f84ed90 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 10:26:14 -0500 Subject: [svn-r23353] Correct target name --- tools/lib/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index f0d0d01..ac86e8a 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -38,15 +38,15 @@ SET (H5_TOOLS_LIB_HDRS ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES FOLDER libraries/tools) +#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## -- cgit v0.12 From dadea7dc7425d27bf48c75d9e40086c073e27b00 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 10:26:55 -0500 Subject: [svn-r23354] Close prop list var --- test/tfile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/tfile.c b/test/tfile.c index e669bd0..ac2ef82 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3084,7 +3084,7 @@ test_filespace_compatible(void) VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); /* Get the file's file creation property list */ - /* Retrieve the file space handling stretegy and threshold */ + /* Retrieve the file space handling strategy and threshold */ fcpl = H5Fget_create_plist(fid); CHECK(fcpl, FAIL, "H5Fget_create_plist"); ret = H5Pget_file_space(fcpl, &strategy, &threshold); @@ -3117,9 +3117,13 @@ test_filespace_compatible(void) ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the plist */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); /* Re-Open the file */ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); -- cgit v0.12 From e188e7797bcf9d10f7f301f9664e4f0c41f36937 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 17 Mar 2013 03:28:21 -0500 Subject: [svn-r23361] Snapshot version 1.9 release 148 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index b3a5451..96c1121 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.148 currently under development +HDF5 version 1.9.149 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b025f0b..37e5d1b 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 37b5b68..8df77f3 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 2c25701..a31c67a 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.148. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.149. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.148' -PACKAGE_STRING='HDF5 1.9.148' +PACKAGE_VERSION='1.9.149' +PACKAGE_STRING='HDF5 1.9.149' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.148 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.149 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.148:";; + short | recursive ) echo "Configuration of HDF5 1.9.149:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.148 +HDF5 configure 1.9.149 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.148, which was +It was created by HDF5 $as_me 1.9.149, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.148' + VERSION='1.9.149' cat >>confdefs.h <<_ACEOF @@ -31748,7 +31748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.148, which was +This file was extended by HDF5 $as_me 1.9.149, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31814,7 +31814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.148 +HDF5 config.status 1.9.149 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34587,7 +34587,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.148 +HDF5 config.lt 1.9.149 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index c51f05e..38b342a 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.148], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.149], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c41653f..7379980 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 89aee46..b360bf3 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index fc734df..fb54a54 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index bd46a70..37d5af8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1f4016c..4414eb1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.148 currently under development +HDF5 version 1.9.149 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index f66508d..deb4587 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 148 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 149 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.148" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.149" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index c08649e..febb111 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 57f358d..f4c0eab 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.148" +#define H5_PACKAGE_STRING "HDF5 1.9.149" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.148" +#define H5_PACKAGE_VERSION "1.9.149" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.148" +#define H5_VERSION "1.9.149" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 76a8599736e22ede7506e550fcfe9c3443ff0a3d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 18 Mar 2013 14:50:32 -0500 Subject: [svn-r23366] Removed the H5Pset_dxpl_multi and H5Pget_dxpl_multi functions from the library. The intended functionality for them was never fully implemented and they are fundamentally broken. The functions were removed from the C and C++ interfaces. They were not exported in the Fortran interface. Tested on: jam(c++/fortran/hl) I tested using check-vfd to ensure the multi VFD still works properly. There is no reason to test this on other machines or on parallel. --- c++/src/H5DxferProp.cpp | 37 ------------- src/H5FDmulti.c | 144 ------------------------------------------------ src/H5FDmulti.h | 3 - 3 files changed, 184 deletions(-) diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 0785735..bc3e0af 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -266,43 +266,6 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setMulti -///\brief Sets the data transfer property list for the multi-file driver. -///\param memb_dxpl - OUT: Array of data access property lists -///\exception H5::PropListIException -///\par Description -/// This function can only be used after the member map has -/// been set with FileAccPropList::setMulti (not done - BMR.) -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -void DSetMemXferPropList::setMulti(const hid_t *memb_dxpl) -{ - herr_t ret_value = H5Pset_dxpl_multi(id, memb_dxpl); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setMulti", - "H5Pset_dxpl_multi failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getMulti -///\brief Returns multi-file data transfer property list information. -///\param memb_dxpl - OUT: Array of data access property lists -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -void DSetMemXferPropList::getMulti(hid_t *memb_dxpl) -{ - herr_t ret_value = H5Pget_dxpl_multi(id, memb_dxpl); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getMulti", - "H5Pget_dxpl_multi failed"); - } -} - -//-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setSmallDataBlockSize ///\brief Sets the size of a contiguous block reserved for small data. ///\param size - IN: Maximum size, in bytes, of the small data block. diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 5bdfbbe..9d6e065 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -726,150 +726,6 @@ H5FD_multi_dxpl_cls_cb(const char *name, size_t size, void *_dx) return 0; } /* end H5FD_multi_dxpl_cls_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pset_dxpl_multi - * - * Purpose: Set the data transfer property list DXPL_ID to use the multi - * driver with the specified data transfer properties for each - * memory usage type MEMB_DXPL[] (after the usage map is - * applied). - * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Tuesday, August 10, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl) -{ - H5FD_multi_dxpl_t dx; - H5FD_mem_t mt; - htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */ - static const char *func = "H5FDset_dxpl_multi"; /* Function Name for error reporting */ - - /*NO TRACE*/ - - /* Clear the error stack */ - H5Eclear2(H5E_DEFAULT); - - /* Check arguments */ - if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1) - if(!memb_dxpl) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1) - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(memb_dxpl[mt] != H5P_DEFAULT && TRUE != H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1) - } /* end for */ - - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Copy the DXPLs to internal property, converting "generic" default - * property lists into default dataset transfer property lists */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(memb_dxpl[mt] == H5P_DEFAULT) - dx.memb_dxpl[mt] = H5P_DATASET_XFER_DEFAULT; - else { - if((dx.memb_dxpl[mt] = H5Pcopy(memb_dxpl[mt])) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCOPY, "can't copy dataset transfer property list", -1) - } /* end else */ - } /* end for */ - - /* Clear previous property, if it exists */ - if(prop_exists) { - H5FD_multi_dxpl_t old_dx; - - /* Get the old DXPL value */ - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &old_dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1) - - ALL_MEMBERS(mt) { - if(old_dx.memb_dxpl[mt] >= 0) - if(H5Pclose(old_dx.memb_dxpl[mt]) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCLOSEOBJ, "can't close property list", -1) - } END_MEMBERS; - - /* Set the new value */ - if(H5Pset(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1) - } /* end if */ - else { - /* Insert multi VFD DXPL property into property list */ - if(H5Pinsert2(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, H5FD_MULTI_DXPL_PROP_SIZE, &dx, NULL, NULL, NULL, H5FD_multi_dxpl_copy_cb, H5FD_multi_dxpl_cmp_cb, H5FD_multi_dxpl_cls_cb) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINSERT, "can't insert multi VFD DXPL property", -1) - } /* end else */ - - return 0; -} /* end H5Pset_dxpl_multi() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_dxpl_multi - * - * Purpose: Returns information which was set with H5Pset_dxpl_multi() - * above. - * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Tuesday, August 10, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/) -{ - H5FD_multi_dxpl_t dx; - H5FD_mem_t mt; - htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */ - static const char *func = "H5FDget_dxpl_multi"; /* Function Name for error reporting */ - - /*NO TRACE*/ - - /* Clear the error stack */ - H5Eclear2(H5E_DEFAULT); - - /* Argument checking */ - if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - - if(memb_dxpl) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - if(!prop_exists) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "multi VFD DXPL property not set", -1) - - /* Get the DXPL value */ - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - - /* Deep copy the multi VFD DXPL value */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(dx.memb_dxpl[mt] >= 0) - memb_dxpl[mt] = H5Pcopy(dx.memb_dxpl[mt]); - else - memb_dxpl[mt] = dx.memb_dxpl[mt]; /*default or bad ID */ - } /* end for */ - } /* end if */ - - return 0; -} /* end H5Pget_dxpl_multi() */ - /*------------------------------------------------------------------------- * Function: H5FD_multi_sb_size diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index da16b0c..e819e74 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -34,9 +34,6 @@ H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, H5_DLL herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, hid_t *memb_fapl/*out*/, char **memb_name/*out*/, haddr_t *memb_addr/*out*/, hbool_t *relax/*out*/); -H5_DLL herr_t H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl); -H5_DLL herr_t H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/); - H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const char *raw_ext, hid_t raw_plist_id); -- cgit v0.12 From 626fb1b02fee15e1954583f7ec06b3e09eb7bffc Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 18 Mar 2013 23:14:59 -0500 Subject: [svn-r23379] HDFFV-8297 h5fc does not recognize files ending in .f95, .f03, and .f08 as source files added missing extensions. Tested: jam (gnu) --- fortran/src/h5fc.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 2d7b5b4..c55b496 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -233,8 +233,13 @@ for arg in $@ ; do *) allargs="$allargs $arg" if [ -s "$arg" ] ; then ext=`expr "$arg" : '.*\(\..*\)'` - if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \ - "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then + if [ "$ext" = ".f" -o "$ext" = ".F" -o \ + "$ext" = ".for" -o "$ext" = ".FOR" -o \ + "$ext" = ".ftn" -o "$ext" = ".FTN" -o \ + "$ext" = ".f90" -o "$ext" = ".F90" -o \ + "$ext" = ".f95" -o "$ext" = ".F95" -o \ + "$ext" = ".f03" -o "$ext" = ".F03" -o \ + "$ext" = ".f08" -o "$ext" = ".F08" ] ; then do_compile="yes" compile_args="$compile_args $arg" fname=`basename $arg $ext` -- cgit v0.12 From 8ad18f496ad665faffc4f2fd0eae8140b53ab760 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 15:51:14 -0500 Subject: [svn-r23388] HDDFV-8322: Free allocations in parse_command_line function. Tested: local linux --- tools/misc/h5mkgrp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index b4ac6f6..b9fb588 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -46,6 +46,7 @@ typedef struct { size_t ngroups; /* Number of groups to create */ char **groups; /* Pointer to array of group names */ } param_t; +param_t params; /* Command line parameter settings */ /*------------------------------------------------------------------------- @@ -62,6 +63,15 @@ typedef struct { static void leave(int ret) { + int curr_group; + + if (params.fname) + HDfree (params.fname); + if (params.ngroups) { + for(curr_group = 0; curr_group < params.ngroups; curr_group++) + HDfree (params.groups[curr_group]); + HDfree (params.groups); + } h5tools_close(); HDexit(ret); } /* end leave() */ @@ -206,7 +216,6 @@ for(curr_group = 0; curr_group < params->ngroups; curr_group++) int main(int argc, const char *argv[]) { - param_t params; /* Command line parameter settings */ hid_t fid; /* HDF5 file ID */ hid_t fapl_id; /* File access property list ID */ hid_t lcpl_id; /* Link creation property list ID */ @@ -322,6 +331,6 @@ main(int argc, const char *argv[]) /* Shut down h5tools lib */ h5tools_close(); - return EXIT_SUCCESS; + leave(EXIT_SUCCESS); } /* end main() */ -- cgit v0.12 From 59dd5665a5887efa8e91e0339719e4bd0c2be2a6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 19 Mar 2013 22:44:28 -0500 Subject: [svn-r23395] Description: Bring Coverity changes from branch to trunk: r20682: fixed coverity: 76, 77, 635, 636, 1164, 1165, 1166, 1121, 1122, 1117, 1343 Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (too minor to require h5committest) --- tools/h5copy/h5copy.c | 39 +-- tools/h5ls/h5ls.c | 247 ++++++++++------- tools/lib/h5diff.c | 34 +-- tools/lib/h5diff.h | 205 -------------- tools/lib/h5diff_array.c | 689 +++++++++++++++++++++++++++++----------------- tools/lib/h5diff_attr.c | 14 +- tools/lib/h5tools_utils.h | 2 +- 7 files changed, 619 insertions(+), 611 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 574ba94..b2ad9d0 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -199,23 +199,21 @@ static int parse_flag(const char* str_flag, unsigned *flag) int main (int argc, const char *argv[]) { - hid_t fid_src=-1; - hid_t fid_dst=-1; - char *fname_src=NULL; - char *fname_dst=NULL; - char *oname_src=NULL; - char *oname_dst=NULL; - unsigned flag=0; - unsigned verbose=0; - unsigned parents=0; + hid_t fid_src = -1; + hid_t fid_dst = -1; + char *fname_src = NULL; + char *fname_dst = NULL; + char *oname_src = NULL; + char *oname_dst = NULL; + char *str_flag = NULL; + unsigned flag = 0; + unsigned verbose = 0; + unsigned parents = 0; hid_t ocpl_id = (-1); /* Object copy property list */ hid_t lcpl_id = (-1); /* Link creation property list */ - char str_flag[20]; int opt; int li_ret; h5tool_link_info_t linkinfo; - int i, len; - char *str_ptr=NULL; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -249,7 +247,7 @@ main (int argc, const char *argv[]) usage(); leave(EXIT_FAILURE); } - HDstrcpy(str_flag,opt_arg); + str_flag = HDstrdup(opt_arg); break; case 'h': @@ -377,8 +375,10 @@ main (int argc, const char *argv[]) { printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, fname_dst, oname_dst); - if (flag) + if (flag) { + HDassert(str_flag); printf("Using %s flag\n", str_flag); + } } @@ -417,14 +417,19 @@ main (int argc, const char *argv[]) } /* end if */ else /* error, if parent groups doesn't already exist in destination file */ { + size_t i, len; + len = HDstrlen(oname_dst); + /* check if all the parents groups exist. skip root group */ for (i = 1; i < len; i++) { if ('/'==oname_dst[i]) { - str_ptr = (char*)HDcalloc((size_t)i+1, sizeof(char)); - HDstrncpy (str_ptr, oname_dst, (size_t)i); + char *str_ptr; + + str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); + HDstrncpy(str_ptr, oname_dst, i); str_ptr[i]='\0'; if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { @@ -513,6 +518,8 @@ error: HDfree(oname_dst); if (oname_src) HDfree(oname_src); + if (str_flag) + HDfree(str_flag); h5tools_close(); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 7135e4e..832d91f 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -115,8 +115,8 @@ typedef struct { hid_t gid; /* Group ID */ hbool_t symlink_target; /* Whether this is the target of an symbolic link */ symlink_trav_t *symlink_list; /* List of visited symbolic links */ - int base_len; /* Length of base path name, if not root */ - int name_start; /* # of leading characters to strip off path names on output */ + size_t base_len; /* Length of base path name, if not root */ + size_t name_start; /* # of leading characters to strip off path names on output */ }iter_t; /* Command-line switches */ @@ -154,7 +154,6 @@ static struct dispatch_t { dispatch_g[TYPE].list2 = (LIST2); \ } -static void display_type(hid_t type, int ind); static void print_type(h5tools_str_t *buffer, hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); @@ -342,7 +341,7 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, int n; if(show_file_name_g) - sprintf(fullname, "%s/%s", iter->fname, oname + iter->name_start); + HDsnprintf(fullname, sizeof(fullname), "%s/%s", iter->fname, oname + iter->name_start); else name = oname + iter->name_start; @@ -553,14 +552,14 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) /* If the precision is less than the total size then show the precision * and offset on the following line. Also display the padding * information. */ - if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) { + if(8 * H5Tget_size(type) != (prec = H5Tget_precision(type))) { h5tools_str_append(buffer, "\n%*s(%lu bit%s of precision beginning at bit %lu)", - ind, "", (unsigned long)prec, 1==prec?"":"s", + ind, "", (unsigned long)prec, 1 == prec ? "" : "s", (unsigned long)H5Tget_offset(type)); H5Tget_pad(type, &plsb, &pmsb); - if (H5Tget_offset(type)>0) { - switch (plsb) { + if(H5Tget_offset(type) > 0) { + switch(plsb) { case H5T_PAD_ZERO: plsb_s = "zero"; break; @@ -575,12 +574,11 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) plsb_s = "unknown"; break; default: - ; break; } } - if (H5Tget_offset(type)+prec<8*H5Tget_size(type)) { - switch (pmsb) { + if((unsigned)H5Tget_offset(type) + prec < 8 * H5Tget_size(type)) { + switch(pmsb) { case H5T_PAD_ZERO: pmsb_s = "zero"; break; @@ -595,23 +593,22 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) pmsb_s = "unknown"; break; default: - ; break; } } if (plsb_s || pmsb_s) { h5tools_str_append(buffer, "\n%*s(", ind, ""); if (plsb_s) { - nbits = H5Tget_offset(type); + nbits = (unsigned)H5Tget_offset(type); h5tools_str_append(buffer, "%lu %s bit%s at bit 0", - (unsigned long)nbits, plsb_s, 1==nbits?"":"s"); + (unsigned long)nbits, plsb_s, 1 == nbits ? "" : "s"); } if (plsb_s && pmsb_s) h5tools_str_append(buffer, ", "); if (pmsb_s) { - nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec); + nbits = (8 * H5Tget_size(type)) - ((unsigned)H5Tget_offset(type) + prec); h5tools_str_append(buffer, "%lu %s bit%s at bit %lu", - (unsigned long)nbits, pmsb_s, 1==nbits?"":"s", - (unsigned long)(8*H5Tget_size(type)-nbits)); + (unsigned long)nbits, pmsb_s, 1 == nbits ? "" : "s", + (unsigned long)(8 * H5Tget_size(type) - nbits)); } h5tools_str_append(buffer, ")"); } @@ -829,14 +826,18 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind) char *name=NULL; /* member name */ size_t size; /* total size of type in bytes */ hid_t subtype; /* member data type */ - unsigned nmembs; /* number of members */ + int nmembs; /* number of members */ int n; /* miscellaneous counters */ unsigned i; /* miscellaneous counters */ - if (H5T_COMPOUND!=H5Tget_class(type)) return FALSE; + if(H5T_COMPOUND != H5Tget_class(type)) + return FALSE; + nmembs = H5Tget_nmembers(type); + if(nmembs <= 0) + return FALSE; + h5tools_str_append(buffer, "struct {"); - nmembs=H5Tget_nmembers(type); - for (i=0; i0); + if(nmembs < 0) + return FALSE; + super = H5Tget_super(type); h5tools_str_append(buffer, "enum "); - print_type(buffer, super, ind+4); + print_type(buffer, super, ind + 4); h5tools_str_append(buffer, " {"); - /* Determine what data type to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format */ - if (H5Tget_size(type)<=sizeof(long long)) { - dst_size = sizeof(long long); - if (H5T_SGN_NONE==H5Tget_sign(type)) { - native = H5T_NATIVE_ULLONG; - } else { - native = H5T_NATIVE_LLONG; + if(nmembs > 0) { + char **name; /* member names */ + unsigned char *value; /* value array */ + hid_t native = -1; /* native integer data type */ + size_t dst_size; /* destination value type size */ + unsigned i; /* miscellaneous counters */ + + /* Determine what data type to use for the native values. To simplify + * things we entertain three possibilities: + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer + * 3. raw format */ + if(H5Tget_size(type) <= sizeof(long long)) { + dst_size = sizeof(long long); + if(H5T_SGN_NONE == H5Tget_sign(type)) + native = H5T_NATIVE_ULLONG; + else + native = H5T_NATIVE_LLONG; + } /* end if */ + else + dst_size = H5Tget_size(type); + + /* Get the names and raw values of all members */ + name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); + for(i = 0; i < (unsigned)nmembs; i++) { + name[i] = H5Tget_member_name(type, i); + H5Tget_member_value(type, i, value + i * H5Tget_size(type)); } - } else { - dst_size = H5Tget_size(type); - } - - /* Get the names and raw values of all members */ - name = HDcalloc(nmembs, sizeof(char*)); - value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); - for (i=0; i0) H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); + /* Convert values to native data type */ + if(native > 0) + if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0) { + /* Release resources */ + for(i = 0; i < (unsigned)nmembs; i++) + HDfree(name[i]); + HDfree(name); + HDfree(value); - /* Sort members by increasing value */ - /*not implemented yet*/ - - /* Print members */ - for (i=0; i", ind+4, ""); + + h5tools_str_append(buffer, "\n%*s}", ind, ""); - /* Release resources */ - for (i=0; i", ind+4, ""); - h5tools_str_append(buffer, "\n%*s}", ind, ""); return TRUE; } @@ -1189,10 +1210,11 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) int ndims, i; hsize_t *dims=NULL; - if (H5T_ARRAY!=H5Tget_class(type)) return FALSE; + if (H5T_ARRAY!=H5Tget_class(type)) + return FALSE; ndims = H5Tget_array_ndims(type); if (ndims) { - dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0])); + dims = (hsize_t *)HDmalloc((unsigned)ndims * sizeof(dims[0])); H5Tget_array_dims2(type, dims); /* Print dimensions */ @@ -1202,9 +1224,8 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) HDfree(dims); } - else { + else h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream); - } /* Print parent type */ @@ -1390,7 +1411,7 @@ dump_dataset_values(hid_t dset) outputformat.line_per_line = 1; } else { - outputformat.line_ncols = width_g; + outputformat.line_ncols = (unsigned)width_g; } if (label_g) outputformat.cmpd_name = "%s="; outputformat.line_pre = " %s "; @@ -1412,9 +1433,9 @@ dump_dataset_values(hid_t dset) } outputformat.arr_linebreak = 0; /* Floating point types should display full precision */ - sprintf(fmt_float, "%%1.%dg", FLT_DIG); + HDsnprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); outputformat.fmt_float = fmt_float; - sprintf(fmt_double, "%%1.%dg", DBL_DIG); + HDsnprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); outputformat.fmt_double = fmt_double; if (hexdump_g) { @@ -1428,8 +1449,7 @@ dump_dataset_values(hid_t dset) outputformat.ascii = TRUE; outputformat.elmt_suf1 = ""; outputformat.elmt_suf2 = ""; - strcpy(string_prefix, outputformat.line_pre); - strcat(string_prefix, "\""); + HDsnprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); outputformat.line_pre = string_prefix; outputformat.line_suf = "\""; } @@ -1487,7 +1507,6 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, size_t need; int ndims; int i; - int n; void *buf; H5S_class_t space_type; hsize_t curr_pos = 0; /* total data element position */ @@ -1502,7 +1521,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Attribute: "); - n = print_string(&buffer, attr_name, TRUE); + print_string(&buffer, attr_name, TRUE); if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) { space = H5Aget_space(attr); @@ -1535,6 +1554,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; + case H5S_NO_CLASS: default: /* Unknown dataspace type */ h5tools_str_append(&buffer, " unknown\n"); @@ -1570,7 +1590,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, outputformat.str_repeat = 8; } - outputformat.line_ncols = width_g; + outputformat.line_ncols = (unsigned)width_g; if(label_g) outputformat.cmpd_name = "%s="; if(string_g && 1==H5Tget_size(type) && @@ -1777,7 +1797,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) } /* Print total raw storage size */ - total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type); + total = (hsize_t)H5Sget_simple_extent_npoints(space) * H5Tget_size(type); used = H5Dget_storage_size(dset); tclass = H5Tget_class(type); h5tools_str_append(&buffer, " %-10s ", "Storage:"); @@ -1795,13 +1815,24 @@ dataset_list2(hid_t dset, const char UNUSED *name) } break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_ARRAY: + case H5T_NCLASSES: default: h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s", total, 1==total?"":"s", used, 1==used?"":"s"); if (used>0) { - utilization = (total*100.0)/used; + utilization = ((double)total * (double)100.0f) / (double)used; h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization); } } @@ -1811,7 +1842,8 @@ dataset_list2(hid_t dset, const char UNUSED *name) /* Print information about external strorage */ if((nf = H5Pget_external_count(dcpl)) > 0) { for(i = 0, max_len = 0; i < nf; i++) { - H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL); + if(H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0) + continue; n = print_string(NULL, f_name, TRUE); max_len = MAX(max_len, n); } /* end for */ @@ -1857,7 +1889,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) filt_id = H5Pget_filter2(dcpl, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); f_name[sizeof(f_name) - 1] = '\0'; - sprintf(s, "Filter-%d:", i); + HDsnprintf(s, sizeof(s), "Filter-%d:", i); h5tools_str_append(&buffer, " %-10s %s-%u %s {", s, (f_name[0] ? f_name : "method"), (unsigned)filt_id, @@ -2054,7 +2086,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void if (cmt_bufsize > 0) { comment = (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if(comment) { - cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize); + cmt_bufsize = H5Oget_comment(obj, comment, (size_t)cmt_bufsize); if(cmt_bufsize > 0) { comment[cmt_bufsize] = 0; h5tools_str_reset(&buffer); @@ -2267,6 +2299,9 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) } break; + case H5L_TYPE_ERROR: + case H5L_TYPE_HARD: + case H5L_TYPE_MAX: default: h5tools_str_append(&buffer, "UD Link {cannot follow UD links}\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); @@ -2457,7 +2492,7 @@ get_width(void) static hbool_t is_valid_args(void) { - herr_t ret = TRUE; + hbool_t ret = TRUE; if(recursive_g && grp_literal_g) { diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 2b4fa29..1752155 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -241,7 +241,6 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options struct exclude_path_list * exclude_path_ptr; int ret_cmp; int ret = 0; - int len_grp; /* check if exclude path option is given */ if (!options->exclude_path) @@ -260,6 +259,8 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options HDstrlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) /* found matching members */ { + size_t len_grp; + /* check if given path belong to an excluding group, if so * exclude it as well. * This verifies if “/grp1/dset1” is only under “/grp1”, but @@ -338,7 +339,6 @@ static void free_exclude_path_list(diff_opt_t *options) *------------------------------------------------------------------------*/ static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, trav_table_t ** table_out, diff_opt_t *options) { - unsigned i; size_t curr1 = 0; size_t curr2 = 0; unsigned infile[2]; @@ -346,8 +346,8 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch char * path2_lp; h5trav_type_t type1_l; h5trav_type_t type2_l; - int path1_offset = 0; - int path2_offset = 0; + size_t path1_offset = 0; + size_t path2_offset = 0; int cmp; trav_table_t *table; size_t idx; @@ -616,8 +616,8 @@ hsize_t h5diff(const char *fname1, int i; int l_ret1 = -1; int l_ret2 = -1; - const char * obj1fullname = NULL; - const char * obj2fullname = NULL; + char * obj1fullname = NULL; + char * obj2fullname = NULL; int both_objs_grp = 0; /* init to group type */ h5trav_type_t obj1type = H5TRAV_TYPE_GROUP; @@ -701,26 +701,26 @@ hsize_t h5diff(const char *fname1, /* make the given object1 fullpath, start with "/" */ if (HDstrncmp(objname1, "/", 1)) { - HDstrcpy((char *)obj1fullname, "/"); - HDstrcat((char *)obj1fullname, objname1); + HDstrcpy(obj1fullname, "/"); + HDstrcat(obj1fullname, objname1); } else - HDstrcpy((char *)obj1fullname, objname1); + HDstrcpy(obj1fullname, objname1); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { - HDstrcpy((char *)obj2fullname, "/"); - HDstrcat((char *)obj2fullname, objname2); + HDstrcpy(obj2fullname, "/"); + HDstrcat(obj2fullname, objname2); } else - HDstrcpy((char *)obj2fullname, objname2); + HDstrcpy(obj2fullname, objname2); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ h5difftrace("h5diff check if obj1 is root, group, single object or symlink\n"); - if(!HDstrcmp((char *)obj1fullname, "/")) + if(!HDstrcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } @@ -840,10 +840,10 @@ hsize_t h5diff(const char *fname1, h5difftrace("h5diff no object specified\n"); /* set root group */ obj1fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat((char *)obj1fullname, "/"); + HDstrcat(obj1fullname, "/"); obj1type = H5TRAV_TYPE_GROUP; obj2fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat((char *)obj2fullname, "/"); + HDstrcat(obj2fullname, "/"); obj2type = H5TRAV_TYPE_GROUP; } @@ -1078,9 +1078,9 @@ out: /* free buffers */ if (obj1fullname) - HDfree((char *)obj1fullname); + HDfree(obj1fullname); if (obj2fullname) - HDfree((char *)obj2fullname); + HDfree(obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 2530805..9e1c8bb 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -196,210 +196,5 @@ int print_objname(diff_opt_t *options, hsize_t nfound); void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts); void do_print_attrname (const char *attr, const char *path1, const char *path2); - -/*------------------------------------------------------------------------- - * XCAO, 11/10/2010 - * added to improve performance for compound datasets - */ -typedef struct mcomp_t -{ - int n; /* number of members */ - hid_t *ids; /* member type id */ - unsigned char *flags; - size_t *offsets; - struct mcomp_t **m; /* members */ -}mcomp_t; - -hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members); /*compound members */ - - - -hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -#if H5_SIZEOF_LONG_DOUBLE !=0 - -hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -#endif - -hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - #endif /* H5DIFF_H__ */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1e7f88b..878f459 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -36,7 +36,6 @@ #endif #define I_FORMAT "%-15d %-15d %-15d\n" -#define C_FORMAT "%-16c %-17c\n" #define S_FORMAT "%-16s %-17s\n" #define UI_FORMAT "%-15u %-15u %-15u\n" #define LI_FORMAT "%-15ld %-15ld %-15ld\n" @@ -101,43 +100,44 @@ *------------------------------------------------------------------------- */ -static int not_comparable; +static hbool_t not_comparable; -#define PER(A,B) { per=-1; \ - not_comparable=0; \ - both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ - if (A!=0) \ - per = (double)ABS( ( double)(B-A) / (double)A ); \ +#define PER(A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(FP_ZERO == fpclassify(A) && FP_ZERO == fpclassify(B)) \ + both_zero = TRUE; \ + if(FP_ZERO != fpclassify(A)) \ + per = (double)ABS((double)(B - A) / (double)A); \ else \ - not_comparable=1; \ + not_comparable = TRUE; \ } -#define PER_UNSIGN(TYPE,A,B) { per=-1; \ - not_comparable=0; \ - both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ - if (A!=0) \ - per = ABS((double)((TYPE)(B-A)) / (double)A) ; \ +#define PER_UNSIGN(TYPE,A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(A == 0 && B == 0) \ + both_zero = TRUE; \ + if(A != 0) \ + per = ABS((double)((TYPE)(B - A)) / (double)A) ; \ else \ - not_comparable=1; \ + not_comparable = TRUE; \ } -#define BOTH_ZERO(A,B) { both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ -} +# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) -#define IS_ZERO(A) { is_zero=0; \ - if (A==0) \ - is_zero=1; \ -} +typedef struct mcomp_t +{ + unsigned n; /* number of members */ + hid_t *ids; /* member type id */ + size_t *offsets; + struct mcomp_t **m; /* members */ +}mcomp_t; -# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) /*------------------------------------------------------------------------- * local prototypes @@ -146,7 +146,7 @@ static int not_comparable; 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(unsigned char *mem1,unsigned 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,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_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); @@ -157,6 +157,179 @@ 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 h5diff_print_char(char ch); +static hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members); /*compound members */ +static hsize_t diff_float(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_double(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +#if H5_SIZEOF_LONG_DOUBLE !=0 +static hsize_t diff_ldouble(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +#endif +static hsize_t diff_schar(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_uchar(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_short(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_ushort(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_int(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_uint(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_long(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_ulong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_llong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + 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 diff_ullong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); /*------------------------------------------------------------------------- @@ -180,7 +353,7 @@ typedef enum dtype_t } dtype_t; #endif -static int my_isnan(dtype_t type, void *val); +static hbool_t my_isnan(dtype_t type, void *val); /*------------------------------------------------------------------------- * XCAO, 11/10/2010 @@ -260,6 +433,9 @@ hsize_t diff_array( void *_mem1, switch (type_class) { + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_NCLASSES: default: HDassert(0); break; @@ -387,21 +563,21 @@ hsize_t diff_array( void *_mem1, * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ +static hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; @@ -411,19 +587,19 @@ hsize_t diff_datum(void *_mem1, H5T_sign_t type_sign; H5T_class_t type_class; size_t offset; - int nmembs; - int j; + unsigned nmembs; + unsigned j; hsize_t nelmts; size_t size=0; - int iszero1; - int iszero2; + hbool_t iszero1; + hbool_t iszero2; hid_t obj1_id; hid_t obj2_id; hsize_t nfound=0; /* differences found */ int ret=0; /* check return error */ float f1, f2; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_datum start\n"); type_size = H5Tget_size( m_type ); @@ -442,10 +618,10 @@ hsize_t diff_datum(void *_mem1, switch (H5Tget_class(m_type)) { - default: - HDassert(0); - break; + case H5T_NO_CLASS: case H5T_TIME: + case H5T_NCLASSES: + default: HDassert(0); break; @@ -464,8 +640,8 @@ hsize_t diff_datum(void *_mem1, memb_type = members->ids[j]; nfound+=diff_datum( - mem1+offset, - mem2+offset, + mem1 + offset, + mem2 + offset, memb_type, i, rank, @@ -508,10 +684,10 @@ hsize_t diff_datum(void *_mem1, else { /* Get pointer to first string */ - s1 = mem1; + s1 = (char *)mem1; size1 = H5Tget_size(m_type); /* Get pointer to second string */ - s2 = mem2; + s2 = (char *)mem2; size2 = H5Tget_size(m_type); } @@ -634,11 +810,11 @@ hsize_t diff_datum(void *_mem1, */ err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); if(err1 < 0) - strcpy(enum_name1, "**INVALID VALUE**"); + HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); if(err2 < 0) - strcpy(enum_name2, "**INVALID VALUE**"); + HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); if(err1 < 0 || err2 < 0) { @@ -702,7 +878,8 @@ hsize_t diff_datum(void *_mem1, { hsize_t adims[H5S_MAX_RANK]; - hsize_t ndims; + int ndims; + /* get the array's base datatype for each element */ memb_type = H5Tget_super(m_type); size = H5Tget_size(memb_type); @@ -711,7 +888,7 @@ hsize_t diff_datum(void *_mem1, HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u len; - for (j = 0; j < (int)nelmts; j++) - nfound+=diff_datum( - ((char *)(((hvl_t *)mem1)->p)) + j * size, - ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ - memb_type, - i, /* index position */ - rank, - dims, - acc, - pos, - options, - obj1, - obj2, - container1_id, - container2_id, - ph, members); + for (j = 0; j < nelmts; j++) + nfound += diff_datum( + ((char *)(((hvl_t *)mem1)->p)) + j * size, + ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ + memb_type, + i, /* index position */ + rank, + dims, + acc, + pos, + options, + obj1, + obj2, + container1_id, + container2_id, + ph, members); H5Tclose(memb_type); @@ -1421,7 +1598,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); } nfound++; } @@ -1434,7 +1611,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); + parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); } nfound++; } @@ -1450,7 +1627,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); } nfound++; } @@ -1463,7 +1640,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); + parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); } nfound++; } @@ -1904,8 +2081,8 @@ hsize_t diff_datum(void *_mem1, { float temp1_float; float temp2_float; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(float)); @@ -1933,29 +2110,29 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > options->delta) + if (ABS(temp1_float-temp2_float) > (float)options->delta) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT,(double)temp1_float,(double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -1979,7 +2156,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -1990,35 +2167,35 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } else - if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) + if ( per > options->percent && (double)ABS(temp1_float-temp2_float) > options->delta ) { if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -2044,7 +2221,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -2055,8 +2232,8 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -2069,22 +2246,22 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -2102,7 +2279,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -2117,8 +2294,8 @@ hsize_t diff_datum(void *_mem1, { double temp1_double; double temp2_double; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(double)); @@ -2144,7 +2321,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2160,7 +2337,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2191,7 +2368,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2225,7 +2402,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2256,7 +2433,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2291,7 +2468,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2331,8 +2508,8 @@ hsize_t diff_datum(void *_mem1, { long double temp1_double; long double temp2_double; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(long double)); @@ -2360,7 +2537,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2375,7 +2552,7 @@ hsize_t diff_datum(void *_mem1, } } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2405,7 +2582,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2439,7 +2616,7 @@ hsize_t diff_datum(void *_mem1, } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2469,7 +2646,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2504,7 +2681,7 @@ hsize_t diff_datum(void *_mem1, } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2671,14 +2848,15 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ if(nblocks1 > 0) { - alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); + HDassert(ndims1 > 0); + alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - ptdata2 = HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); @@ -2726,14 +2904,14 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ if(npoints1 > 0) { - alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); + alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - ptdata2 = HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); @@ -2790,8 +2968,8 @@ hsize_t diff_region(hid_t obj1_id, HDfree(ptdata2); } - nfound_b = nfound_b/ndims1; - nfound_p = nfound_p/ndims1; + nfound_b = nfound_b / (unsigned)ndims1; + nfound_p = nfound_p / (unsigned)ndims1; return (nfound_p + nfound_b); } @@ -2807,8 +2985,8 @@ hsize_t diff_region(hid_t obj1_id, */ static -hsize_t character_compare(unsigned char *mem1, - unsigned char *mem2, +hsize_t character_compare(char *mem1, + char *mem2, hsize_t i, unsigned u, int rank, @@ -2821,8 +2999,8 @@ hsize_t character_compare(unsigned char *mem1, int *ph) { hsize_t nfound=0; /* differences found */ - unsigned char temp1_uchar; - unsigned char temp2_uchar; + char temp1_uchar; + char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2857,7 +3035,7 @@ hsize_t character_compare(unsigned char *mem1, *------------------------------------------------------------------------- */ -hsize_t character_compare_opt(unsigned char *mem1, +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, @@ -2873,7 +3051,7 @@ hsize_t character_compare_opt(unsigned char *mem1, unsigned char temp1_uchar; unsigned char temp2_uchar; double per; - int both_zero; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2950,7 +3128,7 @@ hsize_t character_compare_opt(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_float(unsigned char *mem1, +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -2969,9 +3147,9 @@ hsize_t diff_float(unsigned char *mem1, float temp2_float; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_float start\n"); @@ -2998,27 +3176,27 @@ hsize_t diff_float(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > options->delta) + if ((double)ABS(temp1_float-temp2_float) > options->delta) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3051,7 +3229,7 @@ hsize_t diff_float(unsigned char *mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( (!isnan1 && !isnan2)) { PER(temp1_float,temp2_float); @@ -3062,8 +3240,8 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -3076,21 +3254,21 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3125,7 +3303,7 @@ hsize_t diff_float(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -3136,36 +3314,36 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } else - if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) + if ( per > options->percent && (double)ABS(temp1_float - temp2_float) > options->delta ) { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3194,7 +3372,7 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -3226,7 +3404,7 @@ hsize_t diff_float(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_double(unsigned char *mem1, +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3245,9 +3423,9 @@ hsize_t diff_double(unsigned char *mem1, double temp2_double; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_double start\n"); /*------------------------------------------------------------------------- @@ -3273,7 +3451,7 @@ hsize_t diff_double(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) { @@ -3287,7 +3465,7 @@ hsize_t diff_double(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3326,7 +3504,7 @@ hsize_t diff_double(unsigned char *mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3359,7 +3537,7 @@ hsize_t diff_double(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3400,7 +3578,7 @@ hsize_t diff_double(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3434,7 +3612,7 @@ hsize_t diff_double(unsigned char *mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3510,7 +3688,7 @@ hsize_t diff_double(unsigned char *mem1, */ #if H5_SIZEOF_LONG_DOUBLE !=0 -hsize_t diff_ldouble(unsigned char *mem1, +static hsize_t diff_ldouble(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3529,9 +3707,9 @@ hsize_t diff_ldouble(unsigned char *mem1, long double temp2_double; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_ldouble start\n"); @@ -3558,7 +3736,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) { @@ -3572,7 +3750,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3611,7 +3789,7 @@ hsize_t diff_ldouble(unsigned char *mem1, isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3644,7 +3822,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3685,7 +3863,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3719,7 +3897,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3795,7 +3973,7 @@ hsize_t diff_ldouble(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_schar(unsigned char *mem1, +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3814,7 +3992,7 @@ hsize_t diff_schar(unsigned char *mem1, char temp2_char; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_schar start\n"); @@ -3974,7 +4152,7 @@ hsize_t diff_schar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_uchar(unsigned char *mem1, +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3993,7 +4171,7 @@ hsize_t diff_uchar(unsigned char *mem1, unsigned char temp2_uchar; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); @@ -4152,7 +4330,7 @@ hsize_t diff_uchar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_short(unsigned char *mem1, +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4171,7 +4349,7 @@ hsize_t diff_short(unsigned char *mem1, short temp2_short; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_short start\n"); /* -d and !-p */ @@ -4332,7 +4510,7 @@ hsize_t diff_short(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ushort(unsigned char *mem1, +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4351,7 +4529,7 @@ hsize_t diff_ushort(unsigned char *mem1, unsigned short temp2_ushort; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ @@ -4513,7 +4691,7 @@ hsize_t diff_ushort(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_int(unsigned char *mem1, +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4532,7 +4710,7 @@ hsize_t diff_int(unsigned char *mem1, int temp2_int; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_int start\n"); /* -d and !-p */ @@ -4694,7 +4872,7 @@ hsize_t diff_int(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_uint(unsigned char *mem1, +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4713,7 +4891,7 @@ hsize_t diff_uint(unsigned char *mem1, unsigned int temp2_uint; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_uint start\n"); /* -d and !-p */ @@ -4873,7 +5051,7 @@ hsize_t diff_uint(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_long(unsigned char *mem1, +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4892,7 +5070,7 @@ hsize_t diff_long(unsigned char *mem1, long temp2_long; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_long start\n"); /* -d and !-p */ @@ -5058,7 +5236,7 @@ hsize_t diff_long(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ulong(unsigned char *mem1, +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5077,7 +5255,7 @@ hsize_t diff_ulong(unsigned char *mem1, unsigned long temp2_ulong; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); @@ -5243,7 +5421,7 @@ hsize_t diff_ulong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_llong(unsigned char *mem1, +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5262,7 +5440,7 @@ hsize_t diff_llong(unsigned char *mem1, long long temp2_llong; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ @@ -5418,7 +5596,7 @@ hsize_t diff_llong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ullong(unsigned char *mem1, +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5438,7 +5616,7 @@ hsize_t diff_ullong(unsigned char *mem1, hsize_t i; float f1, f2; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ @@ -5665,8 +5843,8 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options) * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_DOUBLE,&value); - int isnan2 = my_isnan(FLT_DOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_DOUBLE,&value); + hbool_t isnan2 = my_isnan(FLT_DOUBLE,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5720,8 +5898,8 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_LDOUBLE,&value); - int isnan2 = my_isnan(FLT_LDOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_LDOUBLE,&value); + hbool_t isnan2 = my_isnan(FLT_LDOUBLE,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5779,8 +5957,8 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_FLOAT,&value); - int isnan2 = my_isnan(FLT_FLOAT,&expected); + hbool_t isnan1 = my_isnan(FLT_FLOAT,&value); + hbool_t isnan2 = my_isnan(FLT_FLOAT,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5832,40 +6010,39 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * *------------------------------------------------------------------------- */ -static int +static hbool_t my_isnan(dtype_t type, void *val) { - int retval = 0; + hbool_t retval = FALSE; char s[256]; h5difftrace("my_isnan start\n"); if (FLT_FLOAT==type) { float x; + HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); - - - } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); - -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 else if (FLT_LDOUBLE==type) { long double x; + HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); -#endif } +#endif else { - return 0; + return FALSE; } /* @@ -5877,44 +6054,39 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT==type) { float x; - HDmemcpy(&x, val, sizeof(float)); - sprintf(s, "%g", x); - + HDmemcpy(&x, val, sizeof(float)); + HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); - sprintf(s, "%g", x); -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 + HDsnprintf(s, sizeof(s), "%g", x); } +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 else if (FLT_LDOUBLE==type) { long double x; + HDmemcpy(&x, val, sizeof(long double)); - sprintf(s, "%Lg", x); -#endif + HDsnprintf(s, sizeof(s), "%Lg", x); } +#endif else { - return 0; + return FALSE; } - if ( HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan") || HDstrstr(s, "-1.#IND") /* WIN32 */ ) { - - retval = 1; + retval = TRUE; } - - - - } #ifdef H5_VMS @@ -5925,15 +6097,17 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT==type) { float x; + HDmemcpy(&x, val, sizeof(float)); retval = (x==FLT_MAX || x==-FLT_MAX); } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); retval = (x==DBL_MAX || x==-DBL_MAX); } else { - return 0; + return FALSE; } } #endif /*H5_VMS*/ @@ -5943,9 +6117,6 @@ my_isnan(dtype_t type, void *val) } - - - /*------------------------------------------------------------------------- * * Local functions @@ -6164,8 +6335,8 @@ static void h5diff_print_char(char ch) */ static void get_member_types(hid_t tid, mcomp_t *members) { - int i; int tclass; + unsigned u; if (tid <=0 || !members) return; @@ -6179,23 +6350,24 @@ static void get_member_types(hid_t tid, mcomp_t *members) } else if (tclass == H5T_COMPOUND) { - members->n = H5Tget_nmembers( tid ); - if (members->n <=0) + int nmembs; + + nmembs = H5Tget_nmembers(tid); + if(nmembs <= 0) return; + members->n = (unsigned)nmembs; - members->ids = HDcalloc(members->n, sizeof(hid_t)); - members->flags = HDcalloc(members->n, sizeof(unsigned char)); - members->offsets = HDcalloc(members->n, sizeof(size_t)); - members->m = HDcalloc(members->n, sizeof(mcomp_t *)); + members->ids = (hid_t *)HDcalloc(members->n, sizeof(hid_t)); + members->offsets = (size_t *)HDcalloc(members->n, sizeof(size_t)); + members->m = (mcomp_t **)HDcalloc(members->n, sizeof(mcomp_t *)); - for (i=0; i< members->n; i++) + for(u = 0; u < members->n; u++) { - members->ids[i] = H5Tget_member_type( tid, i ); - members->flags[i] = H5Tis_variable_str( members->ids[i] ); - members->offsets[i] = H5Tget_member_offset( tid, i ); - members->m[i] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); - HDmemset(members->m[i], 0, sizeof(mcomp_t)); - get_member_types(members->ids[i], members->m[i]); + members->ids[u] = H5Tget_member_type( tid, u ); + members->offsets[u] = H5Tget_member_offset( tid, u ); + members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); + HDmemset(members->m[u], 0, sizeof(mcomp_t)); + get_member_types(members->ids[u], members->m[u]); } } @@ -6211,24 +6383,23 @@ static void get_member_types(hid_t tid, mcomp_t *members) */ static void close_member_types(mcomp_t *members) { - int i; + unsigned u; if (!members || members->n<=0 || !members->ids) return; - for (i=0; in; i++) + for(u = 0; u < members->n; u++) { - if (members->m[i]) + if(members->m[u]) { - close_member_types(members->m[i]); - HDfree(members->m[i]); + close_member_types(members->m[u]); + HDfree(members->m[u]); } - H5Tclose(members->ids[i]); + H5Tclose(members->ids[u]); } - HDfree (members->m); - HDfree (members->ids); - HDfree (members->flags); - HDfree (members->offsets); + HDfree(members->m); + HDfree(members->ids); + HDfree(members->offsets); } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 4899200..ef1d761 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -108,17 +108,17 @@ static void table_attrs_free( table_attrs_t *table ) *------------------------------------------------------------------------*/ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table) { - unsigned int new; + size_t new_val; if(table->nattrs == table->size) { table->size = MAX(1, table->size * 2); table->attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t)); } /* end if */ - new = table->nattrs++; - table->attrs[new].exist[0] = exist[0]; - table->attrs[new].exist[1] = exist[1]; - table->attrs[new].name = (char *)HDstrdup(name); + new_val = table->nattrs++; + table->attrs[new_val].exist[0] = exist[0]; + table->attrs[new_val].exist[1] = exist[1]; + table->attrs[new_val].name = (char *)HDstrdup(name); } /*------------------------------------------------------------------------- @@ -459,8 +459,8 @@ hsize_t diff_attr(hid_t loc1_id, goto error; /* format output string */ - sprintf(np1,"%s of <%s>",name1,path1); - sprintf(np2,"%s of <%s>",name2,path2); + HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1); + HDsnprintf(np2, sizeof(np1), "%s of <%s>", name2, path2); /*--------------------------------------------------------------------- * array compare diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 10c643d..3285278 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -159,7 +159,7 @@ typedef struct { /* obtain link info from H5tools_get_symlink_info() */ typedef struct { H5O_type_t trg_type; /* OUT: target type */ - const char *trg_path; /* OUT: target obj path. This must be freed + char *trg_path; /* OUT: target obj path. This must be freed * when used with H5tools_get_symlink_info() */ haddr_t objno; /* OUT: target object address */ unsigned long fileno; /* OUT: File number that target object is located in */ -- cgit v0.12 From e8955b876cc81e9cd7318418435d5cd861854c2a Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 20 Mar 2013 15:33:33 -0500 Subject: [svn-r23407] Purpose: HDFFV-8214 - h5repack failed converting small chunked dataset (size < 1K) to contiguous layout. Description: h5repack failed converting small chunked dataset (size < 1K) to contiguous layout. The first case was when chunk dim is bigger than the dataset dim (at leat one), h5repack failed with displaying error stacks. The other case is when chunk dim is smaller than the dataset dim, h5repack failed to change layout. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), emu (solaris-BE),fred (mac64-LE), Windows (32-LE cmake), cmake (jam) --- release_docs/RELEASE.txt | 2 ++ tools/h5repack/CMakeLists.txt | 12 ++++++++++++ tools/h5repack/h5repack.sh.in | 12 ++++++++++++ tools/h5repack/h5repack_copy.c | 10 ---------- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4414eb1..8a54b21 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -751,6 +751,8 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5repack: Fixed failure for converting a layout of small chunked dataset + (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) - h5diff: Fixed to return correct exit code 1 when detect unique extra attribute. Prior to this fix, h5diff returned exit code 0 indicating two files are identical. HDFFV-7643 (JKM 2013/02/15) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 156f6d8..06c6b71 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -881,6 +881,18 @@ ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIM # file input - should not fail ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) +#-------------------------------------------------------------------------- +# 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. +ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) +# chunk dim is smaller than dataset dim. should succeed. +ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) + + + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index dc90426..14e1d04 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -891,6 +891,18 @@ VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f ch # file input - should not fail TOOLTEST error4 h5repack_layout3.h5 -f NONE +#-------------------------------------------------------------------------- +# 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. +VERIFY_LAYOUT_DSET ckdim_smaller h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI + + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 02337fd..f9dd334 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -1017,16 +1017,6 @@ int do_copy_objects(hid_t fidin, /* get the storage size of the input dataset */ dsize_in=H5Dget_storage_size(dset_in); - /* check for small size datasets (less than 1k) except - * changing to COMPACT. For the reference, COMPACT is limited - * by size 64K by library. - */ - if (options->layout_g != H5D_COMPACT) - { - if ( size_dset < options->min_comp ) - apply_s=0; - } - /* apply the filter */ if (apply_s) { -- cgit v0.12 From a0ec9c282b3dbabec9d1f46e86c37336b9cd490b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 20 Mar 2013 23:04:19 -0500 Subject: [svn-r23410] HDFFV-8264: Using F2003, build fails on Fedora with undefined reference to __h5r_MOD_h5rget_region_region_f This turned out being an issue with configure. The reporter submitted a patch which fixed the fact that we should not be setting AM_FCFLAGS (an automake variable) with FFLAGS (a user variable). I removed this, and we now only set FFLAGS if the environment variable is set, otherwise we don't. Tested: jam (gnu) --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 38b342a..a57d149 100644 --- a/configure.ac +++ b/configure.ac @@ -434,9 +434,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## -------------------------------------------------------------------- ## General Fortran flags - ## - AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" - FCFLAGS="${FCFLAGS} ${FFLAGS}" + ## Only add FFLAGS to FCFLAGS if it's set. + if test "x$FFLAGS" != "x" ; then + FCFLAGS="${FCFLAGS} ${FFLAGS}" + fi ## -------------------------------------------------------------------- ## Fortran source extention -- cgit v0.12 From e7ced517bc9fab1e13962231e53ef5c107daf88e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Mar 2013 09:04:50 -0500 Subject: [svn-r23411] HDDFV-8322: Free allocations in command line parsing. Tested: local linux --- tools/h5copy/h5copy.c | 54 +++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index b2ad9d0..3fb5701 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -36,6 +36,11 @@ static struct long_options l_opts[] = { { "version", no_arg, 'V' }, { NULL, 0, '\0' } }; +char *fname_src = NULL; +char *fname_dst = NULL; +char *oname_src = NULL; +char *oname_dst = NULL; +char *str_flag = NULL; /*------------------------------------------------------------------------- * Function: leave @@ -54,6 +59,17 @@ static struct long_options l_opts[] = { static void leave(int ret) { + if (fname_src) + HDfree(fname_src); + if (fname_dst) + HDfree(fname_dst); + if (oname_dst) + HDfree(oname_dst); + if (oname_src) + HDfree(oname_src); + if (str_flag) + HDfree(str_flag); + h5tools_close(); HDexit(ret); } @@ -201,11 +217,6 @@ main (int argc, const char *argv[]) { hid_t fid_src = -1; hid_t fid_dst = -1; - char *fname_src = NULL; - char *fname_dst = NULL; - char *oname_src = NULL; - char *oname_dst = NULL; - char *str_flag = NULL; unsigned flag = 0; unsigned verbose = 0; unsigned parents = 0; @@ -339,8 +350,6 @@ main (int argc, const char *argv[]) if (fid_src==-1) { error_msg("Could not open input file <%s>...Exiting\n", fname_src); - if (fname_src) - HDfree(fname_src); leave(EXIT_FAILURE); } @@ -360,10 +369,6 @@ main (int argc, const char *argv[]) if (fid_dst==-1) { error_msg("Could not open output file <%s>...Exiting\n", fname_dst); - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); leave(EXIT_FAILURE); } @@ -484,18 +489,7 @@ main (int argc, const char *argv[]) if (H5Fclose(fid_dst)<0) goto error; - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - - h5tools_close(); - - return EXIT_SUCCESS; + leave(EXIT_SUCCESS); error: printf("Error in copy...Exiting\n"); @@ -510,19 +504,7 @@ error: H5Fclose(fid_src); H5Fclose(fid_dst); } H5E_END_TRY; - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - if (str_flag) - HDfree(str_flag); - - h5tools_close(); - return EXIT_FAILURE; + leave(EXIT_FAILURE); } -- cgit v0.12 From 0596de6267e6917057df2ebe2f7e524a1a9e6773 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Mar 2013 09:19:09 -0500 Subject: [svn-r23412] Add test depends on clear test. Occasional failures. --- hl/test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 39a3811..c5b6f6e 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -31,6 +31,9 @@ MACRO (HL_ADD_TEST hl_name files) SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) ADD_TEST (NAME hl_${hl_name} COMMAND $) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- #-- Copy the necessary files. @@ -75,6 +78,10 @@ ADD_TEST ( test_packet_table.h5 test_table.h5 ) +IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) +ENDIF (NOT "${last_test}" STREQUAL "") +SET (last_test "hl_test-clear-objects") HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") HL_ADD_TEST (test_dset_opt "") -- cgit v0.12 From 535456397c2886ecaffddbd6471f6f2e50125c1d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 21 Mar 2013 13:19:53 -0500 Subject: [svn-r23415] Description: Avoid using fpclassify() for detecting zero/non-zero values. Tested on: Mac OSX/64 10.8.3 (amazon) w/debug --- tools/lib/h5diff_array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 878f459..528fc40 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -106,9 +106,9 @@ static hbool_t not_comparable; per = -1; \ not_comparable = FALSE; \ both_zero = FALSE; \ - if(FP_ZERO == fpclassify(A) && FP_ZERO == fpclassify(B)) \ + if(0 == (A) && 0 == (B)) \ both_zero = TRUE; \ - if(FP_ZERO != fpclassify(A)) \ + if(0 != (A)) \ per = (double)ABS((double)(B - A) / (double)A); \ else \ not_comparable = TRUE; \ -- cgit v0.12 From 030a17ca60905ef90cabaa147ee84febb064fc42 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 21 Mar 2013 14:22:19 -0500 Subject: [svn-r23417] Fixes an issue (HDFFV-8159) where uninitialized memory was being read during variable-length type conversion. All variable-length type conversion buffers are now initialized to contain 0s on allocation. Tested on: jam(w/ fortran, C++, parallel, parallel fortran) ostrich This is a very small change (basially changing malloc to calloc) and is unlikely to cause issues on other platforms. --- src/H5Tconv.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 5ecf864..b732817 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3014,17 +3014,17 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - H5T_path_t *tpath; /* Type conversion path */ + H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ - H5T_t *src; /*source datatype */ - H5T_t *dst; /*destination datatype */ + H5T_t *src = NULL; /*source datatype */ + H5T_t *dst = NULL; /*destination datatype */ H5HG_t bg_hobjid, parent_hobjid; - uint8_t *s; /*source buffer */ - uint8_t *d; /*destination buffer */ - uint8_t *b; /*background buffer */ + uint8_t *s = NULL; /*source buffer */ + uint8_t *d = NULL; /*destination buffer */ + uint8_t *b = NULL; /*background buffer */ ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ @@ -3120,7 +3120,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); - if(NULL == (tmp_buf = H5FL_BLK_MALLOC(vlen_seq,tmp_buf_size))) + if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") } /* end if */ @@ -3200,7 +3200,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(!seq_len && !conv_buf) { conv_buf_size = ((1 / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE; - if(NULL == (conv_buf = H5FL_BLK_MALLOC(vlen_seq, conv_buf_size))) + if(NULL == (conv_buf = H5FL_BLK_CALLOC(vlen_seq, conv_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") } else if(conv_buf_size < MAX(src_size, dst_size)) { @@ -3208,6 +3208,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, conv_buf_size = ((MAX(src_size, dst_size) / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE; if(NULL == (conv_buf = H5FL_BLK_REALLOC(vlen_seq, conv_buf, conv_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(conv_buf, 0, conv_buf_size); } /* end if */ /* Read in VL sequence */ @@ -3223,6 +3224,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, tmp_buf_size = conv_buf_size; if(NULL == (tmp_buf = H5FL_BLK_REALLOC(vlen_seq, tmp_buf, tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ /* If we are writing and there is a nested VL type, read @@ -3236,6 +3238,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, tmp_buf_size = (bg_seq_len * MAX(src_base_size, dst_base_size)); if(NULL == (tmp_buf = H5FL_BLK_REALLOC(vlen_seq, tmp_buf, tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); INT32DECODE(tmp, bg_hobjid.idx); -- cgit v0.12 From c8018386da2165a16f5e2d0cb5a391dca07b4ed5 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 22 Mar 2013 12:56:05 -0500 Subject: [svn-r23427] Purpose: Fix bug HDFFV-8067 Description: + The C++ test failed with the new PGI compilers versions 12.4 and 12.5 + An exception thrown by an internal function, which was called by a constructor, was not propagating to the test program during the stack unwinding, so it couldn't be caught by the test and the program terminated. + Various trials and errors indicated that the problem is where an STD string converted to a char* being passed to the internal function, but confirmation has not been found yet. It could be a compiler bug. Solution: + Added a try/catch in the constructor around the internal function and re-throw the exception when it is caught. This is a workaround. + Unrelated minor fixes: removed unused variables and MESSAGE's; commented out tvlstr.cpp/test_read_vl_string_attribute because it may be redundant, and commented out H5Tpkg.h inclusion because TEST_ALIGNMENT is not added yet and probably not necessary in the C++ API. Platforms tested: Linux/32 2.6 (jam) with PGI compilers Linux/32 2.6 (jam) with GNU compilers Linux/64 2.6 (koala) --- c++/src/H5File.cpp | 18 ++++++++++++++++-- c++/test/dsets.cpp | 6 ------ c++/test/tattr.cpp | 2 -- c++/test/tcompound.cpp | 1 - c++/test/tfile.cpp | 12 ++++-------- c++/test/tfilter.cpp | 4 ++-- c++/test/th5s.cpp | 1 - c++/test/tlinks.cpp | 3 ++- c++/test/trefer.cpp | 2 -- c++/test/ttypes.cpp | 4 ++++ c++/test/tvlstr.cpp | 5 +++-- 11 files changed, 31 insertions(+), 27 deletions(-) diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 92c4d32..1f7b6f8 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -77,11 +77,18 @@ H5File::H5File() : H5Location(), id(0) {} /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(0) { - p_get_file(name, flags, create_plist, access_plist); + try { + p_get_file(name, flags, create_plist, access_plist); + } catch (FileIException open_file) { + throw open_file; + } } //-------------------------------------------------------------------------- @@ -95,11 +102,18 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(0) { - p_get_file(name.c_str(), flags, create_plist, access_plist); + try { + p_get_file(name.c_str(), flags, create_plist, access_plist); + } catch (FileIException open_file) { + throw open_file; + } } //-------------------------------------------------------------------------- diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index e822b36..643762b 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -285,13 +285,7 @@ test_simple_io( H5File& file) static herr_t test_datasize() { - SUBTEST("DataSet::getInMemDataSize()"); - - int points[100][200]; - int check[100][200]; - int i, j, n; - try { // Open FILE1. diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 100e725..1a15aea 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -964,7 +964,6 @@ static void test_attr_mult_read() static void test_attr_delete() { H5std_string attr_name; // Buffer for attribute names - int ii; // Output message about test being performed SUBTEST("Removing Attribute Function"); @@ -1364,7 +1363,6 @@ extern "C" void test_attr() { // Output message about test being performed - //MESSAGE("Testing Attributes\n"); MESSAGE(5, ("Testing Attributes\n")); test_attr_basic_write(); // Test basic H5A writing code diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index fbb1219..28d8a1e 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -749,7 +749,6 @@ extern "C" void test_compound() { // Output message about test being performed - //MESSAGE("Testing Compound Data Type operations\n"); MESSAGE(5, ("Testing Compound Data Type operations\n")); test_compound_1(); // various things about compound data types diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index ba38d7a..65b8e57 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -117,16 +117,16 @@ static void test_file_create() "terminate called without an active exception Command terminated by signal 6" Commenting it out until it's fixed LK 20120626. -#ifndef H5_HAVE_FILE_VERSIONS +*/ try { H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); } catch( FileIException E ) // catch truncating existing file {} // do nothing, FAIL expected -#endif // Close file1 delete file1; file1 = NULL; @@ -144,7 +144,6 @@ static void test_file_create() // Test create with H5F_ACC_TRUNC. This will truncate the existing file. file1 = new H5File (FILE1, H5F_ACC_TRUNC); -#ifndef H5_HAVE_FILE_VERSIONS // Try to truncate first file again. This should fail because file1 // is the same file and is currently open. try { @@ -155,19 +154,17 @@ static void test_file_create() } catch( FileIException E ) // catching truncating opened file {} // do nothing, FAIL expected -#endif + // Try with H5F_ACC_EXCL. This should fail too because the file already // exists. try { -// H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E + H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); } catch( FileIException E ) // catching H5F_ACC_EXCL on existing file {} // do nothing, FAIL expected -*/ - std::cerr << "SKIPPED for HDFFV-8067" << std::endl; // Get the file-creation template FileCreatPropList tmpl1 = file1->getCreatePlist(); @@ -627,7 +624,6 @@ void test_file() { // Output message about test being performed MESSAGE(5, ("Testing File I/O operations\n")); - //MESSAGE("Testing File I/O operations\n"); test_file_create(); // Test file creation (also creation templates) test_file_open(); // Test file opening diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 0dbdf00..9e60655 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -47,12 +47,14 @@ #define FILTER_CHUNK_DIM2 25 // will do this function later or use it as guideline - BMR - 2007/01/26 +#if 0 static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, int corrupted, hsize_t *dset_size) { cerr << "do nothing right now" << endl; return(0); } +#endif /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS 305 @@ -254,13 +256,11 @@ extern "C" void test_filters() { // Output message about test being performed - //MESSAGE("Testing Various Filters\n"); MESSAGE(5, ("Testing Various Filters\n")); hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template - int nerrors=0; // keep track of number of failures occurr try { // Use the file access template id to create a file access prop. list diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 32c40d5..7947a9b 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -569,7 +569,6 @@ extern "C" void test_h5s() { // Output message about test being performed - //MESSAGE("Testing Dataspaces\n"); MESSAGE(5, ("Testing Dataspaces\n")); test_h5s_basic(); // Test basic H5S code diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index e4e691a..fca5918 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -226,6 +226,7 @@ typedef struct { hbool_t *visited; /* Pointer to array of "visited link" flags */ } link_iter_info_t; +#if 0 /* Link visit structs */ typedef struct { const char *path; /* Path to link */ @@ -374,6 +375,7 @@ typedef struct { unsigned idx; /* Index in object visit structure */ const obj_visit_t *info; /* Pointer to the object visit structure to use */ } ovisit_ud_t; +#endif static const char *FILENAME[] = { "link0", @@ -529,7 +531,6 @@ void test_links() fapl_id = h5_fileaccess(); // Output message about test being performed - //MESSAGE("Testing Various Links\n"); MESSAGE(5, ("Testing Various Links\n")); try { diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 4eb5b21..ce18e58 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -235,7 +235,6 @@ static void test_reference_obj(void) verify_val(name_size, DSET1_LEN, "Group::getObjnameByIdx(index,(std::string)buf,buf_len)", __LINE__, __FILE__); // Test getObjnameByIdx(hsize_t idx, char* name, size_t size) - char name_C[DSET1_LEN+1]; group.getObjnameByIdx(0, name, name_size+1); verify_val(name, DSET1_NAME, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__); verify_val(name_size, DSET1_LEN, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__); @@ -345,7 +344,6 @@ extern "C" void test_reference(void) { // Output message about test being performed - //MESSAGE("Testing References\n"); MESSAGE(5, ("Testing References\n")); test_reference_obj(); // Test basic object reference functionality diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index b1baa29..c10cf6d 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -52,6 +52,7 @@ * normally require alignment. When set, all native datatypes must be aligned * on a byte boundary equal to the data size. */ +#if 0 #define TEST_ALIGNMENT /* Alignment test stuff */ @@ -61,6 +62,9 @@ #endif #define SET_ALIGNMENT(TYPE,VAL) \ H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) +#endif + /* #include "H5Tpkg.h" + */ const char *FILENAME[] = { "dtypes1.h5", diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 73e54e0..89f24f2 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -129,7 +129,7 @@ void test_vlstr_free_custom(void *_mem, void *info) *------------------------------------------------------------------------- */ // String for testing datasets -static char stastring_ds_write[1]={'A'}; +// static char stastring_ds_write[1]={'A'}; // Info for a string dataset const H5std_string DSET1_NAME("String_ds"); @@ -687,6 +687,7 @@ static void test_vlstring_attribute() } } // test_vlstring_attribute() +#if 0 /*------------------------------------------------------------------------- * Function: test_read_vl_string_attribute * @@ -746,6 +747,7 @@ static void test_read_vl_string_attribute() issue_fail_msg("test_read_vl_string_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_read_vl_string_attribute +#endif // 2013: need to verify before adding to test /*------------------------------------------------------------------------- * Function: test_vlstring_array_attribute @@ -957,7 +959,6 @@ extern "C" void test_vlstrings() { // Output message about test being performed - //MESSAGE("Testing Variable-Length Strings"); MESSAGE(5, ("Testing Variable-Length Strings")); // These tests use the same file -- cgit v0.12 From 3f1c23b3151153395c6001b895532bf101bdd746 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 22 Mar 2013 14:16:38 -0500 Subject: [svn-r23428] Description: Fixed bug HDFFV-4272. Just typos in documentation. Platform tested: Jam --- c++/src/H5File.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 1f7b6f8..ede7469 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -61,7 +61,7 @@ H5File::H5File() : H5Location(), id(0) {} /// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT ///\par Description /// Valid values of \a flags include: /// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, @@ -101,7 +101,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c /// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file // could not be caught in the applications. Added try block here // to catch then re-throw it. -BMR 2013/03/21 @@ -201,7 +201,7 @@ bool H5File::isHdf5(const H5std_string& name ) ///\param name - IN: Name of the file ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is -- cgit v0.12 From 99b15244742caf98b5ff634f34d880fd0089d8d4 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 22 Mar 2013 16:02:07 -0500 Subject: [svn-r23431] Fix for HDFFV-8141. Changes default value for USE_SHARED_LIB in compile scripts to yes when static is disabled. Comments in scripts about the order of flag variables containing library paths was also corrected. Tested with h5committest on duck, jam, koala, and ostrich in addition to specific testing for the compile script change. --- c++/src/h5c++.in | 33 ++++++++++++++++++++++----------- fortran/src/h5fc.in | 32 ++++++++++++++++++++------------ tools/misc/h5cc.in | 34 +++++++++++++++++++++++----------- 3 files changed, 65 insertions(+), 34 deletions(-) diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 20435eb..8928d13 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -83,11 +83,12 @@ CXXLINKERBASE="@CXX@" # CXXFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. +# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# from the hdf5 build. The order of the flags is intended to give precedence +# to the user's flags. H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" @@ -100,7 +101,16 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi usage() { # A wonderfully informative "usage" message. @@ -365,11 +375,12 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index c55b496..c58eab0 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -80,12 +80,11 @@ FLINKERBASE="@FC@" # FFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's FFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. - +# User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just +# before clibpath, user's LIBS come after $link_objs and before the hdf5 +# libraries in $link_args, followed by any external library paths and libraries +# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. +# The order of the flags is intended to give precedence to the user's flags. H5BLD_FFLAGS="@AM_FCFLAGS@ @FCFLAGS@" F9XMODFLAG="@F9XMODFLAG@" F9XSUFFIXFLAG="@F9XSUFFIXFLAG@" @@ -98,7 +97,16 @@ FFLAGS="${HDF5_FFLAGS:-$FFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi usage() { # A wonderfully informative "usage" message. @@ -349,11 +357,11 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's FFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just + # before clibpath, user's LIBS come after $link_objs and before the hdf5 + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. $SHOW $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link status=$? fi diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index 233c80a..45143e4 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -85,11 +85,12 @@ CLINKERBASE="@CC@" # CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. +# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# from the hdf5 build. The order of the flags is intended to give precedence +# to the user's flags. H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" @@ -102,7 +103,17 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi + usage() { # A wonderfully informative "usage" message. @@ -374,11 +385,12 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link status=$? fi -- cgit v0.12