From 1573bbcec4563064db0a7fda8112e6d304996e66 Mon Sep 17 00:00:00 2001 From: James Laird Date: Fri, 29 Sep 2006 14:14:24 -0500 Subject: [svn-r12693] Changed return values of H5O*_refcount functions to be herr_t instead of int. Mostly cosmetic change. Testing on mir. --- src/H5O.c | 16 +++++++++------- 1 file 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) -- cgit v0.12