From a6386824c75e804ae5f1782fbbeab79152389d2a Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 24 Dec 2020 07:12:01 -0800 Subject: Switch bool/true/false to hbool_t/TRUE/FALSE in a few places (#229) --- src/H5Z.c | 2 +- test/dsets.c | 2 +- test/genall5.c | 16 +++++++-------- test/s3comms.c | 4 ++-- test/titerate.c | 8 ++++---- testpar/t_pread.c | 52 +++++++++++++++++++++++------------------------ tools/src/h5dump/h5dump.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5stat/h5stat.c | 2 +- 9 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index bd12d0e..b6f617d 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1014,7 +1014,7 @@ H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space) H5O_pline_t pline; /* Object's I/O pipeline information */ H5S_class_t space_class; /* To check class of space */ H5T_class_t type_class; /* To check if type is VL */ - bool bad_for_filters = FALSE; /* Suitable to have filters */ + hbool_t bad_for_filters = FALSE; /* Suitable to have filters */ htri_t ret_value = FALSE; /* TRUE for ignoring filters */ FUNC_ENTER_NOAPI(FAIL) diff --git a/test/dsets.c b/test/dsets.c index 4f2f75a..e7527a8 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7741,7 +7741,7 @@ static H5_ATTR_CONST long gcd(long l0, long r0) { long magnitude, remainder; - bool negative = ((l0 < 0) != (r0 < 0)); + hbool_t negative = ((l0 < 0) != (r0 < 0)); long l = HDlabs(l0), r = HDlabs(r0); do { diff --git a/test/genall5.c b/test/genall5.c index 41fd86a..8965304 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -209,7 +209,7 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); HDassert(0 == grp_info.nlinks); HDassert(0 == grp_info.max_corder); - HDassert(false == grp_info.mounted); + HDassert(FALSE == grp_info.mounted); } if (pass) { @@ -470,7 +470,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); HDassert(nlinks == grp_info.nlinks); HDassert(nlinks == grp_info.max_corder); - HDassert(false == grp_info.mounted); + HDassert(FALSE == grp_info.mounted); } u = 0; @@ -508,7 +508,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset"; } HDassert(ret >= 0); - HDassert(true == lnk_info.corder_valid); + HDassert(TRUE == lnk_info.corder_valid); HDassert(u == lnk_info.corder); HDassert(H5T_CSET_ASCII == lnk_info.cset); @@ -881,7 +881,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type); HDassert(nlinks == grp_info.nlinks); HDassert(nlinks == grp_info.max_corder); - HDassert(false == grp_info.mounted); + HDassert(FALSE == grp_info.mounted); } u = 0; @@ -919,7 +919,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset"; } HDassert(ret >= 0); - HDassert(true == lnk_info.corder_valid); + HDassert(TRUE == lnk_info.corder_valid); HDassert(u == lnk_info.corder); HDassert(H5T_CSET_ASCII == lnk_info.cset); @@ -1244,7 +1244,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); HDassert(0 == grp_info.nlinks); HDassert(0 == grp_info.max_corder); - HDassert(false == grp_info.mounted); + HDassert(FALSE == grp_info.mounted); } if (pass) { @@ -1482,7 +1482,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); HDassert(nlinks == grp_info.nlinks); HDassert(0 == grp_info.max_corder); - HDassert(false == grp_info.mounted); + HDassert(FALSE == grp_info.mounted); } u = 0; @@ -1516,7 +1516,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset"; } HDassert(ret >= 0); - HDassert(false == lnk_info.corder_valid); + HDassert(FALSE == lnk_info.corder_valid); HDassert(H5T_CSET_ASCII == lnk_info.cset); if (0 == (u % 2)) { diff --git a/test/s3comms.c b/test/s3comms.c index 36f6f49..48f11c5 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -2538,9 +2538,9 @@ test_uriencode(void) dest = (char *)HDmalloc(sizeof(char) * 15); HDassert(dest != NULL); - JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, false, &dest_written), + JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, FALSE, &dest_written), "destination cannot be NULL"); - JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written), + JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, FALSE, &dest_written), "source string cannot be NULL"); HDfree(dest); diff --git a/test/titerate.c b/test/titerate.c index 0b20d8d..d0e7ca7 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -54,7 +54,7 @@ typedef struct { #define DSET_NAME "image" typedef struct searched_err_t { char message[256]; - bool found; + hbool_t found; } searched_err_t; /* Call back function for test_corrupted_attnamelen */ @@ -972,7 +972,7 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ /* If the searched error message is found, stop the iteration */ if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, searched_err->message) == 0) { - searched_err->found = true; + searched_err->found = TRUE; status = H5_ITER_STOP; } @@ -1018,14 +1018,14 @@ test_corrupted_attnamelen(void) if (err_status == -1) { /* Initialize client data */ HDstrcpy(err_caught.message, err_message); - err_caught.found = false; + err_caught.found = FALSE; /* Look for the correct error message */ ret = H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, find_err_msg_cb, &err_caught); CHECK(ret, FAIL, "H5Ewalk2"); /* Fail if the indicated message is not found */ - CHECK(err_caught.found, false, "test_corrupted_attnamelen: Expected error not found"); + CHECK(err_caught.found, FALSE, "test_corrupted_attnamelen: Expected error not found"); } /* Close the dataset and file */ diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 78659d4..45e2b89 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -35,7 +35,7 @@ const char *FILENAMES[NFILENAME + 1] = {"reloc_t_pread_data_file", "reloc_t_prea #define LIMIT_NPROC 6 -hbool_t pass = true; +hbool_t pass = TRUE; static const char *random_hdf5_text = "Now is the time for all first-time-users of HDF5 to read their \ manual or go thru the tutorials!\n\ While you\'re at it, now is also the time to read up on MPI-IO."; @@ -112,7 +112,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) float nextValue; float * data_slice = NULL; - pass = true; + pass = TRUE; HDassert(comm != MPI_COMM_NULL); @@ -256,14 +256,14 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) if (pass) { if ((dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dcreate2() failed.\n"; } } if (pass) { if ((H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dwrite() failed.\n"; } } @@ -273,14 +273,14 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) if (pass) { if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pcreate() failed.\n"; } } if (pass) { if ((H5Pset_chunk(dcpl_id, 1, chunk)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pset_chunk() failed.\n"; } } @@ -289,27 +289,27 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) if ((dset_id_ch = H5Dcreate2(file_id, "dataset0_chunked", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dcreate2() failed.\n"; } } if (pass) { if ((H5Dwrite(dset_id_ch, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dwrite() failed.\n"; } } if (pass || (dcpl_id != -1)) { if (H5Pclose(dcpl_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(dcpl_id) failed.\n"; } } if (pass || (dset_id_ch != -1)) { if (H5Dclose(dset_id_ch) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dclose(dset_id_ch) failed.\n"; } } @@ -317,49 +317,49 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) /* close file, etc. */ if (pass || (dset_id != -1)) { if (H5Dclose(dset_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dclose(dset_id) failed.\n"; } } if (pass || (memspace != -1)) { if (H5Sclose(memspace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(memspace) failed.\n"; } } if (pass || (filespace != -1)) { if (H5Sclose(filespace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(filespace) failed.\n"; } } if (pass || (file_id != -1)) { if (H5Fclose(file_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Fclose(file_id) failed.\n"; } } if (pass || (dxpl_id != -1)) { if (H5Pclose(dxpl_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(dxpl_id) failed.\n"; } } if (pass || (fapl_id != -1)) { if (H5Pclose(fapl_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(fapl_id) failed.\n"; } } if (pass || (fctmpl != -1)) { if (H5Pclose(fctmpl) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(fctmpl) failed.\n"; } } @@ -661,14 +661,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) if (pass || (memspace != -1)) { if (H5Sclose(memspace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(memspace) failed.\n"; } } if (pass || (filespace != -1)) { if (H5Sclose(filespace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(filespace) failed.\n"; } } @@ -859,7 +859,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) if (pass || (filespace != -1)) { if (H5Sclose(filespace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(filespace) failed.\n"; } } @@ -956,7 +956,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) if (pass || (memspace != -1)) { if (H5Sclose(memspace) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Sclose(memspace) failed.\n"; } } @@ -969,7 +969,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) if (pass || (dxpl_id != -1)) { if (H5Pclose(dxpl_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(dxpl_id) failed.\n"; } } @@ -978,28 +978,28 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) /* close file, etc. */ if (pass || (dset_id != -1)) { if (H5Dclose(dset_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dclose(dset_id) failed.\n"; } } if (pass || (dset_id_ch != -1)) { if (H5Dclose(dset_id_ch) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Dclose(dset_id_ch) failed.\n"; } } if (pass || (file_id != -1)) { if (H5Fclose(file_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Fclose(file_id) failed.\n"; } } if (pass || (fapl_id != -1)) { if (H5Pclose(fapl_id) < 0) { - pass = false; + pass = FALSE; failure_mssg = "H5Pclose(fapl_id) failed.\n"; } } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 34b3c10..0cf6dd3 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -31,7 +31,7 @@ static h5tools_vol_info_t vol_info_g; /* Default "anonymous" S3 configuration */ static H5FD_ros3_fapl_t ros3_fa_g = { 1, /* Structure Version */ - false, /* Authenticate? */ + FALSE, /* Authenticate? */ "", /* AWS Region */ "", /* Access Key ID */ "", /* Secret Access Key */ diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index dd21bb1..eacb750 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -2664,7 +2664,7 @@ main(int argc, const char *argv[]) /* Default "anonymous" S3 configuration */ H5FD_ros3_fapl_t ros3_fa = { 1, /* Structure Version */ - false, /* Authenticate? */ + FALSE, /* Authenticate? */ "", /* AWS Region */ "", /* Access Key ID */ "", /* Secret Access Key */ diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 12a408e..13428f8 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -122,7 +122,7 @@ static const char *drivername = NULL; /* Default "anonymous" S3 configuration */ static H5FD_ros3_fapl_t ros3_fa = { 1, /* Structure Version */ - false, /* Authenticate? */ + FALSE, /* Authenticate? */ "", /* AWS Region */ "", /* Access Key ID */ "", /* Secret Access Key */ -- cgit v0.12