diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index dce95de9c70..de84034f638 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -248,7 +248,9 @@ H5D__compact_init(H5F_t H5_ATTR_UNUSED *f, const H5D_t *dset, hid_t H5_ATTR_UNUS /* Check for mismatch */ if (dset->shared->layout.storage.u.compact.size != data_size) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "bad value from dataset header - size of compact dataset's data buffer doesn't match size of dataset data"); + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, + "bad value from dataset header - size of compact dataset's data buffer doesn't match " + "size of dataset data"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index c9ad0fc07d2..11b0a8e4ef8 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -366,12 +366,11 @@ H5D__contig_delete(H5F_t *f, const H5O_storage_t *storage) *------------------------------------------------------------------------- */ herr_t -H5D__contig_check(const H5F_t *f, const H5O_layout_t *layout, const H5S_extent_t *extent, - const H5T_t *dt) +H5D__contig_check(const H5F_t *f, const H5O_layout_t *layout, const H5S_extent_t *extent, const H5T_t *dt) { - hsize_t nelmts; /* Number of elements in dataspace */ - size_t dt_size; /* Size of datatype */ - hsize_t data_size; /* Raw data size */ + hsize_t nelmts; /* Number of elements in dataspace */ + size_t dt_size; /* Size of datatype */ + hsize_t data_size; /* Raw data size */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -398,7 +397,7 @@ H5D__contig_check(const H5F_t *f, const H5O_layout_t *layout, const H5S_extent_t /* Check for invalid (corrupted in the file, probably) dimensions */ if (H5_addr_defined(layout->storage.u.contig.addr)) { - haddr_t rel_eoa; /* Relative end of file address */ + haddr_t rel_eoa; /* Relative end of file address */ if (HADDR_UNDEF == (rel_eoa = H5F_get_eoa(f, H5FD_MEM_DRAW))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine file size"); @@ -406,9 +405,9 @@ H5D__contig_check(const H5F_t *f, const H5O_layout_t *layout, const H5S_extent_t /* Check for invalid dataset size (from bad dimensions) putting the * dataset elements off the end of the file */ - if (H5_addr_le((layout->storage.u.contig.addr + data_size), layout->storage.u.contig.addr)) + if (H5_addr_le((layout->storage.u.contig.addr + data_size), layout->storage.u.contig.addr)) HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "invalid dataset size, likely file corruption"); - if (H5_addr_gt((layout->storage.u.contig.addr + data_size), rel_eoa)) + if (H5_addr_gt((layout->storage.u.contig.addr + data_size), rel_eoa)) HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "invalid dataset size, likely file corruption"); } @@ -500,8 +499,8 @@ H5D__contig_construct(H5F_t *f, H5D_t *dset) static herr_t H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t H5_ATTR_UNUSED dapl_id) { - size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -510,7 +509,8 @@ H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t H5_ATTR_UNUSED dapl_id) assert(dset); /* Sanity check the dataset's info */ - if (H5D__contig_check(f, &dset->shared->layout, H5S_GET_EXTENT(dset->shared->space), dset->shared->type) < 0) + if (H5D__contig_check(f, &dset->shared->layout, H5S_GET_EXTENT(dset->shared->space), dset->shared->type) < + 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "invalid dataset info"); /* Compute the size of the contiguous storage for versions of the diff --git a/src/H5Defl.c b/src/H5Defl.c index 899706eec62..22348e33fcc 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -138,7 +138,7 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to determine datatype size"); /* Check for storage overflows */ - max_points = H5S_get_npoints_max(dset->shared->space); + max_points = H5S_get_npoints_max(dset->shared->space); if (H5O_efl_total_size(&dset->shared->dcpl_cache.efl, &max_storage) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve size of external file"); if (H5S_UNLIMITED == max_points) { @@ -179,7 +179,7 @@ H5D__efl_init(H5F_t H5_ATTR_UNUSED *f, const H5D_t *dset, hid_t H5_ATTR_UNUSED d size_t dt_size; /* Size of datatype */ hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ hsize_t nelmts; /* Number of elements in dataspace */ - hsize_t data_size; /* Raw data size */ + hsize_t data_size; /* Raw data size */ hsize_t max_storage; /* Maximum storage size */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dint.c b/src/H5Dint.c index ebab29792f1..3bbfe4d0632 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1678,7 +1678,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) htri_t msg_exists; /* Whether a particular type of message exists */ bool layout_init = false; /* Flag to indicate that chunk information was initialized */ bool must_init_storage = false; - bool fill_init = false; /* Flag to indicate that fill information was initialized */ + bool fill_init = false; /* Flag to indicate that fill information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) @@ -1790,7 +1790,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) /* Check if there is a fill value, but no type yet */ if (fill_prop->buf != NULL && fill_prop->type == NULL) { - H5T_t *tmp_type; /* Temporary pointer to dataset's datatype */ + H5T_t *tmp_type; /* Temporary pointer to dataset's datatype */ /* Copy the dataset type into the fill value message */ if (NULL == (tmp_type = H5T_copy(dataset->shared->type, H5T_COPY_TRANSIENT))) @@ -1806,7 +1806,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) if ((size_t)fill_prop->size < bkg_size) { if (H5T_close_real(tmp_type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't free temporary datatype"); - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "fill value size doesn't match dataset's datatype size"); + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, + "fill value size doesn't match dataset's datatype size"); } } diff --git a/src/H5Gent.c b/src/H5Gent.c index 89c3894b113..40872a041cc 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -353,10 +353,10 @@ H5G__ent_reset(H5G_entry_t *ent) herr_t H5G__ent_to_link(const H5G_entry_t *ent, const H5HL_t *heap, H5O_link_t *lnk) { - const char *name; /* Pointer to link name in heap */ - size_t block_size; /* Size of the heap block */ - bool dup_soft = false; /* xstrdup the symbolic link name or not */ - herr_t ret_value = SUCCEED; /* Return value */ + const char *name; /* Pointer to link name in heap */ + size_t block_size; /* Size of the heap block */ + bool dup_soft = false; /* xstrdup the symbolic link name or not */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -381,7 +381,7 @@ H5G__ent_to_link(const H5G_entry_t *ent, const H5HL_t *heap, H5O_link_t *lnk) /* Object is a symbolic or hard link */ if (ent->type == H5G_CACHED_SLINK) { - const char *s; /* Pointer to link value */ + const char *s; /* Pointer to link value */ if (NULL == (s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset))) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbolic link name"); diff --git a/src/H5Glink.c b/src/H5Glink.c index 26463795ff7..1982f54984c 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -264,8 +264,8 @@ H5G_link_to_info(const H5O_loc_t *link_loc, const H5O_link_t *lnk, H5L_info2_t * *------------------------------------------------------------------------- */ herr_t -H5G__link_to_ent(H5F_t *f, H5HL_t *heap, const H5O_link_t *lnk, H5O_type_t obj_type, - const void *crt_info, H5G_entry_t *ent) +H5G__link_to_ent(H5F_t *f, H5HL_t *heap, const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, + H5G_entry_t *ent) { size_t name_offset; /* Offset of name in heap */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 98fb07ad51c..d04c582d009 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -644,15 +644,15 @@ H5G__loc_addr_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UN const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/) { - haddr_t *udata = (haddr_t *)_udata; /* User data passed in */ + haddr_t *udata = (haddr_t *)_udata; /* User data passed in */ FUNC_ENTER_PACKAGE_NOERR /* Check if the name in this group resolved to a valid link */ if (obj_loc == NULL) - *udata = HADDR_UNDEF; /* No object found */ + *udata = HADDR_UNDEF; /* No object found */ else - *udata = obj_loc->oloc->addr; /* Set address of object */ + *udata = obj_loc->oloc->addr; /* Set address of object */ /* Indicate that this callback didn't take ownership of the group * * location for the object */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 0fb70818715..f211e74e041 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -344,7 +344,7 @@ H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; const char *s1, *s2; - size_t max_len; + size_t max_len; int ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -747,10 +747,10 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i if (NULL == (lnk.name = (char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off))) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get link name"); - /* Compute the size of the link name in the heap, being defensive about corrupted data */ + /* Compute the size of the link name in the heap, being defensive about corrupted data */ link_name_len = strnlen(lnk.name, (udata->common.block_size - sn->entry[idx].name_off)) + 1; - if (link_name_len > (udata->common.block_size - sn->entry[idx].name_off)) - link_name_len = (udata->common.block_size - sn->entry[idx].name_off); + if (link_name_len > (udata->common.block_size - sn->entry[idx].name_off)) + link_name_len = (udata->common.block_size - sn->entry[idx].name_off); /* Set up rest of link structure */ lnk.corder_valid = false; @@ -788,13 +788,17 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i if (lnk.u.soft.name) { size_t soft_link_len; /* Length of string in local heap */ - /* Compute the size of the soft link name in the heap, being defensive about corrupted data */ - soft_link_len = strnlen(lnk.u.soft.name, (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset)) + 1; - if (soft_link_len > (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset)) - soft_link_len = (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset); + /* Compute the size of the soft link name in the heap, being defensive about corrupted data */ + soft_link_len = strnlen(lnk.u.soft.name, + (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset)) + + 1; + if (soft_link_len > (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset)) + soft_link_len = (udata->common.block_size - sn->entry[idx].cache.slink.lval_offset); - if (H5HL_remove(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, soft_link_len) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to remove soft link from local heap"); + if (H5HL_remove(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, + soft_link_len) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, + "unable to remove soft link from local heap"); } /* end if */ } /* end else */ @@ -900,8 +904,8 @@ H5G__node_iterate(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, { H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; H5G_node_t *sn = NULL; - H5G_entry_t *ents; /* Pointer to entries in this node */ - unsigned u; /* Local index variable */ + H5G_entry_t *ents; /* Pointer to entries in this node */ + unsigned u; /* Local index variable */ int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -924,11 +928,12 @@ H5G__node_iterate(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, if (udata->skip > 0) --udata->skip; else { - H5O_link_t lnk; /* Link for entry */ + H5O_link_t lnk; /* Link for entry */ /* Convert the entry to a link */ if (H5G__ent_to_link(&ents[u], udata->heap, &lnk) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, "unable to convert symbol table entry to link"); + HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, + "unable to convert symbol table entry to link"); /* Make the callback */ ret_value = (udata->op)(&lnk, udata->op_data); @@ -1154,14 +1159,15 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const /* copy object in this node one by one */ for (i = 0; i < sn->nsyms; i++) { - H5G_entry_t *src_ent = &(sn->entry[i]); /* Convenience variable to refer to current source group entry */ - H5O_link_t lnk; /* Link to insert */ - char *name; /* Name of source object */ - H5G_entry_t tmp_src_ent; /* Temporary copy. Change will not affect the cache */ + H5G_entry_t *src_ent = + &(sn->entry[i]); /* Convenience variable to refer to current source group entry */ + H5O_link_t lnk; /* Link to insert */ + char *name; /* Name of source object */ + H5G_entry_t tmp_src_ent; /* Temporary copy. Change will not affect the cache */ H5O_type_t obj_type = H5O_TYPE_UNKNOWN; /* Target object type */ - H5G_copy_file_ud_t *cpy_udata; /* Copy file udata */ - H5G_obj_create_t gcrt_info; /* Group creation info */ - size_t max_link_len; /* Max. length of string in local heap */ + H5G_copy_file_ud_t *cpy_udata; /* Copy file udata */ + H5G_obj_create_t gcrt_info; /* Group creation info */ + size_t max_link_len; /* Max. length of string in local heap */ /* expand soft link */ if (H5G_CACHED_SLINK == src_ent->type && cpy_info->expand_soft_link) { @@ -1181,22 +1187,24 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const H5_GCC_CLANG_DIAG_ON("cast-qual") /* Get pointer to link value in local heap */ - if ((link_name = (char *)H5HL_offset_into(udata->src_heap, tmp_src_ent.cache.slink.lval_offset)) == NULL) + if ((link_name = + (char *)H5HL_offset_into(udata->src_heap, tmp_src_ent.cache.slink.lval_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name"); - /* Sanity check soft link name, to detect running off the end of the heap block */ - max_link_len = udata->src_block_size - tmp_src_ent.cache.slink.lval_offset; - if (strnlen(link_name, max_link_len) == max_link_len) + /* Sanity check soft link name, to detect running off the end of the heap block */ + max_link_len = udata->src_block_size - tmp_src_ent.cache.slink.lval_offset; + if (strnlen(link_name, max_link_len) == max_link_len) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "invalid link name offset"); /* Check if the object pointed by the soft link exists in the source file */ if (H5G__loc_addr(&grp_loc, link_name, &obj_addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFIND, H5_ITER_ERROR, "unable to check if soft link resolves to an object"); + HGOTO_ERROR(H5E_SYM, H5E_CANTFIND, H5_ITER_ERROR, + "unable to check if soft link resolves to an object"); if (H5_addr_defined(obj_addr)) { tmp_src_ent.header = obj_addr; src_ent = &tmp_src_ent; } /* end if */ - } /* if ((H5G_CACHED_SLINK == src_ent->type)... */ + } /* if ((H5G_CACHED_SLINK == src_ent->type)... */ /* Check if object in source group is a hard link */ if (H5_addr_defined(src_ent->header)) { @@ -1237,12 +1245,13 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_SOFT; - if ((lnk.u.soft.name = (char *)H5HL_offset_into(udata->src_heap, src_ent->cache.slink.lval_offset)) == NULL) + if ((lnk.u.soft.name = + (char *)H5HL_offset_into(udata->src_heap, src_ent->cache.slink.lval_offset)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name"); - /* Sanity check soft link name, to detect running off the end of the heap block */ - max_link_len = udata->src_block_size - src_ent->cache.slink.lval_offset; - if (strnlen(lnk.u.soft.name, max_link_len) == max_link_len) + /* Sanity check soft link name, to detect running off the end of the heap block */ + max_link_len = udata->src_block_size - src_ent->cache.slink.lval_offset; + if (strnlen(lnk.u.soft.name, max_link_len) == max_link_len) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "invalid link name offset"); } /* else if */ else @@ -1252,16 +1261,16 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const if ((name = (char *)H5HL_offset_into(udata->src_heap, src_ent->name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name"); - /* Sanity check soft link name, to detect running off the end of the heap block */ - max_link_len = udata->src_block_size - src_ent->name_off; - if (strnlen(name, max_link_len) == max_link_len) + /* Sanity check soft link name, to detect running off the end of the heap block */ + max_link_len = udata->src_block_size - src_ent->name_off; + if (strnlen(name, max_link_len) == max_link_len) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "invalid link name offset"); /* Set up common link data */ lnk.cset = H5F_DEFAULT_CSET; /* XXX: Allow user to set this */ lnk.corder = 0; /* Creation order is not tracked for old-style links */ lnk.corder_valid = false; /* Creation order is not valid */ - lnk.name = name; /* Name of link */ + lnk.name = name; /* Name of link */ /* Set copied metadata tag */ H5_BEGIN_TAG(H5AC__COPIED_TAG) @@ -1298,8 +1307,8 @@ H5G__node_build_table(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; - H5G_node_t *sn = NULL; /* Symbol table node */ - unsigned u; /* Local index variable */ + H5G_node_t *sn = NULL; /* Symbol table node */ + unsigned u; /* Local index variable */ int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1332,14 +1341,15 @@ H5G__node_build_table(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr /* Iterate over the symbol table node entries, adding to link table */ for (u = 0; u < sn->nsyms; u++) { - size_t linkno; /* Link allocated */ + size_t linkno; /* Link allocated */ /* Determine the link to operate on in the table */ linkno = udata->ltable->nlinks++; /* Convert the entry to a link */ if (H5G__ent_to_link(&sn->entry[u], udata->heap, &udata->ltable->lnks[linkno]) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, "unable to convert symbol table entry to link"); + HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, + "unable to convert symbol table entry to link"); } /* end for */ done: @@ -1419,7 +1429,7 @@ H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, had H5G_bt_common_t udata; /*data to pass through B-tree */ H5E_clear_stack(NULL); /* discard that error */ - udata.heap = heap; + udata.heap = heap; udata.block_size = H5HL_heap_get_size(heap); if (H5B_debug(f, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 17daaa484fb..51feeaad56d 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -419,8 +419,8 @@ H5G__obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5G_obj_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, bool adj_link, - H5O_type_t obj_type, const void *crt_info) +H5G_obj_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, bool adj_link, H5O_type_t obj_type, + const void *crt_info) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 1fcc6bb63e2..f4f1749dc88 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -347,8 +347,8 @@ H5_DLL const char *H5G__component(const char *name, size_t *size_p); */ H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab); H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint); -H5_DLL herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, - H5O_type_t obj_type, const void *crt_info); +H5_DLL herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, H5O_type_t obj_type, + const void *crt_info); H5_DLL herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info); H5_DLL herr_t H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab); @@ -393,8 +393,8 @@ H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, const void *_lt_key, haddr_t addr H5_DLL herr_t H5G__node_free(H5G_node_t *sym); /* Functions that understand links in groups */ -H5_DLL herr_t H5G__link_to_ent(H5F_t *f, H5HL_t *heap, const H5O_link_t *lnk, - H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent); +H5_DLL herr_t H5G__link_to_ent(H5F_t *f, H5HL_t *heap, const H5O_link_t *lnk, H5O_type_t obj_type, + const void *crt_info, H5G_entry_t *ent); H5_DLL herr_t H5G__link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc); H5_DLL herr_t H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_order_t order); H5_DLL herr_t H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *last_lnk, diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 05a8f93e917..a756a1c324f 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -228,8 +228,8 @@ H5_DLL herr_t H5G_link_to_info(const struct H5O_loc_t *link_loc, const struct H5 /* * Functions that understand group objects */ -H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, struct H5O_link_t *obj_lnk, - bool adj_link, H5O_type_t obj_type, const void *crt_info); +H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, struct H5O_link_t *obj_lnk, bool adj_link, + H5O_type_t obj_type, const void *crt_info); H5_DLL herr_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t name_size, size_t *name_len); diff --git a/src/H5Gstab.c b/src/H5Gstab.c index cfdf4cb0747..1ebd13681b1 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -37,8 +37,8 @@ /* User data for finding link information from B-tree */ typedef struct { /* downward */ - const char *name; /* Name to search for */ - H5HL_t *heap; /* Local heap for group */ + const char *name; /* Name to search for */ + H5HL_t *heap; /* Local heap for group */ /* upward */ H5O_link_t *lnk; /* Caller's link location */ @@ -227,8 +227,8 @@ H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab *------------------------------------------------------------------------- */ herr_t -H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, H5O_link_t *obj_lnk, - H5O_type_t obj_type, const void *crt_info) +H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, H5O_link_t *obj_lnk, H5O_type_t obj_type, + const void *crt_info) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_ins_t udata; /* Data to pass through B-tree */ @@ -275,8 +275,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, H5O_link_t *obj_lnk, *------------------------------------------------------------------------- */ herr_t -H5G__stab_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, H5O_type_t obj_type, - const void *crt_info) +H5G__stab_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info) { H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ @@ -850,7 +849,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_l static herr_t H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) { - H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata; + H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Gtest.c b/src/H5Gtest.c index a7909255db5..0b0708119e1 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -796,10 +796,10 @@ H5G__verify_cached_stabs_test(hid_t gid) { H5G_t *grp = NULL; /* Group */ htri_t stab_exists; - H5O_stab_t stab; /* Symbol table message */ + H5O_stab_t stab; /* Symbol table message */ H5G_bt_common_t udata = {NULL, NULL, 0}; /* Dummy udata so H5B_iterate doesn't freak out */ - haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ - herr_t ret_value = SUCCEED; /* Return value */ + haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5HG.c b/src/H5HG.c index df5576faef1..a859b40f100 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -558,7 +558,8 @@ H5HG_read(H5F_t *f, H5HG_t *hobj, void *object /*out*/, size_t *buf_size) /* Heap object idx 0 is the free space in the heap and should never be given out */ if (0 == hobj->idx) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", hobj->addr, hobj->idx); + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", + hobj->addr, hobj->idx); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) @@ -636,7 +637,8 @@ H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust) /* Heap object idx 0 is the free space in the heap and should never be given out */ if (0 == hobj->idx) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", hobj->addr, hobj->idx); + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", + hobj->addr, hobj->idx); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) @@ -692,7 +694,8 @@ H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size) /* Heap object idx 0 is the free space in the heap and should never be given out */ if (0 == hobj->idx) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", hobj->addr, hobj->idx); + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", + hobj->addr, hobj->idx); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) @@ -745,7 +748,8 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj) /* Heap object idx 0 is the free space in the heap and should never be given out */ if (0 == hobj->idx) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", hobj->addr, hobj->idx); + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap index, heap object = {%" PRIxHADDR ", %zu}", + hobj->addr, hobj->idx); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) diff --git a/src/H5HL.c b/src/H5HL.c index 2e0f4b80af9..f6e589b016d 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -295,11 +295,11 @@ H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap) H5HL_t * H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags) { - H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ - H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ - H5HL_dblk_t *dblk = NULL; /* Local heap data block */ - H5HL_t *heap = NULL; /* Heap data structure */ - H5HL_t *ret_value = NULL; + H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ + H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ + H5HL_dblk_t *dblk = NULL; /* Local heap data block */ + H5HL_t *heap = NULL; /* Heap data structure */ + H5HL_t *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -326,7 +326,7 @@ H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags) /* Check if the heap is already pinned in memory */ /* (for re-entrant situation) */ if (heap->prots == 0) { - void *pin_obj; /* Pointer to local heap object to pin */ + void *pin_obj; /* Pointer to local heap object to pin */ /* Check if heap has separate data block */ if (heap->single_cache_obj) @@ -334,7 +334,8 @@ H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags) pin_obj = prfx; else { /* Protect the local heap data block */ - if (NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) + if (NULL == + (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap data block"); /* Pin data block */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index fcce09ad43c..6916a9044c7 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -309,7 +309,7 @@ H5O__cache_deserialize(const void *image, size_t len, void *_udata, bool *dirty) &(udata->common), dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk"); - /* Check for corruption in object header # of messages */ + /* Check for corruption in object header # of messages */ if (oh->version == H5O_VERSION_1 && udata->v1_pfx_nmesgs < oh->nmesgs) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "bad object header message count"); diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index a83c4b67692..d6002046269 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -362,7 +362,8 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Sanity check message for possible corruption */ if (H5O_UNKNOWN_ID != mesg_src->type->id && H5O_NULL_ID != mesg_src->type->id) if (0 == mesg_src->raw_size) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "message of type '%s' has zero size", mesg_src->type->name); + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "message of type '%s' has zero size", + mesg_src->type->name); /* Check for continuation message; these are converted to NULL * messages because the destination OH will have only one chunk diff --git a/src/H5Odtype.c b/src/H5Odtype.c index d66ca9ace4b..24671b02107 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -392,7 +392,9 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Check for duplicated field name */ for (memb_idx = 0; memb_idx < dt->shared->u.compnd.nmembs; memb_idx++) if (0 == strcmp((const char *)*pp, dt->shared->u.compnd.memb[memb_idx].name)) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "duplicated compound field name '%s', for fields %u and %u", (const char *)*pp, memb_idx, dt->shared->u.compnd.nmembs); + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, + "duplicated compound field name '%s', for fields %u and %u", + (const char *)*pp, memb_idx, dt->shared->u.compnd.nmembs); /* Decode the field name */ if (NULL == (dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].name = @@ -518,10 +520,13 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Validate decoded dims */ for (unsigned u = 0; u < ndims; u++) if (!(dim[u] > 0)) { - dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].name = H5MM_xfree(dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].name); + dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].name = + H5MM_xfree(dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].name); if (H5T_close_real(temp_type) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype info"); - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "zero-sized dimension specified"); + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, + "can't release datatype info"); + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, + "zero-sized dimension specified"); } /* Create the array datatype for the field */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 55e3c5c2491..351dbd30211 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -76,9 +76,9 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED { H5O_efl_t *mesg = NULL; int version; - const uint8_t *p_end = p + p_size - 1; /* pointer to last byte in p */ - const char *s = NULL; - H5HL_t *heap = NULL; + const uint8_t *p_end = p + p_size - 1; /* pointer to last byte in p */ + const char *s = NULL; + H5HL_t *heap = NULL; size_t block_size; /* Size of the heap block */ void *ret_value = NULL; /* Return value */ @@ -401,7 +401,7 @@ herr_t H5O_efl_total_size(const H5O_efl_t *efl, hsize_t *size) { hsize_t total_size = 0, tmp; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -418,7 +418,7 @@ H5O_efl_total_size(const H5O_efl_t *efl, hsize_t *size) /* Set the size to return */ *size = total_size; - } /* end else */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Olayout.c b/src/H5Olayout.c index eeed59451fc..e5ffc382476 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -1226,7 +1226,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool H5_ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *)mesg_src; H5O_layout_t *layout_dst = NULL; - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1250,37 +1250,35 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool H5_ } /* end if */ break; - case H5D_CONTIGUOUS: - { - hsize_t nelmts; /* Number of elements in dataset's extent */ - size_t dt_size; /* Size of dataset's datatype in bytes */ - /* Sanity check the dataset's info */ - if (H5D__contig_check(file_src, layout_src, udata->src_space_extent, udata->src_dtype) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid layout / dataspace / datatype info"); - - /* Compute the size of the contiguous storage for versions of the - * layout message less than version 3 because versions 1 & 2 would - * truncate the dimension sizes to 32-bits of information. - QAK 5/26/04 - */ - nelmts = H5S_extent_nelem(udata->src_space_extent); - dt_size = H5T_get_size(udata->src_dtype); - if (layout_src->version < H5O_LAYOUT_VERSION_3) - layout_dst->storage.u.contig.size = nelmts * dt_size; - else - /* Sanity check layout storage size */ - if (layout_dst->storage.u.contig.size != (nelmts * dt_size)) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid layout storage size "); - - if (H5D__contig_is_space_alloc(&layout_src->storage) || - (cpy_info->shared_fo && - H5D__contig_is_data_cached((const H5D_shared_t *)cpy_info->shared_fo))) { - /* copy contiguous raw data */ - if (H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, - &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage"); - } /* end if */ - } - break; + case H5D_CONTIGUOUS: { + hsize_t nelmts; /* Number of elements in dataset's extent */ + size_t dt_size; /* Size of dataset's datatype in bytes */ + /* Sanity check the dataset's info */ + if (H5D__contig_check(file_src, layout_src, udata->src_space_extent, udata->src_dtype) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid layout / dataspace / datatype info"); + + /* Compute the size of the contiguous storage for versions of the + * layout message less than version 3 because versions 1 & 2 would + * truncate the dimension sizes to 32-bits of information. - QAK 5/26/04 + */ + nelmts = H5S_extent_nelem(udata->src_space_extent); + dt_size = H5T_get_size(udata->src_dtype); + if (layout_src->version < H5O_LAYOUT_VERSION_3) + layout_dst->storage.u.contig.size = nelmts * dt_size; + else + /* Sanity check layout storage size */ + if (layout_dst->storage.u.contig.size != (nelmts * dt_size)) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid layout storage size "); + + if (H5D__contig_is_space_alloc(&layout_src->storage) || + (cpy_info->shared_fo && + H5D__contig_is_data_cached((const H5D_shared_t *)cpy_info->shared_fo))) { + /* copy contiguous raw data */ + if (H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, + &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage"); + } /* end if */ + } break; case H5D_CHUNKED: if (H5D__chunk_is_space_alloc(&layout_src->storage) || diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 2e414e5a8ce..1803ae0daa7 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -600,8 +600,8 @@ H5_DLL herr_t H5O__condense_header(H5F_t *f, H5O_t *oh); H5_DLL herr_t H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, bool adj_link); /* Shared object operators */ -H5_DLL void *H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, size_t buf_size, const uint8_t *buf, - const H5O_msg_class_t *type); +H5_DLL void *H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, size_t buf_size, + const uint8_t *buf, const H5O_msg_class_t *type); H5_DLL herr_t H5O__shared_encode(const H5F_t *f, uint8_t *buf /*out*/, const H5O_shared_t *sh_mesg); H5_DLL size_t H5O__shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg); H5_DLL herr_t H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 2183f064baa..365e3511243 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -196,7 +196,9 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN for (i = 0; i < sdim->rank; i++) { H5F_DECODE_LENGTH(f, p, sdim->max[i]); if (sdim->size[i] > sdim->max[i]) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "dataspace dim %u size of %llu is greater than maxdim size of %llu", i, (unsigned long long)sdim->size[i], (unsigned long long)sdim->max[i]); + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, + "dataspace dim %u size of %llu is greater than maxdim size of %llu", i, + (unsigned long long)sdim->size[i], (unsigned long long)sdim->max[i]); } } diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 8d92cb76ada..d562d1764a8 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -286,13 +286,13 @@ H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_ *------------------------------------------------------------------------- */ void * -H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, size_t buf_size, - const uint8_t *buf, const H5O_msg_class_t *type) +H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, size_t buf_size, const uint8_t *buf, + const H5O_msg_class_t *type) { const uint8_t *buf_end = buf + buf_size - 1; /* End of the buffer */ - H5O_shared_t sh_mesg; /* Shared message info */ - unsigned version; /* Shared message version */ - void *ret_value = NULL; /* Return value */ + H5O_shared_t sh_mesg; /* Shared message info */ + unsigned version; /* Shared message version */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -346,8 +346,8 @@ H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, size_t buf_size, */ if (sh_mesg.type == H5O_SHARE_TYPE_SOHM) { assert(version >= H5O_SHARED_VERSION_3); - if (H5_IS_BUFFER_OVERFLOW(buf, sizeof(sh_mesg.u.heap_id), buf_end)) - HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + if (H5_IS_BUFFER_OVERFLOW(buf, sizeof(sh_mesg.u.heap_id), buf_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5MM_memcpy(&sh_mesg.u.heap_id, buf, sizeof(sh_mesg.u.heap_id)); } /* end if */ else { diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 46d3ce40172..c87034dc13f 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -331,7 +331,7 @@ H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_lo const H5O_stab_t *stab_src = (const H5O_stab_t *)mesg_src; H5O_stab_t *stab_dst = (H5O_stab_t *)mesg_dst; H5G_bt_it_cpy_t udata; /* B-tree user data */ - H5HL_t *heap = NULL; /* Pointer to source group's heap */ + H5HL_t *heap = NULL; /* Pointer to source group's heap */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 84964cca766..690cb6592ac 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1416,7 +1416,8 @@ H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bo HGOTO_ERROR(H5E_DATASPACE, H5E_OVERFLOW, FAIL, "buffer overflow while decoding selection rank"); UINT32DECODE(pp, rank); if (0 == rank || rank > H5S_MAX_RANK) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid rank (%u) for serialized point selection", rank); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid rank (%u) for serialized point selection", + rank); if (!*space) { /* Patch the rank of the allocated dataspace */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index f9e12bb4d00..24a83353f70 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -202,15 +202,15 @@ struct H5O_loc_t; typedef struct H5S_t H5S_t; /* Operations on dataspaces */ -H5_DLL herr_t H5S_init(void); -H5_DLL H5S_t *H5S_copy(const H5S_t *src, bool share_selection, bool copy_max); -H5_DLL herr_t H5S_close(H5S_t *ds); +H5_DLL herr_t H5S_init(void); +H5_DLL H5S_t *H5S_copy(const H5S_t *src, bool share_selection, bool copy_max); +H5_DLL herr_t H5S_close(H5S_t *ds); H5_DLL const H5S_extent_t *H5S_get_simple_extent(const H5S_t *ds); -H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds); -H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds); -H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds); -H5_DLL bool H5S_has_extent(const H5S_t *ds); -H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); +H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds); +H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds); +H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds); +H5_DLL bool H5S_has_extent(const H5S_t *ds); +H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[] /*out*/, hsize_t max_dims[] /*out*/); H5_DLL herr_t H5S_write(H5F_t *f, struct H5O_t *oh, unsigned update_flags, H5S_t *ds); H5_DLL herr_t H5S_append(H5F_t *f, struct H5O_t *oh, H5S_t *ds); diff --git a/src/H5T.c b/src/H5T.c index c1db2738c47..4ab5fc8a6e0 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5008,9 +5008,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, bool superset) static bool H5T__path_table_search(const H5T_t *src, const H5T_t *dst, int *idx, int *last_cmp) { - int lt, rt, md; /* Left, middle, and right edges */ - int cmp; /* Comparison result */ - bool ret_value = false; /* Return value */ + int lt, rt, md; /* Left, middle, and right edges */ + int cmp; /* Comparison result */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5293,7 +5293,8 @@ H5T__init_path_table(void) /* Sanity check */ if (0 != H5T_g.npaths) - HGOTO_ERROR(H5E_DATATYPE, H5E_ALREADYINIT, FAIL, "datatype conversion path table is aleady initialized"); + HGOTO_ERROR(H5E_DATATYPE, H5E_ALREADYINIT, FAIL, + "datatype conversion path table is aleady initialized"); if (NULL == (H5T_g.path = H5MM_calloc(H5T_DEF_CONV_TABLE_SLOTS * sizeof(H5T_path_t *)))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, @@ -5709,7 +5710,7 @@ H5T_path_noop(const H5T_path_t *p) bool H5T_noop_conv(const H5T_t *src, const H5T_t *dst) { - bool ret_value = false; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -5728,7 +5729,7 @@ H5T_noop_conv(const H5T_t *src, const H5T_t *dst) ret_value = true; } /* end if */ else { - int idx = 0; /* Matching entry */ + int idx = 0; /* Matching entry */ /* Search the table of conversion paths */ if (H5T__path_table_search(src, dst, &idx, NULL)) diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 6a6464f3e67..429394d56c8 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -1196,7 +1196,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig member_class = parms[(*parms_index)++]; /* Check for overflow */ - member_size = parms[*parms_index]; + member_size = parms[*parms_index]; prev_used_size = used_size; used_size += member_size; if (used_size > size)