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/H5Fsuper_cache.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/H5Fsuper_cache.c')
-rw-r--r-- | src/H5Fsuper_cache.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 9a5c6d3..718c16d 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -148,11 +148,11 @@ H5F__superblock_prefix_decode(H5F_super_t *sblock, const uint8_t **image_ref, si FUNC_ENTER_PACKAGE - HDassert(sblock); - HDassert(image_ref); - HDassert(image); - HDassert(udata); - HDassert(udata->f); + assert(sblock); + assert(image_ref); + assert(image); + assert(udata); + assert(udata->f); /* Skip over signature (already checked when locating the superblock) */ if (H5_IS_BUFFER_OVERFLOW(image, H5F_SIGNATURE_LEN, end)) @@ -234,11 +234,11 @@ H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvrinfo, char *drv_name, const uint8 FUNC_ENTER_PACKAGE - HDassert(drvrinfo); - HDassert(image_ref); - HDassert(image); - HDassert(udata); - HDassert(udata->f); + assert(drvrinfo); + assert(image_ref); + assert(image); + assert(udata); + assert(udata->f); /* Version number */ if (H5_IS_BUFFER_OVERFLOW(image, 1, end)) @@ -305,7 +305,7 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); /* Set the initial image length size */ *image_len = H5F_SUPERBLOCK_FIXED_SIZE + /* Fixed size of superblock */ @@ -333,11 +333,11 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len, FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); - HDassert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); + assert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); /* Deserialize the file superblock's prefix */ if (H5F__superblock_prefix_decode(&sblock, &image, image_len, udata, TRUE) < 0) @@ -375,8 +375,8 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata FUNC_ENTER_PACKAGE_NOERR - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* No checksum for version 0 & 1 */ if (udata->super_vers >= HDF5_SUPERBLOCK_VERSION_2) { @@ -411,10 +411,10 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(udata->f); - HDassert(len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); + assert(image); + assert(udata); + assert(udata->f); + assert(len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); /* Allocate space for the superblock */ if (NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -632,9 +632,9 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(sblock); - HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); - HDassert(image_len); + assert(sblock); + assert(sblock->cache_info.type == H5AC_SUPERBLOCK); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5F_SUPERBLOCK_SIZE(sblock); @@ -660,15 +660,15 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(sblock); + assert(f); + assert(image); + assert(sblock); /* Assert that the superblock is marked as being flushed last (and collectively in parallel) */ /* (We'll rely on the cache to make sure it actually *is* flushed last (and collectively in parallel), but this check doesn't hurt) */ - HDassert(sblock->cache_info.flush_me_last); + assert(sblock->cache_info.flush_me_last); /* Encode the common portion of the file superblock for all versions */ H5MM_memcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); @@ -763,11 +763,11 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU UINT32ENCODE(image, chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == (size_t)H5F_SUPERBLOCK_SIZE(sblock)); + assert((size_t)(image - (uint8_t *)_image) == (size_t)H5F_SUPERBLOCK_SIZE(sblock)); } /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -790,8 +790,8 @@ H5F__cache_superblock_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(sblock); - HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); + assert(sblock); + assert(sblock->cache_info.type == H5AC_SUPERBLOCK); /* Destroy superblock */ if (H5F__super_free(sblock) < 0) @@ -814,7 +814,7 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); /* Set the initial image length size */ *image_len = H5F_DRVINFOBLOCK_HDR_SIZE; /* Fixed size portion of driver info block */ @@ -841,11 +841,11 @@ H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t image_len, vo FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); - HDassert(image_len == H5F_DRVINFOBLOCK_HDR_SIZE); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); + assert(image_len == H5F_DRVINFOBLOCK_HDR_SIZE); /* Deserialize the file driver info's prefix */ if (H5F__drvrinfo_prefix_decode(&drvrinfo, NULL, &image, image_len, udata, TRUE) < 0) @@ -878,10 +878,10 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hb FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(len >= H5F_DRVINFOBLOCK_HDR_SIZE); - HDassert(udata); - HDassert(udata->f); + assert(image); + assert(len >= H5F_DRVINFOBLOCK_HDR_SIZE); + assert(udata); + assert(udata->f); /* Allocate space for the driver info */ if (NULL == (drvinfo = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t)))) @@ -892,14 +892,14 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hb HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode file driver info prefix") /* Sanity check */ - HDassert(len == (H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); + assert(len == (H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); /* Validate and decode driver information */ if (H5FD_sb_load(udata->f->shared->lf, drv_name, image) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "unable to decode driver information") /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); ret_value = drvinfo; @@ -926,9 +926,9 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); - HDassert(image_len); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(image_len); /* Set the image length size */ *image_len = (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + /* Fixed-size portion of driver info block */ @@ -955,11 +955,11 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); - HDassert(len == (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); + assert(f); + assert(image); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(len == (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); /* Save pointer to beginning of driver info */ dbuf = image; @@ -981,7 +981,7 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU image += 8 + drvinfo->len; /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1003,8 +1003,8 @@ H5F__cache_drvrinfo_free_icr(void *_thing) FUNC_ENTER_PACKAGE_NOERR - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); /* Destroy driver info message */ H5MM_xfree(drvinfo); |