From c821b497b14cb9cad446025621b6024fd9fa9948 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:57:34 -0700 Subject: [PATCH] Remove TRUE and FALSE from H5private.h (#4969) * Remove TRUE and FALSE from H5private.h * Replace hbool_t with bool in test code --- c++/test/tattr.cpp | 2 +- c++/test/tfile.cpp | 6 ++-- c++/test/tlinks.cpp | 14 ++++---- c++/test/tobject.cpp | 32 +++++++++--------- hl/test/test_lite.c | 72 ++++++++++++++++++++-------------------- src/H5Eint.c | 4 +-- src/H5TSmutex.c | 6 ++-- src/H5TSwin.c | 2 +- src/H5VLint.c | 4 +-- src/H5VLtest.c | 2 +- src/H5private.h | 10 ------ test/cmpd_dset.c | 14 ++++---- test/error_test.c | 38 ++++++++++----------- test/h5test.c | 16 ++++----- test/select_io_dset.c | 2 +- test/trefer.c | 4 +-- test/ttsafe_rec_rwlock.c | 16 ++++----- test/vol.c | 4 +-- 18 files changed, 119 insertions(+), 129 deletions(-) diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 07ab0a6d777..a01833802a4 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1983,7 +1983,7 @@ test_attr(const void *params) // Loop over using new group format unsigned new_format; - for (new_format = FALSE; new_format <= TRUE; new_format++) { + for (new_format = false; new_format <= true; new_format++) { FileAccPropList curr_fapl; // Set the file access proplist for the type of format diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 7f3406a60b8..94742f3c447 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -842,7 +842,7 @@ test_file_info() SUBTEST("File general information"); hsize_t out_threshold = 0; // Free space section threshold to get - hbool_t out_persist = FALSE; // Persist free-space read + hbool_t out_persist = false; // Persist free-space read // File space handling strategy H5F_fspace_strategy_t out_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; @@ -869,7 +869,7 @@ test_file_info() // Verify file space information. verify_val(static_cast(out_strategy), static_cast(H5F_FSPACE_STRATEGY_FSM_AGGR), "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(out_persist, FALSE, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(out_persist, false, "H5File::getFileInfo", __LINE__, __FILE__); verify_val(static_cast(out_threshold), 1, "H5File::getFileInfo", __LINE__, __FILE__); /* Retrieve file space page size */ @@ -884,7 +884,7 @@ test_file_info() fcpl.setIstorek(F2_ISTORE); hsize_t threshold = 5; // Free space section threshold to set - hbool_t persist = TRUE; // Persist free-space to set + hbool_t persist = true; // Persist free-space to set H5F_fspace_strategy_t strategy = H5F_FSPACE_STRATEGY_PAGE; fcpl.setFileSpaceStrategy(strategy, persist, threshold); diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index a6d68631fc4..355a4282651 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -129,14 +129,14 @@ test_basic_links(hid_t fapl_id, hbool_t new_format) H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Verify link existence - if (file.nameExists("dset1", LinkAccPropList::DEFAULT) != TRUE) + if (file.nameExists("dset1", LinkAccPropList::DEFAULT) != true) throw InvalidActionException("H5File::nameExists", "dset1 doesn't exist"); - if (file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + if (file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != true) throw InvalidActionException("H5File::nameExists", "grp1/soft doesn't exist"); // Deprecated - if (file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) + if (file.exists("dset1", LinkAccPropList::DEFAULT) != true) throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); - if (file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + if (file.exists("grp1/soft", LinkAccPropList::DEFAULT) != true) throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); // Verify link values @@ -290,7 +290,7 @@ test_move(hid_t fapl_id, hbool_t new_format) // Move a soft link across files, should succeed grp_2.moveLink("soft", file_b, "soft_new_name"); - if (file_b.exists("soft_new_name") != TRUE) + if (file_b.exists("soft_new_name") != true) throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); // Move a group across groups in the same file while renaming it @@ -429,7 +429,7 @@ test_copy(hid_t fapl_id, hbool_t new_format) // Copy a soft link across files, should succeed grp_2.copyLink("soft", file_b, "soft_new_name"); - if (file_b.exists("soft_new_name") != TRUE) + if (file_b.exists("soft_new_name") != true) throw InvalidActionException("H5File::exists", "soft_new_name doesn't exist"); // Move a group across groups in the same file while renaming it @@ -730,7 +730,7 @@ test_links(const void *params) throw Exception("test_links", "H5Pset_libver_bounds failed"); /* Loop over using new group format */ - for (new_format = FALSE; new_format <= TRUE; new_format++) { + for (new_format = false; new_format <= true; new_format++) { hid_t my_fapl_id; /* Check for FAPL to use */ diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index cec13323544..a7ac635de07 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -169,54 +169,54 @@ test_existance() // Check if GROUP1 exists in the file bool exists = file.nameExists(GROUP1); - verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists GROUP1_1", __LINE__, __FILE__); // Deprecated exists = file.exists(GROUP1); - verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists GROUP1_1", __LINE__, __FILE__); // Open GROUP1 Group grp1 = file.openGroup(GROUP1); // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 exists = grp1.nameExists(GROUP1_1); - verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists GROUP1_1", __LINE__, __FILE__); exists = grp1.nameExists(GROUP1_2); - verify_val(exists, TRUE, "Group::nameExists GROUP1_2", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists GROUP1_2", __LINE__, __FILE__); // Deprecated exists = grp1.exists(GROUP1_1); - verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists GROUP1_1", __LINE__, __FILE__); exists = grp1.exists(GROUP1_2); - verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists GROUP1_2", __LINE__, __FILE__); // Check if DSET_IN_GRP1 exists in GROUP1 exists = grp1.nameExists(DSET_IN_GRP1); - verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); // Deprecated exists = grp1.exists(DSET_IN_GRP1); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); // Open GROUP1_2 Group grp1_2 = grp1.openGroup(GROUP1_2); // Check if DSET_IN_GRP1_2 exists in GROUP1_2 exists = grp1_2.nameExists(DSET_IN_GRP1_2); - verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1_2", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists DSET_IN_GRP1_2", __LINE__, __FILE__); // Deprecated exists = grp1_2.exists(DSET_IN_GRP1_2); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); // Check if a dataset exists given dataset as location with full path name DataSet dset1 = file.openDataSet(DSET_IN_FILE); exists = dset1.nameExists("/Top Group/Dataset_in_Group_1"); - verify_val(exists, TRUE, "Group::nameExists given dataset with full path name", __LINE__, __FILE__); + verify_val(exists, true, "Group::nameExists given dataset with full path name", __LINE__, __FILE__); exists = grp1_2.nameExists(DSET_IN_GRP1); - verify_val(exists, FALSE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + verify_val(exists, false, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); // Deprecated exists = dset1.exists("/Top Group/Dataset_in_Group_1"); - verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); + verify_val(exists, true, "Group::exists given dataset with full path name", __LINE__, __FILE__); exists = grp1_2.exists(DSET_IN_GRP1); - verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + verify_val(exists, false, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); // Everything will be closed as they go out of scope @@ -647,7 +647,7 @@ test_intermediate_groups() } // Failure is ignored // Create GROUP14NAME with the flag to create missing groups set - // to FALSE, should fail because group GROUP13NAME is missing + // to false, should fail because group GROUP13NAME is missing // Reset flag to not create missing groups lcpl.setCreateIntermediateGroup(false); @@ -662,7 +662,7 @@ test_intermediate_groups() catch (FileIException &expected2) { } // Failure is ignored - // Set the flag to create missing groups set to TRUE + // Set the flag to create missing groups set to true lcpl.setCreateIntermediateGroup(true); crt_int_grps = lcpl.getCreateIntermediateGroup(); verify_val(crt_int_grps, true, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__); diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 23508b79990..1ec81238a9d 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -2134,54 +2134,54 @@ test_valid_path(void) * CHECK ABSOLUTE PATHS **************************************/ - if ((path_valid = H5LTpath_valid(file_id, "/", TRUE)) != TRUE) { + if ((path_valid = H5LTpath_valid(file_id, "/", true)) != true) { goto out; } - if ((path_valid = H5LTpath_valid(file_id, "/", FALSE)) != TRUE) { + if ((path_valid = H5LTpath_valid(file_id, "/", false)) != true) { goto out; } - if ((path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) { + if ((path_valid = H5LTpath_valid(file_id, "/G1", true)) != true) { goto out; } - if ((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/DS1", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/DS3", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/DS3", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", false)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G2", true)) != true) goto out; /* check soft link points to a valid object*/ - if ((path_valid = H5LTpath_valid(file_id, "/G2/DS4", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G2/DS4", true)) != true) goto out; /* check if path exist, but not the object */ - if ((path_valid = H5LTpath_valid(file_id, "/G2/G7", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G2/G7", false)) != true) goto out; /* check if path exist and if the object exists. It should fail * since it is a dangling soft link */ - if ((path_valid = H5LTpath_valid(file_id, "/G2/G7", TRUE)) == TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G2/G7", true)) == true) goto out; /* check soft links */ - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", true)) != true) goto out; /************************************** @@ -2191,11 +2191,11 @@ test_valid_path(void) if ((group = H5Gopen2(file_id, "/", H5P_DEFAULT)) < 0) goto out; - if ((path_valid = H5LTpath_valid(group, "/", TRUE)) != TRUE) { + if ((path_valid = H5LTpath_valid(group, "/", true)) != true) { goto out; } - if ((path_valid = H5LTpath_valid(group, "/", FALSE)) != TRUE) { + if ((path_valid = H5LTpath_valid(group, "/", false)) != true) { goto out; } @@ -2207,39 +2207,39 @@ test_valid_path(void) /* The identifier (file id) is the object itself, i.e. "." */ - if ((path_valid = H5LTpath_valid(file_id, ".", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, ".", false)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, ".", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, ".", true)) != true) goto out; /* The identifier (group id) is the object itself, i.e. "." */ - if ((path_valid = H5LTpath_valid(group, ".", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, ".", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(group, "DS3", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, "DS3", false)) != true) goto out; - if ((path_valid = H5LTpath_valid(group, "DS3", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, "DS3", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, "G2/G5", true)) != true) goto out; /* Check the "./" case */ - if ((path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, "./DS3", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(group, "./G2/G5", true)) != true) goto out; /* Should fail, does not exist */ - if ((path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE) + if ((path_valid = H5LTpath_valid(group, "./G2/G20", false)) == true) goto out; /* Should fail, does not exist */ - if ((path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE) + if ((path_valid = H5LTpath_valid(group, "./G2/G20", true)) == true) goto out; if (H5Gclose(group) < 0) @@ -2250,36 +2250,36 @@ test_valid_path(void) *****************************/ /* The dangled external link path is valid */ - if ((path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", false)) != true) goto out; /* The file however does not exists, so the link dangles -> should return false */ - if ((path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", TRUE)) == TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", true)) == true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", false)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/DS1", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", false)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", true)) != true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", FALSE)) != TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", false)) != true) goto out; /* Should fail, does not exist */ - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", TRUE)) == TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", true)) == true) goto out; - if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", TRUE)) == TRUE) + if ((path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", true)) == true) goto out; if (H5Fclose(file_id) < 0) diff --git a/src/H5Eint.c b/src/H5Eint.c index 333bc202c0b..2ceb96b31a5 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -160,10 +160,10 @@ static const H5E_stack_t H5E_err_stack_def = { /* H5E_auto_op_t */ #ifndef H5_NO_DEPRECATED_SYMBOLS #ifdef H5_USE_16_API_DEFAULT - {1, TRUE, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2, (H5E_auto1_t)H5Eprint1, + {1, true, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2}, #else /* H5_USE_16_API */ - {2, TRUE, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2, (H5E_auto1_t)H5Eprint1, + {2, true, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2, (H5E_auto1_t)H5Eprint1, (H5E_auto2_t)H5E__print2}, #endif /* H5_USE_16_API_DEFAULT */ #else /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5TSmutex.c b/src/H5TSmutex.c index 5cc66efff89..710f37e74e7 100644 --- a/src/H5TSmutex.c +++ b/src/H5TSmutex.c @@ -86,7 +86,7 @@ H5TS_mutex_init(H5TS_mutex_t *mutex, int type) /*------------------------------------------------------------------------- * Function: H5TS_mutex_trylock * - * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to TRUE if so + * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to true if so * * Return: Non-negative on success / Negative on failure * @@ -157,7 +157,7 @@ H5TS_mutex_init(H5TS_mutex_t *mutex, int H5_ATTR_UNUSED type) /*------------------------------------------------------------------------- * Function: H5TS_mutex_trylock * - * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to TRUE if so + * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to true if so * * Return: Non-negative on success / Negative on failure * @@ -242,7 +242,7 @@ H5TS_mutex_init(H5TS_mutex_t *mutex, int type) /*------------------------------------------------------------------------- * Function: H5TS_mutex_trylock * - * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to TRUE if so + * Purpose: Attempt to lock a H5TS_mutex_t, sets *acquired to true if so * * Return: Non-negative on success / Negative on failure * diff --git a/src/H5TSwin.c b/src/H5TSwin.c index 913dbff0099..48efe009da8 100644 --- a/src/H5TSwin.c +++ b/src/H5TSwin.c @@ -70,7 +70,7 @@ static herr_t H5TS__win32_thread_exit(void); * * Purpose: Per-process setup on Windows when using Win32 threads. * - * Returns: TRUE on success, FALSE on failure + * Returns: true on success, FALSE on failure * *-------------------------------------------------------------------------- */ diff --git a/src/H5VLint.c b/src/H5VLint.c index e3e2b28e1a9..81d8fe07b22 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -1012,7 +1012,7 @@ H5VL_conn_dec_rc(H5VL_connector_t *connector) * * Purpose: Determine if two connectors point to the same VOL class * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -1029,7 +1029,7 @@ H5VL_conn_same_class(const H5VL_connector_t *conn1, const H5VL_connector_t *conn /* Fast check */ if (conn1 == conn2) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); else { int cmp_value; /* Comparison result */ diff --git a/src/H5VLtest.c b/src/H5VLtest.c index 2c50a579e3e..c15f8295d51 100644 --- a/src/H5VLtest.c +++ b/src/H5VLtest.c @@ -99,7 +99,7 @@ H5VL__reparse_def_vol_conn_variable_test(void) * * Purpose: Check if connector is the native connector * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ diff --git a/src/H5private.h b/src/H5private.h index 86799d362b6..0d2d7ed9f9e 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -376,16 +376,6 @@ #define H5_IS_KNOWN_BUFFER_OVERFLOW(skip, ptr, size, buffer_end) \ (skip ? false : H5_IS_BUFFER_OVERFLOW(ptr, size, buffer_end)) -/* - * HDF Boolean type. - */ -#ifndef FALSE -#define FALSE false -#endif -#ifndef TRUE -#define TRUE true -#endif - /* * The max value for ssize_t. * diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 06ae2ff0799..61592165137 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -128,7 +128,7 @@ static hid_t create_stype1(void); static hid_t create_stype2(void); static hid_t create_stype3(void); static hid_t create_stype4(void); -static int compare_data(void *src_data, void *dst_data, hbool_t src_subset); +static int compare_data(void *src_data, void *dst_data, bool src_subset); static int compare_stype4_data(void *expect_buf, void *rbuf); static int compare_s1_data(void *expect_buf, void *rbuf); static int compare_s1_s3_data(void *expect_buf, void *rbuf); @@ -1211,11 +1211,11 @@ test_compounds_selection_io(void) fapl = h5_fileaccess(); h5_fixname(FILENAME[3], fapl, fname, sizeof(fname)); - for (set_cache = FALSE; set_cache <= TRUE; set_cache++) { - for (set_fillvalue = FALSE; set_fillvalue <= TRUE; set_fillvalue++) { - for (select_io = FALSE; select_io <= TRUE; select_io++) { - for (mwbuf = FALSE; mwbuf <= TRUE; mwbuf++) { - for (set_buf = FALSE; set_buf <= TRUE; set_buf++) { + for (set_cache = false; set_cache <= true; set_cache++) { + for (set_fillvalue = false; set_fillvalue <= true; set_fillvalue++) { + for (select_io = false; select_io <= true; select_io++) { + for (mwbuf = false; mwbuf <= true; mwbuf++) { + for (set_buf = false; set_buf <= true; set_buf++) { if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; @@ -1243,7 +1243,7 @@ test_compounds_selection_io(void) if (mwbuf) { printf("with modify write buf, "); - if (H5Pset_modify_write_buf(dxpl, TRUE) < 0) + if (H5Pset_modify_write_buf(dxpl, true) < 0) goto error; } else diff --git a/test/error_test.c b/test/error_test.c index 204055097b8..b08acf63fdb 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -659,7 +659,7 @@ test_append(void) TEST_ERROR; /* Append error stack #2 to error stack #1, and close stack #2 */ - if (H5Eappend_stack(estack_id1, estack_id2, TRUE) < 0) + if (H5Eappend_stack(estack_id1, estack_id2, true) < 0) TEST_ERROR; /* Try to close error stack #2. Should fail because H5Eappend_stack @@ -700,7 +700,7 @@ test_pause(void) const char *err_msg1 = "Error message #1"; /* Error message #1 for pushing error */ ssize_t err_num; /* Number of errors on stack */ hid_t estack_id1 = H5I_INVALID_HID; /* Error stack ID */ - hbool_t is_paused; /* Whether error stack is paused */ + bool is_paused; /* Whether error stack is paused */ herr_t ret; /* Generic return value */ /* Push an error */ @@ -718,7 +718,7 @@ test_pause(void) TEST_ERROR; /* Check for bad arguments */ - is_paused = TRUE; + is_paused = true; H5E_BEGIN_TRY { ret = H5Eis_paused(H5I_INVALID_HID, &is_paused); @@ -728,17 +728,17 @@ test_pause(void) TEST_ERROR; /* Verify that default stack is not paused */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(H5E_DEFAULT, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; /* Verify that application stack is not paused */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(estack_id1, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; /* Check for bad arguments */ @@ -763,10 +763,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused */ - is_paused = FALSE; + is_paused = false; if (H5Eis_paused(estack_id1, &is_paused) < 0) TEST_ERROR; - if (TRUE != is_paused) + if (true != is_paused) TEST_ERROR; /* Resume error stack */ @@ -774,10 +774,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(estack_id1, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; /* Check for resuming too many times */ @@ -790,10 +790,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused, after trying to resume too many times */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(estack_id1, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; /* Close error stack */ @@ -805,10 +805,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused */ - is_paused = FALSE; + is_paused = false; if (H5Eis_paused(H5E_DEFAULT, &is_paused) < 0) TEST_ERROR; - if (TRUE != is_paused) + if (true != is_paused) TEST_ERROR; /* Resume error stack */ @@ -816,10 +816,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(H5E_DEFAULT, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; /* Check for resuming too many times */ @@ -832,10 +832,10 @@ test_pause(void) TEST_ERROR; /* Check if stack is paused, after trying to resume too many times */ - is_paused = TRUE; + is_paused = true; if (H5Eis_paused(H5E_DEFAULT, &is_paused) < 0) TEST_ERROR; - if (FALSE != is_paused) + if (false != is_paused) TEST_ERROR; return 0; diff --git a/test/h5test.c b/test/h5test.c index 828d83f40f4..92e3c65c1d9 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -770,14 +770,14 @@ h5_get_vfd_fapl(hid_t fapl) } else if (!strcmp(tok, "core")) { /* In-memory driver settings (backing store on, 1 MB increment) */ - if (H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0) + if (H5Pset_fapl_core(fapl, (size_t)H5_MB, true) < 0) goto error; } else if (!strcmp(tok, "core_paged")) { /* In-memory driver with write tracking and paging on */ - if (H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0) + if (H5Pset_fapl_core(fapl, (size_t)H5_MB, true) < 0) goto error; - if (H5Pset_core_write_tracking(fapl, TRUE, 4096) < 0) + if (H5Pset_core_write_tracking(fapl, true, 4096) < 0) goto error; } else if (!strcmp(tok, "split")) { @@ -810,7 +810,7 @@ h5_get_vfd_fapl(hid_t fapl) memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } /* end for */ - if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) + if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, false) < 0) goto error; for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) @@ -2394,10 +2394,10 @@ h5_check_file_locking_env_var(htri_t *use_locks, htri_t *ignore_disabled_locks) herr_t h5_using_native_vol(hid_t fapl_id, hid_t obj_id, bool *is_native_vol) { - hbool_t is_native = false; - hid_t native_id = H5I_INVALID_HID; - hid_t vol_id = H5I_INVALID_HID; - herr_t ret_value = SUCCEED; + bool is_native = false; + hid_t native_id = H5I_INVALID_HID; + hid_t vol_id = H5I_INVALID_HID; + herr_t ret_value = SUCCEED; assert((fapl_id >= 0) || (obj_id >= 0)); assert(is_native_vol); diff --git a/test/select_io_dset.c b/test/select_io_dset.c index c17d3b03a21..9ce1c636061 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -3214,7 +3214,7 @@ main(void) if ((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR; - for (set_cache = FALSE; set_cache <= TRUE; set_cache++) { + for (set_cache = false; set_cache <= true; set_cache++) { /* Disable chunk caching on fapl2 */ if (set_cache) { diff --git a/test/trefer.c b/test/trefer.c index e2a09c0a21e..8847608265c 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -578,11 +578,11 @@ test_reference_obj(void) /* Check if references are equal */ htri_t is_equal = H5Requal(&wbuf[0], &wbuf_cp[0]); CHECK(is_equal, FAIL, "H5Requal"); - VERIFY(is_equal, TRUE, "H5Requal"); + VERIFY(is_equal, true, "H5Requal"); is_equal = H5Requal(&wbuf[0], &wbuf[2]); CHECK(is_equal, FAIL, "H5Requal"); - VERIFY(is_equal, FALSE, "H5Requal"); + VERIFY(is_equal, false, "H5Requal"); ret = H5Rdestroy(&wbuf_cp[0]); CHECK(ret, FAIL, "H5Rdestroy"); diff --git a/test/ttsafe_rec_rwlock.c b/test/ttsafe_rec_rwlock.c index 6fafbb4f8c8..5840cc38107 100644 --- a/test/ttsafe_rec_rwlock.c +++ b/test/ttsafe_rec_rwlock.c @@ -115,7 +115,7 @@ typedef struct rec_rwlock_test_udata_t { static H5TS_THREAD_RETURN_TYPE tts_rec_rwlock_smoke_check_test_thread(void *_udata) { - hbool_t read; + bool read; int32_t rec_lock_depth = 0; int32_t max_rec_lock_depth; int32_t rd_locks_remaining; @@ -132,14 +132,14 @@ tts_rec_rwlock_smoke_check_test_thread(void *_udata) while (rd_locks_remaining > 0 || wr_locks_remaining > 0) { if (wr_locks_remaining == 0) - read = TRUE; + read = true; else if (rd_locks_remaining == 0) - read = FALSE; + read = false; else { if ((rand() % 2) == 0) - read = TRUE; + read = true; else - read = FALSE; + read = false; } if (read) { @@ -556,7 +556,7 @@ tts_rec_rwlock_smoke_check_2(const void H5_ATTR_UNUSED *params) H5TS_thread_t threads[MAX_NUM_THREADS]; rec_rwlock_test_udata_t *udata = NULL; #if H5TS_ENABLE_REC_RWLOCK_STATS - hbool_t verbose = FALSE; + bool verbose = false; int32_t total_target_rd_lock_cycles = 0; int32_t total_target_wr_lock_cycles = 0; H5TS_rec_rwlock_stats_t stats; @@ -762,7 +762,7 @@ tts_rec_rwlock_smoke_check_3(const void H5_ATTR_UNUSED *params) H5TS_thread_t threads[MAX_NUM_THREADS]; rec_rwlock_test_udata_t *udata = NULL; #if H5TS_ENABLE_REC_RWLOCK_STATS - hbool_t verbose = FALSE; + bool verbose = false; int32_t total_target_rd_lock_cycles = 0; int32_t total_target_wr_lock_cycles = 0; H5TS_rec_rwlock_stats_t stats; @@ -968,7 +968,7 @@ tts_rec_rwlock_smoke_check_4(const void H5_ATTR_UNUSED *params) H5TS_thread_t threads[MAX_NUM_THREADS]; rec_rwlock_test_udata_t *udata = NULL; #if H5TS_ENABLE_REC_RWLOCK_STATS - hbool_t verbose = FALSE; + bool verbose = false; int32_t total_target_rd_lock_cycles = 0; int32_t total_target_wr_lock_cycles = 0; H5TS_rec_rwlock_stats_t stats; diff --git a/test/vol.c b/test/vol.c index 92b64c2532d..7d61f4f2daa 100644 --- a/test/vol.c +++ b/test/vol.c @@ -902,8 +902,8 @@ test_basic_file_operation(const char *driver_name) */ h5_check_file_locking_env_var(&use_locking_env, &ignore_disabled_env); if (use_locking_env != FAIL) { - hbool_t default_use_locking = true; - hbool_t default_ignore_disabled_locks = true; + bool default_use_locking = true; + bool default_ignore_disabled_locks = true; if (H5Pget_file_locking(H5P_DEFAULT, &default_use_locking, &default_ignore_disabled_locks) < 0) TEST_ERROR;