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/H5Adense.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/H5Adense.c')
-rw-r--r-- | src/H5Adense.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/H5Adense.c b/src/H5Adense.c index d96fd75..4b1a43c 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -263,7 +263,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) +H5A__dense_fnd_cb(const H5A_t *attr, bool *took_ownership, void *_user_attr) { const H5A_t **user_attr = (const H5A_t **)_user_attr; /* User data from v2 B-tree attribute lookup */ herr_t ret_value = SUCCEED; /* Return value */ @@ -303,7 +303,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) /* Take over attribute ownership */ *user_attr = attr; - *took_ownership = TRUE; + *took_ownership = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -326,7 +326,7 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t attr_sharable; /* Flag indicating attributes are shareable */ - hbool_t attr_exists; /* Attribute exists in v2 B-tree */ + bool attr_exists; /* Attribute exists in v2 B-tree */ H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -376,10 +376,10 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - attr_exists = FALSE; + attr_exists = false; if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index"); - if (attr_exists == FALSE) + if (attr_exists == false) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index"); done: @@ -477,7 +477,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) size_t attr_size; /* Size of serialized attribute in the heap */ /* Find out the size of buffer needed for serialized message */ - if ((attr_size = H5O_msg_raw_size(f, H5O_ATTR_ID, FALSE, attr)) == 0) + if ((attr_size = H5O_msg_raw_size(f, H5O_ATTR_ID, false, attr)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get message size"); /* Wrap the local buffer for serialized attributes */ @@ -489,7 +489,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't get actual buffer"); /* Create serialized form of attribute or shared message */ - if (H5O_msg_encode(f, H5O_ATTR_ID, FALSE, (unsigned char *)attr_ptr, attr) < 0) + if (H5O_msg_encode(f, H5O_ATTR_ID, false, (unsigned char *)attr_ptr, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute"); /* Insert the serialized attribute into the fractal heap */ @@ -557,7 +557,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) +H5A__dense_write_bt2_cb2(void *_record, void *_op_data, bool *changed) { H5A_dense_bt2_corder_rec_t *record = (H5A_dense_bt2_corder_rec_t *)_record; /* Record from B-tree */ H5O_fheap_id_t *new_heap_id = (H5O_fheap_id_t *)_op_data; /* "op data" from v2 B-tree modify */ @@ -572,7 +572,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) record->id = *new_heap_id; /* Note that the record changed */ - *changed = TRUE; + *changed = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5A__dense_write_bt2_cb2() */ @@ -587,7 +587,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) *------------------------------------------------------------------------- */ static herr_t -H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) +H5A__dense_write_bt2_cb(void *_record, void *_op_data, bool *changed) { H5A_dense_bt2_name_rec_t *record = (H5A_dense_bt2_name_rec_t *)_record; /* Record from B-tree */ H5A_bt2_od_wrt_t *op_data = (H5A_bt2_od_wrt_t *)_op_data; /* "op data" from v2 B-tree modify */ @@ -638,14 +638,14 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) } /* end if */ /* Note that the record changed */ - *changed = TRUE; + *changed = true; } /* end if */ else { void *attr_ptr; /* Pointer to serialized message */ size_t attr_size; /* Size of serialized attribute in the heap */ /* Find out the size of buffer needed for serialized attribute */ - if ((attr_size = H5O_msg_raw_size(op_data->f, H5O_ATTR_ID, FALSE, op_data->attr)) == 0) + if ((attr_size = H5O_msg_raw_size(op_data->f, H5O_ATTR_ID, false, op_data->attr)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get attribute size"); /* Wrap the local buffer for serialized attributes */ @@ -657,7 +657,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't get actual buffer"); /* Create serialized form of attribute */ - if (H5O_msg_encode(op_data->f, H5O_ATTR_ID, FALSE, (unsigned char *)attr_ptr, op_data->attr) < 0) + if (H5O_msg_encode(op_data->f, H5O_ATTR_ID, false, (unsigned char *)attr_ptr, op_data->attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute"); /* Sanity check */ @@ -837,7 +837,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons H5A_t *attr_copy = NULL; /* Copy of attribute to rename */ htri_t attr_sharable; /* Flag indicating attributes are shareable */ htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ - hbool_t attr_exists; /* Attribute exists in v2 B-tree */ + bool attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -888,10 +888,10 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - attr_exists = FALSE; + attr_exists = false; if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index"); - if (attr_exists == FALSE) + if (attr_exists == false) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index"); assert(attr_copy); @@ -914,7 +914,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Need to remove the attribute from the creation order index v2 B-tree */ if (ainfo->index_corder) { - hbool_t corder_attr_exists; /* Attribute exists in v2 B-tree */ + bool corder_attr_exists; /* Attribute exists in v2 B-tree */ /* Open the creation order index v2 B-tree */ assert(H5_addr_defined(ainfo->corder_bt2_addr)); @@ -924,7 +924,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Set up the creation order to search for */ udata.corder = attr_copy->shared->crt_idx; - corder_attr_exists = FALSE; + corder_attr_exists = false; if (H5B2_find(bt2_corder, &udata, &corder_attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index"); @@ -1380,8 +1380,8 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) H5A_bt2_ud_rmbi_t *bt2_udata = (H5A_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */ H5A_fh_ud_cp_t fh_udata; /* User data for fractal heap 'op' callback */ H5O_shared_t sh_loc; /* Shared message info for attribute */ - hbool_t use_sh_loc; /* Whether to use the attribute's shared location or the separate one */ - herr_t ret_value = SUCCEED; /* Return value */ + bool use_sh_loc; /* Whether to use the attribute's shared location or the separate one */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1404,14 +1404,14 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) assert(fh_udata.attr); /* Use the attribute's shared location */ - use_sh_loc = FALSE; + use_sh_loc = false; } /* end if */ else { /* Create a shared message location from the heap ID for this record */ H5SM_reconstitute(&sh_loc, bt2_udata->f, H5O_ATTR_ID, record->id); /* Use the separate shared location */ - use_sh_loc = TRUE; + use_sh_loc = true; } /* end else */ /* Check for removing the link from the "other" index (creation order, when name used and vice versa) */ @@ -1618,7 +1618,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, hbool_t *attr_exists) +H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, bool *attr_exists) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ |