diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-28 14:31:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 14:31:56 (GMT) |
commit | 7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch) | |
tree | 44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5HLcache.c | |
parent | 622fcbd13881fbc58bbeaed3062583b759f5e864 (diff) | |
download | hdf5-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/H5HLcache.c')
-rw-r--r-- | src/H5HLcache.c | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/src/H5HLcache.c b/src/H5HLcache.c index fcf93d1..f1db854 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -151,9 +151,9 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, size_t len, H5HL_cache FUNC_ENTER_PACKAGE - HDassert(heap); - HDassert(image); - HDassert(udata); + assert(heap); + assert(image); + assert(udata); /* Magic number */ if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end)) @@ -220,8 +220,8 @@ H5HL__fl_deserialize(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); - HDassert(!heap->freelist); + assert(heap); + assert(!heap->freelist); /* Build free list */ free_block = heap->free_block; @@ -288,13 +288,13 @@ H5HL__fl_serialize(const H5HL_t *heap) FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(heap); + assert(heap); /* Serialize the free list into the heap data's image */ for (fl = heap->freelist; fl; fl = fl->next) { uint8_t *image; /* Pointer into raw data buffer */ - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); image = heap->dblk_image + fl->offset; if (fl->next) @@ -329,7 +329,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(image_len); + assert(image_len); /* Set the image length size */ *image_len = H5HL_SPEC_READ_SIZE; @@ -362,10 +362,10 @@ H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len, voi FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); HDmemset(&heap, 0, sizeof(H5HL_t)); @@ -412,14 +412,14 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, hbo FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->sizeof_size > 0); - HDassert(udata->sizeof_addr > 0); - HDassert(udata->sizeof_prfx > 0); - HDassert(H5_addr_defined(udata->prfx_addr)); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->sizeof_size > 0); + assert(udata->sizeof_addr > 0); + assert(udata->sizeof_prfx > 0); + assert(H5_addr_defined(udata->prfx_addr)); + assert(dirty); /* Allocate space in memory for the heap */ if (NULL == (heap = H5HL__new(udata->sizeof_size, udata->sizeof_addr, udata->sizeof_prfx))) @@ -506,9 +506,9 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(image_len); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(image_len); /* Set the prefix's size */ *image_len = prfx->heap->prfx_size; @@ -549,23 +549,23 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); - HDassert(prfx->heap); + assert(f); + assert(image); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); + assert(prfx->heap); /* Get the pointer to the heap */ heap = prfx->heap; - HDassert(heap); + assert(heap); #ifndef NDEBUG /* Compute the buffer size */ size_t buf_size = heap->prfx_size; /* expected size of the image buffer */ if (heap->single_cache_obj) buf_size += heap->dblk_size; - HDassert(len == buf_size); + assert(len == buf_size); #endif /* Update the free block value from the free list */ @@ -603,11 +603,11 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, H5MM_memcpy(image, heap->dblk_image, heap->dblk_size); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) + heap->dblk_size == len); + assert((size_t)(image - (uint8_t *)_image) + heap->dblk_size == len); } else { /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= len); + assert((size_t)(image - (uint8_t *)_image) <= len); /* Clear rest of local heap */ HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image)); @@ -643,9 +643,9 @@ H5HL__cache_prefix_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); /* Destroy local heap prefix */ if (H5HL__prfx_dest(prfx) < 0) @@ -678,9 +678,9 @@ H5HL__cache_datablock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(heap); - HDassert(heap->dblk_size > 0); - HDassert(image_len); + assert(heap); + assert(heap->dblk_size > 0); + assert(image_len); /* Set the image length size */ *image_len = heap->dblk_size; @@ -713,13 +713,13 @@ H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, h FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(heap); - HDassert(heap->dblk_size == len); - HDassert(!heap->single_cache_obj); - HDassert(NULL == heap->dblk); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(heap); + assert(heap->dblk_size == len); + assert(!heap->single_cache_obj); + assert(NULL == heap->dblk); + assert(dirty); /* Allocate space in memory for the heap data block */ if (NULL == (dblk = H5HL__dblk_new(heap))) @@ -772,11 +772,11 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); - HDassert(dblk->heap); - HDassert(dblk->heap->dblk_size > 0); - HDassert(image_len); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk->heap); + assert(dblk->heap->dblk_size > 0); + assert(image_len); *image_len = dblk->heap->dblk_size; @@ -807,14 +807,14 @@ H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *imag FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); - HDassert(dblk->heap); + assert(f); + assert(image); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk->heap); heap = dblk->heap; - HDassert(heap->dblk_size == len); - HDassert(!heap->single_cache_obj); + assert(heap->dblk_size == len); + assert(!heap->single_cache_obj); /* Update the free block value from the free list */ heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; @@ -851,7 +851,7 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk); + assert(dblk); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -860,8 +860,8 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Sanity checks */ - HDassert(dblk->heap); - HDassert(dblk->heap->prfx); + assert(dblk->heap); + assert(dblk->heap->prfx); /* Pin the heap's prefix */ if (FAIL == H5AC_pin_protected_entry(dblk->heap->prfx)) @@ -880,8 +880,8 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Sanity checks */ - HDassert(dblk->heap); - HDassert(dblk->heap->prfx); + assert(dblk->heap); + assert(dblk->heap->prfx); /* Unpin the local heap prefix */ if (FAIL == H5AC_unpin_entry(dblk->heap->prfx)) @@ -919,8 +919,8 @@ H5HL__cache_datablock_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); /* Destroy the data block */ if (H5HL__dblk_dest(dblk) < 0) |