[svn-r28612] Normalization of H5G package with revise_chunks.

Mostly minor fixes like warnings, etc.

Tested on:
    Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1
    serial only
    (these changes have been in revise_chunks for a long time)
This commit is contained in:
Dana Robinson 2015-12-13 20:22:33 -05:00
parent e78db67c62
commit abf03a6c65
8 changed files with 25 additions and 23 deletions

View File

@ -322,8 +322,9 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_NAME;
bt2_cparam.node_size = (size_t)H5G_NAME_BT2_NODE_SIZE;
H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
bt2_cparam.rrec_size = 4 + /* Name's hash value */
fheap_id_len; /* Fractal heap ID */
(uint32_t)fheap_id_len; /* Fractal heap ID */
bt2_cparam.split_percent = H5G_NAME_BT2_SPLIT_PERC;
bt2_cparam.merge_percent = H5G_NAME_BT2_MERGE_PERC;
if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL)))
@ -342,8 +343,9 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr)
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_CORDER;
bt2_cparam.node_size = (size_t)H5G_CORDER_BT2_NODE_SIZE;
bt2_cparam.rrec_size = 8 + /* Creation order value */
fheap_id_len; /* Fractal heap ID */
H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
bt2_cparam.rrec_size = 8 + /* Creation order value */
(uint32_t)fheap_id_len; /* Fractal heap ID */
bt2_cparam.split_percent = H5G_CORDER_BT2_SPLIT_PERC;
bt2_cparam.merge_percent = H5G_CORDER_BT2_MERGE_PERC;
if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL)))

View File

@ -411,8 +411,8 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name,
* Add the new name to the heap.
*/
name_offset = H5HL_insert(f, dxpl_id, heap, HDstrlen(name) + 1, name);
if(0 == name_offset || (size_t)(-1) == name_offset)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap")
if(0 == name_offset || UFAIL == name_offset)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap")
ent->name_off = name_offset;
/* Build correct information for symbol table entry based on link type */
@ -505,7 +505,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name,
size_t lnk_offset; /* Offset to sym-link value */
/* Insert link value into local heap */
if((size_t)(-1) == (lnk_offset = H5HL_insert(f, dxpl_id, heap,
if(UFAIL == (lnk_offset = H5HL_insert(f, dxpl_id, heap,
HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap")

View File

@ -259,7 +259,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5G__loc_copy
* Function: H5G_loc_copy
*
* Purpose: Copy over information for a location
*
@ -271,11 +271,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5G__loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth)
H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
FUNC_ENTER_NOAPI(FAIL)
/* Check args. */
HDassert(dst);
@ -289,7 +289,7 @@ H5G__loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G__loc_copy() */
} /* end H5G_loc_copy() */
/*-------------------------------------------------------------------------
@ -388,7 +388,7 @@ H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name,
/* (Group traversal callbacks are responsible for either taking ownership
* of the group location for the object, or freeing it. - QAK)
*/
H5G__loc_copy(udata->loc, obj_loc, H5_COPY_SHALLOW);
H5G_loc_copy(udata->loc, obj_loc, H5_COPY_SHALLOW);
*own_loc = H5G_OWN_OBJ_LOC;
done:

View File

@ -119,7 +119,7 @@ H5B_class_t H5B_SNODE[1] = {{
H5G_node_remove, /*remove */
H5G_node_decode_key, /*decode */
H5G_node_encode_key, /*encode */
H5G_node_debug_key, /*debug */
H5G_node_debug_key /*debug */
}};
/* Declare a free list to manage the H5G_node_t struct */

View File

@ -516,7 +516,6 @@ H5_DLL herr_t H5G__name_init(H5G_name_t *name, const char *path);
/*
* These functions operate on group "locations"
*/
H5_DLL herr_t H5G__loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth);
H5_DLL herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name,
H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id);

View File

@ -280,6 +280,7 @@ H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char
* These functions operate on group "locations"
*/
H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc);
H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth);
H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name,
H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name,

View File

@ -156,16 +156,16 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree")
/* Create symbol table private heap */
if(H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap")
if(FAIL == H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap")
/* Pin the heap down in memory */
if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap")
/* Insert name into the heap */
if((size_t)(-1) == (name_offset = H5HL_insert(f, dxpl_id, heap, (size_t)1, "")))
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap")
if(UFAIL == (name_offset = H5HL_insert(f, dxpl_id, heap, (size_t)1, "")))
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap")
/*
* B-tree's won't work if the first name isn't at the beginning
@ -175,7 +175,7 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t
done:
/* Release resources */
if(heap && H5HL_unprotect(heap) < 0)
if(heap && FAIL == H5HL_unprotect(heap))
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)

View File

@ -201,7 +201,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk,
grp_loc_copy.path = &grp_path_copy;
grp_loc_copy.oloc = &grp_oloc_copy;
H5G_loc_reset(&grp_loc_copy);
if(H5G__loc_copy(&grp_loc_copy, grp_loc, H5_COPY_DEEP) < 0)
if(H5G_loc_copy(&grp_loc_copy, grp_loc, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object location")
/* Create a group ID to pass to the user-defined callback */
@ -263,7 +263,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk,
H5G_loc_free(obj_loc);
/* Copy new object's location information */
H5G__loc_copy(obj_loc, &new_loc, H5_COPY_DEEP);
H5G_loc_copy(obj_loc, &new_loc, H5_COPY_DEEP);
/* Hold the file open until we free this object header (otherwise the
* object location will be invalidated when the file closes).
@ -344,7 +344,7 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk,
/* ("tracking the names properly" means to ignore the effects of the
* link traversal on the object's & group's paths - QAK)
*/
H5G__loc_copy(&tmp_grp_loc, grp_loc, H5_COPY_DEEP);
H5G_loc_copy(&tmp_grp_loc, grp_loc, H5_COPY_DEEP);
tmp_grp_loc_set = TRUE;
/* Hold the object's group hier. path to restore later */
@ -544,7 +544,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
#endif /* H5_USING_MEMCHECKER */
/* Deep copy of the starting location to group location */
if(H5G__loc_copy(&grp_loc, &loc, H5_COPY_DEEP) < 0)
if(H5G_loc_copy(&grp_loc, &loc, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to copy location")
group_copy = TRUE;
@ -761,7 +761,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
/* Transfer "ownership" of the object's information to the group object */
H5G_loc_free(&grp_loc);
H5G__loc_copy(&grp_loc, &obj_loc, H5_COPY_SHALLOW);
H5G_loc_copy(&grp_loc, &obj_loc, H5_COPY_SHALLOW);
H5G_loc_reset(&obj_loc);
obj_loc_valid = FALSE;