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/H5FAcache.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/H5FAcache.c')
-rw-r--r-- | src/H5FAcache.c | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 119bbc8..9a89bba 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -174,9 +174,9 @@ H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5FA_HEADER_SIZE_FILE(udata->f); @@ -208,7 +208,7 @@ H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -246,9 +246,9 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(H5_addr_defined(udata->addr)); + assert(udata); + assert(udata->f); + assert(H5_addr_defined(udata->addr)); /* Allocate space for the fixed array data structure */ if (NULL == (hdr = H5FA__hdr_alloc(udata->f))) @@ -305,7 +305,7 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* checksum verification already done in verify_chksum cb */ @@ -313,12 +313,12 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Finish initializing fixed array header */ if (H5FA__hdr_init(hdr, udata->ctx_udata) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "initialization failed for fixed array header") - HDassert(hdr->size == len); + assert(hdr->size == len); /* Set return value */ ret_value = hdr; @@ -352,8 +352,8 @@ H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(image_len); + assert(hdr); + assert(image_len); /* Set the image length size */ *image_len = hdr->size; @@ -383,9 +383,9 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(hdr); + assert(f); + assert(image); + assert(hdr); /* Magic number */ H5MM_memcpy(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -395,7 +395,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5FA_HDR_VERSION; /* Fixed array type */ - HDassert(hdr->cparam.cls->id <= 255); + assert(hdr->cparam.cls->id <= 255); *image++ = (uint8_t)hdr->cparam.cls->id; /* General array creation/configuration information */ @@ -417,7 +417,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FA__cache_hdr_serialize() */ @@ -443,7 +443,7 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Check if the file was opened with SWMR-write access */ if (hdr->swmr_write) { @@ -467,7 +467,7 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) */ if (hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Destroy flush dependency on object header proxy */ if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent, @@ -491,12 +491,12 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == hdr->parent); + assert(NULL == hdr->parent); done: @@ -524,7 +524,7 @@ H5FA__cache_hdr_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array header */ if (H5FA__hdr_dest((H5FA_hdr_t *)thing) < 0) @@ -556,9 +556,9 @@ H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(image_len); /* Set up fake data block for computing size on disk */ /* (Note: extracted from H5FA__dblock_alloc) */ @@ -610,7 +610,7 @@ H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -648,15 +648,15 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(udata); - HDassert(udata->hdr); + assert(udata); + assert(udata->hdr); /* Allocate the fixed array data block */ if (NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array data block") - HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || - (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); + assert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || + (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the fixed array data block's information */ dblock->addr = udata->dblk_addr; @@ -697,7 +697,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block's size */ dblock->size = H5FA_DBLOCK_SIZE(dblock); @@ -708,7 +708,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Set return value */ ret_value = dblock; @@ -742,8 +742,8 @@ H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(image_len); + assert(dblock); + assert(image_len); /* Set the image length size */ if (!dblock->npages) @@ -777,10 +777,10 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblock); - HDassert(dblock->hdr); + assert(f); + assert(image); + assert(dblock); + assert(dblock->hdr); /* Magic number */ H5MM_memcpy(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -790,7 +790,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5FA_DBLOCK_VERSION; /* Fixed array type */ - HDassert(dblock->hdr->cparam.cls->id <= 255); + assert(dblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)dblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -822,7 +822,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -849,7 +849,7 @@ H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); + assert(dblock); /* Check if the file was opened with SWMR-write access */ if (dblock->hdr->swmr_write) { @@ -893,7 +893,7 @@ H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif } /* end switch */ } /* end if */ @@ -924,7 +924,7 @@ H5FA__cache_dblock_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(dblock); + assert(dblock); /* Release the fixed array data block */ if (H5FA__dblock_dest(dblock) < 0) @@ -971,9 +971,9 @@ H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK); - HDassert(fsf_size); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK); + assert(fsf_size); *fsf_size = dblock->size; @@ -1000,10 +1000,10 @@ H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->nelmts > 0); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(udata->nelmts > 0); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts); @@ -1035,7 +1035,7 @@ H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -1072,10 +1072,10 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, /* Sanity check */ FUNC_ENTER_PACKAGE - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->nelmts > 0); - HDassert(H5_addr_defined(udata->dblk_page_addr)); + assert(udata); + assert(udata->hdr); + assert(udata->nelmts > 0); + assert(H5_addr_defined(udata->dblk_page_addr)); /* Allocate the fixed array data block page */ if (NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts))) @@ -1095,7 +1095,7 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block page's size */ dblk_page->size = len; @@ -1106,7 +1106,7 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); + assert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); /* Set return value */ ret_value = dblk_page; @@ -1141,8 +1141,8 @@ H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblk_page); - HDassert(image_len); + assert(dblk_page); + assert(image_len); /* Set the image length size */ *image_len = dblk_page->size; @@ -1174,10 +1174,10 @@ H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(image); - HDassert(dblk_page); - HDassert(dblk_page->hdr); + assert(f); + assert(image); + assert(dblk_page); + assert(dblk_page->hdr); /* Internal information */ @@ -1196,7 +1196,7 @@ H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1223,7 +1223,7 @@ H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Determine which action to take */ switch (action) { @@ -1257,7 +1257,7 @@ H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -1286,7 +1286,7 @@ H5FA__cache_dblk_page_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the fixed array data block page */ if (H5FA__dblk_page_dest((H5FA_dblk_page_t *)thing) < 0) |