[svn-r10050] Purpose: Fix bugzilla #241

Description:
    Checked return value from C API for failure condition.
    Added/Modified some comments appropriately.

Platforms tested:
    Linux 2.4 (heping)
    AIX 5.1 (copper) - tests passed but there were some old warnings about
			duplicate symbols on std::string; I'll check on that.
This commit is contained in:
Binh-Minh Ribler
2005-02-20 15:45:44 -05:00
parent 322297809c
commit 6f2de2c62c
7 changed files with 38 additions and 6 deletions

View File

@@ -86,11 +86,14 @@ PropList::PropList( const hid_t plist_id ) : IdComponent(0)
///\param like_plist - IN: Reference to the existing property list
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
void PropList::copy( const PropList& like_plist )
{
// reset the identifier of this PropList - send 'this' in so that
// H5Pclose can be called appropriately
// If this object has a valid id, appropriately decrement reference
// counter and close the id.
try {
decRefCount();
}
@@ -324,7 +327,7 @@ size_t PropList::getPropSize(const char *name) const
{
size_t prop_size;
herr_t ret_value = H5Pget_size(id, name, &prop_size);
if (prop_size < 0)
if (ret_value < 0)
{
throw PropListIException("PropList::getPropSize", "H5Pget_size failed");
}
@@ -376,7 +379,7 @@ size_t PropList::getNumProps() const
{
size_t nprops;
herr_t ret_value = H5Pget_nprops (id, &nprops);
if( nprops < 0 )
if (ret_value < 0)
{
throw PropListIException("PropList::getNumProps", "H5Pget_nprops failed");
}