diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2015-04-06 17:46:54 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2015-04-06 17:46:54 (GMT) |
commit | 4275900a7b99b2e23f13df54ba24159960fc86b5 (patch) | |
tree | 716338fc6f597ea0c10c1e6181d63b3349102fae /c++/src/H5CommonFG.cpp | |
parent | b9e5e2af4e31b0a60c2d2f6421fb1b3cb9aa0564 (diff) | |
download | hdf5-4275900a7b99b2e23f13df54ba24159960fc86b5.zip hdf5-4275900a7b99b2e23f13df54ba24159960fc86b5.tar.gz hdf5-4275900a7b99b2e23f13df54ba24159960fc86b5.tar.bz2 |
[svn-r26737] Purpose: Fix daily test failure
Description:
- In DataType::DataType(const PredType& pred_type), using DataType::copy
will invoke DataType::close() unnecessarily, which will produce undefined
behavior. Changed to call H5Tcopy directly, code reuse is not useful in
this case.
- Also, fixed CommonFG::childObjVersion to return expected value outside of
an if/else block.
Platforms tested:
Linux/ppc64 (ostrich)
Linux/64 (platypus)
Linux/32 2.6 (jam)
Diffstat (limited to 'c++/src/H5CommonFG.cpp')
-rw-r--r-- | c++/src/H5CommonFG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 1547a5b..dbe26b4 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -1130,6 +1130,7 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_ unsigned CommonFG::childObjVersion(const char* objname) const { H5O_info_t objinfo; + unsigned version = 0; // Use C API to get information of the object herr_t ret_value = H5Oget_info_by_name(getLocId(), objname, &objinfo, H5P_DEFAULT); @@ -1140,12 +1141,11 @@ unsigned CommonFG::childObjVersion(const char* objname) const // Return a valid version or throw an exception for invalid value else { - unsigned version = objinfo.hdr.version; + version = objinfo.hdr.version; if (version != H5O_VERSION_1 && version != H5O_VERSION_2) throwException("childObjVersion", "Invalid version for object"); - else - return(version); } + return(version); } //-------------------------------------------------------------------------- |