[svn-r11151] Purpose: Fix bugzilla #407 and #408

Description:
    PropList::copyProp has incorrect prototype; although it works,
    it does cause users inconvenience.

Solution:
    Added another overloaded function with correct prototype.  The
    old version will be removed in a future release.  In the meantime,
    "Obsolete" will be displayed in its RM page.

    Also, changed several checks on the returned value of a C API from
    non-positive to negative because id = 0 is no longer significant,
    now that the C++ reference counting had been removed.

Platforms tested:
    Linux 2.4 (heping)
    IRIX64 with -n32 (modi4)
    Linux 2.4 w/PGI (colonelk)
This commit is contained in:
Binh-Minh Ribler
2005-07-24 22:37:21 -05:00
parent f208550696
commit fab172d704
14 changed files with 65 additions and 28 deletions

View File

@@ -111,7 +111,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
hid_t create_plist_id = create_plist.getId();
hid_t access_plist_id = access_plist.getId();
id = H5Fcreate( name, flags, create_plist_id, access_plist_id );
if( id <= 0 ) // throw an exception when open/create fail
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fcreate failed");
}
@@ -121,7 +121,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
{
hid_t access_plist_id = access_plist.getId();
id = H5Fopen( name, flags, access_plist_id );
if( id <= 0 ) // throw an exception when open/create fail
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fopen failed");
}
@@ -201,7 +201,7 @@ void H5File::reOpen()
// call C routine to reopen the file - Note: not sure about this
// does id need to be closed later? which id to be the parameter?
id = H5Freopen( id );
if( id <= 0 ) // Raise exception when H5Freopen returns a neg value
if( id < 0 ) // Raise exception when H5Freopen returns a neg value
throw FileIException("H5File::reOpen", "H5Freopen failed");
}