Skip to content

Commit

Permalink
Convert hbool_t --> bool in src (#3496)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
derobins authored Sep 5, 2023
1 parent 9208697 commit 8253ab9
Show file tree
Hide file tree
Showing 342 changed files with 7,281 additions and 7,315 deletions.
4 changes: 2 additions & 2 deletions bin/make_err
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ sub create_init ($) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, false))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";
}

Expand All @@ -260,7 +260,7 @@ sub create_init ($) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, true))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";
}
}
Expand Down
64 changes: 32 additions & 32 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 @@ -150,7 +150,7 @@ H5_init_library(void)
/* Set the 'library initialized' flag as early as possible, to avoid
* possible re-entrancy.
*/
H5_INIT_GLOBAL = TRUE;
H5_INIT_GLOBAL = true;

#ifdef H5_HAVE_PARALLEL
{
Expand Down Expand Up @@ -224,7 +224,7 @@ H5_init_library(void)
/* Normal library termination code */
(void)atexit(H5_term_library);

H5_dont_atexit_g = TRUE;
H5_dont_atexit_g = true;
} /* end if */

/*
Expand Down Expand Up @@ -313,7 +313,7 @@ H5_term_library(void)
goto done;

/* Indicate that the library is being shut down */
H5_TERM_GLOBAL = TRUE;
H5_TERM_GLOBAL = true;

/* Push the API context without checking for errors */
H5CX_push_special();
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 @@ -498,10 +498,10 @@ H5_term_library(void)
} /* end while */

/* Reset flag indicating that the library is being shut down */
H5_TERM_GLOBAL = FALSE;
H5_TERM_GLOBAL = false;

/* Mark library as closed */
H5_INIT_GLOBAL = FALSE;
H5_INIT_GLOBAL = false;

/* Don't pop the API context (i.e. H5CX_pop), since it's been shut down already */

Expand Down Expand Up @@ -544,7 +544,7 @@ H5dont_atexit(void)
if (H5_dont_atexit_g)
ret_value = FAIL;
else
H5_dont_atexit_g = TRUE;
H5_dont_atexit_g = true;

FUNC_LEAVE_API_NOFS(ret_value)
} /* end H5dont_atexit() */
Expand Down Expand Up @@ -690,26 +690,26 @@ 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) {

if (isalpha(*s) || '-' == *s || '+' == *s) {

/* Enable or Disable debugging? */
if ('-' == *s) {
clear = TRUE;
clear = true;
s++;
}
else if ('+' == *s) {
clear = FALSE;
clear = false;
s++;
}
else {
clear = FALSE;
clear = false;
} /* end if */

/* Get the name */
Expand All @@ -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 All @@ -1220,9 +1220,9 @@ H5is_library_threadsafe(hbool_t *is_ts /*out*/)

if (is_ts) {
#ifdef H5_HAVE_THREADSAFE
*is_ts = TRUE;
*is_ts = true;
#else /* H5_HAVE_THREADSAFE */
*is_ts = FALSE;
*is_ts = false;
#endif /* H5_HAVE_THREADSAFE */
}
else
Expand All @@ -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 Expand Up @@ -1276,7 +1276,7 @@ H5is_library_terminating(hbool_t *is_terminating /*out*/)
* Only enabled when the shared Windows library is built with
* thread safety enabled.
*
* Return: TRUE on success, FALSE on failure
* Return: true on success, false on failure
*
*-------------------------------------------------------------------------
*/
Expand All @@ -1290,7 +1290,7 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
* This includes any functions that are called by from here!
*/

BOOL fOkay = TRUE;
BOOL fOkay = true;

switch (fdwReason) {
case DLL_PROCESS_ATTACH:
Expand All @@ -1302,20 +1302,20 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
case DLL_THREAD_ATTACH:
#ifdef H5_HAVE_WIN_THREADS
if (H5TS_win32_thread_enter() < 0)
fOkay = FALSE;
fOkay = false;
#endif /* H5_HAVE_WIN_THREADS */
break;

case DLL_THREAD_DETACH:
#ifdef H5_HAVE_WIN_THREADS
if (H5TS_win32_thread_exit() < 0)
fOkay = FALSE;
fOkay = false;
#endif /* H5_HAVE_WIN_THREADS */
break;

default:
/* Shouldn't get here */
fOkay = FALSE;
fOkay = false;
break;
}

Expand Down
Loading

0 comments on commit 8253ab9

Please sign in to comment.