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/H5Omessage.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/H5Omessage.c')
-rw-r--r-- | src/H5Omessage.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c index e492ceb..f6cafdc 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -52,7 +52,7 @@ typedef struct { unsigned nfailed; /* # of failed message removals */ H5O_operator_t op; /* Callback routine for removal operations */ void *op_data; /* Callback data for removal operations */ - hbool_t adj_link; /* Whether to adjust links when removing messages */ + bool adj_link; /* Whether to adjust links when removing messages */ } H5O_iter_rm_t; /********************/ @@ -375,7 +375,7 @@ H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned m if ((status = H5SM_try_share(f, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "error while trying to share message"); - if (status == FALSE && (mesg_flags & H5O_MSG_FLAG_SHARED)) + if (status == false && (mesg_flags & H5O_MSG_FLAG_SHARED)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status"); } /* end if */ @@ -424,7 +424,7 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg) assert(type_id < NELMTS(H5O_msg_class_g)); /* Get the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header"); /* Call the "real" read routine */ @@ -711,7 +711,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id) assert(type); /* Load the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Count the messages of the correct type */ @@ -763,7 +763,7 @@ H5O__msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) * Purpose: Determines if a particular message exists in an object * header without trying to decode the message. * - * Return: Success: FALSE if the message does not exist; TRUE if + * Return: Success: false if the message does not exist; true if * th message exists. * * Failure: FAIL if the existence of the message could @@ -785,7 +785,7 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id) assert(type_id < NELMTS(H5O_msg_class_g)); /* Load the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Call the "real" exists routine */ @@ -805,7 +805,7 @@ done: * Purpose: Determines if a particular message exists in an object * header without trying to decode the message. * - * Return: Success: FALSE if the message does not exist; TRUE if + * Return: Success: false if the message does not exist; true if * th message exists. * * Failure: FAIL if the existence of the message could @@ -819,7 +819,7 @@ H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned u; /* Local index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -831,7 +831,7 @@ H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id) /* Scan through the messages looking for the right one */ for (u = 0; u < oh->nmesgs; u++) if (type == oh->mesg[u].type) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -854,7 +854,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link) +H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, bool adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -901,7 +901,7 @@ done: */ herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, H5O_operator_t op, void *op_data, - hbool_t adj_link) + bool adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -949,7 +949,7 @@ H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, un void *_udata /*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ - htri_t try_remove = FALSE; /* Whether to try removing a message */ + htri_t try_remove = false; /* Whether to try removing a message */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -967,7 +967,7 @@ H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, un else { /* If there's no callback routine, does the sequence # match? */ if ((int)sequence == udata->sequence || H5O_ALL == udata->sequence) - try_remove = TRUE; + try_remove = true; } /* end else */ /* Try removing the message, if indicated */ @@ -1008,7 +1008,7 @@ done: */ herr_t H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, int sequence, H5O_operator_t app_op, - void *op_data, hbool_t adj_link) + void *op_data, bool adj_link) { H5O_iter_rm_t udata; /* User data for iterator */ H5O_mesg_operator_t op; /* Wrapper for operator */ @@ -1093,7 +1093,7 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, const H5O_mesg_operator_ assert(op); /* Protect the object header to iterate over */ - if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Call the "real" iterate routine */ @@ -1191,7 +1191,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header"); /* Mark object header as changed */ - if (H5O_touch_oh(f, oh, FALSE) < 0) + if (H5O_touch_oh(f, oh, false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); /* Mark object header as dirty in cache */ @@ -1213,7 +1213,7 @@ done: *------------------------------------------------------------------------- */ size_t -H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const void *mesg) +H5O_msg_raw_size(const H5F_t *f, unsigned type_id, bool disable_shared, const void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value = 0; /* Return value */ @@ -1276,7 +1276,7 @@ H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, const void *mesg HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "can't get object header flags"); /* Compute the raw data size for the mesg */ - if ((ret_value = (type->raw_size)(f, FALSE, mesg)) == 0) + if ((ret_value = (type->raw_size)(f, false, mesg)) == 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, 0, "unable to determine size of message"); /* Add in "extra" raw space */ @@ -1323,7 +1323,7 @@ H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id, const void *m assert(mesg); /* Compute the raw data size for the mesg */ - if ((ret_value = (type->raw_size)(f, FALSE, mesg)) == 0) + if ((ret_value = (type->raw_size)(f, false, mesg)) == 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, 0, "unable to determine size of message"); /* Add in "extra" raw space */ @@ -1343,13 +1343,13 @@ done: * Function: H5O_msg_can_share * * Purpose: Call the 'can share' method for a - * particular class of object header. This returns TRUE + * particular class of object header. This returns true * if the message is allowed to be put in the shared message * heap and false otherwise (e.g., for committed or immutable * datatypes). * - * Return: Object can be shared: TRUE - * Object cannot be shared: FALSE + * Return: Object can be shared: true + * Object cannot be shared: false * *------------------------------------------------------------------------- */ @@ -1375,12 +1375,12 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) * shareable in general; i.e., if they have the "is_sharable" flag * in the "share_flags" class member set. */ - ret_value = (type->share_flags & H5O_SHARE_IS_SHARABLE) ? TRUE : FALSE; + ret_value = (type->share_flags & H5O_SHARE_IS_SHARABLE) ? true : false; } /* end else */ /* If the message is shareable, both copy_file and post_copy_file must be * defined */ - assert((type->post_copy_file && type->copy_file) || ret_value == FALSE); + assert((type->post_copy_file && type->copy_file) || ret_value == false); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_can_share() */ @@ -1391,8 +1391,8 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) * Purpose: Check if the message class allows its messages to be shared * in the object's header. * - * Return: Object can be shared: TRUE - * Object cannot be shared: FALSE + * Return: Object can be shared: true + * Object cannot be shared: false * *------------------------------------------------------------------------- */ @@ -1413,7 +1413,7 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) * shareable in general; i.e., if they have the "is_sharable" flag * in the "share_flags" class member set. */ - ret_value = (type->share_flags & H5O_SHARE_IN_OHDR) ? TRUE : FALSE; + ret_value = (type->share_flags & H5O_SHARE_IN_OHDR) ? true : false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_can_share_in_ohdr() */ @@ -1424,8 +1424,8 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) * Purpose: Call the 'is_shared' method for a * particular class of object header. * - * Return: Object is shared: TRUE - * Object is not shared: FALSE + * Return: Object is shared: true + * Object is not shared: false * *------------------------------------------------------------------------- */ @@ -1440,7 +1440,7 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) /* Check args */ #ifdef H5O_ENABLE_BOGUS if (type_id >= NELMTS(H5O_msg_class_g)) - ret_value = FALSE; + ret_value = false; else #endif /* H5O_ENABLE_BOGUS */ { @@ -1453,7 +1453,7 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) if (type->share_flags & H5O_SHARE_IS_SHARABLE) ret_value = H5O_IS_STORED_SHARED(((const H5O_shared_t *)mesg)->type); else - ret_value = FALSE; + ret_value = false; } /* end block/else */ FUNC_LEAVE_NOAPI(ret_value) @@ -1583,7 +1583,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *mesg) +H5O_msg_encode(H5F_t *f, unsigned type_id, bool disable_shared, unsigned char *buf, const void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1646,7 +1646,7 @@ done: * pointer is returned with no error. * * Attempts to share the message in the destination and sets - * SHARED to TRUE or FALSE depending on whether this succeeds. + * SHARED to true or false depending on whether this succeeds. * * Return: Success: Ptr to the new message * @@ -1656,7 +1656,7 @@ done: */ void * H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src, H5F_t *file_dst, - hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) + bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { void *ret_value = NULL; /* Return value */ @@ -1760,7 +1760,7 @@ H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, con { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied = false; /* Flag for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1787,8 +1787,8 @@ H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, con idx_msg->flags = (uint8_t)mesg_flags; /* Mark the message as modified */ - idx_msg->dirty = TRUE; - chk_dirtied = TRUE; + idx_msg->dirty = true; + chk_dirtied = true; /* Release chunk */ if (H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) @@ -1797,7 +1797,7 @@ H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, con /* Update the modification time, if requested */ if (update_flags & H5O_UPDATE_TIME) - if (H5O_touch_oh(f, oh, FALSE) < 0) + if (H5O_touch_oh(f, oh, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -1966,18 +1966,18 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) { size_t msg_size; - msg_size = mesg->type->raw_size(f, FALSE, mesg->native); + msg_size = mesg->type->raw_size(f, false, mesg->native); msg_size = H5O_ALIGN_OH(oh, msg_size); assert(msg_size <= mesg->raw_size); } #endif /* NDEBUG */ assert(mesg->type->encode); - if ((mesg->type->encode)(f, FALSE, mesg->raw, mesg->native) < 0) + if ((mesg->type->encode)(f, false, mesg->raw, mesg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode object header message"); } /* end if */ /* Mark the message as clean now */ - mesg->dirty = FALSE; + mesg->dirty = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -2054,7 +2054,7 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags) assert(type); /* Get the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Locate message of correct type */ |