summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-09-29 19:14:24 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-09-29 19:14:24 (GMT)
commit1573bbcec4563064db0a7fda8112e6d304996e66 (patch)
tree1dd66544fb6ec18071d678db05b54f24667537e0
parent71ba8671b3c48722c09fed8721e73b9322d14a5c (diff)
downloadhdf5-1573bbcec4563064db0a7fda8112e6d304996e66.zip
hdf5-1573bbcec4563064db0a7fda8112e6d304996e66.tar.gz
hdf5-1573bbcec4563064db0a7fda8112e6d304996e66.tar.bz2
[svn-r12693] Changed return values of H5O*_refcount functions to be herr_t instead of
int. Mostly cosmetic change. Testing on mir.
-rw-r--r--src/H5O.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 1303976..d8f5afe 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -443,7 +443,7 @@ done:
* that references an object by address is deleted. When the
* link is deleted, H5Odecr_refcount should be used.
*
- * Return: Success: The object's new refcount
+ * Return: Success: Non-negative
* Failure: Negative
*
* Programmer: James Laird
@@ -451,11 +451,11 @@ done:
*
*-------------------------------------------------------------------------
*/
-int
+herr_t
H5Oincr_refcount(hid_t object_id)
{
H5O_loc_t *oloc;
- int ret_value;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(H5Oincr_refcount, FAIL)
H5TRACE1("Is","i",object_id);
@@ -464,7 +464,8 @@ H5Oincr_refcount(hid_t object_id)
if((oloc = H5O_get_oloc(object_id)) == NULL)
HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID")
- ret_value = H5O_link(oloc, 1, H5AC_dxpl_id);
+ if(H5O_link(oloc, 1, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -491,11 +492,11 @@ done:
*
*-------------------------------------------------------------------------
*/
-int
+herr_t
H5Odecr_refcount(hid_t object_id)
{
H5O_loc_t *oloc;
- int ret_value;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(H5Odecr_refcount, FAIL)
H5TRACE1("Is","i",object_id);
@@ -504,7 +505,8 @@ H5Odecr_refcount(hid_t object_id)
if((oloc = H5O_get_oloc(object_id)) == NULL)
HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID")
- ret_value = H5O_link(oloc, -1, H5AC_dxpl_id);
+ if(H5O_link(oloc, -1, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed")
done:
FUNC_LEAVE_API(ret_value)