From d774cf9daff3f2a09cdfcdc2a1716bebfa3027e0 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 21 Oct 1998 00:09:58 -0500 Subject: [svn-r770] H5B.c: Replaced FAIL with H5B_INS_ERROR in routine H5B_remove_helper. Updated code that calls H5B_remove_helper with the proper code. H5Fmpio.c: Removed a typo. H5Gnode.c: Replaced FAIL with H5B_INS_ERROR in routine H5G_node_remove. H5Odtype.c: Put in proper casting to remove compiler warnings. H5S.c: Replaced FAIL with H5S_NO_CLASS in routine H5Sget_simple_extent_type. H5Sselect.c: Fixed couple typos to remove compiler warnings. Platform tested: O2K. --- src/H5B.c | 28 ++++++++++++++-------------- src/H5Fmpio.c | 2 +- src/H5Gnode.c | 6 +++--- src/H5Odtype.c | 4 ++-- src/H5S.c | 4 ++-- src/H5Sselect.c | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/H5B.c b/src/H5B.c index 0bab777..adf5710 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -1585,9 +1585,9 @@ H5B_iterate (H5F_t *f, const H5B_class_t *type, const haddr_t *addr, * item falls at the left or right end of the current level then * it might be necessary to adjust the left and/or right keys. * - * Return: Success: SUCCEED + * Return: Success: A B-tree operation. * - * Failure: FAIL + * Failure: H5B_INS_ERROR * * Programmer: Robb Matzke * Wednesday, September 16, 1998 @@ -1607,7 +1607,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, intn idx=-1, lt=0, rt, cmp=1, i; size_t sizeof_rkey, sizeof_node, sizeof_rec; - FUNC_ENTER(H5B_remove_helper, FAIL); + FUNC_ENTER(H5B_remove_helper, H5B_INS_ERROR); assert(f); assert(addr && H5F_addr_defined(addr)); assert(type); @@ -1623,14 +1623,14 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, * for which we're searching. */ if (NULL==(bt=H5AC_protect(f, H5AC_BT, addr, type, udata))) { - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, + HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load B-tree node"); } rt = bt->nchildren; while (ltcmp3)(f, bt->key[idx].nkey, udata, @@ -1641,7 +1641,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, } } if (cmp) { - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree key not found"); + HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "B-tree key not found"); } /* @@ -1659,8 +1659,8 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, lt_key_changed/*out*/, udata, bt->key[idx+1].nkey/*out*/, - rt_key_changed/*out*/))<0) { - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, + rt_key_changed/*out*/))==H5B_INS_ERROR) { + HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree"); } } else if (type->remove) { @@ -1676,7 +1676,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, udata, bt->key[idx+1].nkey, rt_key_changed))<0) { - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, + HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node"); } } else { @@ -1735,7 +1735,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, if (H5F_addr_defined(&(bt->left))) { if (NULL==(sibling=H5AC_find(f, H5AC_BT, &(bt->left), type, udata))) { - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, + HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree"); } sibling->right = bt->right; @@ -1744,7 +1744,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, if (H5F_addr_defined(&(bt->right))) { if (NULL==(sibling=H5AC_find(f, H5AC_BT, &(bt->right), type, udata))) { - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, + HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree"); } sibling->left = bt->left; @@ -1758,7 +1758,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, H5AC_flush(f, H5AC_BT, addr, TRUE)<0 || H5MF_xfree(f, addr, sizeof_node)<0) { bt = NULL; - HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, + HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to free B-tree node"); } bt = NULL; @@ -1851,7 +1851,7 @@ H5B_remove_helper(H5F_t *f, const haddr_t *addr, const H5B_class_t *type, done: if (bt && H5AC_unprotect(f, H5AC_BT, addr, bt)<0) { - HRETURN_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, + HRETURN_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node"); } FUNC_LEAVE(ret_value); @@ -1901,7 +1901,7 @@ H5B_remove(H5F_t *f, const H5B_class_t *type, const haddr_t *addr, /* The actual removal */ if (H5B_remove_helper(f, addr, type, 0, lt_key, <_key_changed, - udata, rt_key, &rt_key_changed)<0) { + udata, rt_key, &rt_key_changed)==H5B_INS_ERROR) { HRETURN_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree"); } diff --git a/src/H5Fmpio.c b/src/H5Fmpio.c index a8461ee..aacc59d 100644 --- a/src/H5Fmpio.c +++ b/src/H5Fmpio.c @@ -67,7 +67,7 @@ #ifdef HAVE_PABLO #include "MPIO_Trace.h" -#endif HAVE_PABLO +#endif #define PABLO_MASK H5F_mpio static hbool_t interface_initialize_g = FALSE; /* rky??? */ #define INTERFACE_INIT NULL diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 9002c65..e9b4ac7 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -919,7 +919,7 @@ H5G_node_remove(H5F_t *f, const haddr_t *addr, void *_lt_key/*in,out*/, idx = (lt+rt)/2; if (NULL==(s=H5HL_peek(f, &(bt_udata->heap_addr), sn->entry[idx].name_off))) { - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to read symbol name"); } cmp = HDstrcmp(bt_udata->name, s); @@ -929,7 +929,7 @@ H5G_node_remove(H5F_t *f, const haddr_t *addr, void *_lt_key/*in,out*/, lt = idx+1; } } - if (cmp) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found"); + if (cmp) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "not found"); if (H5G_CACHED_SLINK==sn->entry[idx].type) { /* Remove the symbolic link value */ @@ -944,7 +944,7 @@ H5G_node_remove(H5F_t *f, const haddr_t *addr, void *_lt_key/*in,out*/, /* Decrement the reference count */ assert(H5F_addr_defined(&(sn->entry[idx].header))); if (H5O_link(sn->entry+idx, -1)<0) { - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count"); } } diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 79bf74f..482725e 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -123,8 +123,8 @@ H5O_dtype_decode_helper(const uint8 **pp, H5T_t *dt) dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - dt->u.atomic.u.s.pad = flags & 0x0f; - dt->u.atomic.u.s.cset = (flags>>4) & 0x0f; + dt->u.atomic.u.s.pad = (H5T_str_t)(flags & 0x0f); + dt->u.atomic.u.s.cset = (H5T_cset_t)((flags>>4) & 0x0f); break; case H5T_FLOAT: diff --git a/src/H5S.c b/src/H5S.c index 55bc218..3c689ba 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1668,12 +1668,12 @@ H5Sget_simple_extent_type(hid_t sid) H5S_class_t ret_value = H5S_NO_CLASS; H5S_t *space = NULL; - FUNC_ENTER(H5Sget_simple_extent_type, FAIL); + FUNC_ENTER(H5Sget_simple_extent_type, H5S_NO_CLASS); H5TRACE1("Sc","i",sid); /* Check arguments */ if (H5I_DATASPACE != H5I_get_type(sid) || NULL == (space = H5I_object(sid))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace"); } ret_value=space->extent.type; diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 3f2493a..8e7383f 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -152,7 +152,7 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src) break; } - FUNC_LEAVE (SUCCEED); + FUNC_LEAVE (ret_value); } /* H5S_select_copy() */ /*-------------------------------------------------------------------------- @@ -759,7 +759,7 @@ H5Sget_select_npoints(hid_t spaceid) hsize_t H5S_get_select_npoints (const H5S_t *space) { - herr_t ret_value=FAIL; /* return value */ + hsize_t ret_value=FAIL; /* return value */ FUNC_ENTER (H5S_get_select_npoints, FAIL); -- cgit v0.12