summaryrefslogtreecommitdiffstats
path: root/src/H5B2cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r--src/H5B2cache.c134
1 files changed, 67 insertions, 67 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index e29d0c7..cf23705 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -168,9 +168,9 @@ H5B2__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 = H5B2_HEADER_SIZE_FILE(udata->f);
@@ -202,7 +202,7 @@ H5B2__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);
@@ -242,8 +242,8 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(image);
- HDassert(udata);
+ assert(image);
+ assert(udata);
/* Allocate new B-tree header and reset cache info */
if (NULL == (hdr = H5B2__hdr_alloc(udata->f)))
@@ -287,7 +287,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
UINT32DECODE(image, stored_chksum);
/* Sanity check */
- HDassert((size_t)(image - (const uint8_t *)_image) == hdr->hdr_size);
+ assert((size_t)(image - (const uint8_t *)_image) == hdr->hdr_size);
/* Initialize B-tree header info */
cparam.cls = H5B2_client_class_g[id];
@@ -298,7 +298,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
hdr->addr = udata->addr;
/* 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 = hdr;
@@ -331,8 +331,8 @@ H5B2__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->hdr_size;
@@ -362,9 +362,9 @@ H5B2__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, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC);
@@ -374,7 +374,7 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_HDR_VERSION;
/* B-tree type */
- HDassert(hdr->cls->id <= 255);
+ assert(hdr->cls->id <= 255);
*image++ = (uint8_t)hdr->cls->id;
/* Node size (in bytes) */
@@ -404,7 +404,7 @@ H5B2__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)
} /* H5B2__cache_hdr_serialize() */
@@ -432,7 +432,7 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
/*
* Check arguments.
*/
- HDassert(hdr);
+ assert(hdr);
/* Check if the file was opened with SWMR-write access */
if (hdr->swmr_write) {
@@ -463,7 +463,7 @@ H5B2__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,
@@ -487,12 +487,12 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
#ifdef NDEBUG
HGOTO_ERROR(H5E_BTREE, 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:
FUNC_LEAVE_NOAPI(ret_value)
@@ -519,7 +519,7 @@ H5B2__cache_hdr_free_icr(void *thing)
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(thing);
+ assert(thing);
/* Destroy v2 B-tree header */
if (H5B2__hdr_free((H5B2_hdr_t *)thing) < 0)
@@ -549,9 +549,9 @@ H5B2__cache_int_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 the image length size */
*image_len = udata->hdr->node_size;
@@ -585,8 +585,8 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments */
- HDassert(image);
- HDassert(udata);
+ assert(image);
+ assert(udata);
/* Internal node prefix header + records + child pointer triplets: size with checksum at the end */
chk_size = H5B2_INT_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size) +
@@ -631,8 +631,8 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(image);
- HDassert(udata);
+ assert(image);
+ assert(udata);
/* Allocate new internal node and reset cache info */
if (NULL == (internal = H5FL_CALLOC(H5B2_internal_t)))
@@ -711,7 +711,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
UINT32DECODE(image, stored_chksum);
/* Sanity check parsing */
- HDassert((size_t)(image - (const uint8_t *)_image) <= len);
+ assert((size_t)(image - (const uint8_t *)_image) <= len);
/* Set return value */
ret_value = internal;
@@ -745,9 +745,9 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len)
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments */
- HDassert(internal);
- HDassert(internal->hdr);
- HDassert(image_len);
+ assert(internal);
+ assert(internal->hdr);
+ assert(image_len);
/* Set the image length size */
*image_len = internal->hdr->node_size;
@@ -781,10 +781,10 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
FUNC_ENTER_PACKAGE
/* check arguments */
- HDassert(f);
- HDassert(image);
- HDassert(internal);
- HDassert(internal->hdr);
+ assert(f);
+ assert(image);
+ assert(internal);
+ assert(internal->hdr);
/* Magic number */
H5MM_memcpy(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC);
@@ -794,9 +794,9 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_INT_VERSION;
/* B-tree type */
- HDassert(internal->hdr->cls->id <= 255);
+ assert(internal->hdr->cls->id <= 255);
*image++ = (uint8_t)internal->hdr->cls->id;
- HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
+ assert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for internal node */
native = internal->int_native;
@@ -831,7 +831,7 @@ H5B2__cache_int_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);
/* Clear rest of internal node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
@@ -863,8 +863,8 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing)
/*
* Check arguments.
*/
- HDassert(internal);
- HDassert(internal->hdr);
+ assert(internal);
+ assert(internal->hdr);
/* Check if the file was opened with SWMR-write access */
if (internal->hdr->swmr_write) {
@@ -905,12 +905,12 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing)
#ifdef NDEBUG
HGOTO_ERROR(H5E_BTREE, 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 == internal->top_proxy);
+ assert(NULL == internal->top_proxy);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -938,7 +938,7 @@ H5B2__cache_int_free_icr(void *_thing)
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(internal);
+ assert(internal);
/* Release v2 B-tree internal node */
if (H5B2__internal_free(internal) < 0)
@@ -968,9 +968,9 @@ H5B2__cache_leaf_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 the image length size */
*image_len = udata->hdr->node_size;
@@ -1004,8 +1004,8 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments */
- HDassert(image);
- HDassert(udata);
+ assert(image);
+ assert(udata);
/* Leaf node prefix header + records: size with checksum at the end */
chk_size = H5B2_LEAF_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size);
@@ -1047,8 +1047,8 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(image);
- HDassert(udata);
+ assert(image);
+ assert(udata);
/* Allocate new leaf node and reset cache info */
if (NULL == (leaf = H5FL_CALLOC(H5B2_leaf_t)))
@@ -1101,10 +1101,10 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
UINT32DECODE(image, stored_chksum);
/* Sanity check parsing */
- HDassert((size_t)(image - (const uint8_t *)_image) <= udata->hdr->node_size);
+ assert((size_t)(image - (const uint8_t *)_image) <= udata->hdr->node_size);
/* 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 = leaf;
@@ -1137,9 +1137,9 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len)
FUNC_ENTER_PACKAGE_NOERR
/* Check arguments */
- HDassert(leaf);
- HDassert(leaf->hdr);
- HDassert(image_len);
+ assert(leaf);
+ assert(leaf->hdr);
+ assert(image_len);
/* Set the image length size */
*image_len = leaf->hdr->node_size;
@@ -1173,10 +1173,10 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
FUNC_ENTER_PACKAGE
/* check arguments */
- HDassert(f);
- HDassert(image);
- HDassert(leaf);
- HDassert(leaf->hdr);
+ assert(f);
+ assert(image);
+ assert(leaf);
+ assert(leaf->hdr);
/* magic number */
H5MM_memcpy(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC);
@@ -1186,9 +1186,9 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
*image++ = H5B2_LEAF_VERSION;
/* B-tree type */
- HDassert(leaf->hdr->cls->id <= 255);
+ assert(leaf->hdr->cls->id <= 255);
*image++ = (uint8_t)leaf->hdr->cls->id;
- HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
+ assert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for leaf node */
native = leaf->leaf_native;
@@ -1210,7 +1210,7 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
UINT32ENCODE(image, metadata_chksum);
/* Sanity check */
- HDassert((size_t)(image - (uint8_t *)_image) <= len);
+ assert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of leaf node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
@@ -1242,8 +1242,8 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing)
/*
* Check arguments.
*/
- HDassert(leaf);
- HDassert(leaf->hdr);
+ assert(leaf);
+ assert(leaf->hdr);
/* Check if the file was opened with SWMR-write access */
if (leaf->hdr->swmr_write) {
@@ -1284,12 +1284,12 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing)
#ifdef NDEBUG
HGOTO_ERROR(H5E_BTREE, 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 == leaf->top_proxy);
+ assert(NULL == leaf->top_proxy);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1317,7 +1317,7 @@ H5B2__cache_leaf_free_icr(void *_thing)
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(leaf);
+ assert(leaf);
/* Destroy v2 B-tree leaf node */
if (H5B2__leaf_free(leaf) < 0)