summaryrefslogtreecommitdiffstats
path: root/src/H5FAcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FAcache.c')
-rw-r--r--src/H5FAcache.c142
1 files changed, 71 insertions, 71 deletions
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index fdd56ff..562c56a 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(H5F_addr_defined(udata->addr));
+ assert(udata);
+ assert(udata->f);
+ assert(H5F_addr_defined(udata->addr));
/* Allocate space for the fixed array data structure */
if (NULL == (hdr = H5FA__hdr_alloc(udata->f)))
@@ -258,7 +258,7 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ if (memcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
@@ -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,13 +556,13 @@ 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) */
- HDmemset(&dblock, 0, sizeof(dblock));
+ memset(&dblock, 0, sizeof(dblock));
/* Set up fake data block for computing size on disk
*
@@ -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,21 +648,21 @@ 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;
/* Magic number */
- if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ if (memcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
@@ -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,10 +971,10 @@ H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments */
- HDassert(dblock);
- HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK);
- HDassert(fsf_size);
+ assert(dblock);
+ assert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ assert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK);
+ assert(fsf_size);
*fsf_size = dblock->size;
@@ -1001,10 +1001,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);
@@ -1036,7 +1036,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);
@@ -1073,10 +1073,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(H5F_addr_defined(udata->dblk_page_addr));
+ assert(udata);
+ assert(udata->hdr);
+ assert(udata->nelmts > 0);
+ assert(H5F_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)))
@@ -1096,7 +1096,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;
@@ -1107,7 +1107,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;
@@ -1142,8 +1142,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;
@@ -1175,10 +1175,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 */
@@ -1197,7 +1197,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)
@@ -1224,7 +1224,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) {
@@ -1258,7 +1258,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 */
@@ -1287,7 +1287,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)