summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Group.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-09-30 18:20:36 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-09-30 18:20:36 (GMT)
commit10f1e6acf8916a429f2cc925f49518cfc0015b6c (patch)
treef6078e3ae7987d9eb9737cfc1e8f3dc0e7f005b9 /c++/src/H5Group.cpp
parent0befe65753b60e85891453dcbca373763a070419 (diff)
downloadhdf5-10f1e6acf8916a429f2cc925f49518cfc0015b6c.zip
hdf5-10f1e6acf8916a429f2cc925f49518cfc0015b6c.tar.gz
hdf5-10f1e6acf8916a429f2cc925f49518cfc0015b6c.tar.bz2
[svn-r25640] Purpose: Fixed HDFFV-4259
Description: - Used H5I_INVALID_HID instead of 0 to initialized member "id" in classes that represent HDF5 objects. For PropList, H5P_DEFAULT has to be used instead of H5I_INVALID_HID. - Added try/catch block to some dynamically allocating memory code and re-throw the bad_alloc exception with a message informing the location of the failure. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
Diffstat (limited to 'c++/src/H5Group.cpp')
-rw-r--r--c++/src/H5Group.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 7679315..cad5e29 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -51,7 +51,7 @@ namespace H5 {
///\brief Default constructor: creates a stub Group.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group::Group() : H5Object(), id(0) {}
+Group::Group() : H5Object(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
// Function: Group copy constructor
@@ -100,7 +100,7 @@ Group::Group(const hid_t existing_id) : H5Object()
/// is a datatype that has been named by DataType::commit.
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
-Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
+Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
}
@@ -115,7 +115,7 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const
///\exception H5::ReferenceException
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
-Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
+Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
}
@@ -181,7 +181,7 @@ void Group::close()
throw GroupIException("Group::close", "H5Gclose failed");
}
// reset the id
- id = 0;
+ id = H5I_INVALID_HID;
}
}