Skip to content

Commit

Permalink
hbool_t --> bool in src
Browse files Browse the repository at this point in the history
* Does not remove TRUE/FALSE
* Public header files are unchanged
* Public API calls are unchanged
  • Loading branch information
derobins committed Sep 3, 2023
1 parent 9c85c6e commit 2dddb4f
Show file tree
Hide file tree
Showing 293 changed files with 3,026 additions and 3,066 deletions.
32 changes: 16 additions & 16 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ static const unsigned VERS_RELEASE_EXCEPTIONS_SIZE = 1;
#ifdef H5_HAVE_THREADSAFE
H5_api_t H5_g;
#else
hbool_t H5_libinit_g = FALSE; /* Library hasn't been initialized */
hbool_t H5_libterm_g = FALSE; /* Library isn't being shutdown */
bool H5_libinit_g = FALSE; /* Library hasn't been initialized */
bool H5_libterm_g = FALSE; /* Library isn't being shutdown */
#endif

char H5_lib_vers_info_g[] = H5_VERS_INFO;
static hbool_t H5_dont_atexit_g = FALSE;
H5_debug_t H5_debug_g; /* debugging info */
char H5_lib_vers_info_g[] = H5_VERS_INFO;
static bool H5_dont_atexit_g = FALSE;
H5_debug_t H5_debug_g; /* debugging info */

/*******************/
/* Local Variables */
Expand Down Expand Up @@ -371,10 +371,10 @@ H5_term_library(void)
* some dependent modules, first.
*/
const char *name; /* name of the module */
hbool_t completed; /* true iff this terminator was already
bool completed; /* true iff this terminator was already
* completed
*/
const hbool_t await_prior; /* true iff all prior terminators in the
const bool await_prior; /* true iff all prior terminators in the
* list must complete before this
* terminator is attempted
*/
Expand Down Expand Up @@ -690,10 +690,10 @@ H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t
static void
H5__debug_mask(const char *s)
{
FILE *stream = stderr;
char pkg_name[32], *rest;
size_t i;
hbool_t clear;
FILE *stream = stderr;
char pkg_name[32], *rest;
size_t i;
bool clear;

while (s && *s) {

Expand Down Expand Up @@ -724,11 +724,11 @@ H5__debug_mask(const char *s)
}
else if (!HDstrcmp(pkg_name, "ttop")) {
H5_debug_g.trace = stream;
H5_debug_g.ttop = (hbool_t)!clear;
H5_debug_g.ttop = (bool)!clear;
}
else if (!HDstrcmp(pkg_name, "ttimes")) {
H5_debug_g.trace = stream;
H5_debug_g.ttimes = (hbool_t)!clear;
H5_debug_g.ttimes = (bool)!clear;
}
else if (!HDstrcmp(pkg_name, "all")) {
for (i = 0; i < (size_t)H5_NPKGS; i++)
Expand Down Expand Up @@ -1121,7 +1121,7 @@ H5close(void)
*-------------------------------------------------------------------------
*/
void *H5_ATTR_MALLOC
H5allocate_memory(size_t size, hbool_t clear)
H5allocate_memory(size_t size, bool clear)
{
void *ret_value = NULL;

Expand Down Expand Up @@ -1211,7 +1211,7 @@ H5free_memory(void *mem)
*-------------------------------------------------------------------------
*/
herr_t
H5is_library_threadsafe(hbool_t *is_ts /*out*/)
H5is_library_threadsafe(bool *is_ts /*out*/)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand Down Expand Up @@ -1246,7 +1246,7 @@ H5is_library_threadsafe(hbool_t *is_ts /*out*/)
*-------------------------------------------------------------------------
*/
herr_t
H5is_library_terminating(hbool_t *is_terminating /*out*/)
H5is_library_terminating(bool *is_terminating /*out*/)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand Down
25 changes: 12 additions & 13 deletions src/H5A.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ static herr_t H5A__rename_by_name_api_common(hid_t loc_id, const char *obj_name,
const char *new_attr_name, hid_t lapl_id, void **token_ptr,
H5VL_object_t **_vol_obj_ptr);
static herr_t H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const char *attr_name,
hbool_t *attr_exists, void **token_ptr);
static herr_t H5A__exists_api_common(hid_t obj_id, const char *attr_name, hbool_t *attr_exists,
void **token_ptr, H5VL_object_t **_vol_obj_ptr);
bool *attr_exists, void **token_ptr);
static herr_t H5A__exists_api_common(hid_t obj_id, const char *attr_name, bool *attr_exists, void **token_ptr,
H5VL_object_t **_vol_obj_ptr);
static herr_t H5A__exists_by_name_api_common(hid_t obj_id, const char *obj_name, const char *attr_name,
hbool_t *attr_exists, hid_t lapl_id, void **token_ptr,
bool *attr_exists, hid_t lapl_id, void **token_ptr,
H5VL_object_t **_vol_obj_ptr);

/*********************/
Expand Down Expand Up @@ -2303,7 +2303,7 @@ H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
*--------------------------------------------------------------------------*/
static herr_t
H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const char *attr_name,
hbool_t *attr_exists, void **token_ptr)
bool *attr_exists, void **token_ptr)
{
H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
herr_t ret_value = SUCCEED; /* Return value */
Expand Down Expand Up @@ -2340,7 +2340,7 @@ H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const
* Non-negative on success/Negative on failure
*--------------------------------------------------------------------------*/
static herr_t
H5A__exists_api_common(hid_t obj_id, const char *attr_name, hbool_t *attr_exists, void **token_ptr,
H5A__exists_api_common(hid_t obj_id, const char *attr_name, bool *attr_exists, void **token_ptr,
H5VL_object_t **_vol_obj_ptr)
{
H5VL_object_t *tmp_vol_obj = NULL; /* Object for loc_id */
Expand Down Expand Up @@ -2385,8 +2385,8 @@ H5A__exists_api_common(hid_t obj_id, const char *attr_name, hbool_t *attr_exists
htri_t
H5Aexists(hid_t obj_id, const char *attr_name)
{
hbool_t exists; /* Flag for attribute existence */
htri_t ret_value = FAIL; /* Return value */
bool exists; /* Flag for attribute existence */
htri_t ret_value = FAIL; /* Return value */

FUNC_ENTER_API(FAIL)
H5TRACE2("t", "i*s", obj_id, attr_name);
Expand Down Expand Up @@ -2452,9 +2452,8 @@ H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, h
* Non-negative on success/Negative on failure
*--------------------------------------------------------------------------*/
static herr_t
H5A__exists_by_name_api_common(hid_t loc_id, const char *obj_name, const char *attr_name,
hbool_t *attr_exists, hid_t lapl_id, void **token_ptr,
H5VL_object_t **_vol_obj_ptr)
H5A__exists_by_name_api_common(hid_t loc_id, const char *obj_name, const char *attr_name, bool *attr_exists,
hid_t lapl_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr)
{
H5VL_object_t *tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
Expand Down Expand Up @@ -2498,8 +2497,8 @@ H5A__exists_by_name_api_common(hid_t loc_id, const char *obj_name, const char *a
htri_t
H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
{
hbool_t exists; /* Flag for attribute existence */
htri_t ret_value = FAIL; /* Return value */
bool exists; /* Flag for attribute existence */
htri_t ret_value = FAIL; /* Return value */

FUNC_ENTER_API(FAIL)
H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id);
Expand Down
54 changes: 27 additions & 27 deletions src/H5AC.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/* Local Prototypes */
/********************/

static herr_t H5AC__check_if_write_permitted(const H5F_t *f, hbool_t *write_permitted_ptr);
static herr_t H5AC__check_if_write_permitted(const H5F_t *f, bool *write_permitted_ptr);
static herr_t H5AC__ext_config_2_int_config(const H5AC_cache_config_t *ext_conf_ptr,
H5C_auto_size_ctl_t *int_conf_ptr);
#if H5AC_DO_TAGGING_SANITY_CHECKS
Expand All @@ -73,7 +73,7 @@ static herr_t H5AC__verify_tag(const H5AC_class_t *type);

#ifdef H5_HAVE_PARALLEL
/* Environment variable for collective API sanity checks */
hbool_t H5_coll_api_sanity_check_g = false;
bool H5_coll_api_sanity_check_g = false;
#endif /* H5_HAVE_PARALLEL */

/*******************/
Expand Down Expand Up @@ -188,11 +188,11 @@ H5AC_term_package(void)
*
*-------------------------------------------------------------------------
*/
hbool_t
bool
H5AC_cache_image_pending(const H5F_t *f)
{
H5C_t *cache_ptr;
hbool_t ret_value = FALSE; /* Return value */
H5C_t *cache_ptr;
bool ret_value = FALSE; /* Return value */

FUNC_ENTER_NOAPI_NOINIT_NOERR

Expand Down Expand Up @@ -400,8 +400,8 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
herr_t
H5AC_dest(H5F_t *f)
{
hbool_t log_enabled; /* TRUE if logging was set up */
hbool_t curr_logging; /* TRUE if currently logging */
bool log_enabled; /* TRUE if logging was set up */
bool curr_logging; /* TRUE if currently logging */
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t *aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
Expand Down Expand Up @@ -649,15 +649,15 @@ H5AC_flush(H5F_t *f)
herr_t
H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
{
hbool_t in_cache; /* Entry @ addr is in the cache */
hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
hbool_t is_protected; /* Entry @ addr is in the cache and protected */
hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
hbool_t is_corked;
hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
herr_t ret_value = SUCCEED; /* Return value */
bool in_cache; /* Entry @ addr is in the cache */
bool is_dirty; /* Entry @ addr is in the cache and dirty */
bool is_protected; /* Entry @ addr is in the cache and protected */
bool is_pinned; /* Entry @ addr is in the cache and pinned */
bool is_corked;
bool is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
bool is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
bool image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_NOAPI(FAIL)

Expand Down Expand Up @@ -771,7 +771,7 @@ H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
*-------------------------------------------------------------------------
*/
herr_t
H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw)
H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, bool rw)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand Down Expand Up @@ -1504,8 +1504,8 @@ H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing)
herr_t
H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags)
{
hbool_t dirtied;
hbool_t deleted;
bool dirtied;
bool deleted;
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t *aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
Expand All @@ -1526,8 +1526,8 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, un
assert(((H5AC_info_t *)thing)->type == type);

dirtied =
(hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || (((H5AC_info_t *)thing)->dirtied));
deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG);
(bool)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || (((H5AC_info_t *)thing)->dirtied));
deleted = (bool)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG);

/* Check if the size changed out from underneath us, if we're not deleting
* the entry.
Expand Down Expand Up @@ -1591,7 +1591,7 @@ herr_t
H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
hbool_t evictions_enabled;
bool evictions_enabled;
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_NOAPI(FAIL)
Expand Down Expand Up @@ -1694,7 +1694,7 @@ H5AC_get_cache_size(const H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_c
*-------------------------------------------------------------------------
*/
herr_t
H5AC_get_cache_flush_in_progress(H5AC_t *cache_ptr, hbool_t *flush_in_progress_ptr)
H5AC_get_cache_flush_in_progress(H5AC_t *cache_ptr, bool *flush_in_progress_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand Down Expand Up @@ -1979,12 +1979,12 @@ H5AC__check_if_write_permitted(const H5F_t
H5_ATTR_UNUSED
#endif /* H5_HAVE_PARALLEL */
*f,
hbool_t *write_permitted_ptr)
bool *write_permitted_ptr)
{
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t *aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
hbool_t write_permitted = TRUE;
bool write_permitted = TRUE;

FUNC_ENTER_PACKAGE_NOERR

Expand Down Expand Up @@ -2201,7 +2201,7 @@ H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag)
*------------------------------------------------------------------------------
*/
herr_t
H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global)
H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, bool match_global)
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
Expand Down Expand Up @@ -2292,7 +2292,7 @@ H5AC_get_tag(const void *thing, haddr_t *tag)
*-------------------------------------------------------------------------
*/
herr_t
H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked)
H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, bool *corked)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand Down
18 changes: 9 additions & 9 deletions src/H5ACdbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr)
*/
#ifndef NDEBUG
herr_t
H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr)
H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, bool *fd_exists_ptr)
{
H5C_t *cache_ptr; /* Ptr to cache */
herr_t ret_value = FAIL; /* Return value */
Expand Down Expand Up @@ -247,8 +247,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr,
*/
#ifndef NDEBUG
herr_t
H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expected_type, hbool_t *in_cache_ptr,
hbool_t *type_ok_ptr)
H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expected_type, bool *in_cache_ptr,
bool *type_ok_ptr)
{
H5C_t *cache_ptr;
herr_t ret_value = SUCCEED; /* Return value */
Expand Down Expand Up @@ -279,11 +279,11 @@ H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expecte
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
hbool_t
bool
H5AC_get_serialization_in_progress(H5F_t *f)
{
H5C_t *cache_ptr;
hbool_t ret_value = FALSE; /* Return value */
H5C_t *cache_ptr;
bool ret_value = FALSE; /* Return value */

FUNC_ENTER_NOAPI_NOINIT_NOERR

Expand Down Expand Up @@ -315,11 +315,11 @@ H5AC_get_serialization_in_progress(H5F_t *f)
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
hbool_t
bool
H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring)
{
H5C_t *cache_ptr;
hbool_t ret_value = FALSE; /* Return value */
H5C_t *cache_ptr;
bool ret_value = FALSE; /* Return value */

FUNC_ENTER_NOAPI_NOINIT_NOERR

Expand Down
12 changes: 6 additions & 6 deletions src/H5ACmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,9 @@ H5AC__log_cleaned_entry(const H5AC_info_t *entry_ptr)
*-------------------------------------------------------------------------
*/
herr_t
H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, unsigned flags)
H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, bool was_dirty, unsigned flags)
{
hbool_t cleared;
bool cleared;
H5AC_aux_t *aux_ptr;
H5AC_slist_entry_t *slist_entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
Expand Down Expand Up @@ -986,8 +986,8 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr)
{
H5AC_t *cache_ptr;
H5AC_aux_t *aux_ptr;
hbool_t entry_in_cache;
hbool_t entry_dirty;
bool entry_in_cache;
bool entry_dirty;
size_t entry_size;
herr_t ret_value = SUCCEED; /* Return value */

Expand Down Expand Up @@ -1715,7 +1715,7 @@ H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f)
{
H5AC_t *cache_ptr;
H5AC_aux_t *aux_ptr;
hbool_t evictions_enabled;
bool evictions_enabled;
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_PACKAGE
Expand Down Expand Up @@ -1897,7 +1897,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f)
{
H5AC_t *cache_ptr;
H5AC_aux_t *aux_ptr;
hbool_t evictions_enabled;
bool evictions_enabled;
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_PACKAGE
Expand Down
Loading

0 comments on commit 2dddb4f

Please sign in to comment.