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/H5Odtype.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/H5Odtype.c')
-rw-r--r-- | src/H5Odtype.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 48622e2..bad4684 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -34,11 +34,10 @@ static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); static herr_t H5O__dtype_set_share(void *_mesg, const H5O_shared_t *sh); static htri_t H5O__dtype_can_share(const void *_mesg); -static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *_udata); static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void *udata); + H5F_t *file_dst, bool *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -112,19 +111,19 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ * * Purpose: Decodes a datatype * - * Return: TRUE if we can upgrade the parent type's version even + * Return: true if we can upgrade the parent type's version even * with strict format checks - * FALSE if we cannot + * false if we cannot * NEGATIVE on failure *------------------------------------------------------------------------- */ static htri_t -H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt, hbool_t skip, +H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt, bool skip, const uint8_t *p_end) { unsigned flags; unsigned version; - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_PACKAGE @@ -460,7 +459,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t upgrade_to = temp_type->shared->version; /* Pass "can_upgrade" flag down to parent type */ - ret_value = TRUE; + ret_value = true; } /* Go create the array datatype now, for older versions of the datatype message */ @@ -498,7 +497,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the return value to indicate that we should freely * upgrade parent types */ - ret_value = TRUE; + ret_value = true; } } } @@ -510,8 +509,8 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the "force conversion" flag if VL datatype fields exist in this * type or any component types */ - if (temp_type->shared->force_conv == TRUE) - dt->shared->force_conv = TRUE; + if (temp_type->shared->force_conv == true) + dt->shared->force_conv = true; /* Member size */ dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].size = temp_type->shared->size; @@ -583,16 +582,16 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t if (dt->shared->u.atomic.u.r.rtype == H5R_OBJECT2 || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { - dt->shared->u.atomic.u.r.opaque = TRUE; + dt->shared->u.atomic.u.r.opaque = true; dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); if (dt->shared->u.atomic.u.r.version != H5R_ENCODE_VERSION) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "reference version does not match"); } else - dt->shared->u.atomic.u.r.opaque = FALSE; + dt->shared->u.atomic.u.r.opaque = false; /* This type needs conversion */ - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; /* Mark location of this type as undefined for now. The caller * function should decide the location. */ @@ -702,7 +701,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t * vlen itself. */ H5O_DTYPE_CHECK_VERSION(dt, version, dt->shared->parent->shared->version, ioflags, "vlen", FAIL) - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; /* Mark location this type as undefined for now. The caller function should * decide the location. */ @@ -762,8 +761,8 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the "force conversion" flag if a VL base datatype is used or * or if any components of the base datatype are VL types. */ - if (dt->shared->parent->shared->force_conv == TRUE) - dt->shared->force_conv = TRUE; + if (dt->shared->parent->shared->force_conv == true) + dt->shared->force_conv = true; break; case H5T_NO_CLASS: @@ -1312,7 +1311,7 @@ static void * H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags /*in,out*/, size_t p_size, const uint8_t *p) { - hbool_t skip; + bool skip; H5T_t *dt = NULL; const uint8_t *p_end = p + p_size - 1; void *ret_value = NULL; @@ -1331,7 +1330,7 @@ H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign * the library will have set p_size to SIZE_MAX and we can use that * as a signal to skip bounds checking. */ - skip = (p_size == SIZE_MAX ? TRUE : FALSE); + skip = (p_size == SIZE_MAX ? true : false); /* Perform actual decode of message */ if (H5O__dtype_decode_helper(ioflags, &p, dt, skip, p_end) < 0) @@ -1673,8 +1672,8 @@ done: * not. Immutable datatypes or datatypes that are already * shared cannot be shared (again). * - * Return: TRUE if datatype can be shared - * FALSE if datatype may not shared + * Return: true if datatype can be shared + * false if datatype may not shared * Negative on failure * *------------------------------------------------------------------------- @@ -1684,7 +1683,7 @@ H5O__dtype_can_share(const void *_mesg) { const H5T_t *mesg = (const H5T_t *)_mesg; htri_t tri_ret; - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE @@ -1692,13 +1691,13 @@ H5O__dtype_can_share(const void *_mesg) /* Don't share immutable datatypes */ if ((tri_ret = H5T_is_immutable(mesg)) > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if (tri_ret < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is immutable"); /* Don't share committed datatypes */ if ((tri_ret = H5T_is_named(mesg)) > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if (tri_ret < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is shared"); @@ -1719,7 +1718,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, +H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5T_t *dt_src = (const H5T_t *)mesg_src; /* Source datatype */ @@ -1772,7 +1771,7 @@ done: */ static void * H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, + H5F_t *file_dst, bool H5_ATTR_UNUSED *recompute_size, H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5T_t *dst_mesg; /* Destination datatype */ |