diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2014-10-02 04:05:38 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2014-10-02 04:05:38 (GMT) |
commit | 9c9326c7debc3b4f32602ec21cc67cfccafa6fc0 (patch) | |
tree | 5860b1568bae4fb51cd4051191e48a729e368cbc /c++/src/H5DataType.cpp | |
parent | 40c17513405c1056c90b7324a954df2a217efd65 (diff) | |
download | hdf5-9c9326c7debc3b4f32602ec21cc67cfccafa6fc0.zip hdf5-9c9326c7debc3b4f32602ec21cc67cfccafa6fc0.tar.gz hdf5-9c9326c7debc3b4f32602ec21cc67cfccafa6fc0.tar.bz2 |
[svn-r25653] 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.
(merged from trunk-r25640)
Purpose: Fixed HDFFV-8852
Description:
H5F_ACC_CREAT was included in the C++ API while the C library doesn't
allow it yet. Possibly, in the future, but not now. In addition, the
two flags H5F_ACC_RDONLY and H5F_ACC_RDWR were missing from the
documentation, causing confusion that appending is not supported.
Solution:
- Removed H5F_ACC_CREAT from the function until the C library support it
- Added H5F_ACC_RDONLY and H5F_ACC_RDWR to the comments to update the
documentation
(merged from trunk-r25632)
Platforms tested:
Linux/ppc64 (ostrich)
Linux/32 2.6 (jam)
SunOS 5.11 (emu)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r-- | c++/src/H5DataType.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 08d1778..0d7d61b 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -53,7 +53,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType() : H5Object(), id(0) {} +DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- // Function: DataType overloaded constructor @@ -104,7 +104,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), id(0) +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, "constructor - by dereference"); } @@ -122,7 +122,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object(), id(0) +DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, "constructor - by dereference"); } @@ -708,7 +708,7 @@ void DataType::close() throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } // reset the id - id = 0; + id = H5I_INVALID_HID; } } |