Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committing clang-format changes
Browse files Browse the repository at this point in the history
github-actions[bot] committed Mar 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5d3f95f commit 38607e5
Showing 28 changed files with 191 additions and 166 deletions.
4 changes: 3 additions & 1 deletion src/H5Dcompact.c
Original file line number Diff line number Diff line change
@@ -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)
22 changes: 11 additions & 11 deletions src/H5Dcontig.c
Original file line number Diff line number Diff line change
@@ -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,17 +397,17 @@ 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");

/* 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
4 changes: 2 additions & 2 deletions src/H5Defl.c
Original file line number Diff line number Diff line change
@@ -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 */

7 changes: 4 additions & 3 deletions src/H5Dint.c
Original file line number Diff line number Diff line change
@@ -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");
}
}

10 changes: 5 additions & 5 deletions src/H5Gent.c
Original file line number Diff line number Diff line change
@@ -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");
4 changes: 2 additions & 2 deletions src/H5Glink.c
Original file line number Diff line number Diff line change
@@ -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 */
6 changes: 3 additions & 3 deletions src/H5Gloc.c
Original file line number Diff line number Diff line change
@@ -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 */
Loading

0 comments on commit 38607e5

Please sign in to comment.