From 99e331190948cab9e3f2ecc539af421c3beecfcf Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 12 Sep 2006 10:30:32 -0500 Subject: [svn-r12662] Description: Whitespace/formatting/compiler warning cleanup. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) --- src/H5A.c | 6 +++--- src/H5B2int.c | 15 ++++++++------- src/H5MM.c | 17 ++++++----------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 6135b91..24e27b4 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -282,7 +282,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, } /* Copy the attribute name */ - attr->name = HDstrdup(name); + attr->name = H5MM_xstrdup(name); /* Copy the attribute's datatype */ attr->dt = H5T_copy(type, H5T_COPY_ALL); @@ -1344,7 +1344,7 @@ H5A_rename(H5O_loc_t *loc, const char *old_name, const char *new_name, hid_t dxp /* Copy the attribute name. */ if(found_attr.name) HDfree(found_attr.name); - found_attr.name = HDstrdup(new_name); + found_attr.name = H5MM_xstrdup(new_name); if(!found_attr.name) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "String copy failed") @@ -1585,7 +1585,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr, unsigned update_flags) new_attr->obj_opened = FALSE; /* Copy the guts of the attribute */ - new_attr->name = HDstrdup(old_attr->name); + new_attr->name = H5MM_xstrdup(old_attr->name); new_attr->dt = H5T_copy(old_attr->dt, H5T_COPY_ALL); new_attr->ds = H5S_copy(old_attr->ds, FALSE); } /* end if */ diff --git a/src/H5B2int.c b/src/H5B2int.c index 09392ba..e974583 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -2131,14 +2131,15 @@ H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, HDassert(op); /* Get the pointer to the shared B-tree info */ - shared=H5RC_GET_OBJ(bt2_shared); + shared = H5RC_GET_OBJ(bt2_shared); HDassert(shared); - if(depth>0) { + /* Protect current node & set up variables */ + if(depth > 0) { H5B2_internal_t *internal; /* Pointer to internal node */ /* Lock the current B-tree node */ - if (NULL == (internal = H5B2_protect_internal(f, dxpl_id, bt2_shared, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) + if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, bt2_shared, curr_node->addr, curr_node->node_nrec, depth, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Set up information about current node */ @@ -2164,7 +2165,7 @@ H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, for(u = 0; u < curr_node->node_nrec && !ret_value; u++) { /* Descend into child node, if current node is an internal node */ if(depth > 0) { - if((ret_value = H5B2_iterate_node(f, dxpl_id, bt2_shared, depth-1, &(node_ptrs[u]), op, op_data)) < 0) + if((ret_value = H5B2_iterate_node(f, dxpl_id, bt2_shared, (depth - 1), &(node_ptrs[u]), op, op_data)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ @@ -2174,15 +2175,15 @@ H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, } /* end for */ /* Descend into last child node, if current node is an internal node */ - if(!ret_value && depth>0) { - if((ret_value = H5B2_iterate_node(f,dxpl_id,bt2_shared,depth-1,&(node_ptrs[u]),op,op_data)) < 0) + if(!ret_value && depth > 0) { + if((ret_value = H5B2_iterate_node(f, dxpl_id, bt2_shared, (depth - 1), &(node_ptrs[u]), op, op_data)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ done: /* Unlock current node */ if(node) - if (H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, node, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, node, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5MM.c b/src/H5MM.c index 415b2e2..afe7a3a 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -165,29 +165,24 @@ done: * matzke@llnl.gov * Jul 10 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ char * H5MM_xstrdup(const char *s) { - char *ret_value=NULL; + char *ret_value = NULL; /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_xstrdup); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_xstrdup) - if (s) { + if(s) { ret_value = H5MM_malloc(HDstrlen(s) + 1); - assert (ret_value); + HDassert(ret_value); HDstrcpy(ret_value, s); } /* end if */ -#ifdef LATER -done: -#endif /* LATER */ - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5MM_xstrdup() */ /*------------------------------------------------------------------------- -- cgit v0.12