[svn-r26695] Purpose: Fixed HDFFV-7947 (cont.)

Description:
    - Put back the UNUSED parameters in dsets test because the change to remove
      the warning last time caused failure in setting filter, in turn, caused
      failure in the test with such obscure/unrelated errors!
    - Added incRefCount() to other constructors that missed from last time.
Platforms tested:
    Linux/64 (platypus)
    Linux/32 2.6 (jam)
    SunOS 5.11 (emu)
This commit is contained in:
Binh-Minh Ribler 2015-04-01 13:52:05 -05:00
parent 6f03b60c61
commit f6d9d1fdc8
8 changed files with 9 additions and 29 deletions

View File

@ -74,7 +74,8 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent()
//--------------------------------------------------------------------------
Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent()
{
id = existing_id;
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------

View File

@ -63,6 +63,7 @@ DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {}
DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------

View File

@ -85,6 +85,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) :
DataSpace::DataSpace(const hid_t existing_id) : IdComponent()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------

View File

@ -404,25 +404,6 @@ ssize_t H5File::getObjCount(unsigned types) const
return (num_objs);
}
//--------------------------------------------------------------------------
// Function: H5File::getObjCount
///\brief This is an overloaded member function, provided for convenience.
/// It takes no parameter and returns the object count of all
/// object types.
///\return Number of opened object IDs
///\exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ssize_t H5File::getObjCount() const
{
ssize_t num_objs = H5Fget_obj_count(id, H5F_OBJ_ALL);
if( num_objs < 0 )
{
throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
}
return (num_objs);
}
//--------------------------------------------------------------------------
// Function: H5File::getObjIDs
///\brief Retrieves a list of opened object IDs (files, datasets,

View File

@ -59,8 +59,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG {
// Returns the number of opened object IDs (files, datasets, groups
// and datatypes) in the same file.
ssize_t getObjCount(unsigned types) const;
ssize_t getObjCount() const;
ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const;
// Retrieves a list of opened object IDs (files, datasets, groups
// and datatypes) in the same file.

View File

@ -85,6 +85,7 @@ hid_t Group::getLocId() const
Group::Group(const hid_t existing_id) : H5Object(), CommonFG()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------

View File

@ -195,7 +195,7 @@ Attribute H5Location::openAttribute( const unsigned int idx ) const
H5_ITER_INC, (hsize_t)idx, H5P_DEFAULT, H5P_DEFAULT);
if( attr_id > 0 )
{
Attribute attr( attr_id );
Attribute attr;
f_Attribute_setId(&attr, attr_id);
return(attr);
}

View File

@ -59,11 +59,9 @@ const H5std_string DSET_BOGUS_NAME ("bogus");
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
#endif
static size_t filter_bogus(size_t nbytes);
// UNUSED variables caused warning, but taking them out caused failure.
/*-------------------------------------------------------------------------
* Function: test_create
@ -461,12 +459,10 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[], size_t nbytes,
size_t *buf_size, void **buf)
#endif
filter_bogus(size_t nbytes)
// UNUSED variables caused warning, but taking them out caused failure.
{
return nbytes;
}