summaryrefslogtreecommitdiffstats
path: root/src/H5Dbtree2.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 14:31:56 (GMT)
committerGitHub <noreply@github.com>2023-06-28 14:31:56 (GMT)
commit7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch)
tree44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5Dbtree2.c
parent622fcbd13881fbc58bbeaed3062583b759f5e864 (diff)
downloadhdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.zip
hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.gz
hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.bz2
Rename HDassert() to assert() (#3191)
* Change HDassert to assert * Fix bin/make_err
Diffstat (limited to 'src/H5Dbtree2.c')
-rw-r--r--src/H5Dbtree2.c232
1 files changed, 116 insertions, 116 deletions
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index 135c564..69c6629 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -221,9 +221,9 @@ H5D__bt2_crt_context(void *_udata)
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(udata);
- HDassert(udata->f);
- HDassert(udata->ndims > 0 && udata->ndims < H5O_LAYOUT_NDIMS);
+ assert(udata);
+ assert(udata->f);
+ assert(udata->ndims > 0 && udata->ndims < H5O_LAYOUT_NDIMS);
/* Allocate callback context */
if (NULL == (ctx = H5FL_MALLOC(H5D_bt2_ctx_t)))
@@ -275,7 +275,7 @@ H5D__bt2_dst_context(void *_ctx)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(ctx);
+ assert(ctx);
/* Free array for chunk dimension sizes */
if (ctx->dim)
@@ -336,8 +336,8 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(rec1);
- HDassert(rec2);
+ assert(rec1);
+ assert(rec2);
/* Compare the offsets but ignore the other fields */
*result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled);
@@ -368,7 +368,7 @@ H5D__bt2_unfilt_encode(uint8_t *raw, const void *_record, void *_ctx)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(ctx);
+ assert(ctx);
/* Encode the record's fields */
H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->chunk_addr);
@@ -402,7 +402,7 @@ H5D__bt2_unfilt_decode(const uint8_t *raw, void *_record, void *_ctx)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(ctx);
+ assert(ctx);
/* Decode the record's fields */
H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->chunk_addr);
@@ -436,9 +436,9 @@ H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, const void *_record,
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(record);
- HDassert(ctx->chunk_size == record->nbytes);
- HDassert(0 == record->filter_mask);
+ assert(record);
+ assert(ctx->chunk_size == record->nbytes);
+ assert(0 == record->filter_mask);
HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
@@ -473,10 +473,10 @@ H5D__bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(ctx);
- HDassert(record);
- HDassert(H5_addr_defined(record->chunk_addr));
- HDassert(0 != record->nbytes);
+ assert(ctx);
+ assert(record);
+ assert(H5_addr_defined(record->chunk_addr));
+ assert(0 != record->nbytes);
/* Encode the record's fields */
H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->chunk_addr);
@@ -511,8 +511,8 @@ H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(ctx);
- HDassert(record);
+ assert(ctx);
+ assert(record);
/* Decode the record's fields */
H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->chunk_addr);
@@ -522,8 +522,8 @@ H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
UINT64DECODE(raw, record->scaled[u]);
/* Sanity checks */
- HDassert(H5_addr_defined(record->chunk_addr));
- HDassert(0 != record->nbytes);
+ assert(H5_addr_defined(record->chunk_addr));
+ assert(0 != record->nbytes);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5D__bt2_filt_decode() */
@@ -550,9 +550,9 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, const void *_record, c
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(record);
- HDassert(H5_addr_defined(record->chunk_addr));
- HDassert(0 != record->nbytes);
+ assert(record);
+ assert(H5_addr_defined(record->chunk_addr));
+ assert(0 != record->nbytes);
HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth, "Chunk size:", (unsigned)record->nbytes);
@@ -585,7 +585,7 @@ H5D__bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, const H5S_t
FUNC_ENTER_PACKAGE_NOERR
/* Check args */
- HDassert(H5_addr_defined(dset_ohdr_addr));
+ assert(H5_addr_defined(dset_ohdr_addr));
idx_info->storage->u.btree2.dset_ohdr_addr = dset_ohdr_addr;
@@ -617,16 +617,16 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type);
- HDassert(idx_info->storage);
- HDassert(H5D_CHUNK_IDX_BT2 == idx_info->storage->idx_type);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(idx_info->storage->u.btree2.bt2);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type);
+ assert(idx_info->storage);
+ assert(H5D_CHUNK_IDX_BT2 == idx_info->storage->idx_type);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(idx_info->storage->u.btree2.bt2);
/* Set up object header location for dataset */
H5O_loc_reset(&oloc);
@@ -680,14 +680,14 @@ H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(NULL == idx_info->storage->u.btree2.bt2);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(NULL == idx_info->storage->u.btree2.bt2);
/* Set up the user data */
u_ctx.f = idx_info->f;
@@ -731,12 +731,12 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
- HDassert(!H5_addr_defined(idx_info->storage->idx_addr));
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
+ assert(!H5_addr_defined(idx_info->storage->idx_addr));
bt2_cparam.rrec_size = H5F_SIZEOF_ADDR(idx_info->f) /* Address of chunk */
+ (idx_info->layout->ndims - 1) * 8; /* # of dimensions x 64-bit chunk offsets */
@@ -804,7 +804,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
FUNC_ENTER_PACKAGE_NOERR
/* Check args */
- HDassert(storage);
+ assert(storage);
FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr))
} /* end H5D__bt2_idx_is_space_alloc() */
@@ -837,7 +837,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed)
unsigned u; /* Local index variable */
for (u = 0; u < op_data->ndims; u++)
- HDassert(record->scaled[u] == op_data->rec.scaled[u]);
+ assert(record->scaled[u] == op_data->rec.scaled[u]);
}
#endif /* NDEBUG */
@@ -880,14 +880,14 @@ H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(udata);
- HDassert(H5_addr_defined(udata->chunk_block.offset));
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(udata);
+ assert(H5_addr_defined(udata->chunk_block.offset));
/* Check if the v2 B-tree is open yet */
if (NULL == idx_info->storage->u.btree2.bt2) {
@@ -974,14 +974,14 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->layout->ndims > 0);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(udata);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->layout->ndims > 0);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(udata);
/* Check if the v2 B-tree is open yet */
if (NULL == idx_info->storage->u.btree2.bt2) {
@@ -1017,7 +1017,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Check if chunk was found */
if (found) {
/* Sanity check */
- HDassert(0 != found_rec.nbytes);
+ assert(0 != found_rec.nbytes);
/* Set common info for the chunk */
udata->chunk_block.offset = found_rec.chunk_addr;
@@ -1096,14 +1096,14 @@ H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chu
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(chunk_cb);
- HDassert(chunk_udata);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(chunk_cb);
+ assert(chunk_udata);
/* Check if the v2 B-tree is open yet */
if (NULL == idx_info->storage->u.btree2.bt2) {
@@ -1155,7 +1155,7 @@ H5D__bt2_remove_cb(const void *_record, void *_udata)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(f);
+ assert(f);
/* Free the space in the file for the object being removed */
H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t);
@@ -1188,13 +1188,13 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(udata);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(udata);
/* Check if the v2 B-tree is open yet */
if (NULL == idx_info->storage->u.btree2.bt2) {
@@ -1250,11 +1250,11 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
/* Check if the index data structure has been allocated */
if (H5_addr_defined(idx_info->storage->idx_addr)) {
@@ -1301,19 +1301,19 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_id
FUNC_ENTER_PACKAGE
/* Source file */
- HDassert(idx_info_src);
- HDassert(idx_info_src->f);
- HDassert(idx_info_src->pline);
- HDassert(idx_info_src->layout);
- HDassert(idx_info_src->storage);
+ assert(idx_info_src);
+ assert(idx_info_src->f);
+ assert(idx_info_src->pline);
+ assert(idx_info_src->layout);
+ assert(idx_info_src->storage);
/* Destination file */
- HDassert(idx_info_dst);
- HDassert(idx_info_dst->f);
- HDassert(idx_info_dst->pline);
- HDassert(idx_info_dst->layout);
- HDassert(idx_info_dst->storage);
- HDassert(!H5_addr_defined(idx_info_dst->storage->idx_addr));
+ assert(idx_info_dst);
+ assert(idx_info_dst->f);
+ assert(idx_info_dst->pline);
+ assert(idx_info_dst->layout);
+ assert(idx_info_dst->storage);
+ assert(!H5_addr_defined(idx_info_dst->storage->idx_addr));
/* Check if the source v2 B-tree is open yet */
if (NULL == idx_info_src->storage->u.btree2.bt2)
@@ -1326,7 +1326,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_id
/* Create v2 B-tree that describes the chunked dataset in the destination file */
if (H5D__bt2_idx_create(idx_info_dst) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
- HDassert(H5_addr_defined(idx_info_dst->storage->idx_addr));
+ assert(H5_addr_defined(idx_info_dst->storage->idx_addr));
/* Reset metadata tag */
H5_END_TAG
@@ -1354,10 +1354,10 @@ H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(storage_src);
- HDassert(storage_src->u.btree2.bt2);
- HDassert(storage_dst);
- HDassert(storage_dst->u.btree2.bt2);
+ assert(storage_src);
+ assert(storage_src->u.btree2.bt2);
+ assert(storage_dst);
+ assert(storage_dst->u.btree2.bt2);
/* Close v2 B-tree for source file */
if (H5B2_close(storage_src->u.btree2.bt2) < 0)
@@ -1394,13 +1394,13 @@ H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->pline);
- HDassert(idx_info->layout);
- HDassert(idx_info->storage);
- HDassert(H5_addr_defined(idx_info->storage->idx_addr));
- HDassert(index_size);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->pline);
+ assert(idx_info->layout);
+ assert(idx_info->storage);
+ assert(H5_addr_defined(idx_info->storage->idx_addr));
+ assert(index_size);
/* Open v2 B-tree */
if (H5D__bt2_idx_open(idx_info) < 0)
@@ -1439,7 +1439,7 @@ H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(storage);
+ assert(storage);
/* Reset index info */
if (reset_addr)
@@ -1466,8 +1466,8 @@ H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(storage);
- HDassert(stream);
+ assert(storage);
+ assert(stream);
HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
@@ -1493,9 +1493,9 @@ H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(idx_info);
- HDassert(idx_info->f);
- HDassert(idx_info->storage);
+ assert(idx_info);
+ assert(idx_info->f);
+ assert(idx_info->storage);
/* Check if the v2-btree is open */
if (idx_info->storage->u.btree2.bt2) {