summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 14:31:56 (GMT)
committerGitHub <noreply@github.com>2023-06-28 14:31:56 (GMT)
commit7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch)
tree44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5Pfapl.c
parent622fcbd13881fbc58bbeaed3062583b759f5e864 (diff)
downloadhdf5-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/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c170
1 files changed, 84 insertions, 86 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 84d2522..2b79b82 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -868,7 +868,7 @@ H5P__facc_set_def_driver(void)
if ((driver_is_registered = H5FD_is_driver_registered_by_name(driver_env_var, &driver_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't check if VFL driver is already registered")
if (driver_is_registered) {
- HDassert(driver_id >= 0);
+ assert(driver_id >= 0);
if (H5I_inc_ref(driver_id, TRUE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFD")
@@ -948,8 +948,8 @@ H5P__facc_set_def_driver_check_predefined(const char *driver_name, hid_t *driver
FUNC_ENTER_PACKAGE
- HDassert(driver_name);
- HDassert(driver_id);
+ assert(driver_name);
+ assert(driver_id);
if (!HDstrcmp(driver_name, "sec2")) {
if ((*driver_id = H5FD_SEC2) < 0)
@@ -1166,7 +1166,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
/* If VFD configuration information is supplied, ensure that either binary
* configuration data or a configuration string is supplied, but not both.
*/
- HDassert(!new_driver_info || !new_driver_config_str);
+ assert(!new_driver_info || !new_driver_config_str);
if (NULL == H5I_object_verify(new_driver_id, H5I_VFL))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver ID")
@@ -1258,8 +1258,8 @@ H5P_set_driver_by_name(H5P_genplist_t *plist, const char *driver_name, const cha
FUNC_ENTER_NOAPI(FAIL)
- HDassert(plist);
- HDassert(driver_name);
+ assert(plist);
+ assert(driver_name);
/* Register the driver */
if ((new_driver_id = H5FD_register_driver_by_name(driver_name, app_ref)) < 0)
@@ -1346,8 +1346,8 @@ H5P_set_driver_by_value(H5P_genplist_t *plist, H5FD_class_value_t driver_value,
FUNC_ENTER_NOAPI(FAIL)
- HDassert(plist);
- HDassert(driver_value >= 0);
+ assert(plist);
+ assert(driver_value >= 0);
/* Register the driver */
if ((new_driver_id = H5FD_register_driver_by_value(driver_value, app_ref)) < 0)
@@ -1827,7 +1827,7 @@ H5P__facc_file_driver_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSE
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of file driver ID & info */
if (H5P__file_driver_copy(value) < 0)
@@ -1859,7 +1859,7 @@ H5P__facc_file_driver_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSE
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of file driver */
if (H5P__file_driver_copy(value) < 0)
@@ -1954,9 +1954,9 @@ H5P__facc_file_driver_cmp(const void *_info1, const void *_info2, size_t H5_ATTR
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(info1);
- HDassert(info2);
- HDassert(size == sizeof(H5FD_driver_prop_t));
+ assert(info1);
+ assert(info2);
+ assert(size == sizeof(H5FD_driver_prop_t));
/* Compare drivers */
if (NULL == (cls1 = H5FD_get_class(info1->driver_id)))
@@ -1975,13 +1975,13 @@ H5P__facc_file_driver_cmp(const void *_info1, const void *_info2, size_t H5_ATTR
HGOTO_DONE(-1)
if (cls1->fapl_size > cls2->fapl_size)
HGOTO_DONE(1)
- HDassert(cls1->fapl_size == cls2->fapl_size);
+ assert(cls1->fapl_size == cls2->fapl_size);
if (info1->driver_info == NULL && info2->driver_info != NULL)
HGOTO_DONE(-1);
if (info1->driver_info != NULL && info2->driver_info == NULL)
HGOTO_DONE(1);
if (info1->driver_info) {
- HDassert(cls1->fapl_size > 0);
+ assert(cls1->fapl_size > 0);
if (0 != (cmp_value = HDmemcmp(info1->driver_info, info2->driver_info, cls1->fapl_size)))
HGOTO_DONE(cmp_value);
} /* end if */
@@ -3235,8 +3235,8 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
/* verify file image field consistency */
- HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) ||
- ((image_info.buffer == NULL) && (image_info.size == 0)));
+ assert(((image_info.buffer != NULL) && (image_info.size > 0)) ||
+ ((image_info.buffer == NULL) && (image_info.size == 0)));
/* Set output size */
if (buf_len != NULL)
@@ -3310,7 +3310,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info")
/* verify file image field consistency */
- HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
+ assert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
/* Make sure a file image hasn't already been set */
if (info.buffer != NULL || info.size > 0)
@@ -3329,7 +3329,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* Release old udata if it exists */
if (info.callbacks.udata != NULL) {
- HDassert(info.callbacks.udata_free);
+ assert(info.callbacks.udata_free);
if (info.callbacks.udata_free(info.callbacks.udata) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed")
} /* end if */
@@ -3338,8 +3338,8 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
info.callbacks = *callbacks_ptr;
if (callbacks_ptr->udata) {
- HDassert(callbacks_ptr->udata_copy);
- HDassert(callbacks_ptr->udata_free);
+ assert(callbacks_ptr->udata_copy);
+ assert(callbacks_ptr->udata_free);
if ((info.callbacks.udata = callbacks_ptr->udata_copy(callbacks_ptr->udata)) == NULL)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy the supplied udata")
} /* end if */
@@ -3386,7 +3386,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
/* verify file image field consistency */
- HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
+ assert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
/* verify that callbacks is not NULL */
if (NULL == callbacks)
@@ -3397,7 +3397,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* Copy udata if it exists */
if (info.callbacks.udata != NULL) {
- HDassert(info.callbacks.udata_copy);
+ assert(info.callbacks.udata_copy);
if ((callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata")
} /* end if */
@@ -3438,8 +3438,7 @@ H5P__file_image_info_copy(void *value)
info = (H5FD_file_image_info_t *)value;
/* verify file image field consistency */
- HDassert(((info->buffer != NULL) && (info->size > 0)) ||
- ((info->buffer == NULL) && (info->size == 0)));
+ assert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0)));
if (info->buffer && info->size > 0) {
void *old_buffer; /* Pointer to old image buffer */
@@ -3512,8 +3511,7 @@ H5P__file_image_info_free(void *value)
info = (H5FD_file_image_info_t *)value;
/* Verify file image field consistency */
- HDassert(((info->buffer != NULL) && (info->size > 0)) ||
- ((info->buffer == NULL) && (info->size == 0)));
+ assert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0)));
/* Free buffer */
if (info->buffer != NULL && info->size > 0) {
@@ -3618,7 +3616,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(value);
+ assert(value);
if (NULL != *pp) {
/* Encode type sizes (as a safety check) */
@@ -3665,9 +3663,9 @@ H5P__facc_cache_image_config_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(config);
+ assert(pp);
+ assert(*pp);
+ assert(config);
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
/* Set property to default value */
@@ -3712,7 +3710,7 @@ H5P__facc_file_image_info_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of file image info */
if (H5P__file_image_info_copy(value) < 0)
@@ -3744,7 +3742,7 @@ H5P__facc_file_image_info_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of file image info */
if (H5P__file_image_info_copy(value) < 0)
@@ -3840,9 +3838,9 @@ H5P__facc_file_image_info_cmp(const void *_info1, const void *_info2, size_t H5_
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(info1);
- HDassert(info2);
- HDassert(size == sizeof(H5FD_file_image_info_t));
+ assert(info1);
+ assert(info2);
+ assert(size == sizeof(H5FD_file_image_info_t));
/* Check for different buffer sizes */
if (info1->size < info2->size)
@@ -4109,7 +4107,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(value);
+ assert(value);
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
if (NULL != *pp) {
@@ -4136,7 +4134,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
enc_value = (uint64_t)config->initial_size;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -4144,13 +4142,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
enc_value = (uint64_t)config->max_size;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
enc_value = (uint64_t)config->min_size;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -4168,7 +4166,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
enc_value = (uint64_t)config->max_increment;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -4190,7 +4188,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
enc_value = (uint64_t)config->max_decrement;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -4254,9 +4252,9 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(config);
+ assert(pp);
+ assert(*pp);
+ assert(config);
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
/* Set property to default value */
@@ -4287,19 +4285,19 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value)
H5_DECODE_UNSIGNED(*pp, config->set_initial_size);
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
UINT64DECODE_VAR(*pp, enc_value, enc_size);
config->initial_size = (size_t)enc_value;
H5_DECODE_DOUBLE(*pp, config->min_clean_fraction);
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
UINT64DECODE_VAR(*pp, enc_value, enc_size);
config->max_size = (size_t)enc_value;
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
UINT64DECODE_VAR(*pp, enc_value, enc_size);
config->min_size = (size_t)enc_value;
@@ -4319,7 +4317,7 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value)
H5_DECODE_UNSIGNED(*pp, config->apply_max_increment);
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
UINT64DECODE_VAR(*pp, enc_value, enc_size);
config->max_increment = (size_t)enc_value;
@@ -4340,7 +4338,7 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value)
H5_DECODE_UNSIGNED(*pp, config->apply_max_decrement);
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
UINT64DECODE_VAR(*pp, enc_value, enc_size);
config->max_decrement = (size_t)enc_value;
@@ -4386,8 +4384,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(fclose_degree);
- HDassert(size);
+ assert(fclose_degree);
+ assert(size);
if (NULL != *pp)
/* Encode file close degree */
@@ -4423,9 +4421,9 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(fclose_degree);
+ assert(pp);
+ assert(*pp);
+ assert(fclose_degree);
/* Decode file close degree */
*fclose_degree = (H5F_close_degree_t) * (*pp)++;
@@ -4457,8 +4455,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(type);
- HDassert(size);
+ assert(type);
+ assert(size);
if (NULL != *pp)
/* Encode file close degree */
@@ -4494,9 +4492,9 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(type);
+ assert(pp);
+ assert(*pp);
+ assert(type);
/* Decode multi VFD memory type */
*type = (H5FD_mem_t) * (*pp)++;
@@ -4527,8 +4525,8 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(type);
- HDassert(size);
+ assert(type);
+ assert(size);
/* Encode */
if (NULL != *pp)
@@ -4563,9 +4561,9 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(type);
+ assert(pp);
+ assert(*pp);
+ assert(type);
/* Decode */
*type = (H5F_libver_t) * (*pp)++;
@@ -4868,7 +4866,7 @@ H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size)
enc_value = (uint64_t)len;
enc_size = H5VM_limit_enc_size(enc_value);
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
if (NULL != *pp) {
/* encode the length of the prefix */
@@ -4913,14 +4911,14 @@ H5P__facc_mdc_log_location_dec(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE
- HDassert(pp);
- HDassert(*pp);
- HDassert(log_location);
+ assert(pp);
+ assert(*pp);
+ assert(log_location);
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
/* Decode the size */
enc_size = *(*pp)++;
- HDassert(enc_size < 256);
+ assert(enc_size < 256);
/* Decode the value */
UINT64DECODE_VAR(*pp, enc_value, enc_size);
@@ -4957,7 +4955,7 @@ H5P__facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_
{
FUNC_ENTER_PACKAGE_NOERR
- HDassert(value);
+ assert(value);
H5MM_xfree(*(void **)value);
@@ -4978,7 +4976,7 @@ H5P__facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_
{
FUNC_ENTER_PACKAGE_NOERR
- HDassert(value);
+ assert(value);
*(char **)value = H5MM_xstrdup(*(const char **)value);
@@ -5031,7 +5029,7 @@ H5P__facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR
{
FUNC_ENTER_PACKAGE_NOERR
- HDassert(value);
+ assert(value);
H5MM_xfree(*(void **)value);
@@ -5242,8 +5240,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(coll_md_read_flag);
- HDassert(size);
+ assert(coll_md_read_flag);
+ assert(size);
if (NULL != *pp) {
/* Encode the value */
@@ -5279,9 +5277,9 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity checks */
- HDassert(pp);
- HDassert(*pp);
- HDassert(coll_md_read_flag);
+ assert(pp);
+ assert(*pp);
+ assert(coll_md_read_flag);
/* Decode file close degree */
*coll_md_read_flag = (H5P_coll_md_read_flag_t) * (*pp);
@@ -6337,7 +6335,7 @@ H5P__facc_vol_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of VOL connector ID & info */
if (H5VL_conn_copy((H5VL_connector_prop_t *)value) < 0)
@@ -6366,7 +6364,7 @@ H5P__facc_vol_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(value);
+ assert(value);
/* Make copy of VOL connector */
if (H5VL_conn_copy((H5VL_connector_prop_t *)value) < 0)
@@ -6454,9 +6452,9 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(info1);
- HDassert(info2);
- HDassert(size == sizeof(H5VL_connector_prop_t));
+ assert(info1);
+ assert(info2);
+ assert(size == sizeof(H5VL_connector_prop_t));
/* Compare connectors */
if (NULL == (cls1 = (H5VL_class_t *)H5I_object(info1->connector_id)))
@@ -6464,7 +6462,7 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
if (NULL == (cls2 = (H5VL_class_t *)H5I_object(info2->connector_id)))
HGOTO_DONE(1)
status = H5VL_cmp_connector_cls(&cmp_value, cls1, cls2);
- HDassert(status >= 0);
+ assert(status >= 0);
if (cmp_value != 0)
HGOTO_DONE(cmp_value);
@@ -6475,9 +6473,9 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
/* Use one of the classes (cls1) info comparison routines to compare the
* info objects
*/
- HDassert(cls1->info_cls.cmp == cls2->info_cls.cmp);
+ assert(cls1->info_cls.cmp == cls2->info_cls.cmp);
status = H5VL_cmp_connector_info(cls1, &cmp_value, info1->connector_info, info2->connector_info);
- HDassert(status >= 0);
+ assert(status >= 0);
/* Set return value */
ret_value = cmp_value;