diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 20:43:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 20:43:30 (GMT) |
commit | 1e91d96fa02466ffe451319bdac1005f84dc7993 (patch) | |
tree | 4de04ef502c313dfd766497b20235188761146c0 /src/H5B2cache.c | |
parent | 95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff) | |
download | hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2 |
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r-- | src/H5B2cache.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 07c6cdf..a3968e5 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -167,9 +167,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); @@ -201,7 +201,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); @@ -241,15 +241,15 @@ 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))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header") /* Magic number */ - if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) + if (memcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature") image += H5_SIZEOF_MAGIC; @@ -286,7 +286,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]; @@ -297,7 +297,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; @@ -330,8 +330,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; @@ -361,9 +361,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); @@ -373,7 +373,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) */ @@ -403,7 +403,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() */ @@ -431,7 +431,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) { @@ -462,7 +462,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, @@ -486,12 +486,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) @@ -518,7 +518,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) @@ -548,9 +548,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; @@ -584,8 +584,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) + @@ -630,8 +630,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))) @@ -647,7 +647,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void internal->shadow_epoch = udata->hdr->shadow_epoch; /* Magic number */ - if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) + if (memcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature") image += H5_SIZEOF_MAGIC; @@ -710,7 +710,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; @@ -744,9 +744,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; @@ -780,10 +780,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); @@ -793,9 +793,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; @@ -830,10 +830,10 @@ 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)); + memset(image, 0, len - (size_t)(image - (uint8_t *)_image)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -862,8 +862,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) { @@ -904,12 +904,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) @@ -937,7 +937,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) @@ -967,9 +967,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; @@ -1003,8 +1003,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); @@ -1046,8 +1046,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))) @@ -1063,7 +1063,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void leaf->shadow_epoch = udata->hdr->shadow_epoch; /* Magic number */ - if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) + if (memcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature") image += H5_SIZEOF_MAGIC; @@ -1100,10 +1100,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; @@ -1136,9 +1136,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; @@ -1172,10 +1172,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); @@ -1185,9 +1185,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; @@ -1209,10 +1209,10 @@ 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)); + memset(image, 0, len - (size_t)(image - (uint8_t *)_image)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1241,8 +1241,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) { @@ -1283,12 +1283,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) @@ -1316,7 +1316,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) |