summaryrefslogtreecommitdiffstats
path: root/src/H5B2leaf.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/H5B2leaf.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/H5B2leaf.c')
-rw-r--r--src/H5B2leaf.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c
index 390c9d6..84e0afd 100644
--- a/src/H5B2leaf.c
+++ b/src/H5B2leaf.c
@@ -91,8 +91,8 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(node_ptr);
+ assert(hdr);
+ assert(node_ptr);
/* Allocate memory for leaf information */
if (NULL == (leaf = H5FL_CALLOC(H5B2_leaf_t)))
@@ -178,12 +178,12 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, hbo
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(node_ptr);
- HDassert(H5_addr_defined(node_ptr->addr));
+ assert(hdr);
+ assert(node_ptr);
+ assert(H5_addr_defined(node_ptr->addr));
/* only H5AC__READ_ONLY_FLAG may appear in flags */
- HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
+ assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Set up user data for callback */
udata.f = hdr->f;
@@ -273,10 +273,10 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neigh
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
- HDassert(op);
+ assert(hdr);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
+ assert(op);
/* Lock current B-tree node */
if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG)))
@@ -296,7 +296,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neigh
neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx - 1);
} /* end if */
else {
- HDassert(comp == H5B2_COMPARE_GREATER);
+ assert(comp == H5B2_COMPARE_GREATER);
if (idx < leaf->nrec)
neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx);
@@ -345,20 +345,20 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
+ assert(hdr);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
/* Lock current B-tree node */
if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Must have a leaf node with enough space to insert a record now */
- HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);
+ assert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);
/* Sanity check number of records */
- HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
- HDassert(leaf->nrec == curr_node_ptr->node_nrec);
+ assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
+ assert(leaf->nrec == curr_node_ptr->node_nrec);
/* Check for inserting into empty leaf */
if (leaf->nrec == 0)
@@ -459,17 +459,17 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
+ assert(hdr);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
/* Lock current B-tree node */
if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Sanity check number of records */
- HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
- HDassert(leaf->nrec == curr_node_ptr->node_nrec);
+ assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
+ assert(leaf->nrec == curr_node_ptr->node_nrec);
/* Check for inserting into empty leaf */
if (leaf->nrec == 0)
@@ -508,7 +508,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s
/* Make callback for current record */
if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) {
/* Make certain that the callback didn't modify the value if it failed */
- HDassert(changed == FALSE);
+ assert(changed == FALSE);
HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL,
"'modify' callback failed for B-tree update operation")
@@ -522,7 +522,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s
} /* end if */
else {
/* Must have a leaf node with enough space to insert a record now */
- HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);
+ assert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);
/* Make callback to store record in native form */
if ((hdr->cls->store)(H5B2_LEAF_NREC(leaf, hdr, idx), udata) < 0)
@@ -615,10 +615,10 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsi
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(internal);
- HDassert(internal_flags_ptr);
- HDassert(idx <= internal->nrec);
+ assert(hdr);
+ assert(internal);
+ assert(internal_flags_ptr);
+ assert(idx <= internal->nrec);
/* Check for the kind of B-tree node to swap */
if (depth > 1) {
@@ -706,12 +706,12 @@ H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr)
/*
* Check arguments.
*/
- HDassert(leaf);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
+ assert(leaf);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
hdr = leaf->hdr;
- HDassert(hdr);
- HDassert(hdr->swmr_write);
+ assert(hdr);
+ assert(hdr->swmr_write);
/* We only need to shadow the node if it has not been shadowed since the
* last time the header was flushed, as otherwise it will be unreachable by
@@ -773,9 +773,9 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
+ assert(hdr);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
/* Lock current B-tree node */
if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
@@ -783,8 +783,8 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_
leaf_addr = curr_node_ptr->addr;
/* Sanity check number of records */
- HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
- HDassert(leaf->nrec == curr_node_ptr->node_nrec);
+ assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
+ assert(leaf->nrec == curr_node_ptr->node_nrec);
/* Find correct location to remove this record */
if (H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0)
@@ -879,9 +879,9 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(hdr);
- HDassert(curr_node_ptr);
- HDassert(H5_addr_defined(curr_node_ptr->addr));
+ assert(hdr);
+ assert(curr_node_ptr);
+ assert(H5_addr_defined(curr_node_ptr->addr));
/* Lock B-tree leaf node */
if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
@@ -889,9 +889,9 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n
leaf_addr = curr_node_ptr->addr;
/* Sanity check number of records */
- HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
- HDassert(leaf->nrec == curr_node_ptr->node_nrec);
- HDassert(idx < leaf->nrec);
+ assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
+ assert(leaf->nrec == curr_node_ptr->node_nrec);
+ assert(idx < leaf->nrec);
/* Check for invalidating the min/max record for the tree */
if (H5B2_POS_MIDDLE != curr_pos) {
@@ -977,7 +977,7 @@ H5B2__leaf_free(H5B2_leaf_t *leaf)
/*
* Check arguments.
*/
- HDassert(leaf);
+ assert(leaf);
/* Release leaf's native key buffer */
if (leaf->leaf_native)
@@ -988,7 +988,7 @@ H5B2__leaf_free(H5B2_leaf_t *leaf)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header")
/* Sanity check */
- HDassert(NULL == leaf->top_proxy);
+ assert(NULL == leaf->top_proxy);
/* Free B-tree leaf node info */
leaf = H5FL_FREE(H5B2_leaf_t, leaf);
@@ -1015,7 +1015,7 @@ H5_ATTR_PURE herr_t
H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf)
{
/* General sanity checking on node */
- HDassert(leaf->nrec <= hdr->node_info->split_nrec);
+ assert(leaf->nrec <= hdr->node_info->split_nrec);
return (0);
} /* end H5B2__assert_leaf() */
@@ -1037,7 +1037,7 @@ H5B2__assert_leaf2(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_
const H5B2_leaf_t H5_ATTR_UNUSED *leaf2)
{
/* General sanity checking on node */
- HDassert(leaf->nrec <= hdr->node_info->split_nrec);
+ assert(leaf->nrec <= hdr->node_info->split_nrec);
return (0);
} /* end H5B2__assert_leaf2() */