summaryrefslogtreecommitdiffstats
path: root/src/H5FSsection.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/H5FSsection.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/H5FSsection.c')
-rw-r--r--src/H5FSsection.c306
1 files changed, 153 insertions, 153 deletions
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 365daa0..920fe88 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -119,8 +119,8 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
+ assert(f);
+ assert(fspace);
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: fspace->addr = %" PRIuHADDR "\n", __func__, fspace->addr);
#endif /* H5FS_SINFO_DEBUG */
@@ -154,7 +154,7 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace)
/* Link free space manager to section info */
/* (for deserializing sections) */
- HDassert(fspace->sinfo == NULL);
+ assert(fspace->sinfo == NULL);
fspace->sinfo = sinfo;
/* Set return value */
@@ -208,11 +208,11 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
#endif /* H5FS_SINFO_DEBUG */
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
+ assert(f);
+ assert(fspace);
/* only H5AC__READ_ONLY_FLAG may appear in accmode */
- HDassert((accmode & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
+ assert((accmode & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* If the free space header doesn't already "own" the section info, load
* section info or create it
@@ -221,7 +221,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
/* Check if the section info was protected & we want a different access mode */
/* only H5AC__READ_ONLY_FLAG may appear in fspace->sinfo_accmode */
- HDassert(((fspace->sinfo_accmode) & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
+ assert(((fspace->sinfo_accmode) & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
if (fspace->sinfo_protected && accmode != fspace->sinfo_accmode) {
/* Check if we need to switch from read-only access to read-write */
@@ -248,8 +248,8 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
/* If the section address is defined, load it from the file */
if (H5_addr_defined(fspace->sect_addr)) {
/* Sanity check */
- HDassert(fspace->sinfo_protected == FALSE);
- HDassert(H5_addr_defined(fspace->addr));
+ assert(fspace->sinfo_protected == FALSE);
+ assert(H5_addr_defined(fspace->addr));
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %" PRIuHADDR "\n",
@@ -271,9 +271,9 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
HDfprintf(stderr, "%s: Creating new section info\n", __func__);
#endif /* H5FS_SINFO_DEBUG */
/* Sanity check */
- HDassert(fspace->tot_sect_count == 0);
- HDassert(fspace->serial_sect_count == 0);
- HDassert(fspace->ghost_sect_count == 0);
+ assert(fspace->tot_sect_count == 0);
+ assert(fspace->serial_sect_count == 0);
+ assert(fspace->ghost_sect_count == 0);
/* Allocate and initialize free space section info */
if (NULL == (fspace->sinfo = H5FS__sinfo_new(f, fspace)))
@@ -283,7 +283,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
fspace->sect_size = fspace->alloc_sect_size = 0;
} /* end if */
} /* end if */
- HDassert(fspace->rc == 2);
+ assert(fspace->rc == 2);
/* Increment the section info lock count */
fspace->sinfo_lock_count++;
@@ -347,10 +347,10 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
#endif /* H5FS_SINFO_DEBUG */
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
- HDassert(fspace->rc == 2);
- HDassert(fspace->sinfo);
+ assert(f);
+ assert(fspace);
+ assert(fspace->rc == 2);
+ assert(fspace->sinfo);
/* Check if we modified any section */
if (modified) {
@@ -390,7 +390,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap */
/* Sanity check */
- HDassert(H5_addr_defined(fspace->addr));
+ assert(H5_addr_defined(fspace->addr));
/* Check if we've made new changes to the section info while locked */
if (fspace->sinfo_modified) {
@@ -412,7 +412,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
} /* end if */
/* Sanity check */
- HDassert(H5_addr_defined(fspace->sect_addr));
+ assert(H5_addr_defined(fspace->sect_addr));
/* Unprotect section info in cache */
/* (Possibly dirty) */
@@ -460,15 +460,15 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
release_sinfo_space = TRUE;
}
else
- HDassert(fspace->alloc_sect_size == 0);
+ assert(fspace->alloc_sect_size == 0);
} /* end if */
else {
/* Sanity checks... */
if (H5_addr_defined(fspace->sect_addr))
- HDassert(fspace->alloc_sect_size == fspace->sect_size);
+ assert(fspace->alloc_sect_size == fspace->sect_size);
else
- HDassert(fspace->alloc_sect_size == 0);
+ assert(fspace->alloc_sect_size == 0);
} /* end else */
} /* end else */
@@ -481,7 +481,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
hsize_t old_alloc_sect_size = fspace->alloc_sect_size; /* Previous size of section info in file */
/* Sanity check */
- HDassert(H5_addr_defined(fspace->addr));
+ assert(H5_addr_defined(fspace->addr));
/* Reset section info in header */
fspace->sect_addr = HADDR_UNDEF;
@@ -531,7 +531,7 @@ H5FS__sect_serialize_size(H5FS_t *fspace)
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments. */
- HDassert(fspace);
+ assert(fspace);
/* Compute the size of the buffer required to serialize all the sections */
if (fspace->serial_sect_count > 0) {
@@ -587,9 +587,9 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fl
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(cls);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(cls);
/* Increment total # of sections on free space list */
fspace->tot_sect_count++;
@@ -597,7 +597,7 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fl
/* Check for serializable or 'ghost' section */
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
/* Sanity check */
- HDassert(cls->serial_size == 0);
+ assert(cls->serial_size == 0);
/* Increment # of ghost sections */
fspace->ghost_sect_count++;
@@ -642,9 +642,9 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(cls);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(cls);
/* Decrement total # of sections in free space manager */
fspace->tot_sect_count--;
@@ -652,7 +652,7 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
/* Check for serializable or 'ghost' section */
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
/* Sanity check */
- HDassert(cls->serial_size == 0);
+ assert(cls->serial_size == 0);
/* Decrement # of ghost sections */
fspace->ghost_sect_count--;
@@ -694,9 +694,9 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(sinfo);
- HDassert(fspace_node);
- HDassert(cls);
+ assert(sinfo);
+ assert(fspace_node);
+ assert(cls);
/* Decrement the # of sections in this bin */
/* (Different from the # of items in the bin's skiplist, since each node on
@@ -734,8 +734,8 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node
H5FS_node_t *tmp_fspace_node; /* Free space list size node */
/* Sanity checks */
- HDassert(fspace_node->ghost_count == 0);
- HDassert(fspace_node->serial_count == 0);
+ assert(fspace_node->ghost_count == 0);
+ assert(fspace_node->serial_count == 0);
/* Remove size tracking list from bin */
tmp_fspace_node = (H5FS_node_t *)H5SL_remove(sinfo->bins[bin].bin_list, &fspace_node->sect_size);
@@ -781,14 +781,14 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5F
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(sinfo);
- HDassert(sinfo->bins);
- HDassert(sect);
- HDassert(cls);
+ assert(sinfo);
+ assert(sinfo->bins);
+ assert(sect);
+ assert(cls);
/* Determine correct bin which holds items of at least the section's size */
bin = H5VM_log2_gen(sect->size);
- HDassert(bin < sinfo->nbins);
+ assert(bin < sinfo->nbins);
if (sinfo->bins[bin].bin_list == NULL)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?")
@@ -831,10 +831,10 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sec
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(cls);
- HDassert(sect);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(cls);
+ assert(sect);
/* Remove node from merge list, if it was entered there */
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
@@ -877,9 +877,9 @@ H5FS__sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(sect);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(sect);
/* Get section's class */
cls = &fspace->sect_cls[sect->type];
@@ -918,9 +918,9 @@ H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect)
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
- HDassert(sect);
+ assert(f);
+ assert(fspace);
+ assert(sect);
/* Get a pointer to the section info */
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -962,14 +962,14 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(sinfo);
- HDassert(sect);
- HDassert(H5_addr_defined(sect->addr));
- HDassert(sect->size);
+ assert(sinfo);
+ assert(sect);
+ assert(H5_addr_defined(sect->addr));
+ assert(sect->size);
/* Determine correct bin which holds items of the section's size */
bin = H5VM_log2_gen(sect->size);
- HDassert(bin < sinfo->nbins);
+ assert(bin < sinfo->nbins);
if (sinfo->bins[bin].bin_list == NULL) {
if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes")
@@ -1060,9 +1060,9 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_secti
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(sect);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(sect);
/* Add section to the address-ordered list of sections, if allowed */
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
@@ -1107,9 +1107,9 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(sect);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(sect);
/* Get section's class */
cls = &fspace->sect_cls[sect->type];
@@ -1152,10 +1152,10 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(*sect);
- HDassert(H5_addr_defined((*sect)->addr));
- HDassert((*sect)->size);
+ assert(fspace);
+ assert(*sect);
+ assert(H5_addr_defined((*sect)->addr));
+ assert((*sect)->size);
/* Loop until no more merging */
if (fspace->sinfo->merge_list) {
@@ -1196,7 +1196,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for merging sections")
if (status > 0) {
/* Sanity check */
- HDassert(tmp_sect_cls->merge);
+ assert(tmp_sect_cls->merge);
/* Remove 'less than' node from data structures */
if (H5FS__sect_remove_real(fspace, tmp_sect) < 0)
@@ -1243,7 +1243,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for merging sections")
if (status > 0) {
/* Sanity check */
- HDassert(sect_cls->merge);
+ assert(sect_cls->merge);
/* Remove 'greater than' node from data structures */
if (H5FS__sect_remove_real(fspace, tmp_sect) < 0)
@@ -1266,7 +1266,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
} /* end if */
} while (modified);
} /* end if */
- HDassert(*sect);
+ assert(*sect);
/* Loop until no more shrinking */
do {
@@ -1290,7 +1290,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
/* Shrink the container */
/* (callback can indicate that it has discarded the section by setting *sect to NULL) */
- HDassert(sect_cls->shrink);
+ assert(sect_cls->shrink);
if ((*sect_cls->shrink)(sect, op_data) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't shrink free space container")
@@ -1304,7 +1304,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
if (NULL != (last_node = H5SL_last(fspace->sinfo->merge_list))) {
/* Get the pointer to the last section, from the last node */
*sect = (H5FS_section_info_t *)H5SL_item(last_node);
- HDassert(*sect);
+ assert(*sect);
/* Indicate that this section needs to be removed if it causes a shrink */
remove_sect = TRUE;
@@ -1355,10 +1355,10 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag
#endif /* H5FS_SINFO_DEBUG */
/* Check arguments. */
- HDassert(fspace);
- HDassert(sect);
- HDassert(H5_addr_defined(sect->addr));
- HDassert(sect->size);
+ assert(fspace);
+ assert(sect);
+ assert(H5_addr_defined(sect->addr));
+ assert(sect->size);
/* Get a pointer to the section info */
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -1441,11 +1441,11 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
#endif /* H5FS_SINFO_DEBUG */
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
- HDassert(H5_addr_defined(addr));
- HDassert(size > 0);
- HDassert(extra_requested > 0);
+ assert(f);
+ assert(fspace);
+ assert(H5_addr_defined(addr));
+ assert(size > 0);
+ assert(extra_requested > 0);
/* Check for any sections on free space list */
#ifdef H5FS_SINFO_DEBUG
@@ -1508,7 +1508,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
*/
if (sect->size > extra_requested) {
/* Sanity check (for now) */
- HDassert(cls->flags & H5FS_CLS_ADJUST_OK);
+ assert(cls->flags & H5FS_CLS_ADJUST_OK);
/* Adjust section by amount requested */
sect->addr += extra_requested;
@@ -1528,7 +1528,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
} /* end if */
else {
/* Sanity check */
- HDassert(sect->size == extra_requested);
+ assert(sect->size == extra_requested);
/* Exact match, so just free section */
if ((*cls->free)(sect) < 0)
@@ -1577,11 +1577,11 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigne
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments. */
- HDassert(f);
- HDassert(fspace);
- HDassert(sect);
- HDassert(H5_addr_defined(sect->addr));
- HDassert(sect->size);
+ assert(f);
+ assert(fspace);
+ assert(sect);
+ assert(H5_addr_defined(sect->addr));
+ assert(sect->size);
/* Get a pointer to the section info */
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -1644,15 +1644,15 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->sinfo);
- HDassert(fspace->sinfo->bins);
- HDassert(request > 0);
- HDassert(node);
+ assert(fspace);
+ assert(fspace->sinfo);
+ assert(fspace->sinfo->bins);
+ assert(request > 0);
+ assert(node);
/* Determine correct bin which holds items of at least the section's size */
bin = H5VM_log2_gen(request);
- HDassert(bin < fspace->sinfo->nbins);
+ assert(bin < fspace->sinfo->nbins);
alignment = fspace->alignment;
if (!((alignment > 1) && (request >= fspace->align_thres)))
alignment = 0; /* no alignment */
@@ -1708,13 +1708,13 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node
/* Get section node */
curr_sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node);
- HDassert(H5_addr_defined(curr_sect->addr));
- HDassert(curr_fspace_node->sect_size == curr_sect->size);
+ assert(H5_addr_defined(curr_sect->addr));
+ assert(curr_fspace_node->sect_size == curr_sect->size);
cls = &fspace->sect_cls[curr_sect->type];
- HDassert(alignment);
- HDassert(cls);
+ assert(alignment);
+ assert(cls);
if ((mis_align = curr_sect->addr % alignment))
frag_size = alignment - mis_align;
@@ -1746,8 +1746,8 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL,
"can't insert free space section into skip list")
/* sanity check */
- HDassert(split_sect->addr < (*node)->addr);
- HDassert(request <= (*node)->size);
+ assert(split_sect->addr < (*node)->addr);
+ assert(request <= (*node)->size);
} /* end if */
/* Indicate that we found a node for the request */
HGOTO_DONE(TRUE)
@@ -1793,10 +1793,10 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments. */
- HDassert(fspace);
- HDassert(fspace->nclasses);
- HDassert(request);
- HDassert(node);
+ assert(fspace);
+ assert(fspace->nclasses);
+ assert(request);
+ assert(node);
/* Check for any sections on free space list */
if (fspace->tot_sect_count > 0) {
@@ -1850,9 +1850,9 @@ H5FS__iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(sect_info);
- HDassert(udata->fspace);
- HDassert(udata->op);
+ assert(sect_info);
+ assert(udata->fspace);
+ assert(udata->op);
/* Make callback for this section */
if ((*udata->op)(sect_info, udata->op_data) < 0)
@@ -1885,12 +1885,12 @@ H5FS__iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
FUNC_ENTER_PACKAGE
/* Check arguments. */
- HDassert(fspace_node);
- HDassert(udata->fspace);
- HDassert(udata->op);
+ assert(fspace_node);
+ assert(udata->fspace);
+ assert(udata->op);
/* Iterate through all the sections of this size */
- HDassert(fspace_node->sect_list);
+ assert(fspace_node->sect_list);
if (H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes")
@@ -1920,8 +1920,8 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data)
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments. */
- HDassert(fspace);
- HDassert(op);
+ assert(fspace);
+ assert(op);
/* Set up user data for iterator */
udata.fspace = fspace;
@@ -1974,7 +1974,7 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments. */
- HDassert(fspace);
+ assert(fspace);
/* Get the stats desired */
if (tot_space)
@@ -2010,10 +2010,10 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments. */
- HDassert(fspace);
- HDassert(sect);
- HDassert(sect->type < fspace->nclasses);
- HDassert(new_class < fspace->nclasses);
+ assert(fspace);
+ assert(sect);
+ assert(sect->type < fspace->nclasses);
+ assert(new_class < fspace->nclasses);
/* Get a pointer to the section info */
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -2038,16 +2038,16 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
to_ghost = TRUE;
/* Sanity check */
- HDassert(fspace->sinfo->bins);
+ assert(fspace->sinfo->bins);
/* Determine correct bin which holds items of at least the section's size */
bin = H5VM_log2_gen(sect->size);
- HDassert(bin < fspace->sinfo->nbins);
- HDassert(fspace->sinfo->bins[bin].bin_list);
+ assert(bin < fspace->sinfo->nbins);
+ assert(fspace->sinfo->bins[bin].bin_list);
/* Get space node for section's size */
fspace_node = (H5FS_node_t *)H5SL_search(fspace->sinfo->bins[bin].bin_list, &sect->size);
- HDassert(fspace_node);
+ assert(fspace_node);
/* Adjust serializable/ghost counts */
if (to_ghost) {
@@ -2216,8 +2216,8 @@ H5FS__sect_assert(const H5FS_t *fspace)
cls = &fspace->sect_cls[sect->type];
/* Sanity check section */
- HDassert(H5_addr_defined(sect->addr));
- HDassert(fspace_node->sect_size == sect->size);
+ assert(H5_addr_defined(sect->addr));
+ assert(fspace_node->sect_size == sect->size);
if (cls->valid)
(*cls->valid)(cls, sect);
@@ -2236,8 +2236,8 @@ H5FS__sect_assert(const H5FS_t *fspace)
} /* end while */
/* Check the number of serializable & ghost sections of this size */
- HDassert(fspace_node->serial_count == size_serial_count);
- HDassert(fspace_node->ghost_count == size_ghost_count);
+ assert(fspace_node->serial_count == size_serial_count);
+ assert(fspace_node->ghost_count == size_ghost_count);
/* Add to global count of serializable & ghost section sizes */
if (fspace_node->serial_count > 0)
@@ -2254,30 +2254,30 @@ H5FS__sect_assert(const H5FS_t *fspace)
} /* end while */
/* Check the number of serializable & ghost sections in this bin */
- HDassert(fspace->sinfo->bins[u].tot_sect_count == (bin_serial_count + bin_ghost_count));
- HDassert(fspace->sinfo->bins[u].serial_sect_count == bin_serial_count);
- HDassert(fspace->sinfo->bins[u].ghost_sect_count == bin_ghost_count);
+ assert(fspace->sinfo->bins[u].tot_sect_count == (bin_serial_count + bin_ghost_count));
+ assert(fspace->sinfo->bins[u].serial_sect_count == bin_serial_count);
+ assert(fspace->sinfo->bins[u].ghost_sect_count == bin_ghost_count);
} /* end if */
} /* end for */
/* Check counts from bins vs. global counts */
- HDassert(fspace->sinfo->tot_size_count == acc_tot_size_count);
- HDassert(fspace->sinfo->serial_size_count == acc_serial_size_count);
- HDassert(fspace->sinfo->ghost_size_count == acc_ghost_size_count);
- HDassert(fspace->tot_sect_count == acc_tot_sect_count);
- HDassert(fspace->serial_sect_count == acc_serial_sect_count);
- HDassert(fspace->ghost_sect_count == acc_ghost_sect_count);
+ assert(fspace->sinfo->tot_size_count == acc_tot_size_count);
+ assert(fspace->sinfo->serial_size_count == acc_serial_size_count);
+ assert(fspace->sinfo->ghost_size_count == acc_ghost_size_count);
+ assert(fspace->tot_sect_count == acc_tot_sect_count);
+ assert(fspace->serial_sect_count == acc_serial_sect_count);
+ assert(fspace->ghost_sect_count == acc_ghost_sect_count);
} /* end if */
else {
/* Check counts are zero */
- HDassert(fspace->tot_sect_count == 0);
- HDassert(fspace->serial_sect_count == 0);
- HDassert(fspace->ghost_sect_count == 0);
+ assert(fspace->tot_sect_count == 0);
+ assert(fspace->serial_sect_count == 0);
+ assert(fspace->ghost_sect_count == 0);
} /* end else */
/* Make certain that the number of sections on the address list is correct */
if (fspace->sinfo->merge_list)
- HDassert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list)));
+ assert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list)));
FUNC_LEAVE_NOAPI_VOID
} /* end H5FS__sect_assert() */
@@ -2305,7 +2305,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data)
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments. */
- HDassert(fspace);
+ assert(fspace);
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info")
@@ -2321,14 +2321,14 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data)
/* Get the pointer to the last section, from the last node */
tmp_sect = (H5FS_section_info_t *)H5SL_item(last_node);
- HDassert(tmp_sect);
+ assert(tmp_sect);
tmp_sect_cls = &fspace->sect_cls[tmp_sect->type];
if (tmp_sect_cls->can_shrink) {
/* Check if the section can be shrunk away */
if ((ret_value = (*tmp_sect_cls->can_shrink)(tmp_sect, op_data)) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container")
if (ret_value > 0) {
- HDassert(tmp_sect_cls->shrink);
+ assert(tmp_sect_cls->shrink);
/* Remove section from free space manager */
if (H5FS__sect_remove_real(fspace, tmp_sect) < 0)
@@ -2401,25 +2401,25 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments. */
- HDassert(f);
- HDassert(f->shared);
- HDassert(f->shared->lf);
- HDassert(fspace);
- HDassert(fs_addr_ptr);
+ assert(f);
+ assert(f->shared);
+ assert(f->shared->lf);
+ assert(fspace);
+ assert(fs_addr_ptr);
/* the section info should be unlocked */
- HDassert(fspace->sinfo_lock_count == 0);
+ assert(fspace->sinfo_lock_count == 0);
/* persistent free space managers must be enabled */
- HDassert(f->shared->fs_persist);
+ assert(f->shared->fs_persist);
/* At present, all free space strategies enable the free space managers.
* This will probably change -- at which point this assertion should
* be revisited.
*/
/* Updated: Only the following two strategies enable the free-space managers */
- HDassert((f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) ||
- (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE));
+ assert((f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) ||
+ (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE));
if (fspace->serial_sect_count > 0 && fspace->sinfo) {
/* the section info is floating, so space->sinfo should be defined */
@@ -2440,7 +2440,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t
hdr_alloc_size = H5FS_HEADER_SIZE(f);
if (H5F_PAGED_AGGR(f))
- HDassert(0 == (eoa % f->shared->fs_page_size));
+ assert(0 == (eoa % f->shared->fs_page_size));
/* Allocate space for the free space header */
if (HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, hdr_alloc_size)))
@@ -2469,7 +2469,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t
sinfo_alloc_size = fspace->sect_size;
if (H5F_PAGED_AGGR(f))
- HDassert(0 == (eoa % f->shared->fs_page_size));
+ assert(0 == (eoa % f->shared->fs_page_size));
/* allocate space for the section info */
if (HADDR_UNDEF == (sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, sinfo_alloc_size)))