diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-09-05 21:52:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 21:52:30 (GMT) |
commit | 8253ab9ebf6a082dc07eb931f27b169d6a45d577 (patch) | |
tree | 47630856491e54f5d28e1608ffa5e2f976dc9c95 /src/H5Pint.c | |
parent | 920869796031ed4ee9c1fbea8aaccda3592a88b3 (diff) | |
download | hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.zip hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.tar.gz hdf5-8253ab9ebf6a082dc07eb931f27b169d6a45d577.tar.bz2 |
Convert hbool_t --> bool in src (#3496)
* hbool_t --> bool in src
* Does not remove TRUE/FALSE
* Public header files are unchanged
* Public API calls are unchanged
* TRUE/FALSE --> true/false in src
* Add deprecation notice for hbool_t
Diffstat (limited to 'src/H5Pint.c')
-rw-r--r-- | src/H5Pint.c | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/H5Pint.c b/src/H5Pint.c index b9db915..ccdf3a5 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -476,13 +476,13 @@ H5P_init_phase1(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register properties"); /* Register the new class */ - if ((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, *lib_class->pclass, FALSE)) < 0) + if ((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, *lib_class->pclass, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); /* Only register the default property list if it hasn't been created yet */ if (lib_class->def_plist_id && *lib_class->def_plist_id == (-1)) { /* Register the default property list for the new class*/ - if ((*lib_class->def_plist_id = H5P_create_id(*lib_class->pclass, FALSE)) < 0) + if ((*lib_class->def_plist_id = H5P_create_id(*lib_class->pclass, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register default property list for class"); } /* end if */ @@ -500,7 +500,7 @@ H5P_init_phase1(void) done: if (ret_value < 0 && tot_init > 0) { /* First uninitialize all default property lists */ - H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + H5I_clear_type(H5I_GENPROP_LST, false, false); /* Then uninitialize any initialized libclass */ for (u = 0; u < NELMTS(init_class); u++) { @@ -588,7 +588,7 @@ H5P_term_package(void) if ((nclass + nlist) > 0) { /* Clear the lists */ if (nlist > 0) { - (void)H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + (void)H5I_clear_type(H5I_GENPROP_LST, false, false); /* Reset the default property lists, if they've been closed */ if (H5I_nmembers(H5I_GENPROP_LST) == 0) { @@ -616,7 +616,7 @@ H5P_term_package(void) /* Only attempt to close the classes after all the lists are closed */ if (nlist == 0 && nclass > 0) { - (void)H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); + (void)H5I_clear_type(H5I_GENPROP_CLS, false, false); /* Reset the default property classes and IDs if they've been closed */ if (H5I_nmembers(H5I_GENPROP_CLS) == 0) { @@ -903,7 +903,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) +H5P_copy_plist(const H5P_genplist_t *old_plist, bool app_ref) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *new_plist = NULL; /* New property list generated from copy */ @@ -913,7 +913,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) H5SL_node_t *curr_node; /* Current node in skip list */ H5SL_t *seen = NULL; /* Skip list containing properties already seen */ size_t nseen; /* Number of items 'seen' */ - hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ + bool has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value = H5I_INVALID_HID; /* return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -931,7 +931,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) /* Set class state */ new_plist->pclass = old_plist->pclass; new_plist->nprops = 0; /* Initially the plist has the same number of properties as the class */ - new_plist->class_init = FALSE; /* Initially, wait until the class callback finishes to set */ + new_plist->class_init = false; /* Initially, wait until the class callback finishes to set */ /* Initialize the skip list to hold the changed properties */ if ((new_plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) @@ -1022,7 +1022,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) * initialize each with default value & make property 'copy' callback. */ tclass = old_plist->pclass; - has_parent_class = (hbool_t)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); + has_parent_class = (bool)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); while (tclass != NULL) { if (tclass->nprops > 0) { /* Walk through the properties in the old class */ @@ -1091,7 +1091,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) } /* end while */ /* Set the class initialization flag */ - new_plist->class_init = TRUE; + new_plist->class_init = true; /* Set the return value */ ret_value = new_plist_id; @@ -1149,7 +1149,7 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicating property for a class */ if (type == H5P_PROP_WITHIN_CLASS) { assert(oprop->type == H5P_PROP_WITHIN_CLASS); - assert(oprop->shared_name == FALSE); + assert(oprop->shared_name == false); /* Duplicate name */ prop->name = H5MM_xstrdup(oprop->name); @@ -1167,10 +1167,10 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicating a property from a class */ else { assert(oprop->type == H5P_PROP_WITHIN_CLASS); - assert(oprop->shared_name == FALSE); + assert(oprop->shared_name == false); /* Share the name */ - prop->shared_name = TRUE; + prop->shared_name = true; /* Set the type */ prop->type = type; @@ -1258,7 +1258,7 @@ H5P__create_prop(const char *name, size_t size, H5P_prop_within_t type, const vo /* Set the property initial values */ prop->name = H5MM_xstrdup(name); /* Duplicate name */ - prop->shared_name = FALSE; + prop->shared_name = false; prop->size = size; prop->type = type; @@ -1498,7 +1498,7 @@ static herr_t H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5P_genprop_t *tprop = (H5P_genprop_t *)item; /* Temporary pointer to property */ - hbool_t make_cb = *(hbool_t *)op_data; /* Whether to make property 'close' callback */ + bool make_cb = *(bool *)op_data; /* Whether to make property 'close' callback */ FUNC_ENTER_PACKAGE_NOERR @@ -1598,7 +1598,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) case H5P_MOD_INC_REF: /* Increment the ID reference count*/ /* Reset the deleted flag if incrementing the reference count */ if (pclass->deleted) - pclass->deleted = FALSE; + pclass->deleted = false; pclass->ref_count++; break; @@ -1607,7 +1607,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) /* Mark the class object as deleted if reference count drops to zero */ if (pclass->ref_count == 0) - pclass->deleted = TRUE; + pclass->deleted = true; break; case H5P_MOD_ERR: @@ -1625,7 +1625,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) /* Free the class properties without making callbacks */ if (pclass->props) { - hbool_t make_cb = FALSE; + bool make_cb = false; H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ @@ -1748,7 +1748,7 @@ H5P__create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t pclass->plists = 0; /* No properties lists of this class yet */ pclass->classes = 0; /* No classes derived from this class yet */ pclass->ref_count = 1; /* This is the first reference to the new class */ - pclass->deleted = FALSE; /* Not deleted yet... :-) */ + pclass->deleted = false; /* Not deleted yet... :-) */ pclass->revision = H5P_GET_NEXT_REV; /* Get a revision number for the class */ /* Create the skip list for properties */ @@ -1779,7 +1779,7 @@ done: if (pclass->name) H5MM_xfree(pclass->name); if (pclass->props) { - hbool_t make_cb = FALSE; + bool make_cb = false; H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ @@ -1838,7 +1838,7 @@ H5P__create(H5P_genclass_t *pclass) /* Set class state */ plist->pclass = pclass; plist->nprops = 0; /* Initially the plist has the same number of properties as the class */ - plist->class_init = FALSE; /* Initially, wait until the class callback finishes to set */ + plist->class_init = false; /* Initially, wait until the class callback finishes to set */ /* Create the skip list for changed properties */ if ((plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) @@ -1955,7 +1955,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) +H5P_create_id(H5P_genclass_t *pclass, bool app_ref) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *plist = NULL; /* Property list created */ @@ -1996,7 +1996,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) } /* end while */ /* Set the class initialization flag */ - plist->class_init = TRUE; + plist->class_init = true; /* Set the return value */ ret_value = plist_id; @@ -3321,25 +3321,25 @@ H5P_exist_plist(const H5P_genplist_t *plist, const char *name) /* Check for property in deleted property list */ if (H5SL_search(plist->del, name) != NULL) - ret_value = FALSE; + ret_value = false; else { /* Check for property in changed property list */ if (H5SL_search(plist->props, name) != NULL) - ret_value = TRUE; + ret_value = true; else { H5P_genclass_t *tclass; /* Temporary class pointer */ tclass = plist->pclass; while (tclass != NULL) { if (H5SL_search(tclass->props, name) != NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Go up to parent class */ tclass = tclass->parent; } /* end while */ /* If we've reached here, we couldn't find the property */ - ret_value = FALSE; + ret_value = false; } /* end else */ } /* end else */ @@ -3380,21 +3380,21 @@ H5P__exist_pclass(H5P_genclass_t *pclass, const char *name) /* Check for property in property list */ if (H5SL_search(pclass->props, name) != NULL) - ret_value = TRUE; + ret_value = true; else { H5P_genclass_t *tclass; /* Temporary class pointer */ tclass = pclass->parent; while (tclass != NULL) { if (H5SL_search(tclass->props, name) != NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Go up to parent class */ tclass = tclass->parent; } /* end while */ /* If we've reached here, we couldn't find the property */ - ret_value = FALSE; + ret_value = false; } /* end else */ done: @@ -3534,7 +3534,7 @@ H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) herr_t H5P_get_nprops_pclass(pclass, nprops) H5P_genclass_t *pclass; IN: Property class to check size_t *nprops; OUT: Number of properties in the property list - hbool_t recurse; IN: Include properties in parent class(es) also + bool recurse; IN: Include properties in parent class(es) also RETURNS Success: non-negative value (can't fail) Failure: negative value @@ -3547,7 +3547,7 @@ H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, hbool_t recurse) +H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, bool recurse) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3950,7 +3950,7 @@ H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int * udata.plist2 = plist2; /* Iterate over properties in first property list */ - if ((ret_value = H5P__iterate_plist(plist1, TRUE, &idx, H5P__cmp_plist_cb, &udata)) < 0) + if ((ret_value = H5P__iterate_plist(plist1, true, &idx, H5P__cmp_plist_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); if (ret_value != 0) { *cmp_ret = udata.cmp_value; @@ -3979,7 +3979,7 @@ done: H5P_genclass_t *pclass1; IN: Property class to check H5P_genclass_t *pclass2; IN: Property class to compare with RETURNS - Success: TRUE (1) or FALSE (0) + Success: true (1) or false (0) Failure: negative value DESCRIPTION This routine queries whether a property class is the same as another class, @@ -4003,14 +4003,14 @@ H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) /* Compare property classes */ if (H5P__cmp_class(pclass1, pclass2) == 0) { - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } else { /* Check if the class is derived, and walk up the chain, if so */ if (pclass1->parent != NULL) ret_value = H5P_class_isa(pclass1->parent, pclass2); else - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end else */ done: @@ -4027,7 +4027,7 @@ done: hid_t plist_id; IN: Property list to query hid_t pclass_id; IN: Property class to query RETURNS - Success: TRUE (1) or FALSE (0) + Success: true (1) or false (0) Failure: negative DESCRIPTION This routine queries whether a property list is a member of the property @@ -4101,7 +4101,7 @@ H5P_object_verify(hid_t plist_id, hid_t pclass_id) FUNC_ENTER_NOAPI(NULL) /* Compare the property list's class against the other class */ - if (H5P_isa_class(plist_id, pclass_id) != TRUE) + if (H5P_isa_class(plist_id, pclass_id) != true) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, NULL, "property list is not a member of the class"); /* Get the plist structure */ @@ -4216,9 +4216,9 @@ H5P__iterate_plist_pclass_cb(void *_item, void *_key, void *_udata) USAGE int H5P__iterate_plist(plist, iter_all_prop, idx, cb_func, iter_data) const H5P_genplist_t *plist; IN: Property list to iterate over - hbool_t iter_all_prop; IN: Whether to iterate over all properties - (TRUE), or just non-default (i.e. changed) - properties (FALSE). + bool iter_all_prop; IN: Whether to iterate over all properties + (true), or just non-default (i.e. changed) + properties (false). int *idx; IN/OUT: Index of the property to begin with H5P_iterate_t cb_func; IN: Function pointer to function to be called with each property iterated over. @@ -4263,7 +4263,7 @@ iteration, the function's behavior is undefined. REVISION LOG --------------------------------------------------------------------------*/ int -H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, H5P_iterate_int_t cb_func, +H5P__iterate_plist(const H5P_genplist_t *plist, bool iter_all_prop, int *idx, H5P_iterate_int_t cb_func, void *udata) { H5P_genclass_t *tclass; /* Temporary class pointer */ @@ -5131,7 +5131,7 @@ H5P_close(H5P_genplist_t *plist) H5P_genclass_t *tclass; /* Temporary class pointer */ H5SL_t *seen = NULL; /* Skip list to hold names of properties already seen */ size_t nseen; /* Number of items 'seen' */ - hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ + bool has_parent_class; /* Flag to indicate that this property list's class has a parent */ size_t ndel; /* Number of items deleted */ H5SL_node_t *curr_node; /* Current node in skip list */ H5P_genprop_t *tmp; /* Temporary pointer to properties */ @@ -5198,7 +5198,7 @@ H5P_close(H5P_genplist_t *plist) * initialize each with default value & make property 'remove' callback. */ tclass = plist->pclass; - has_parent_class = (hbool_t)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); + has_parent_class = (bool)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); while (tclass != NULL) { if (tclass->nprops > 0) { /* Walk through the properties in the class */ @@ -5421,7 +5421,7 @@ H5P__open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) + if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes"); else if (NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class"); @@ -5439,7 +5439,7 @@ H5P__open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) + if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes"); else if (NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class"); @@ -5651,7 +5651,7 @@ H5P__new_plist_of_type(H5P_plist_type_t type) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, H5I_INVALID_HID, "not a property class"); /* Create the new property list */ - if ((ret_value = H5P_create_id(pclass, TRUE)) < 0) + if ((ret_value = H5P_create_id(pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list"); done: |