diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-12 22:36:34 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-12 22:36:34 (GMT) |
commit | 94f89911545edce6fc9ebde2c83357cbda0bbd70 (patch) | |
tree | ea81574cb50d78ff04256ec1ca42c959249e4498 /c++/src | |
parent | 4ce17c9aa6515c32551104516b32caf8b0ce9f02 (diff) | |
download | hdf5-94f89911545edce6fc9ebde2c83357cbda0bbd70.zip hdf5-94f89911545edce6fc9ebde2c83357cbda0bbd70.tar.gz hdf5-94f89911545edce6fc9ebde2c83357cbda0bbd70.tar.bz2 |
[svn-r23582] Bring revisions 22708:22730 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'c++/src')
-rw-r--r-- | c++/src/H5CommonFG.cpp | 28 | ||||
-rw-r--r-- | c++/src/Makefile.in | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 6a8609f..dcc331f 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -68,25 +68,29 @@ namespace H5 { //-------------------------------------------------------------------------- Group CommonFG::createGroup( const char* name, size_t size_hint ) const { - // Create group creation property list for size_hint - hid_t gcpl_id = H5Pcreate(H5P_GROUP_CREATE); - - // If the creation of the property list failed, throw an exception - if( gcpl_id < 0 ) - throwException("createGroup", "H5Pcreate failed"); + // Group creation property list for size_hint + hid_t gcpl_id = 0; // Set the local heap size hint - if( H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) { - H5Pclose(gcpl_id); - throwException("createGroup", "H5Pset_local_heap_size failed"); - } + if(!(size_hint == (size_t)-1 || size_hint == 0)) { + + // If the creation of the property list failed, throw an exception + if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) + throwException("createGroup", "H5Pcreate failed"); + + if( H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) { + H5Pclose(gcpl_id); + throwException("createGroup", "H5Pset_local_heap_size failed"); + } + } // Call C routine H5Gcreate2 to create the named group, giving the // location id which can be a file id or a group id hid_t group_id = H5Gcreate2( getLocId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT ); - // Close the group creation property list - H5Pclose(gcpl_id); + // Close the group creation property list, if necessary + if(gcpl_id > 0) + H5Pclose(gcpl_id); // If the creation of the group failed, throw an exception if( group_id < 0 ) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 42c33a6..4265900 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 = 117 +LT_VERS_REVISION = 121 LT_VERS_AGE = 0 # Include src directory |