From 8253ab9ebf6a082dc07eb931f27b169d6a45d577 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:52:30 -0700 Subject: 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 --- bin/make_err | 4 +- src/H5.c | 64 ++-- src/H5A.c | 69 ++-- src/H5AC.c | 102 +++--- src/H5ACdbg.c | 34 +- src/H5ACmpio.c | 34 +- src/H5ACpkg.h | 18 +- src/H5ACprivate.h | 76 ++--- src/H5ACpublic.h | 12 +- src/H5Abtree2.c | 4 +- src/H5Adense.c | 46 +-- src/H5Adeprec.c | 6 +- src/H5Aint.c | 147 ++++---- src/H5Apkg.h | 12 +- src/H5Atest.c | 12 +- src/H5B.c | 50 +-- src/H5B2.c | 50 +-- src/H5B2cache.c | 30 +- src/H5B2dbg.c | 4 +- src/H5B2hdr.c | 4 +- src/H5B2int.c | 40 +-- src/H5B2internal.c | 56 +-- src/H5B2leaf.c | 24 +- src/H5B2pkg.h | 16 +- src/H5B2private.h | 4 +- src/H5B2test.c | 4 +- src/H5Bcache.c | 4 +- src/H5Bprivate.h | 12 +- src/H5C.c | 162 ++++----- src/H5CX.c | 243 +++++++------ src/H5CXprivate.h | 33 +- src/H5Cdbg.c | 56 +-- src/H5Centry.c | 405 +++++++++++----------- src/H5Cepoch.c | 7 +- src/H5Cimage.c | 112 +++--- src/H5Cint.c | 158 ++++----- src/H5Clog.c | 20 +- src/H5Clog.h | 6 +- src/H5Cmpio.c | 70 ++-- src/H5Cpkg.h | 96 +++--- src/H5Cprefetched.c | 4 +- src/H5Cprivate.h | 171 +++++----- src/H5Cquery.c | 19 +- src/H5Ctag.c | 64 ++-- src/H5Ctest.c | 10 +- src/H5D.c | 38 +-- src/H5Dbtree.c | 100 +++--- src/H5Dbtree2.c | 56 +-- src/H5Dchunk.c | 608 ++++++++++++++++----------------- src/H5Dcompact.c | 32 +- src/H5Dcontig.c | 80 ++--- src/H5Ddeprec.c | 8 +- src/H5Dearray.c | 56 +-- src/H5Defl.c | 4 +- src/H5Dfarray.c | 54 +-- src/H5Dfill.c | 22 +- src/H5Dint.c | 238 ++++++------- src/H5Dio.c | 54 +-- src/H5Dlayout.c | 28 +- src/H5Dmpio.c | 297 ++++++++-------- src/H5Dnone.c | 32 +- src/H5Doh.c | 18 +- src/H5Dpkg.h | 141 ++++---- src/H5Dprivate.h | 6 +- src/H5Dscatgath.c | 52 +-- src/H5Dselect.c | 12 +- src/H5Dsingle.c | 40 +-- src/H5Dtest.c | 4 +- src/H5Dvirtual.c | 116 +++---- src/H5E.c | 48 +-- src/H5EA.c | 40 +-- src/H5EAcache.c | 62 ++-- src/H5EAdblkpage.c | 4 +- src/H5EAdblock.c | 8 +- src/H5EAhdr.c | 4 +- src/H5EAiblock.c | 8 +- src/H5EApkg.h | 24 +- src/H5EAsblock.c | 8 +- src/H5ES.c | 2 +- src/H5ESint.c | 30 +- src/H5ESpkg.h | 6 +- src/H5Edeprec.c | 6 +- src/H5Eint.c | 18 +- src/H5Epkg.h | 4 +- src/H5Eprivate.h | 4 +- src/H5Epublic.h | 2 +- src/H5F.c | 44 +-- src/H5FA.c | 22 +- src/H5FAcache.c | 30 +- src/H5FAdblkpage.c | 4 +- src/H5FAdblock.c | 8 +- src/H5FAhdr.c | 4 +- src/H5FApkg.h | 10 +- src/H5FD.c | 56 +-- src/H5FDcore.c | 62 ++-- src/H5FDcore.h | 6 +- src/H5FDdirect.c | 46 +-- src/H5FDfamily.c | 62 ++-- src/H5FDhdfs.c | 7 +- src/H5FDint.c | 172 +++++----- src/H5FDlog.c | 18 +- src/H5FDmirror.c | 94 ++--- src/H5FDmirror_priv.h | 16 +- src/H5FDmpi.c | 2 +- src/H5FDmpio.c | 227 ++++++------ src/H5FDmulti.c | 60 ++-- src/H5FDmulti.h | 8 +- src/H5FDonion.c | 34 +- src/H5FDonion_index.c | 12 +- src/H5FDonion_index.h | 6 +- src/H5FDpkg.h | 2 +- src/H5FDprivate.h | 30 +- src/H5FDros3.c | 11 +- src/H5FDros3.h | 8 +- src/H5FDs3comms.c | 24 +- src/H5FDs3comms.h | 5 +- src/H5FDsec2.c | 22 +- src/H5FDspace.c | 10 +- src/H5FDsplitter.c | 46 +-- src/H5FDstdio.c | 16 +- src/H5FDsubfiling/H5FDioc.c | 30 +- src/H5FDsubfiling/H5FDioc_int.c | 2 +- src/H5FDsubfiling/H5FDioc_priv.h | 18 +- src/H5FDsubfiling/H5FDioc_threads.c | 38 +-- src/H5FDsubfiling/H5FDsubfiling.c | 80 ++--- src/H5FDsubfiling/H5FDsubfiling.h | 6 +- src/H5FDsubfiling/H5subfiling_common.c | 54 +-- src/H5FDtest.c | 10 +- src/H5FL.c | 20 +- src/H5FLprivate.h | 10 +- src/H5FO.c | 16 +- src/H5FOprivate.h | 6 +- src/H5FS.c | 18 +- src/H5FScache.c | 28 +- src/H5FSpkg.h | 8 +- src/H5FSprivate.h | 2 +- src/H5FSsection.c | 161 +++++---- src/H5Faccum.c | 44 +-- src/H5Fcwfs.c | 10 +- src/H5Fdeprec.c | 4 +- src/H5Fefc.c | 4 +- src/H5Fint.c | 186 +++++----- src/H5Fio.c | 4 +- src/H5Fmodule.h | 12 +- src/H5Fmount.c | 20 +- src/H5Fmpi.c | 32 +- src/H5Fpkg.h | 94 ++--- src/H5Fprivate.h | 72 ++-- src/H5Fpublic.h | 8 +- src/H5Fquery.c | 64 ++-- src/H5Fspace.c | 6 +- src/H5Fsuper.c | 94 ++--- src/H5Fsuper_cache.c | 32 +- src/H5Ftest.c | 20 +- src/H5G.c | 26 +- src/H5Gcache.c | 4 +- src/H5Gcompact.c | 12 +- src/H5Gdense.c | 24 +- src/H5Gdeprec.c | 10 +- src/H5Gent.c | 2 +- src/H5Gint.c | 52 +-- src/H5Glink.c | 10 +- src/H5Gloc.c | 30 +- src/H5Gname.c | 58 ++-- src/H5Gnode.c | 44 +-- src/H5Gobj.c | 62 ++-- src/H5Goh.c | 4 +- src/H5Gpkg.h | 19 +- src/H5Gprivate.h | 18 +- src/H5Groot.c | 16 +- src/H5Gstab.c | 24 +- src/H5Gtest.c | 104 +++--- src/H5Gtraverse.c | 66 ++-- src/H5HF.c | 8 +- src/H5HFcache.c | 154 ++++----- src/H5HFdbg.c | 18 +- src/H5HFdblock.c | 18 +- src/H5HFhdr.c | 34 +- src/H5HFhuge.c | 28 +- src/H5HFiblock.c | 60 ++-- src/H5HFiter.c | 16 +- src/H5HFman.c | 6 +- src/H5HFpkg.h | 74 ++-- src/H5HFprivate.h | 11 +- src/H5HFsection.c | 112 +++--- src/H5HFspace.c | 10 +- src/H5HFtest.c | 4 +- src/H5HFtiny.c | 6 +- src/H5HG.c | 4 +- src/H5HGcache.c | 6 +- src/H5HL.c | 14 +- src/H5HLcache.c | 12 +- src/H5HLdblk.c | 2 +- src/H5HLpkg.h | 2 +- src/H5I.c | 42 +-- src/H5Iint.c | 62 ++-- src/H5Ipkg.h | 8 +- src/H5Iprivate.h | 13 +- src/H5Itest.c | 12 +- src/H5L.c | 74 ++-- src/H5Ldeprec.c | 28 +- src/H5Lexternal.c | 4 +- src/H5Lint.c | 92 ++--- src/H5Lpkg.h | 4 +- src/H5Lprivate.h | 4 +- src/H5Lpublic.h | 8 +- src/H5M.c | 36 +- src/H5MF.c | 166 ++++----- src/H5MFaggr.c | 28 +- src/H5MFpkg.h | 8 +- src/H5MFprivate.h | 4 +- src/H5MFsection.c | 30 +- src/H5O.c | 58 ++-- src/H5Oainfo.c | 24 +- src/H5Oalloc.c | 240 ++++++------- src/H5Oattr.c | 17 +- src/H5Oattribute.c | 116 +++---- src/H5Obogus.c | 8 +- src/H5Obtreek.c | 9 +- src/H5Ocache.c | 64 ++-- src/H5Ocache_image.c | 8 +- src/H5Ochunk.c | 4 +- src/H5Ocont.c | 8 +- src/H5Ocopy.c | 112 +++--- src/H5Ocopy_ref.c | 12 +- src/H5Odbg.c | 28 +- src/H5Odeprec.c | 26 +- src/H5Odrvinfo.c | 8 +- src/H5Odtype.c | 51 ++- src/H5Oefl.c | 18 +- src/H5Ofill.c | 34 +- src/H5Oflush.c | 18 +- src/H5Ofsinfo.c | 14 +- src/H5Oginfo.c | 13 +- src/H5Oint.c | 124 +++---- src/H5Olayout.c | 36 +- src/H5Olinfo.c | 24 +- src/H5Olink.c | 24 +- src/H5Omessage.c | 84 ++--- src/H5Omtime.c | 17 +- src/H5Oname.c | 9 +- src/H5Opkg.h | 64 ++-- src/H5Opline.c | 6 +- src/H5Oprivate.h | 87 +++-- src/H5Opublic.h | 2 +- src/H5Orefcount.c | 14 +- src/H5Osdspace.c | 10 +- src/H5Oshared.c | 10 +- src/H5Oshared.h | 6 +- src/H5Oshmesg.c | 8 +- src/H5Ostab.c | 15 +- src/H5Otest.c | 70 ++-- src/H5P.c | 30 +- src/H5PB.c | 58 ++-- src/H5PBpkg.h | 2 +- src/H5PBprivate.h | 2 +- src/H5PLint.c | 24 +- src/H5PLpath.c | 30 +- src/H5PLpkg.h | 13 +- src/H5PLplugin_cache.c | 25 +- src/H5Pdcpl.c | 50 +-- src/H5Pdeprec.c | 10 +- src/H5Pdxpl.c | 36 +- src/H5Pencdec.c | 34 +- src/H5Pfapl.c | 167 +++++---- src/H5Pfcpl.c | 8 +- src/H5Pfmpl.c | 6 +- src/H5Pgcpl.c | 24 +- src/H5Pint.c | 94 ++--- src/H5Plapl.c | 18 +- src/H5Pocpl.c | 16 +- src/H5Ppkg.h | 16 +- src/H5Pprivate.h | 10 +- src/H5Ppublic.h | 24 +- src/H5Ptest.c | 2 +- src/H5R.c | 32 +- src/H5RS.c | 10 +- src/H5Rdeprec.c | 20 +- src/H5Rint.c | 34 +- src/H5Rpkg.h | 4 +- src/H5S.c | 80 ++--- src/H5SM.c | 122 +++---- src/H5SMcache.c | 20 +- src/H5Sall.c | 52 +-- src/H5Sdeprec.c | 2 +- src/H5Shyper.c | 555 +++++++++++++++--------------- src/H5Smpio.c | 76 ++--- src/H5Snone.c | 36 +- src/H5Spkg.h | 10 +- src/H5Spoint.c | 72 ++-- src/H5Sprivate.h | 27 +- src/H5Sselect.c | 118 +++---- src/H5Stest.c | 8 +- src/H5T.c | 286 ++++++++-------- src/H5TS.c | 8 +- src/H5Tarray.c | 8 +- src/H5Tbit.c | 32 +- src/H5Tcommit.c | 42 +-- src/H5Tcompound.c | 26 +- src/H5Tconv.c | 304 ++++++++--------- src/H5Tdeprec.c | 2 +- src/H5Tenum.c | 6 +- src/H5Tfields.c | 28 +- src/H5Tinit_float.c | 6 +- src/H5Tmodule.h | 2 +- src/H5Tnative.c | 14 +- src/H5Toh.c | 4 +- src/H5Tpkg.h | 29 +- src/H5Tprivate.h | 12 +- src/H5Tref.c | 89 +++-- src/H5Tvisit.c | 4 +- src/H5Tvlen.c | 28 +- src/H5VL.c | 30 +- src/H5VLcallback.c | 346 +++++++++---------- src/H5VLint.c | 110 +++--- src/H5VLmodule.h | 2 +- src/H5VLnative.c | 6 +- src/H5VLnative_attr.c | 2 +- src/H5VLnative_blob.c | 2 +- src/H5VLnative_dataset.c | 8 +- src/H5VLnative_file.c | 20 +- src/H5VLnative_link.c | 4 +- src/H5VLnative_object.c | 4 +- src/H5VLpassthru.c | 2 +- src/H5VLpkg.h | 16 +- src/H5VLprivate.h | 20 +- src/H5VM.c | 34 +- src/H5VMprivate.h | 30 +- src/H5Z.c | 113 +++--- src/H5Znbit.c | 38 +-- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 2 +- src/H5Zscaleoffset.c | 20 +- src/H5Zszip.c | 6 +- src/H5Ztrans.c | 58 ++-- src/H5checksum.c | 4 +- src/H5mpi.c | 40 +-- src/H5private.h | 54 +-- src/H5public.h | 12 +- src/H5system.c | 12 +- src/H5timer.c | 4 +- src/H5trace.c | 36 +- 342 files changed, 7281 insertions(+), 7315 deletions(-) diff --git a/bin/make_err b/bin/make_err index eb9e909..064d66c 100755 --- a/bin/make_err +++ b/bin/make_err @@ -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"; } @@ -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"; } } diff --git a/src/H5.c b/src/H5.c index bb042c6..9226a74 100644 --- a/src/H5.c +++ b/src/H5.c @@ -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 */ @@ -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 { @@ -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 */ /* @@ -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(); @@ -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 */ @@ -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 */ @@ -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() */ @@ -690,10 +690,10 @@ done: 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) { @@ -701,15 +701,15 @@ H5__debug_mask(const char *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 */ @@ -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++) @@ -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; @@ -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 */ @@ -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 @@ -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 */ @@ -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 * *------------------------------------------------------------------------- */ @@ -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: @@ -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; } diff --git a/src/H5A.c b/src/H5A.c index cbb577d..4f722ef 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -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); /*********************/ @@ -129,7 +129,7 @@ H5A__create_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute"); /* Register the new attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID"); done: @@ -172,7 +172,7 @@ H5A__create_api_common(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "attr_name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_AACC, TRUE, &aapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_AACC, true, &aapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Get correct property list */ @@ -319,11 +319,11 @@ H5A__create_by_name_api_common(hid_t loc_id, const char *obj_name, const char *a /* obj_name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, obj_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, obj_name, true, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, true) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info"); /* Get correct property list */ @@ -464,7 +464,7 @@ H5A__open_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const ch HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute: '%s'", attr_name); /* Register the attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID"); done: @@ -507,7 +507,7 @@ H5A__open_api_common(hid_t loc_id, const char *attr_name, hid_t aapl_id, void ** HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_AACC, FALSE, &aapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_AACC, false, &aapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Open the attribute */ @@ -629,11 +629,11 @@ H5A__open_by_name_api_common(hid_t loc_id, const char *obj_name, const char *att /* obj_name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, obj_name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, obj_name, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info"); /* Open the attribute */ @@ -763,12 +763,12 @@ H5A__open_by_idx_api_common(hid_t loc_id, const char *obj_name, H5_index_t idx_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid iteration order specified"); /* Set up object access arguments */ - if (H5VL_setup_idx_args(loc_id, obj_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr, &loc_params) < + if (H5VL_setup_idx_args(loc_id, obj_name, idx_type, order, n, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info"); /* Open the attribute */ @@ -1323,7 +1323,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the object */ @@ -1471,7 +1471,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the object */ @@ -1530,7 +1530,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the object */ @@ -1743,7 +1743,7 @@ H5A__rename_by_name_api_common(hid_t loc_id, const char *obj_name, const char *o /* obj_name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, obj_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, obj_name, true, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Rename the attribute */ @@ -1977,7 +1977,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* get the loc object */ @@ -2100,7 +2100,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the object */ @@ -2172,7 +2172,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_ite HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info"); /* get the object */ @@ -2303,7 +2303,7 @@ done: *--------------------------------------------------------------------------*/ 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 */ @@ -2340,7 +2340,7 @@ done: * 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 */ @@ -2377,7 +2377,7 @@ done: * Purpose: Checks if an attribute with a given name exists on an opened * object. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -2385,14 +2385,14 @@ done: 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); /* Synchronously check if an attribute exists */ - exists = FALSE; + exists = false; if (H5A__exists_api_common(obj_id, attr_name, &exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't synchronously check if attribute exists"); @@ -2452,9 +2452,8 @@ done: * 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 = @@ -2474,7 +2473,7 @@ H5A__exists_by_name_api_common(hid_t loc_id, const char *obj_name, const char *a /* obj_name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, obj_name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, obj_name, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Check if the attribute exists */ @@ -2490,7 +2489,7 @@ done: * * Purpose: Checks if an attribute with a given name exists on an object. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -2498,14 +2497,14 @@ done: 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); /* Synchronously check if an attribute exists */ - exists = FALSE; + exists = false; if (H5A__exists_by_name_api_common(loc_id, obj_name, attr_name, &exists, lapl_id, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't synchronously determine if attribute exists by name"); diff --git a/src/H5AC.c b/src/H5AC.c index f698bfe..eb83813 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -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 @@ -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 */ /*******************/ @@ -146,7 +146,7 @@ H5AC_init(void) s = HDgetenv("H5_COLL_API_SANITY_CHECK"); if (s && isdigit(*s)) { long env_val = strtol(s, NULL, 0); - H5_coll_api_sanity_check_g = (0 == env_val) ? FALSE : TRUE; + H5_coll_api_sanity_check_g = (0 == env_val) ? false : true; } } #endif /* H5_HAVE_PARALLEL */ @@ -181,18 +181,18 @@ H5AC_term_package(void) * metadata cache image load is pending (i.e. will be executed * on the next protect or insert) * - * Returns TRUE if a cache image load is pending, and FALSE + * Returns true if a cache image load is pending, and false * if not. Throws an assertion failure on error. * - * Return: TRUE if a cache image load is pending, and FALSE otherwise. + * Return: true if a cache image load is pending, and false otherwise. * *------------------------------------------------------------------------- */ -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 @@ -268,7 +268,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co aux_ptr->mpi_comm = mpi_comm; aux_ptr->mpi_rank = mpi_rank; aux_ptr->mpi_size = mpi_size; - aux_ptr->write_permitted = FALSE; + aux_ptr->write_permitted = false; aux_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; aux_ptr->dirty_bytes = 0; aux_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; @@ -308,11 +308,11 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co if (aux_ptr->mpi_rank == 0) f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), H5AC_class_s, H5AC__check_if_write_permitted, - TRUE, H5AC__log_flushed_entry, (void *)aux_ptr); + true, H5AC__log_flushed_entry, (void *)aux_ptr); else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, (void *)aux_ptr); + H5AC_class_s, H5AC__check_if_write_permitted, true, NULL, (void *)aux_ptr); } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ @@ -322,7 +322,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co */ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, NULL); + H5AC_class_s, H5AC__check_if_write_permitted, true, NULL, NULL); #ifdef H5_HAVE_PARALLEL } /* end else */ #endif /* H5_HAVE_PARALLEL */ @@ -400,8 +400,8 @@ done: 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 */ @@ -435,7 +435,7 @@ H5AC_dest(H5F_t *f) #ifdef H5_HAVE_PARALLEL /* destroying the cache, so clear all collective entries */ - if (H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) + if (H5C_clear_coll_entries(f->shared->cache, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't clear collective entries"); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); @@ -459,14 +459,14 @@ H5AC_dest(H5F_t *f) */ if (H5F_ACC_RDWR & H5F_INTENT(f)) { /* enable and load the skip list */ - if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list"); if (H5AC__flush_entries(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush"); /* disable the skip list -- should be empty */ - if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list"); } /* end if */ } /* end if */ @@ -606,7 +606,7 @@ H5AC_flush(H5F_t *f) #ifdef H5_HAVE_PARALLEL /* flushing the cache, so clear all collective entries */ - if (H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) + if (H5C_clear_coll_entries(f->shared->cache, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed"); /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ @@ -649,15 +649,15 @@ done: 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) @@ -771,7 +771,7 @@ done: *------------------------------------------------------------------------- */ 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 */ @@ -1127,7 +1127,7 @@ H5AC_prep_for_file_flush(H5F_t *f) assert(f->shared); assert(f->shared->cache); - if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list"); done: @@ -1168,7 +1168,7 @@ H5AC_secure_from_file_flush(H5F_t *f) assert(f->shared); assert(f->shared->cache); - if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list"); done: @@ -1479,7 +1479,7 @@ done: * argument must be the value returned by that call to * H5AC_protect(). * - * If the deleted flag is TRUE, simply remove the target entry + * If the deleted flag is true, simply remove the target entry * from the cache, clear it, and free it without writing it to * disk. * @@ -1504,8 +1504,8 @@ done: 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 */ @@ -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. @@ -1544,7 +1544,7 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, un #ifdef H5_HAVE_PARALLEL if (NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache))) { - if (dirtied && ((H5AC_info_t *)thing)->is_dirty == FALSE) + if (dirtied && ((H5AC_info_t *)thing)->is_dirty == false) if (H5AC__log_dirtied_entry((H5AC_info_t *)thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry"); @@ -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) @@ -1609,11 +1609,11 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t * /* Set the information to return */ if (internal_config.rpt_fcn == NULL) - config_ptr->rpt_fcn_enabled = FALSE; + config_ptr->rpt_fcn_enabled = false; else - config_ptr->rpt_fcn_enabled = TRUE; - config_ptr->open_trace_file = FALSE; - config_ptr->close_trace_file = FALSE; + config_ptr->rpt_fcn_enabled = true; + config_ptr->open_trace_file = false; + config_ptr->close_trace_file = false; config_ptr->trace_file_name[0] = '\0'; config_ptr->evictions_enabled = evictions_enabled; config_ptr->set_initial_size = internal_config.set_initial_size; @@ -1694,7 +1694,7 @@ done: *------------------------------------------------------------------------- */ 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 */ @@ -1797,7 +1797,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, const H5AC_cache_config_t * * This will be trace output until we create a special API call. JSON * output is generated when logging is controlled by the H5P calls. */ - if (H5C_log_set_up((H5C_t *)cache_ptr, config_ptr->trace_file_name, H5C_LOG_STYLE_TRACE, TRUE) < 0) + if (H5C_log_set_up((H5C_t *)cache_ptr, config_ptr->trace_file_name, H5C_LOG_STYLE_TRACE, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "mdc logging setup failed"); } @@ -1866,7 +1866,7 @@ H5AC_validate_config(const H5AC_cache_config_t *config_ptr) if (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version"); - /* don't bother to test trace_file_name unless open_trace_file is TRUE */ + /* don't bother to test trace_file_name unless open_trace_file is true */ if (config_ptr->open_trace_file) { size_t name_len; @@ -1881,7 +1881,7 @@ H5AC_validate_config(const H5AC_cache_config_t *config_ptr) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long"); } /* end if */ - if ((config_ptr->evictions_enabled == FALSE) && + if ((config_ptr->evictions_enabled == false) && ((config_ptr->incr_mode != H5C_incr__off) || (config_ptr->flash_incr_mode != H5C_flash_incr__off) || (config_ptr->decr_mode != H5C_decr__off))) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled"); @@ -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 @@ -1999,7 +1999,7 @@ H5AC__check_if_write_permitted(const H5F_t (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) write_permitted = aux_ptr->write_permitted; else - write_permitted = FALSE; + write_permitted = false; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2201,7 +2201,7 @@ done: *------------------------------------------------------------------------------ */ 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; @@ -2292,7 +2292,7 @@ done: *------------------------------------------------------------------------- */ 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 */ @@ -2313,7 +2313,7 @@ H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked) if (action == H5AC__GET_CORKED) { assert(corked); if (H5C_get_num_objs_corked(f->shared->cache) == 0) { - *corked = FALSE; + *corked = false; HGOTO_DONE(SUCCEED); } } diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 914040f..37d9ca8 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -81,7 +81,7 @@ H5AC_stats(const H5F_t *f) assert(f->shared->cache); /* at present, this can't fail */ - (void)H5C_stats(f->shared->cache, H5F_OPEN_NAME(f), FALSE); + (void)H5C_stats(f->shared->cache, H5F_OPEN_NAME(f), false); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5AC_stats() */ @@ -186,13 +186,13 @@ done: * of protect / unprotect calls prior to this call. * * If either the parent or the child is not in the metadata - * cache, the function sets *fd_exists_ptr to FALSE. + * cache, the function sets *fd_exists_ptr to false. * * If both are in the cache, the child's list of parents is * searched for the proposed parent. If the proposed parent * is found in the child's parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, - * the function sets *fd_exists_ptr FALSE. + * *fd_exists_ptr to true. In all other non-error cases, + * the function sets *fd_exists_ptr false. * * Return: SUCCEED on success/FAIL on failure. Note that * *fd_exists_ptr is undefined on failure. @@ -201,7 +201,7 @@ done: */ #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 */ @@ -228,12 +228,12 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, * type field contains the expected value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * to true, and *type_ok_ptr is set to true or false depending * on whether the entries type field matches the * expected_type parameter * * If the target entry is not in cache, *in_cache_ptr is - * set to FALSE, and *type_ok_ptr is undefined. + * set to false, and *type_ok_ptr is undefined. * * Note that this function is only defined if NDEBUG * is not defined. @@ -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 */ @@ -279,11 +279,11 @@ done: *------------------------------------------------------------------------- */ #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 @@ -307,19 +307,19 @@ H5AC_get_serialization_in_progress(H5F_t *f) * metadata cache are clean from the outermost ring, inwards * to the inner ring specified. * - * Returns TRUE if all specified rings are clean, and FALSE + * Returns true if all specified rings are clean, and false * if not. Throws an assertion failure on error. * - * Return: TRUE if the indicated ring(s) are clean, and FALSE otherwise. + * Return: true if the indicated ring(s) are clean, and false otherwise. * *------------------------------------------------------------------------- */ #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 diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 0a634c0..77c7fdb 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -699,7 +699,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) /* Sanity checks */ assert(entry_ptr); - assert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr->is_dirty == false); cache_ptr = entry_ptr->cache_ptr; assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); @@ -772,7 +772,7 @@ H5AC__log_cleaned_entry(const H5AC_info_t *entry_ptr) /* Sanity check */ assert(entry_ptr); - assert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr->is_dirty == false); cache_ptr = entry_ptr->cache_ptr; assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); @@ -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 */ @@ -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 */ @@ -1203,14 +1203,14 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) */ /* Enable writes during this operation */ - aux_ptr->write_permitted = TRUE; + aux_ptr->write_permitted = true; /* Apply the candidate list */ result = H5C_apply_candidate_list(f, cache_ptr, num_candidates, candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ - aux_ptr->write_permitted = FALSE; + aux_ptr->write_permitted = false; /* Check for error on the write operation */ if (result < 0) @@ -1613,14 +1613,14 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) /* Enable writes during this operation */ - aux_ptr->write_permitted = TRUE; + aux_ptr->write_permitted = true; /* Apply the candidate list */ result = H5C_apply_candidate_list(f, cache_ptr, num_entries, haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ - aux_ptr->write_permitted = FALSE; + aux_ptr->write_permitted = false; /* Check for error on the write operation */ if (result < 0) @@ -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 @@ -1819,13 +1819,13 @@ H5AC__rsp__p0_only__flush(H5F_t *f) herr_t result; /* Enable writes during this operation */ - aux_ptr->write_permitted = TRUE; + aux_ptr->write_permitted = true; /* Flush the cache */ result = H5C_flush_cache(f, H5AC__NO_FLAGS_SET); /* Disable writes again */ - aux_ptr->write_permitted = FALSE; + aux_ptr->write_permitted = false; /* Check for error on the write operation */ if (result < 0) { @@ -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 @@ -1941,13 +1941,13 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) */ /* Enable writes during this operation */ - aux_ptr->write_permitted = TRUE; + aux_ptr->write_permitted = true; /* Flush the cache */ result = H5C_flush_to_min_clean(f); /* Disable writes again */ - aux_ptr->write_permitted = FALSE; + aux_ptr->write_permitted = false; /* Check for error on the write operation */ if (result < 0) { @@ -2035,7 +2035,7 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op) * order of the collectively accessed entries except through collective * access. */ - if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) + if (H5C_clear_coll_entries(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed."); switch (aux_ptr->metadata_write_strategy) { diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 535eabd..e0867f4 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -204,49 +204,49 @@ H5FL_EXTERN(H5AC_aux_t); * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * * dirty_bytes_propagations: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of times the cleaned list * has been propagated from process 0 to the other * processes. * * unprotect_dirty_bytes: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of dirty bytes created * via unprotect operations since the last time the cleaned * list was propagated. * * unprotect_dirty_bytes_updates: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of times dirty bytes have * been created via unprotect operations since the last time * the cleaned list was propagated. * * insert_dirty_bytes: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of dirty bytes created * via insert operations since the last time the cleaned * list was propagated. * * insert_dirty_bytes_updates: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of times dirty bytes have * been created via insert operations since the last time * the cleaned list was propagated. * * move_dirty_bytes: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of dirty bytes created * via move operations since the last time the cleaned * list was propagated. * * move_dirty_bytes_updates: This field only exists when the - * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. + * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is true. * * It is used to track the number of times dirty bytes have * been created via move operations since the last time @@ -351,7 +351,7 @@ typedef struct H5AC_aux_t { int mpi_rank; int mpi_size; - hbool_t write_permitted; + bool write_permitted; size_t dirty_bytes_threshold; size_t dirty_bytes; int32_t metadata_write_strategy; @@ -391,7 +391,7 @@ typedef void (*H5AC_write_done_cb_t)(void); H5_DLL herr_t H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_cleaned_entry(const H5AC_info_t *entry_ptr); -H5_DLL herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, unsigned flags); +H5_DLL herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, bool was_dirty, unsigned flags); H5_DLL herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC__flush_entries(H5F_t *f); diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 5ea159e..010fdc7 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -76,11 +76,11 @@ typedef enum { H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; -/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when - * H5C_COLLECT_CACHE_STATS is FALSE. +/* H5AC_DUMP_STATS_ON_CLOSE should always be false when + * H5C_COLLECT_CACHE_STATS is false. * - * When H5C_COLLECT_CACHE_STATS is TRUE, H5AC_DUMP_STATS_ON_CLOSE must - * be FALSE for "make check" to succeed, but may be set to TRUE at other + * When H5C_COLLECT_CACHE_STATS is true, H5AC_DUMP_STATS_ON_CLOSE must + * be false for "make check" to succeed, but may be set to true at other * times for debugging purposes. * * Hence the following, somewhat odd set of #defines. @@ -224,12 +224,12 @@ typedef struct H5AC_proxy_entry_t { #define H5AC__DEFAULT_CACHE_CONFIG \ { \ /* int version = */ H5AC__CURR_CACHE_CONFIG_VERSION, \ - /* hbool_t rpt_fcn_enabled = */ FALSE, \ - /* hbool_t open_trace_file = */ FALSE, \ - /* hbool_t close_trace_file = */ FALSE, \ + /* bool rpt_fcn_enabled = */ false, \ + /* bool open_trace_file = */ false, \ + /* bool close_trace_file = */ false, \ /* char trace_file_name[] = */ "", \ - /* hbool_t evictions_enabled = */ TRUE, \ - /* hbool_t set_initial_size = */ TRUE, \ + /* bool evictions_enabled = */ true, \ + /* bool set_initial_size = */ true, \ /* size_t initial_size = */ ( 2 * 1024 * 1024), \ /* double min_clean_fraction = */ 0.3, \ /* size_t max_size = */ (32 * 1024 * 1024), \ @@ -238,7 +238,7 @@ typedef struct H5AC_proxy_entry_t { /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \ /* double lower_hr_threshold = */ 0.9, \ /* double increment = */ 2.0, \ - /* hbool_t apply_max_increment = */ TRUE, \ + /* bool apply_max_increment = */ true, \ /* size_t max_increment = */ (4 * 1024 * 1024), \ /* enum H5C_cache_flash_incr_mode */ \ /* flash_incr_mode = */ H5C_flash_incr__add_space, \ @@ -247,10 +247,10 @@ typedef struct H5AC_proxy_entry_t { /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, \ /* double upper_hr_threshold = */ 0.999, \ /* double decrement = */ 0.9, \ - /* hbool_t apply_max_decrement = */ TRUE, \ + /* bool apply_max_decrement = */ true, \ /* size_t max_decrement = */ (1 * 1024 * 1024), \ /* int epochs_before_eviction = */ 3, \ - /* hbool_t apply_empty_reserve = */ TRUE, \ + /* bool apply_empty_reserve = */ true, \ /* double empty_reserve = */ 0.1, \ /* size_t dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ @@ -260,12 +260,12 @@ typedef struct H5AC_proxy_entry_t { #define H5AC__DEFAULT_CACHE_CONFIG \ { \ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, \ - /* hbool_t rpt_fcn_enabled = */ FALSE, \ - /* hbool_t open_trace_file = */ FALSE, \ - /* hbool_t close_trace_file = */ FALSE, \ + /* bool rpt_fcn_enabled = */ false, \ + /* bool open_trace_file = */ false, \ + /* bool close_trace_file = */ false, \ /* char trace_file_name[] = */ "", \ - /* hbool_t evictions_enabled = */ TRUE, \ - /* hbool_t set_initial_size = */ TRUE, \ + /* bool evictions_enabled = */ true, \ + /* bool set_initial_size = */ true, \ /* size_t initial_size = */ ( 2 * 1024 * 1024), \ /* double min_clean_fraction = */ 0.01, \ /* size_t max_size = */ (32 * 1024 * 1024), \ @@ -274,7 +274,7 @@ typedef struct H5AC_proxy_entry_t { /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \ /* double lower_hr_threshold = */ 0.9, \ /* double increment = */ 2.0, \ - /* hbool_t apply_max_increment = */ TRUE, \ + /* bool apply_max_increment = */ true, \ /* size_t max_increment = */ (4 * 1024 * 1024), \ /* enum H5C_cache_flash_incr_mode */ \ /* flash_incr_mode = */ H5C_flash_incr__add_space, \ @@ -283,10 +283,10 @@ typedef struct H5AC_proxy_entry_t { /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\ /* double upper_hr_threshold = */ 0.999, \ /* double decrement = */ 0.9, \ - /* hbool_t apply_max_decrement = */ TRUE, \ + /* bool apply_max_decrement = */ true, \ /* size_t max_decrement = */ (1 * 1024 * 1024), \ /* int epochs_before_eviction = */ 3, \ - /* hbool_t apply_empty_reserve = */ TRUE, \ + /* bool apply_empty_reserve = */ true, \ /* double empty_reserve = */ 0.1, \ /* size_t dirty_bytes_threshold = */ (256 * 1024), \ /* int metadata_write_strategy = */ \ @@ -297,8 +297,8 @@ typedef struct H5AC_proxy_entry_t { #define H5AC__DEFAULT_CACHE_IMAGE_CONFIG \ { \ /* int32_t version = */ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, \ - /* hbool_t generate_image = */ FALSE, \ - /* hbool_t save_resize_status = */ FALSE, \ + /* bool generate_image = */ false, \ + /* bool save_resize_status = */ false, \ /* int32_t entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE \ } /* clang-format on */ @@ -403,26 +403,26 @@ H5_DLL herr_t H5AC_remove_entry(void *entry); H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_cache_size(const H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr); -H5_DLL herr_t H5AC_get_cache_flush_in_progress(H5AC_t *cache_ptr, hbool_t *flush_in_progress_ptr); +H5_DLL herr_t H5AC_get_cache_flush_in_progress(H5AC_t *cache_ptr, bool *flush_in_progress_ptr); H5_DLL herr_t H5AC_get_cache_hit_rate(const H5AC_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, const H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_validate_config(const H5AC_cache_config_t *config_ptr); /* Cache image routines */ -H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); -H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); -H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f); -H5_DLL herr_t H5AC_force_cache_image_load(H5F_t *f); -H5_DLL herr_t H5AC_get_mdc_image_info(const H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); +H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, bool rw); +H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); +H5_DLL bool H5AC_cache_image_pending(const H5F_t *f); +H5_DLL herr_t H5AC_force_cache_image_load(H5F_t *f); +H5_DLL herr_t H5AC_get_mdc_image_info(const H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); /* Tag & Ring routines */ H5_DLL void H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag); H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag); -H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global); +H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, bool match_global); H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag); H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f); -H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked); +H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, bool *corked); H5_DLL herr_t H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring); H5_DLL void H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring); H5_DLL herr_t H5AC_unsettle_entry_ring(void *entry); @@ -445,14 +445,14 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t *cache_ptr, haddr_t addr); /* Debugging functions */ H5_DLL herr_t H5AC_stats(const H5F_t *f); #ifndef NDEBUG -H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); -H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr); -H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, - hbool_t *fd_exists_ptr); -H5_DLL 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); -H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); -H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); +H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); +H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr); +H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, + bool *fd_exists_ptr); +H5_DLL herr_t 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); +H5_DLL bool H5AC_get_serialization_in_progress(H5F_t *f); +H5_DLL bool H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); #endif /* NDEBUG */ /* end debugging functions */ #endif /* H5ACprivate_H */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 532cc80..71292b6 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -70,13 +70,13 @@ * * The trace file is a debugging feature that allow the capture of * top level metadata cache requests for purposes of debugging and/or - * optimization. This field should normally be set to FALSE, as + * optimization. This field should normally be set to false, as * trace file collection imposes considerable overhead. * - * This field should only be set to TRUE when the trace_file_name + * This field should only be set to true when the trace_file_name * contains the full path of the desired trace file, and either * there is no open trace file on the cache, or the close_trace_file - * field is also TRUE. + * field is also true. * * close_trace_file: Boolean field indicating whether the current trace * file (if any) should be closed. @@ -84,11 +84,11 @@ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * * See the above comments on the open_trace_file field. This field - * should be set to FALSE unless there is an open trace file on the + * should be set to false unless there is an open trace file on the * cache that you wish to close. * * trace_file_name: Full path of the trace file to be opened if the - * open_trace_file field is TRUE. + * open_trace_file field is true. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * @@ -120,7 +120,7 @@ * * set_initial_size: Boolean flag indicating whether the size of the * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the + * the initial_size field. If set_initial_size is false, the * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index a25cd34..d8f0e2f 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -143,8 +143,8 @@ H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5A_fh_ud_cmp_t *udata = (H5A_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5A_t *attr = NULL; /* Pointer to attribute created from heap object */ - hbool_t took_ownership = FALSE; /* Whether the "found" operator took ownership of the attribute */ - herr_t ret_value = SUCCEED; /* Return value */ + bool took_ownership = false; /* Whether the "found" operator took ownership of the attribute */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Adense.c b/src/H5Adense.c index d96fd75..4b1a43c 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -263,7 +263,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) +H5A__dense_fnd_cb(const H5A_t *attr, bool *took_ownership, void *_user_attr) { const H5A_t **user_attr = (const H5A_t **)_user_attr; /* User data from v2 B-tree attribute lookup */ herr_t ret_value = SUCCEED; /* Return value */ @@ -303,7 +303,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) /* Take over attribute ownership */ *user_attr = attr; - *took_ownership = TRUE; + *took_ownership = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -326,7 +326,7 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t attr_sharable; /* Flag indicating attributes are shareable */ - hbool_t attr_exists; /* Attribute exists in v2 B-tree */ + bool attr_exists; /* Attribute exists in v2 B-tree */ H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -376,10 +376,10 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - attr_exists = FALSE; + attr_exists = false; if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index"); - if (attr_exists == FALSE) + if (attr_exists == false) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index"); done: @@ -477,7 +477,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) size_t attr_size; /* Size of serialized attribute in the heap */ /* Find out the size of buffer needed for serialized message */ - if ((attr_size = H5O_msg_raw_size(f, H5O_ATTR_ID, FALSE, attr)) == 0) + if ((attr_size = H5O_msg_raw_size(f, H5O_ATTR_ID, false, attr)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get message size"); /* Wrap the local buffer for serialized attributes */ @@ -489,7 +489,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't get actual buffer"); /* Create serialized form of attribute or shared message */ - if (H5O_msg_encode(f, H5O_ATTR_ID, FALSE, (unsigned char *)attr_ptr, attr) < 0) + if (H5O_msg_encode(f, H5O_ATTR_ID, false, (unsigned char *)attr_ptr, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute"); /* Insert the serialized attribute into the fractal heap */ @@ -557,7 +557,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) +H5A__dense_write_bt2_cb2(void *_record, void *_op_data, bool *changed) { H5A_dense_bt2_corder_rec_t *record = (H5A_dense_bt2_corder_rec_t *)_record; /* Record from B-tree */ H5O_fheap_id_t *new_heap_id = (H5O_fheap_id_t *)_op_data; /* "op data" from v2 B-tree modify */ @@ -572,7 +572,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) record->id = *new_heap_id; /* Note that the record changed */ - *changed = TRUE; + *changed = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5A__dense_write_bt2_cb2() */ @@ -587,7 +587,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) *------------------------------------------------------------------------- */ static herr_t -H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) +H5A__dense_write_bt2_cb(void *_record, void *_op_data, bool *changed) { H5A_dense_bt2_name_rec_t *record = (H5A_dense_bt2_name_rec_t *)_record; /* Record from B-tree */ H5A_bt2_od_wrt_t *op_data = (H5A_bt2_od_wrt_t *)_op_data; /* "op data" from v2 B-tree modify */ @@ -638,14 +638,14 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) } /* end if */ /* Note that the record changed */ - *changed = TRUE; + *changed = true; } /* end if */ else { void *attr_ptr; /* Pointer to serialized message */ size_t attr_size; /* Size of serialized attribute in the heap */ /* Find out the size of buffer needed for serialized attribute */ - if ((attr_size = H5O_msg_raw_size(op_data->f, H5O_ATTR_ID, FALSE, op_data->attr)) == 0) + if ((attr_size = H5O_msg_raw_size(op_data->f, H5O_ATTR_ID, false, op_data->attr)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get attribute size"); /* Wrap the local buffer for serialized attributes */ @@ -657,7 +657,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't get actual buffer"); /* Create serialized form of attribute */ - if (H5O_msg_encode(op_data->f, H5O_ATTR_ID, FALSE, (unsigned char *)attr_ptr, op_data->attr) < 0) + if (H5O_msg_encode(op_data->f, H5O_ATTR_ID, false, (unsigned char *)attr_ptr, op_data->attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute"); /* Sanity check */ @@ -837,7 +837,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons H5A_t *attr_copy = NULL; /* Copy of attribute to rename */ htri_t attr_sharable; /* Flag indicating attributes are shareable */ htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ - hbool_t attr_exists; /* Attribute exists in v2 B-tree */ + bool attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -888,10 +888,10 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - attr_exists = FALSE; + attr_exists = false; if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index"); - if (attr_exists == FALSE) + if (attr_exists == false) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index"); assert(attr_copy); @@ -914,7 +914,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Need to remove the attribute from the creation order index v2 B-tree */ if (ainfo->index_corder) { - hbool_t corder_attr_exists; /* Attribute exists in v2 B-tree */ + bool corder_attr_exists; /* Attribute exists in v2 B-tree */ /* Open the creation order index v2 B-tree */ assert(H5_addr_defined(ainfo->corder_bt2_addr)); @@ -924,7 +924,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Set up the creation order to search for */ udata.corder = attr_copy->shared->crt_idx; - corder_attr_exists = FALSE; + corder_attr_exists = false; if (H5B2_find(bt2_corder, &udata, &corder_attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index"); @@ -1380,8 +1380,8 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) H5A_bt2_ud_rmbi_t *bt2_udata = (H5A_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */ H5A_fh_ud_cp_t fh_udata; /* User data for fractal heap 'op' callback */ H5O_shared_t sh_loc; /* Shared message info for attribute */ - hbool_t use_sh_loc; /* Whether to use the attribute's shared location or the separate one */ - herr_t ret_value = SUCCEED; /* Return value */ + bool use_sh_loc; /* Whether to use the attribute's shared location or the separate one */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1404,14 +1404,14 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) assert(fh_udata.attr); /* Use the attribute's shared location */ - use_sh_loc = FALSE; + use_sh_loc = false; } /* end if */ else { /* Create a shared message location from the heap ID for this record */ H5SM_reconstitute(&sh_loc, bt2_udata->f, H5O_ATTR_ID, record->id); /* Use the separate shared location */ - use_sh_loc = TRUE; + use_sh_loc = true; } /* end else */ /* Check for removing the link from the "other" index (creation order, when name used and vice versa) */ @@ -1618,7 +1618,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, hbool_t *attr_exists) +H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, bool *attr_exists) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index e8fd3ea..7ff2b06 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -140,7 +140,7 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute"); /* Register the new attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID"); done: @@ -205,7 +205,7 @@ H5Aopen_name(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute"); /* Register the attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute handle"); done: @@ -273,7 +273,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute"); /* Register the attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute handle"); done: diff --git a/src/H5Aint.c b/src/H5Aint.c index b68be48..f9f74c3 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -53,7 +53,7 @@ typedef struct { H5F_t *f; /* Pointer to file that fractal heap is in */ H5A_attr_table_t *atable; /* Pointer to attribute table to build */ size_t curr_attr; /* Current attribute to operate on */ - hbool_t bogus_crt_idx; /* Whether bogus creation index values need to be set */ + bool bogus_crt_idx; /* Whether bogus creation index values need to be set */ } H5A_compact_bt_ud_t; /* Data exchange structure to use when building table of dense attributes for an object */ @@ -66,7 +66,7 @@ typedef struct { typedef struct { const H5O_ainfo_t *ainfo; /* dense information */ H5F_t *file; /* file */ - hbool_t *recompute_size; /* Flag to indicate if size changed */ + bool *recompute_size; /* Flag to indicate if size changed */ H5O_copy_t *cpy_info; /* Information on copying options */ const H5O_loc_t *oloc_src; H5O_loc_t *oloc_dst; @@ -186,7 +186,7 @@ H5A_top_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_ATTR) > 0) { - (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); + (void)H5I_clear_type(H5I_ATTR, false, false); n++; /*H5I*/ } /* end if */ @@ -243,7 +243,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons H5A_t *attr = NULL; /* Attribute created */ hssize_t snelmts; /* elements in attribute */ size_t nelmts; /* elements in attribute */ - hbool_t exists; /* Whether attribute exists */ + bool exists; /* Whether attribute exists */ H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE_TAG(loc->oloc->addr) @@ -259,7 +259,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons * name, but it's going to be hard to unwind all the special cases on * failure, so just check first, for now - QAK) */ - exists = FALSE; + exists = false; if (H5O__attr_exists(loc->oloc, attr_name, &exists) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "error checking attributes"); if (exists) @@ -270,7 +270,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, NULL, "dataspace extent has not been set"); /* Check if the datatype is "sensible" for use in a dataset */ - if (H5T_is_sensible(type) != TRUE) + if (H5T_is_sensible(type) != true) HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, NULL, "datatype is not sensible"); /* Build the attribute information */ @@ -316,7 +316,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set version of datatype"); /* Copy the dataspace for the attribute */ - attr->shared->ds = H5S_copy(space, FALSE, TRUE); + attr->shared->ds = H5S_copy(space, false, true); /* Set the version for dataspace */ if (H5S_set_version(loc->oloc->file, attr->shared->ds) < 0) @@ -351,8 +351,8 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons * datatype and dataspace messages themselves, or the size of the "shared" * messages if either or both of them are shared. */ - attr->shared->dt_size = H5O_msg_raw_size(attr->oloc.file, H5O_DTYPE_ID, FALSE, attr->shared->dt); - attr->shared->ds_size = H5O_msg_raw_size(attr->oloc.file, H5O_SDSPACE_ID, FALSE, attr->shared->ds); + attr->shared->dt_size = H5O_msg_raw_size(attr->oloc.file, H5O_DTYPE_ID, false, attr->shared->dt); + attr->shared->ds_size = H5O_msg_raw_size(attr->oloc.file, H5O_SDSPACE_ID, false, attr->shared->ds); /* Get # of elements for attribute's dataspace */ if ((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) @@ -366,7 +366,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons /* Hold the symbol table entry (and file) open */ if (H5O_open(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open"); - attr->obj_opened = TRUE; + attr->obj_opened = true; /* Set the version to encode the attribute with */ if (H5A__set_version(attr->oloc.file, attr) < 0) @@ -403,7 +403,7 @@ H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ @@ -422,7 +422,7 @@ H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Go do the real work for attaching the attribute to the object */ if (NULL == (attr = H5A__create(&obj_loc, attr_name, type, space, acpl_id))) @@ -490,7 +490,7 @@ H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) /* Hold the symbol table entry (and file) open */ if (H5O_open(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open"); - attr->obj_opened = TRUE; + attr->obj_opened = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -554,7 +554,7 @@ H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ @@ -572,7 +572,7 @@ H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Read in attribute from object header */ if (NULL == (attr = H5O__attr_open_by_idx(obj_loc.oloc, idx_type, order, n))) @@ -613,7 +613,7 @@ H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_n H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ @@ -632,7 +632,7 @@ H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_n /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Read in attribute from object header */ if (NULL == (attr = H5O__attr_open_by_name(obj_loc.oloc, attr_name))) @@ -722,9 +722,9 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) if (!H5T_path_noop(tpath)) { H5T_bkg_t need_bkg; /* Background buffer type */ - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), false)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); /* Get the maximum buffer size needed and allocate it */ @@ -840,8 +840,8 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) if (!H5T_path_noop(tpath)) { H5T_bkg_t need_bkg; /* Background buffer type */ - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), false)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); /* Get the maximum buffer size needed and allocate it */ @@ -853,7 +853,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) H5MM_memcpy(tconv_buf, buf, (src_type_size * nelmts)); /* Check if we need a background buffer */ - if (H5T_detect_class(attr->shared->dt, H5T_VLEN, FALSE)) + if (H5T_detect_class(attr->shared->dt, H5T_VLEN, false)) need_bkg = H5T_BKG_YES; else need_bkg = H5T_path_bkg(tpath); @@ -988,11 +988,11 @@ H5A_get_space(H5A_t *attr) assert(attr); /* Copy the attribute's dataspace */ - if (NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE))) + if (NULL == (ds = H5S_copy(attr->shared->ds, false, true))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, ds, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: @@ -1038,7 +1038,7 @@ H5A__get_type(H5A_t *attr) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "invalid datatype location"); /* Lock copied type */ - if (H5T_lock(dt, FALSE) < 0) + if (H5T_lock(dt, false) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to lock transient datatype"); /* Register */ @@ -1047,11 +1047,11 @@ H5A__get_type(H5A_t *attr) * two level IDs, where the VOL object is a copy of the * returned datatype */ - if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); } else { - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype"); } @@ -1090,7 +1090,7 @@ H5A__get_create_plist(H5A_t *attr) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get default ACPL"); /* Create the property list object to return */ - if ((new_plist_id = H5P_copy_plist(plist, TRUE)) < 0) + if ((new_plist_id = H5P_copy_plist(plist, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties"); if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_plist_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); @@ -1130,11 +1130,11 @@ H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) ainfo->cset = attr->shared->encoding; ainfo->data_size = attr->shared->data_size; if (attr->shared->crt_idx == H5O_MAX_CRT_ORDER_IDX) { - ainfo->corder_valid = FALSE; + ainfo->corder_valid = false; ainfo->corder = 0; } /* end if */ else { - ainfo->corder_valid = TRUE; + ainfo->corder_valid = true; ainfo->corder = attr->shared->crt_idx; } /* end else */ @@ -1154,9 +1154,9 @@ H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) H5A_t * H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) { - H5A_t *new_attr = NULL; - hbool_t allocated_attr = FALSE; /* Whether the attribute was allocated */ - H5A_t *ret_value = NULL; /* Return value */ + H5A_t *new_attr = NULL; + bool allocated_attr = false; /* Whether the attribute was allocated */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1167,7 +1167,7 @@ H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) if (_new_attr == NULL) { if (NULL == (new_attr = H5FL_CALLOC(H5A_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - allocated_attr = TRUE; + allocated_attr = true; } /* end if */ else new_attr = _new_attr; @@ -1186,7 +1186,7 @@ H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) new_attr->shared->nrefs++; /* Don't open the object header for a copy */ - new_attr->obj_opened = FALSE; + new_attr->obj_opened = false; /* Set the return value */ ret_value = new_attr; @@ -1409,17 +1409,17 @@ H5A_type(const H5A_t *attr) * * Purpose: Private version of H5Aexists_by_name * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ herr_t -H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, hbool_t *attr_exists) +H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, bool *attr_exists) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1437,7 +1437,7 @@ H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, /* Find the object's location */ if (H5G_loc_find(&loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Check if the attribute exists */ if (H5O__attr_exists(obj_loc.oloc, attr_name, attr_exists) < 0) @@ -1539,8 +1539,8 @@ H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, H5_iter_order udata.atable = atable; udata.curr_attr = 0; udata.bogus_crt_idx = - (hbool_t)((oh->version == H5O_VERSION_1 || !(oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) ? TRUE - : FALSE); + (bool)((oh->version == H5O_VERSION_1 || !(oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) ? true + : false); /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; @@ -1947,7 +1947,7 @@ done: * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -2013,10 +2013,9 @@ done: herr_t H5A__set_version(const H5F_t *f, H5A_t *attr) { - hbool_t type_shared, - space_shared; /* Flags to indicate that shared messages are used for this attribute */ - uint8_t version; /* Message version */ - herr_t ret_value = SUCCEED; /* Return value */ + bool type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ + uint8_t version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2026,14 +2025,14 @@ H5A__set_version(const H5F_t *f, H5A_t *attr) /* Check whether datatype and dataspace are shared */ if (H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt) > 0) - type_shared = TRUE; + type_shared = true; else - type_shared = FALSE; + type_shared = false; if (H5O_msg_is_shared(H5O_SDSPACE_ID, attr->shared->ds) > 0) - space_shared = TRUE; + space_shared = true; else - space_shared = FALSE; + space_shared = false; /* Check which version to encode attribute with */ if (attr->shared->encoding != H5T_CSET_ASCII) @@ -2076,7 +2075,7 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, +H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size, H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info) { H5A_t *attr_dst = NULL; /* Destination attribute */ @@ -2113,7 +2112,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Don't have an opened group location for copy */ H5O_loc_reset(&(attr_dst->oloc)); H5G_name_reset(&(attr_dst->path)); - attr_dst->obj_opened = FALSE; + attr_dst->obj_opened = false; /* Reference count for the header message in the cache */ attr_dst->shared->nrefs = 1; @@ -2144,7 +2143,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Copy the dataspace for the attribute. Make sure the maximal dimension is also copied. * Otherwise the comparison in the test may complain about it. SLU 2011/4/12 */ - attr_dst->shared->ds = H5S_copy(attr_src->shared->ds, FALSE, TRUE); + attr_dst->shared->ds = H5S_copy(attr_src->shared->ds, false, true); assert(attr_dst->shared->ds); /* Reset the dataspace's sharing in the source file before trying to share @@ -2165,16 +2164,16 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Compute the sizes of the datatype and dataspace. This is their raw * size unless they're shared. */ - attr_dst->shared->dt_size = H5O_msg_raw_size(file_dst, H5O_DTYPE_ID, FALSE, attr_dst->shared->dt); + attr_dst->shared->dt_size = H5O_msg_raw_size(file_dst, H5O_DTYPE_ID, false, attr_dst->shared->dt); assert(attr_dst->shared->dt_size > 0); - attr_dst->shared->ds_size = H5O_msg_raw_size(file_dst, H5O_SDSPACE_ID, FALSE, attr_dst->shared->ds); + attr_dst->shared->ds_size = H5O_msg_raw_size(file_dst, H5O_SDSPACE_ID, false, attr_dst->shared->ds); assert(attr_dst->shared->ds_size > 0); /* Check whether to recompute the size of the attribute */ /* (happens when the datatype or dataspace changes sharing status) */ if (attr_dst->shared->dt_size != attr_src->shared->dt_size || attr_dst->shared->ds_size != attr_src->shared->ds_size) - *recompute_size = TRUE; + *recompute_size = true; /* Get # of elements for destination attribute's dataspace */ if ((sdst_nelmts = H5S_GET_EXTENT_NPOINTS(attr_dst->shared->ds)) < 0) @@ -2194,7 +2193,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Check if we need to convert data */ - if (H5T_detect_class(attr_src->shared->dt, H5T_VLEN, FALSE) > 0) { + if (H5T_detect_class(attr_src->shared->dt, H5T_VLEN, false) > 0) { H5T_path_t *tpath_src_mem, *tpath_mem_dst; /* Datatype conversion paths */ H5T_t *dt_mem; /* Memory datatype */ size_t src_dt_size; /* Source datatype size */ @@ -2206,17 +2205,17 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s size_t buf_size; /* Size of copy buffer */ /* Create datatype ID for src datatype */ - if ((tid_src = H5I_register(H5I_DATATYPE, attr_src->shared->dt, FALSE)) < 0) + if ((tid_src = H5I_register(H5I_DATATYPE, attr_src->shared->dt, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source file datatype"); /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(attr_src->shared->dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) + if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register memory datatype"); /* create variable-length datatype at the destination file */ - if ((tid_dst = H5I_register(H5I_DATATYPE, attr_dst->shared->dt, FALSE)) < 0) + if ((tid_dst = H5I_register(H5I_DATATYPE, attr_dst->shared->dt, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination file datatype"); @@ -2253,7 +2252,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace"); /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { + if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, NULL, "unable to register dataspace ID"); } /* end if */ @@ -2307,7 +2306,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Recompute the destination attribute's size, if it's a different version */ if (attr_src->shared->version != attr_dst->shared->version) - *recompute_size = TRUE; + *recompute_size = true; /* Set return value */ ret_value = attr_dst; @@ -2390,7 +2389,7 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l dst_oloc_dt->file = file_dst; /* Copy the shared object from source to destination */ - if (H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, cpy_info, FALSE, NULL, NULL) < 0) + if (H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, cpy_info, false, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object"); /* Update shared message info from named datatype info */ @@ -2408,7 +2407,7 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l /* Only need to fix reference attribute with real data being copied to * another file. */ - if ((NULL != attr_dst->shared->data) && (H5T_get_class(attr_dst->shared->dt, FALSE) == H5T_REFERENCE)) { + if ((NULL != attr_dst->shared->data) && (H5T_get_class(attr_dst->shared->dt, false) == H5T_REFERENCE)) { /* copy object pointed by reference. The current implementation does not * deal with nested reference such as reference in a compound structure @@ -2500,7 +2499,7 @@ H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainf { H5A_dense_file_cp_ud_t udata; /* User data for iteration callback */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hbool_t recompute_size = FALSE; /* recompute the size */ + bool recompute_size = false; /* recompute the size */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2542,7 +2541,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2557,7 +2556,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na /* Find the object's location */ if (H5G_loc_find(&loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Call attribute rename routine */ if (H5O__attr_rename(obj_loc.oloc, old_attr_name, new_attr_name) < 0) @@ -2619,7 +2618,7 @@ H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5 H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ hid_t obj_loc_id = H5I_INVALID_HID; /* ID for object located */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ void *temp_obj = NULL; @@ -2640,14 +2639,14 @@ H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5 /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Open the object */ if (NULL == (temp_obj = H5O_open_by_loc(&obj_loc, &obj_type))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object"); /* Get an ID for the object */ - if ((obj_loc_id = H5VL_wrap_register(obj_type, temp_obj, TRUE)) < 0) + if ((obj_loc_id = H5VL_wrap_register(obj_type, temp_obj, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype"); /* Call internal attribute iteration routine */ @@ -2721,7 +2720,7 @@ H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2734,7 +2733,7 @@ H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Delete the attribute from the location */ if (H5O__attr_remove(obj_loc.oloc, attr_name) < 0) @@ -2764,7 +2763,7 @@ H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_ty H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + bool loc_found = false; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2777,7 +2776,7 @@ H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_ty /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Delete the attribute from the location */ if (H5O__attr_remove_by_idx(obj_loc.oloc, idx_type, order, n) < 0) diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 3a5c411..64549c8 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -87,7 +87,7 @@ typedef struct H5A_shared_t { struct H5A_t { H5O_shared_t sh_loc; /* Shared message info (must be first) */ H5O_loc_t oloc; /* Object location for object attribute is on */ - hbool_t obj_opened; /* Object header entry opened? */ + bool obj_opened; /* Object header entry opened? */ H5G_name_t path; /* Group hierarchy path */ H5A_shared_t *shared; /* Shared attribute information */ }; @@ -113,7 +113,7 @@ typedef struct H5A_dense_bt2_corder_rec_t { } H5A_dense_bt2_corder_rec_t; /* Define the 'found' callback function pointer for matching an attribute record in a v2 B-tree */ -typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, void *op_data); +typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, bool *took_ownership, void *op_data); /* * Common data exchange structure for dense attribute storage. This structure @@ -200,7 +200,7 @@ H5_DLL herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, co H5_DLL herr_t H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, - hbool_t *attr_exists); + bool *attr_exists); H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf); H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf); H5_DLL herr_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf, size_t *attr_name_len); @@ -218,7 +218,7 @@ H5_DLL herr_t H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainf H5_DLL herr_t H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name); H5_DLL herr_t H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, hbool_t *attr_exists); +H5_DLL herr_t H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, bool *attr_exists); H5_DLL herr_t H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo); /* Attribute table operations */ @@ -243,8 +243,8 @@ H5_DLL herr_t H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name); H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists); -H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, +H5_DLL herr_t H5O__attr_exists(const H5O_loc_t *loc, const char *name, bool *attr_exists); +H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size, H5O_copy_t *cpy_info); H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, H5O_copy_t *cpy_info); diff --git a/src/H5Atest.c b/src/H5Atest.c index f66377d..1d18b44 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -71,7 +71,7 @@ * * Purpose: Check if an attribute is shared * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -106,9 +106,9 @@ done: herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { - H5A_t *attr; /* Attribute object for ID */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - herr_t ret_value = SUCCEED; /* Return value */ + H5A_t *attr; /* Attribute object for ID */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -119,7 +119,7 @@ H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) /* Push API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Sanity check */ assert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); @@ -129,7 +129,7 @@ H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count"); done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B.c b/src/H5B.c index ad53043..9d89218 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -142,8 +142,8 @@ typedef struct H5B_ins_ud_t { /* Local Prototypes */ /********************/ static H5B_ins_t H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, - hbool_t *lt_key_changed, uint8_t *md_key, void *udata, uint8_t *rt_key, - hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud /*out*/); + bool *lt_key_changed, uint8_t *md_key, void *udata, uint8_t *rt_key, + bool *rt_key_changed, H5B_ins_ud_t *split_bt_ud /*out*/); static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key); static herr_t H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, @@ -268,14 +268,14 @@ done: * pointers since it assumes that all nodes can be reached * from the parent node. * - * Return: Non-negative (TRUE/FALSE) on success (if found, values returned + * Return: Non-negative (true/false) on success (if found, values returned * through the UDATA argument). Negative on failure (if not found, * UDATA is undefined). * *------------------------------------------------------------------------- */ herr_t -H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, hbool_t *found, void *udata) +H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, bool *found, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -325,7 +325,7 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, hbool_t *found, void * /* Check if not found */ if (cmp) - *found = FALSE; + *found = false; else { /* * Follow the link to the subtree or to the data node. @@ -527,7 +527,7 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) uint8_t *md_key = (uint8_t *)_md_key; uint8_t *rt_key = (uint8_t *)_rt_key; - hbool_t lt_key_changed = FALSE, rt_key_changed = FALSE; + bool lt_key_changed = false, rt_key_changed = false; haddr_t old_root_addr = HADDR_UNDEF; unsigned level; H5B_ins_ud_t bt_ud = H5B_INS_UD_T_NULL; /* (Old) root node */ @@ -752,8 +752,8 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5 */ static H5B_ins_t H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, - hbool_t *lt_key_changed, uint8_t *md_key, void *udata, uint8_t *rt_key, - hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud /*out*/) + bool *lt_key_changed, uint8_t *md_key, void *udata, uint8_t *rt_key, bool *rt_key_changed, + H5B_ins_ud_t *split_bt_ud /*out*/) { H5B_t *bt; /* Convenience pointer to B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -790,8 +790,8 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 bt = bt_ud->bt; - *lt_key_changed = FALSE; - *rt_key_changed = FALSE; + *lt_key_changed = false; + *rt_key_changed = false; /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) @@ -880,7 +880,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if ((type->new_node)(f, H5B_INS_LEFT, H5B_NKEY(bt, shared, idx), udata, md_key, &new_child_bt_ud.addr /*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node"); - *lt_key_changed = TRUE; + *lt_key_changed = true; } /* end else */ #ifdef H5_STRICT_FORMAT_CHECKS @@ -932,7 +932,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if ((type->new_node)(f, H5B_INS_RIGHT, md_key, udata, H5B_NKEY(bt, shared, idx + 1), &new_child_bt_ud.addr /*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node"); - *rt_key_changed = TRUE; + *rt_key_changed = true; } /* end else */ #ifdef H5_STRICT_FORMAT_CHECKS @@ -988,7 +988,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (idx > 0) { assert(type->critical_key == H5B_LEFT); assert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); - *lt_key_changed = FALSE; + *lt_key_changed = false; } /* end if */ else H5MM_memcpy(lt_key, H5B_NKEY(bt, shared, idx), type->sizeof_nkey); @@ -998,7 +998,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (idx + 1 < bt->nchildren) { assert(type->critical_key == H5B_RIGHT); assert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); - *rt_key_changed = FALSE; + *rt_key_changed = false; } /* end if */ else H5MM_memcpy(rt_key, H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey); @@ -1196,8 +1196,8 @@ H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, */ static H5B_ins_t H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, uint8_t *lt_key /*out*/, - hbool_t *lt_key_changed /*out*/, void *udata, uint8_t *rt_key /*out*/, - hbool_t *rt_key_changed /*out*/) + bool *lt_key_changed /*out*/, void *udata, uint8_t *rt_key /*out*/, + bool *rt_key_changed /*out*/) { H5B_t *bt = NULL, *sibling = NULL; unsigned bt_flags = H5AC__NO_FLAGS_SET; @@ -1276,8 +1276,8 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u * method. The best we can do is to leave the object alone but * remove the B-tree reference to the object. */ - *lt_key_changed = FALSE; - *rt_key_changed = FALSE; + *lt_key_changed = false; + *rt_key_changed = false; ret_value = H5B_INS_REMOVE; } @@ -1295,7 +1295,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u if (idx > 0) /* Don't propagate change out of this B-tree node */ - *lt_key_changed = FALSE; + *lt_key_changed = false; else H5MM_memcpy(lt_key, H5B_NKEY(bt, shared, idx), type->sizeof_nkey); } /* end if */ @@ -1304,7 +1304,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u bt_flags |= H5AC__DIRTIED_FLAG; if (idx + 1 < bt->nchildren) /* Don't propagate change out of this B-tree node */ - *rt_key_changed = FALSE; + *rt_key_changed = false; else H5MM_memcpy(rt_key, H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey); } /* end if */ @@ -1407,7 +1407,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u /* Slide all keys down 1, update lt_key */ memmove(H5B_NKEY(bt, shared, 0), H5B_NKEY(bt, shared, 1), bt->nchildren * type->sizeof_nkey); H5MM_memcpy(lt_key, H5B_NKEY(bt, shared, 0), type->sizeof_nkey); - *lt_key_changed = TRUE; + *lt_key_changed = true; } else /* Slide all but the leftmost 2 keys down, leaving the leftmost @@ -1436,7 +1436,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u else { /* Just update rt_key */ H5MM_memcpy(rt_key, H5B_NKEY(bt, shared, bt->nchildren - 1), type->sizeof_nkey); - *rt_key_changed = TRUE; + *rt_key_changed = true; } /* end else */ bt->nchildren -= 1; @@ -1527,8 +1527,8 @@ H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) uint64_t _lt_key[128], _rt_key[128]; uint8_t *lt_key = (uint8_t *)_lt_key; /*left key*/ uint8_t *rt_key = (uint8_t *)_rt_key; /*right key*/ - hbool_t lt_key_changed = FALSE; /*left key changed?*/ - hbool_t rt_key_changed = FALSE; /*right key changed?*/ + bool lt_key_changed = false; /*left key changed?*/ + bool rt_key_changed = false; /*right key changed?*/ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1600,7 +1600,7 @@ H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) } /* end if */ else { - hbool_t lt_key_changed, rt_key_changed; /* Whether key changed (unused here, just for callback) */ + bool lt_key_changed, rt_key_changed; /* Whether key changed (unused here, just for callback) */ /* Check for removal callback */ if (type->remove) { diff --git a/src/H5B2.c b/src/H5B2.c index 152a2d5..7f59ac8 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -418,7 +418,7 @@ H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) * OP_DATA pointer, to allow caller to return information about * the record. * - * If 'OP' is NULL, then this routine just returns "TRUE" when + * If 'OP' is NULL, then this routine just returns true when * a record is present in the B-tree. * * Return: SUCCEED/FAIL @@ -426,7 +426,7 @@ H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) *------------------------------------------------------------------------- */ herr_t -H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_data) +H5B2_find(H5B2_t *bt2, void *udata, bool *found, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -454,7 +454,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da /* Check for empty tree */ if (curr_node_ptr.node_nrec == 0) { - *found = FALSE; + *found = false; HGOTO_DONE(SUCCEED); } @@ -465,14 +465,14 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da if ((hdr->cls->compare)(udata, hdr->min_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records"); if (cmp < 0) { - *found = FALSE; /* Less than the least record--not found */ + *found = false; /* Less than the least record--not found */ HGOTO_DONE(SUCCEED); } else if (cmp == 0) { /* Record is found */ if (op && (op)(hdr->min_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation"); - *found = TRUE; + *found = true; HGOTO_DONE(SUCCEED); } /* end if */ } /* end if */ @@ -480,14 +480,14 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da if ((hdr->cls->compare)(udata, hdr->max_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records"); if (cmp > 0) { - *found = FALSE; /* Greater than the largest record--not found */ + *found = false; /* Greater than the largest record--not found */ HGOTO_DONE(SUCCEED); } else if (cmp == 0) { /* Record is found */ if (op && (op)(hdr->max_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation"); - *found = TRUE; + *found = true; HGOTO_DONE(SUCCEED); } /* end if */ } /* end if */ @@ -507,7 +507,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node"); @@ -579,7 +579,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node"); /* Indicate record found */ - *found = TRUE; + *found = true; HGOTO_DONE(SUCCEED); } /* end else */ @@ -591,7 +591,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Unpin parent if necessary */ @@ -615,7 +615,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node"); /* Record not found */ - *found = FALSE; + *found = false; HGOTO_DONE(SUCCEED); } /* end if */ else { @@ -658,7 +658,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node"); /* Indicate record found */ - *found = TRUE; + *found = true; } /* end block */ done: @@ -735,7 +735,7 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi unsigned u; /* Local index variable */ /* Lock B-tree current node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node"); @@ -830,7 +830,7 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Unpin parent if necessary */ @@ -899,7 +899,7 @@ H5B2_remove(H5B2_t *bt2, void *udata, H5B2_remove_t op, void *op_data) /* Attempt to remove record from B-tree */ if (hdr->depth > 0) { - hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ + bool depth_decreased = false; /* Flag to indicate whether the depth of the B-tree decreased */ if (H5B2__remove_internal(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, H5B2_POS_ROOT, &hdr->root, udata, op, op_data) < 0) @@ -977,7 +977,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_remove_ /* Attempt to remove record from B-tree */ if (hdr->depth > 0) { - hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ + bool depth_decreased = false; /* Flag to indicate whether the depth of the B-tree decreased */ if (H5B2__remove_internal_by_idx(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, &hdr->root, H5B2_POS_ROOT, idx, op, op_data) < 0) @@ -1160,7 +1160,7 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node"); @@ -1217,12 +1217,12 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) curr_node_ptr = next_node_ptr; } /* end if */ else { - hbool_t changed; /* Whether the 'modify' callback changed the record */ + bool changed; /* Whether the 'modify' callback changed the record */ /* Make callback for current record */ if ((op)(H5B2_INT_NREC(internal, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - assert(changed == FALSE); + assert(changed == false); /* Unlock current node */ if (H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < @@ -1250,10 +1250,10 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ unsigned leaf_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting the leaf node */ - hbool_t changed = FALSE; /* Whether the 'modify' callback changed the record */ + bool changed = false; /* Whether the 'modify' callback changed the record */ /* Lock B-tree leaf node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Unpin parent if necessary */ @@ -1286,7 +1286,7 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) /* Make callback for current record */ if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - assert(changed == FALSE); + assert(changed == false); /* Unlock current node */ if (H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) @@ -1351,7 +1351,7 @@ herr_t H5B2_close(H5B2_t *bt2) { haddr_t bt2_addr = HADDR_UNDEF; /* Address of v2 B-tree (for deletion) */ - hbool_t pending_delete = FALSE; /* Whether the v2 B-tree is pending deletion */ + bool pending_delete = false; /* Whether the v2 B-tree is pending deletion */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1370,7 +1370,7 @@ H5B2_close(H5B2_t *bt2) /* Set local info, so B-tree deletion can occur after decrementing the * header's ref count */ - pending_delete = TRUE; + pending_delete = true; bt2_addr = bt2->hdr->addr; } /* end if */ } /* end if */ @@ -1477,7 +1477,7 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, void *op_ /* Check for files using shared v2 B-tree header */ if (hdr->file_rc) - hdr->pending_delete = TRUE; + hdr->pending_delete = true; else { /* Set the shared v2 B-tree header's file context for this operation */ hdr->f = f; diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 76aa73f..8ff0a45 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -60,7 +60,7 @@ /* Metadata cache callbacks */ static herr_t H5B2__cache_hdr_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5B2__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata); -static void *H5B2__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5B2__cache_hdr_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5B2__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5B2__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *thing); @@ -68,7 +68,7 @@ static herr_t H5B2__cache_hdr_free_icr(void *thing); static herr_t H5B2__cache_int_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5B2__cache_int_verify_chksum(const void *image_ptr, size_t len, void *udata); -static void *H5B2__cache_int_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5B2__cache_int_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5B2__cache_int_image_len(const void *thing, size_t *image_len); static herr_t H5B2__cache_int_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5B2__cache_int_notify(H5AC_notify_action_t action, void *thing); @@ -76,7 +76,7 @@ static herr_t H5B2__cache_int_free_icr(void *thing); static herr_t H5B2__cache_leaf_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5B2__cache_leaf_verify_chksum(const void *image_ptr, size_t len, void *udata); -static void *H5B2__cache_leaf_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5B2__cache_leaf_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5B2__cache_leaf_image_len(const void *thing, size_t *image_len); static herr_t H5B2__cache_leaf_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *thing); @@ -181,7 +181,7 @@ H5B2__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -192,7 +192,7 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -203,7 +203,7 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2__cache_hdr_verify_chksum() */ @@ -220,7 +220,7 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE */ static void * H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_hdr_cache_ud_t *udata = (H5B2_hdr_cache_ud_t *)_udata; @@ -542,7 +542,7 @@ H5B2__cache_int_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -555,7 +555,7 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi size_t chk_size; /* Exact size of the node with checksum at the end */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -571,7 +571,7 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi H5F_get_checksums(image, chk_size, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2__cache_int_verify_chksum() */ @@ -588,7 +588,7 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi */ static void * H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5B2_internal_cache_ud_t *udata = (H5B2_internal_cache_ud_t *)_udata; /* Pointer to user data */ H5B2_internal_t *internal = NULL; /* Internal node read */ @@ -941,7 +941,7 @@ H5B2__cache_leaf_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -954,7 +954,7 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo size_t chk_size; /* Exact size of the node with checksum at the end */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -969,7 +969,7 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo H5F_get_checksums(image, chk_size, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2__cache_leaf_verify_chksum() */ @@ -986,7 +986,7 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo */ static void * H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5B2_leaf_cache_ud_t *udata = (H5B2_leaf_cache_ud_t *)_udata; H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index af558f2..39c6db9 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -184,7 +184,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned); - if (NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node"); @@ -282,7 +282,7 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, c H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned); - if (NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Print opening message */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index c4ffea2..8196ee2 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -264,7 +264,7 @@ haddr_t H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_PACKAGE @@ -295,7 +295,7 @@ H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) /* Cache the new B-tree node */ if (H5AC_insert_entry(f, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, HADDR_UNDEF, "can't add B-tree header to cache"); - inserted = TRUE; + inserted = true; /* Add header as child of 'top' proxy */ if (hdr->top_proxy) diff --git a/src/H5B2int.c b/src/H5B2int.c index 269d7f7..1b3ecae 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -177,7 +177,7 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); left_addr = internal->node_ptrs[idx].addr; if (NULL == (right_int = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], - (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + (uint16_t)(depth - 1), false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -208,7 +208,7 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); left_addr = internal->node_ptrs[idx].addr; - if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, + if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -377,7 +377,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) /* Protect new root node */ if (NULL == - (new_root = H5B2__protect_internal(hdr, hdr, &hdr->root, hdr->depth, FALSE, H5AC__NO_FLAGS_SET))) + (new_root = H5B2__protect_internal(hdr, hdr, &hdr->root, hdr->depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Set first node pointer in root node to old root node pointer info */ @@ -1141,7 +1141,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, left_addr = internal->node_ptrs[idx].addr; if (NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], - (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + (uint16_t)(depth - 1), false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -1168,7 +1168,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); left_addr = internal->node_ptrs[idx].addr; - if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, + if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -1326,7 +1326,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, middle_addr = internal->node_ptrs[idx].addr; if (NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], - (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + (uint16_t)(depth - 1), false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -1362,7 +1362,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); middle_addr = internal->node_ptrs[idx].addr; - if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, + if (NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); right_addr = internal->node_ptrs[idx + 1].addr; @@ -1599,7 +1599,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, uint8_t *node_native; /* Pointers to node's native records */ uint8_t *native = NULL; /* Pointers to copy of node's native records */ H5B2_node_ptr_t *node_ptrs = NULL; /* Pointers to node's node pointers */ - hbool_t node_pinned = FALSE; /* Whether node is pinned */ + bool node_pinned = false; /* Whether node is pinned */ unsigned u; /* Local index */ herr_t ret_value = H5_ITER_CONT; /* Iterator return value */ @@ -1616,7 +1616,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, /* Lock the current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) + (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Set up information about current node */ @@ -1637,7 +1637,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); @@ -1660,7 +1660,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node"); if (hdr->swmr_write) - node_pinned = TRUE; + node_pinned = true; else node = NULL; @@ -1729,7 +1729,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, v /* Lock the current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, FALSE, H5AC__NO_FLAGS_SET))) + (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Set up information about current node */ @@ -1748,7 +1748,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, v /* Lock the current B-tree node */ if (NULL == - (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__NO_FLAGS_SET))) + (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Set up information about current node */ @@ -1806,7 +1806,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, voi /* Lock the current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) + (internal = H5B2__protect_internal(hdr, parent, curr_node, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Recursively descend into child nodes, if we are above the "twig" level in the B-tree */ @@ -1893,8 +1893,8 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node /* If the node is in the cache, check for retargeting its parent */ if (node_status & H5AC_ES__IN_CACHE) { - void **parent_ptr = NULL; /* Pointer to child node's parent */ - hbool_t update_deps = FALSE; /* Whether to update flush dependencies */ + void **parent_ptr = NULL; /* Pointer to child node's parent */ + bool update_deps = false; /* Whether to update flush dependencies */ /* Get child node pointer */ if (depth > 1) { @@ -1902,14 +1902,14 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node /* Protect child */ if (NULL == (child_int = H5B2__protect_internal(hdr, new_parent, node_ptr, (uint16_t)(depth - 1), - FALSE, H5AC__NO_FLAGS_SET))) + false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); child_class = H5AC_BT2_INT; child = child_int; if (child_int->parent == old_parent) { parent_ptr = &child_int->parent; - update_deps = TRUE; + update_deps = true; } /* end if */ else assert(child_int->parent == new_parent); @@ -1918,7 +1918,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node H5B2_leaf_t *child_leaf; /* Protect child */ - if (NULL == (child_leaf = H5B2__protect_leaf(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, FALSE, + if (NULL == (child_leaf = H5B2__protect_leaf(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); child_class = H5AC_BT2_LEAF; @@ -1926,7 +1926,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node if (child_leaf->parent == old_parent) { parent_ptr = &child_leaf->parent; - update_deps = TRUE; + update_deps = true; } /* end if */ else assert(child_leaf->parent == new_parent); diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 399bcd2..e97e921 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -79,7 +79,7 @@ herr_t H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth) { H5B2_internal_t *internal = NULL; /* Pointer to new internal node created */ - hbool_t inserted = FALSE; /* Whether the internal node was inserted into cache */ + bool inserted = false; /* Whether the internal node was inserted into cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -129,7 +129,7 @@ H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, /* Cache the new B-tree node */ if (H5AC_insert_entry(hdr->f, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree internal node to cache"); - inserted = TRUE; + inserted = true; /* Add internal node as child of 'top' proxy */ if (hdr->top_proxy) { @@ -172,8 +172,8 @@ done: *------------------------------------------------------------------------- */ H5B2_internal_t * -H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth, - hbool_t shadow, unsigned flags) +H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth, bool shadow, + unsigned flags) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *internal = NULL; /* v2 B-tree internal node */ @@ -286,7 +286,7 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_n /* Lock current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Locate node pointer for child */ @@ -359,7 +359,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Lock current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Sanity check number of records */ @@ -527,7 +527,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Lock current B-tree node */ if (NULL == - (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); /* Sanity check number of records */ @@ -540,12 +540,12 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Check for modifying existing record */ if (0 == cmp) { - hbool_t changed = FALSE; /* Whether the 'modify' callback changed the record */ + bool changed = false; /* Whether the 'modify' callback changed the record */ /* Make callback for current record */ if ((op)(H5B2_INT_NREC(internal, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - assert(changed == FALSE); + assert(changed == false); HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree update operation"); @@ -614,30 +614,30 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in case H5B2_UPDATE_INSERT_CHILD_FULL: /* Split/redistribute this node */ if (internal->nrec == hdr->node_info[depth].split_nrec) { - hbool_t could_split = FALSE; /* Whether the child node could split */ + bool could_split = false; /* Whether the child node could split */ if (idx == 0) { /* Left-most child */ /* Check for left-most child and its neighbor being close to full */ if ((internal->node_ptrs[idx].node_nrec + internal->node_ptrs[idx + 1].node_nrec) >= (unsigned)((hdr->node_info[depth - 1].split_nrec * 2) - 1)) - could_split = TRUE; + could_split = true; } else if (idx == internal->nrec) { /* Right-most child */ /* Check for right-most child and its neighbor being close to full */ if ((internal->node_ptrs[idx - 1].node_nrec + internal->node_ptrs[idx].node_nrec) >= (unsigned)((hdr->node_info[depth - 1].split_nrec * 2) - 1)) - could_split = TRUE; + could_split = true; } else { /* Middle child */ /* Check for middle child and its left neighbor being close to full */ if ((internal->node_ptrs[idx - 1].node_nrec + internal->node_ptrs[idx].node_nrec) >= (unsigned)((hdr->node_info[depth - 1].split_nrec * 2) - 1)) - could_split = TRUE; + could_split = true; /* Check for middle child and its right neighbor being close to full */ else if ((internal->node_ptrs[idx].node_nrec + internal->node_ptrs[idx + 1].node_nrec) >= (unsigned)((hdr->node_info[depth - 1].split_nrec * 2) - 1)) - could_split = TRUE; + could_split = true; } /* If this node is full and the child node insertion could @@ -777,7 +777,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, +H5B2__remove_internal(H5B2_hdr_t *hdr, bool *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data) @@ -790,7 +790,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, unsigned internal_flags = H5AC__NO_FLAGS_SET; haddr_t internal_addr = HADDR_UNDEF; /* Address of internal node */ size_t merge_nrec; /* Number of records to merge node at */ - hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ + bool collapsed_root = false; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -803,7 +803,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); internal_addr = curr_node_ptr->addr; @@ -836,7 +836,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent"); /* Indicate that the level of the B-tree decreased */ - *depth_decreased = TRUE; + *depth_decreased = true; /* Set pointers for advancing to child node */ new_cache_info = parent_cache_info; @@ -844,7 +844,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, new_node_ptr = curr_node_ptr; /* Set flag to indicate root was collapsed */ - collapsed_root = TRUE; + collapsed_root = true; /* Indicate position of next node */ next_pos = H5B2_POS_ROOT; @@ -1018,7 +1018,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, +H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, bool *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data) @@ -1031,7 +1031,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw unsigned internal_flags = H5AC__NO_FLAGS_SET; haddr_t internal_addr = HADDR_UNDEF; /* Address of internal node */ size_t merge_nrec; /* Number of records to merge node at */ - hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ + bool collapsed_root = false; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1044,7 +1044,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); internal_addr = curr_node_ptr->addr; @@ -1080,7 +1080,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent"); /* Indicate that the level of the B-tree decreased */ - *depth_decreased = TRUE; + *depth_decreased = true; /* Set pointers for advancing to child node */ new_cache_info = parent_cache_info; @@ -1088,7 +1088,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw new_node_ptr = curr_node_ptr; /* Set flag to indicate root was collapsed */ - collapsed_root = TRUE; + collapsed_root = true; /* Indicate position of next node */ next_pos = H5B2_POS_ROOT; @@ -1097,7 +1097,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw else { hsize_t orig_n = n; /* Original index looked for */ unsigned idx; /* Location of record which matches key */ - hbool_t found = FALSE; /* Comparison value of records */ + bool found = false; /* Comparison value of records */ unsigned retries; /* Number of times to attempt redistribution */ /* Shadow the node if doing SWMR writes */ @@ -1120,7 +1120,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw /* Indicate the record was found and that the index * in child nodes is zero from now on */ - found = TRUE; + found = true; n = 0; /* Increment to next record */ @@ -1203,7 +1203,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw /* Reset "found" flag - the record may have shifted during the * redistribute/merge */ - found = FALSE; + found = false; /* Search for record with correct index */ for (idx = 0; idx < internal->nrec; idx++) { @@ -1214,7 +1214,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw /* Indicate the record was found and that the index * in child nodes is zero from now on */ - found = TRUE; + found = true; n = 0; /* Increment to next record */ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 23a7c4d..48e5f62 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -80,7 +80,7 @@ herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr) { H5B2_leaf_t *leaf = NULL; /* Pointer to new leaf node created */ - hbool_t inserted = FALSE; /* Whether the leaf node was inserted into cache */ + bool inserted = false; /* Whether the leaf node was inserted into cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -118,7 +118,7 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr) /* Cache the new B-tree node */ if (H5AC_insert_entry(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache"); - inserted = TRUE; + inserted = true; /* Add leaf node as child of 'top' proxy */ if (hdr->top_proxy) { @@ -161,7 +161,7 @@ done: *------------------------------------------------------------------------- */ H5B2_leaf_t * -H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags) +H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, bool shadow, unsigned flags) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *leaf; /* v2 B-tree leaf node */ @@ -268,7 +268,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neigh assert(op); /* Lock current B-tree node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Locate node pointer for child */ @@ -336,7 +336,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_ assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Must have a leaf node with enough space to insert a record now */ @@ -447,7 +447,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Sanity check number of records */ @@ -486,12 +486,12 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s /* Check for modifying existing record */ if (0 == cmp) { - hbool_t changed = FALSE; /* Whether the 'modify' callback changed the record */ + bool changed = false; /* Whether the 'modify' callback changed the record */ /* Make callback for current record */ if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - assert(changed == FALSE); + assert(changed == false); HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree update operation"); @@ -610,7 +610,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsi /* Lock B-tree child nodes */ if (NULL == (child_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], - (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + (uint16_t)(depth - 1), false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node"); child_addr = internal->node_ptrs[idx].addr; @@ -625,7 +625,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsi child_class = H5AC_BT2_LEAF; /* Lock B-tree child node */ - if (NULL == (child_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], FALSE, + if (NULL == (child_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); child_addr = internal->node_ptrs[idx].addr; @@ -752,7 +752,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_ assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); leaf_addr = curr_node_ptr->addr; @@ -855,7 +855,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock B-tree leaf node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, false, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); leaf_addr = curr_node_ptr->addr; diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 668ea5d..d60e1ac 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -161,7 +161,7 @@ typedef struct H5B2_hdr_t { size_t hdr_size; /* Size of the B-tree header on disk */ size_t rc; /* Reference count of nodes using this header */ size_t file_rc; /* Reference count of files using this header */ - hbool_t pending_delete; /* B-tree is pending deletion */ + bool pending_delete; /* B-tree is pending deletion */ uint8_t sizeof_size; /* Size of file sizes */ uint8_t sizeof_addr; /* Size of file addresses */ H5B2_remove_t remove_op; /* Callback operator for deleting B-tree */ @@ -173,7 +173,7 @@ typedef struct H5B2_hdr_t { void *max_native_rec; /* Pointer to maximum native record */ /* SWMR / Flush dependency information (not stored) */ - hbool_t swmr_write; /* Whether we are doing SWMR writes */ + bool swmr_write; /* Whether we are doing SWMR writes */ H5AC_proxy_entry_t *top_proxy; /* 'Top' proxy cache entry for all B-tree entries */ void *parent; /* Pointer to 'top' proxy flush dependency * parent, if it exists, otherwise NULL. @@ -349,14 +349,14 @@ H5_DLL herr_t H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags); H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr); /* Routines for operating on leaf nodes */ -H5_DLL H5B2_leaf_t *H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, - hbool_t shadow, unsigned flags); +H5_DLL H5B2_leaf_t *H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, bool shadow, + unsigned flags); H5_DLL herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); /* Routines for operating on internal nodes */ H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, - uint16_t depth, hbool_t shadow, unsigned flags); + uint16_t depth, bool shadow, unsigned flags); /* Routines for allocating nodes */ H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr); @@ -402,14 +402,14 @@ H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_pt void *op_data); /* Routines for removing records */ -H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, - void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, +H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, bool *depth_decreased, void *swap_loc, void *swap_parent, + uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, bool *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, diff --git a/src/H5B2private.h b/src/H5B2private.h index 354bea5..f3f1eaf 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -64,7 +64,7 @@ typedef int (*H5B2_operator_t)(const void *record, void *op_data); typedef herr_t (*H5B2_found_t)(const void *record, void *op_data); /* Define the 'modify' callback function pointer for H5B2_modify() */ -typedef herr_t (*H5B2_modify_t)(void *record, void *op_data, hbool_t *changed); +typedef herr_t (*H5B2_modify_t)(void *record, void *op_data, bool *changed); /* Define the 'remove' callback function pointer for H5B2_remove() & H5B2_delete() */ typedef herr_t (*H5B2_remove_t)(const void *record, void *op_data); @@ -128,7 +128,7 @@ H5_DLL H5B2_t *H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata); H5_DLL herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr /*out*/); H5_DLL herr_t H5B2_insert(H5B2_t *bt2, void *udata); H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2_find(H5B2_t *bt2, void *udata, bool *found, H5B2_found_t op, void *op_data); H5_DLL herr_t H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data); H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data); H5_DLL herr_t H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data); diff --git a/src/H5B2test.c b/src/H5B2test.c index 3285d30..4a5a325 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -481,7 +481,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, + if (NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node"); @@ -537,7 +537,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, false, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node"); /* Unpin parent if necessary */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 3426426..bc693fa 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -47,7 +47,7 @@ /* Metadata cache callbacks */ static herr_t H5B__cache_get_initial_load_size(void *udata, size_t *image_len); -static void *H5B__cache_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5B__cache_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5B__cache_image_len(const void *thing, size_t *image_len); static herr_t H5B__cache_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5B__cache_free_icr(void *thing); @@ -118,7 +118,7 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static void * -H5B__cache_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5B__cache_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5B_t *bt = NULL; /* Pointer to the deserialized B-tree node */ H5B_cache_ud_t *udata = (H5B_cache_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index fd06efe..a1d84ef 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -106,20 +106,20 @@ typedef struct H5B_class_t { herr_t (*new_node)(H5F_t *, H5B_ins_t, void *, void *, void *, haddr_t *); int (*cmp2)(void *, void *, void *); /*compare 2 keys */ int (*cmp3)(void *, void *, void *); /*compare 3 keys */ - htri_t (*found)(H5F_t *, haddr_t, const void *, hbool_t *, void *); + htri_t (*found)(H5F_t *, haddr_t, const void *, bool *, void *); /* insert new data */ - H5B_ins_t (*insert)(H5F_t *, haddr_t, void *, hbool_t *, void *, void *, void *, hbool_t *, haddr_t *); + H5B_ins_t (*insert)(H5F_t *, haddr_t, void *, bool *, void *, void *, void *, bool *, haddr_t *); /* min insert uses min leaf, not new(), similarly for max insert */ - hbool_t follow_min; - hbool_t follow_max; + bool follow_min; + bool follow_max; /* The direction of the key that is intrinsically associated with each node */ H5B_dir_t critical_key; /* remove existing data */ - H5B_ins_t (*remove)(H5F_t *, haddr_t, void *, hbool_t *, void *, void *, hbool_t *); + H5B_ins_t (*remove)(H5F_t *, haddr_t, void *, bool *, void *, void *, bool *); /* encode, decode, debug key values */ herr_t (*decode)(const H5B_shared_t *, const uint8_t *, void *); @@ -141,7 +141,7 @@ typedef struct H5B_info_t { /* Library-private Function Prototypes */ /***************************************/ H5_DLL herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out*/); -H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, hbool_t *found, void *udata); +H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, bool *found, void *udata); H5_DLL herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata); H5_DLL herr_t H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata); H5_DLL herr_t H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_info, diff --git a/src/H5C.c b/src/H5C.c index 545154c..018413c 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -120,7 +120,7 @@ H5FL_DEFINE_STATIC(H5C_t); H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, const H5C_class_t *const *class_table_ptr, H5C_write_permitted_func_t check_write_permitted, - hbool_t write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr) + bool write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr) { int i; H5C_t *cache_ptr = NULL; @@ -153,7 +153,7 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, * the fields. */ - cache_ptr->flush_in_progress = FALSE; + cache_ptr->flush_in_progress = false; if (NULL == (cache_ptr->log_info = (H5C_log_info_t *)H5MM_calloc(sizeof(H5C_log_info_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed"); @@ -172,8 +172,8 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->log_flush = log_flush; - cache_ptr->evictions_enabled = TRUE; - cache_ptr->close_warning_received = FALSE; + cache_ptr->evictions_enabled = true; + cache_ptr->close_warning_received = false; cache_ptr->index_len = 0; cache_ptr->index_size = (size_t)0; @@ -199,12 +199,12 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->il_tail = NULL; /* Tagging Field Initializations */ - cache_ptr->ignore_tags = FALSE; + cache_ptr->ignore_tags = false; cache_ptr->num_objs_corked = 0; /* slist field initializations */ - cache_ptr->slist_enabled = FALSE; - cache_ptr->slist_changed = FALSE; + cache_ptr->slist_enabled = false; + cache_ptr->slist_changed = false; cache_ptr->slist_len = 0; cache_ptr->slist_size = (size_t)0; @@ -256,19 +256,19 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->dLRU_tail_ptr = NULL; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - cache_ptr->size_increase_possible = FALSE; - cache_ptr->flash_size_increase_possible = FALSE; + cache_ptr->size_increase_possible = false; + cache_ptr->flash_size_increase_possible = false; cache_ptr->flash_size_increase_threshold = 0; - cache_ptr->size_decrease_possible = FALSE; - cache_ptr->resize_enabled = FALSE; - cache_ptr->cache_full = FALSE; - cache_ptr->size_decreased = FALSE; - cache_ptr->resize_in_progress = FALSE; - cache_ptr->msic_in_progress = FALSE; + cache_ptr->size_decrease_possible = false; + cache_ptr->resize_enabled = false; + cache_ptr->cache_full = false; + cache_ptr->size_decreased = false; + cache_ptr->resize_in_progress = false; + cache_ptr->msic_in_progress = false; cache_ptr->resize_ctl.version = H5C__CURR_AUTO_SIZE_CTL_VER; cache_ptr->resize_ctl.rpt_fcn = NULL; - cache_ptr->resize_ctl.set_initial_size = FALSE; + cache_ptr->resize_ctl.set_initial_size = false; cache_ptr->resize_ctl.initial_size = H5C__DEF_AR_INIT_SIZE; cache_ptr->resize_ctl.min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC; cache_ptr->resize_ctl.max_size = H5C__DEF_AR_MAX_SIZE; @@ -278,7 +278,7 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->resize_ctl.incr_mode = H5C_incr__off; cache_ptr->resize_ctl.lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD; cache_ptr->resize_ctl.increment = H5C__DEF_AR_INCREMENT; - cache_ptr->resize_ctl.apply_max_increment = TRUE; + cache_ptr->resize_ctl.apply_max_increment = true; cache_ptr->resize_ctl.max_increment = H5C__DEF_AR_MAX_INCREMENT; cache_ptr->resize_ctl.flash_incr_mode = H5C_flash_incr__off; @@ -288,10 +288,10 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->resize_ctl.decr_mode = H5C_decr__off; cache_ptr->resize_ctl.upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; cache_ptr->resize_ctl.decrement = H5C__DEF_AR_DECREMENT; - cache_ptr->resize_ctl.apply_max_decrement = TRUE; + cache_ptr->resize_ctl.apply_max_decrement = true; cache_ptr->resize_ctl.max_decrement = H5C__DEF_AR_MAX_DECREMENT; cache_ptr->resize_ctl.epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; - cache_ptr->resize_ctl.apply_empty_reserve = TRUE; + cache_ptr->resize_ctl.apply_empty_reserve = true; cache_ptr->resize_ctl.empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; cache_ptr->epoch_markers_active = 0; @@ -301,10 +301,10 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->epoch_marker_ringbuf_last = 0; cache_ptr->epoch_marker_ringbuf_size = 0; - /* Initialize all epoch marker entries' fields to zero/FALSE/NULL */ + /* Initialize all epoch marker entries' fields to zero/false/NULL */ memset(cache_ptr->epoch_markers, 0, sizeof(cache_ptr->epoch_markers)); - /* Set non-zero/FALSE/NULL fields for epoch markers */ + /* Set non-zero/false/NULL fields for epoch markers */ for (i = 0; i < H5C__MAX_EPOCH_MARKERS; i++) { ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; ((cache_ptr->epoch_markers)[i]).type = H5AC_EPOCH_MARKER; @@ -315,15 +315,15 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, * in H5Cprivate.h. */ cache_ptr->image_ctl.version = H5C__CURR_CACHE_IMAGE_CTL_VER; - cache_ptr->image_ctl.generate_image = FALSE; - cache_ptr->image_ctl.save_resize_status = FALSE; + cache_ptr->image_ctl.generate_image = false; + cache_ptr->image_ctl.save_resize_status = false; cache_ptr->image_ctl.entry_ageout = -1; cache_ptr->image_ctl.flags = H5C_CI__ALL_FLAGS; - cache_ptr->serialization_in_progress = FALSE; - cache_ptr->load_image = FALSE; - cache_ptr->image_loaded = FALSE; - cache_ptr->delete_image = FALSE; + cache_ptr->serialization_in_progress = false; + cache_ptr->load_image = false; + cache_ptr->image_loaded = false; + cache_ptr->delete_image = false; cache_ptr->image_addr = HADDR_UNDEF; cache_ptr->image_len = 0; cache_ptr->image_data_len = 0; @@ -338,8 +338,8 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->image_buffer = NULL; /* initialize free space manager related fields: */ - cache_ptr->rdfsm_settled = FALSE; - cache_ptr->mdfsm_settled = FALSE; + cache_ptr->rdfsm_settled = false; + cache_ptr->mdfsm_settled = false; if (H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ @@ -389,9 +389,9 @@ done: herr_t H5C_prep_for_file_close(H5F_t *f) { - H5C_t *cache_ptr; - hbool_t image_generated = FALSE; /* Whether a cache image was generated */ - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t *cache_ptr; + bool image_generated = false; /* Whether a cache image was generated */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -405,7 +405,7 @@ H5C_prep_for_file_close(H5F_t *f) /* It is possible to receive the close warning more than once */ if (cache_ptr->close_warning_received) HGOTO_DONE(SUCCEED); - cache_ptr->close_warning_received = TRUE; + cache_ptr->close_warning_received = true; /* Make certain there aren't any protected entries */ assert(cache_ptr->pl_len == 0); @@ -488,12 +488,12 @@ H5C_dest(H5F_t *f) assert(cache_ptr->close_warning_received); #if H5AC_DUMP_IMAGE_STATS_ON_CLOSE - if (H5C__image_stats(cache_ptr, TRUE) < 0) + if (H5C__image_stats(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't display cache image stats"); #endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ /* Enable the slist, as it is needed in the flush */ - if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed"); /* Flush and invalidate all cache entries */ @@ -541,7 +541,7 @@ done: * calls to H5C_dest(). Thus we re-enable the slist on failure if it * and the cache still exist. JRM -- 5/15/20 */ - if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, false) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist on flush dest failure failed"); FUNC_LEAVE_NOAPI(ret_value) @@ -567,7 +567,7 @@ H5C_evict(H5F_t *f) assert(f); /* Enable the slist, as it is needed in the flush */ - if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed"); /* Flush and invalidate all cache entries except the pinned entries */ @@ -575,7 +575,7 @@ H5C_evict(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache"); /* Disable the slist */ - if (H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist disabled failed"); done: @@ -612,7 +612,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ H5C_ring_t ring; H5C_t *cache_ptr; - hbool_t destroy; + bool destroy; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -659,7 +659,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) assert(!(destroy && ((flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0))); assert(!(cache_ptr->flush_in_progress)); - cache_ptr->flush_in_progress = TRUE; + cache_ptr->flush_in_progress = true; if (destroy) { if (H5C__flush_invalidate_cache(f, flags) < 0) @@ -710,7 +710,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) } /* end else */ done: - cache_ptr->flush_in_progress = FALSE; + cache_ptr->flush_in_progress = false; FUNC_LEAVE_NOAPI(ret_value) } /* H5C_flush_cache() */ @@ -739,9 +739,9 @@ done: herr_t H5C_flush_to_min_clean(H5F_t *f) { - H5C_t *cache_ptr; - hbool_t write_permitted; - herr_t ret_value = SUCCEED; + H5C_t *cache_ptr; + bool write_permitted; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -841,20 +841,20 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p if (H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config"); - /* will set the increase possible fields to FALSE later if needed */ - cache_ptr->size_increase_possible = TRUE; - cache_ptr->flash_size_increase_possible = TRUE; - cache_ptr->size_decrease_possible = TRUE; + /* will set the increase possible fields to false later if needed */ + cache_ptr->size_increase_possible = true; + cache_ptr->flash_size_increase_possible = true; + cache_ptr->size_decrease_possible = true; switch (config_ptr->incr_mode) { case H5C_incr__off: - cache_ptr->size_increase_possible = FALSE; + cache_ptr->size_increase_possible = false; break; case H5C_incr__threshold: if ((config_ptr->lower_hr_threshold <= 0.0) || (config_ptr->increment <= 1.0) || ((config_ptr->apply_max_increment) && (config_ptr->max_increment <= 0))) - cache_ptr->size_increase_possible = FALSE; + cache_ptr->size_increase_possible = false; break; default: /* should be unreachable */ @@ -868,26 +868,26 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p switch (config_ptr->decr_mode) { case H5C_decr__off: - cache_ptr->size_decrease_possible = FALSE; + cache_ptr->size_decrease_possible = false; break; case H5C_decr__threshold: if (config_ptr->upper_hr_threshold >= 1.0 || config_ptr->decrement >= 1.0 || (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0)) - cache_ptr->size_decrease_possible = FALSE; + cache_ptr->size_decrease_possible = false; break; case H5C_decr__age_out: if ((config_ptr->apply_empty_reserve && config_ptr->empty_reserve >= 1.0) || (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0)) - cache_ptr->size_decrease_possible = FALSE; + cache_ptr->size_decrease_possible = false; break; case H5C_decr__age_out_with_threshold: if ((config_ptr->apply_empty_reserve && config_ptr->empty_reserve >= 1.0) || (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0) || config_ptr->upper_hr_threshold >= 1.0) - cache_ptr->size_decrease_possible = FALSE; + cache_ptr->size_decrease_possible = false; break; default: /* should be unreachable */ @@ -895,9 +895,9 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p } /* end switch */ if (config_ptr->max_size == config_ptr->min_size) { - cache_ptr->size_increase_possible = FALSE; - cache_ptr->flash_size_increase_possible = FALSE; - cache_ptr->size_decrease_possible = FALSE; + cache_ptr->size_increase_possible = false; + cache_ptr->flash_size_increase_possible = false; + cache_ptr->size_decrease_possible = false; } /* end if */ /* flash_size_increase_possible is intentionally omitted from the @@ -936,7 +936,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p assert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); if (new_max_cache_size < cache_ptr->max_cache_size) - cache_ptr->size_decreased = TRUE; + cache_ptr->size_decreased = true; cache_ptr->max_cache_size = new_max_cache_size; cache_ptr->min_clean_size = new_min_clean_size; @@ -967,11 +967,11 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p if (cache_ptr->flash_size_increase_possible) { switch (config_ptr->flash_incr_mode) { case H5C_flash_incr__off: - cache_ptr->flash_size_increase_possible = FALSE; + cache_ptr->flash_size_increase_possible = false; break; case H5C_flash_incr__add_space: - cache_ptr->flash_size_increase_possible = TRUE; + cache_ptr->flash_size_increase_possible = true; cache_ptr->flash_size_increase_threshold = (size_t)(((double)(cache_ptr->max_cache_size)) * (cache_ptr->resize_ctl.flash_threshold)); break; @@ -997,7 +997,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) +H5C_set_evictions_enabled(H5C_t *cache_ptr, bool evictions_enabled) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1011,7 +1011,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) * However, allowing it would greatly complicate testing * the feature. Hence the following: */ - if ((evictions_enabled != TRUE) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || + if ((evictions_enabled != true) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || (cache_ptr->resize_ctl.decr_mode != H5C_decr__off))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled"); @@ -1038,20 +1038,20 @@ done: * slist when it is not needed. * * - * If the slist_enabled parameter is TRUE, the function + * If the slist_enabled parameter is true, the function * * 1) Verifies that the slist is empty. * * 2) Scans the index list, and inserts all dirty entries * into the slist. * - * 3) Sets cache_ptr->slist_enabled = TRUE. + * 3) Sets cache_ptr->slist_enabled = true. * * Note that the clear_slist parameter is ignored if - * the slist_enabed parameter is TRUE. + * the slist_enabed parameter is true. * * - * If the slist_enabled_parameter is FALSE, the function + * If the slist_enabled_parameter is false, the function * shuts down the slist. * * Normally the slist will be empty at this point, however @@ -1063,20 +1063,20 @@ done: * 1) Test to see if the slist is empty. If it is, proceed * to step 3. * - * 2) Test to see if the clear_slist parameter is TRUE. + * 2) Test to see if the clear_slist parameter is true. * * If it is, remove all entries from the slist. * * If it isn't, throw an error. * - * 3) set cache_ptr->slist_enabled = FALSE. + * 3) set cache_ptr->slist_enabled = false. * * Return: SUCCEED on success, and FAIL on failure. * *------------------------------------------------------------------------- */ herr_t -H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_slist) +H5C_set_slist_enabled(H5C_t *cache_ptr, bool slist_enabled, bool clear_slist) { H5C_cache_entry_t *entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1092,10 +1092,10 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?"); - /* set cache_ptr->slist_enabled to TRUE so that the slist + /* set cache_ptr->slist_enabled to true so that the slist * maintenance macros will be enabled. */ - cache_ptr->slist_enabled = TRUE; + cache_ptr->slist_enabled = true; /* scan the index list and insert all dirty entries in the slist */ entry_ptr = cache_ptr->il_head; @@ -1124,7 +1124,7 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli node_ptr = H5SL_first(cache_ptr->slist_ptr); while (node_ptr != NULL) { entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE, FAIL); + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, false, FAIL); node_ptr = H5SL_first(cache_ptr->slist_ptr); } } @@ -1132,7 +1132,7 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?"); } - cache_ptr->slist_enabled = FALSE; + cache_ptr->slist_enabled = false; assert(0 == cache_ptr->slist_len); assert(0 == cache_ptr->slist_size); @@ -1183,7 +1183,7 @@ H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring) if (cache_ptr->rdfsm_settled) { if (cache_ptr->close_warning_received) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected rdfsm ring unsettle"); - cache_ptr->rdfsm_settled = FALSE; + cache_ptr->rdfsm_settled = false; } /* end if */ break; @@ -1191,12 +1191,12 @@ H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring) if (cache_ptr->mdfsm_settled) { if (cache_ptr->close_warning_received) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected mdfsm ring unsettle"); - cache_ptr->mdfsm_settled = FALSE; + cache_ptr->mdfsm_settled = false; } /* end if */ break; default: - assert(FALSE); /* this should be un-reachable */ + assert(false); /* this should be un-reachable */ break; } /* end switch */ @@ -1356,7 +1356,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) +H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, bool *corked) { H5C_tag_info_t *tag_info = NULL; herr_t ret_value = SUCCEED; @@ -1374,9 +1374,9 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) if (H5C__GET_CORKED == action) { assert(corked); if (tag_info != NULL && tag_info->corked) - *corked = TRUE; + *corked = true; else - *corked = FALSE; + *corked = false; } else { /* Sanity check */ @@ -1404,7 +1404,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) } /* Set the corked status for the entire object */ - tag_info->corked = TRUE; + tag_info->corked = true; cache_ptr->num_objs_corked++; } else { @@ -1417,7 +1417,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNCORK, FAIL, "object already uncorked"); /* Set the corked status for the entire object */ - tag_info->corked = FALSE; + tag_info->corked = false; cache_ptr->num_objs_corked--; /* Remove the tag info from the tag list, if there's no more entries with this tag */ diff --git a/src/H5CX.c b/src/H5CX.c index 49f2274..aa9d0b5 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -82,7 +82,7 @@ } /* end else */ \ \ /* Mark the field as valid */ \ - (*head)->ctx.H5_GLUE(PROP_FIELD, _valid) = TRUE; + (*head)->ctx.H5_GLUE(PROP_FIELD, _valid) = true; /* Macro for the duplicated code to retrieve properties from a property list */ #define H5CX_RETRIEVE_PROP_VALID(PL, DEF_PL, PROP_NAME, PROP_FIELD) \ @@ -117,7 +117,7 @@ if ((*head)->ctx.H5_GLUE(PROP_FIELD, _set) || check_prop > 0) { \ /* Cache the value for later, marking it to set in DXPL when context popped */ \ (*head)->ctx.PROP_FIELD = PROP_FIELD; \ - (*head)->ctx.H5_GLUE(PROP_FIELD, _set) = TRUE; \ + (*head)->ctx.H5_GLUE(PROP_FIELD, _set) = true; \ } /* end if */ \ } #endif /* defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY) */ @@ -201,140 +201,137 @@ typedef struct H5CX_t { #ifdef H5_HAVE_PARALLEL /* Internal: Parallel I/O settings */ - hbool_t coll_metadata_read; /* Whether to use collective I/O for metadata read */ + bool coll_metadata_read; /* Whether to use collective I/O for metadata read */ MPI_Datatype btype; /* MPI datatype for buffer, when using collective I/O */ MPI_Datatype ftype; /* MPI datatype for file, when using collective I/O */ - hbool_t mpi_file_flushing; /* Whether an MPI-opened file is being flushed */ - hbool_t rank0_bcast; /* Whether a dataset meets read-with-rank0-and-bcast requirements */ + bool mpi_file_flushing; /* Whether an MPI-opened file is being flushed */ + bool rank0_bcast; /* Whether a dataset meets read-with-rank0-and-bcast requirements */ #endif /* H5_HAVE_PARALLEL */ /* Cached DXPL properties */ size_t max_temp_buf; /* Maximum temporary buffer size */ - hbool_t max_temp_buf_valid; /* Whether maximum temporary buffer size is valid */ + bool max_temp_buf_valid; /* Whether maximum temporary buffer size is valid */ void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ - hbool_t tconv_buf_valid; /* Whether temporary conversion buffer is valid */ + bool tconv_buf_valid; /* Whether temporary conversion buffer is valid */ void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ - hbool_t bkgr_buf_valid; /* Whether background conversion buffer is valid */ + bool bkgr_buf_valid; /* Whether background conversion buffer is valid */ H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ - hbool_t bkgr_buf_type_valid; /* Whether background buffer type is valid */ + bool bkgr_buf_type_valid; /* Whether background buffer type is valid */ double btree_split_ratio[3]; /* B-tree split ratios */ - hbool_t btree_split_ratio_valid; /* Whether B-tree split ratios are valid */ + bool btree_split_ratio_valid; /* Whether B-tree split ratios are valid */ size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ - hbool_t vec_size_valid; /* Whether hyperslab vector is valid */ + bool vec_size_valid; /* Whether hyperslab vector is valid */ #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t io_xfer_mode; /* Parallel transfer mode for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - hbool_t io_xfer_mode_valid; /* Whether parallel transfer mode is valid */ + bool io_xfer_mode_valid; /* Whether parallel transfer mode is valid */ H5FD_mpio_collective_opt_t mpio_coll_opt; /* Parallel transfer with independent IO or collective IO with this mode (H5D_XFER_MPIO_COLLECTIVE_OPT_NAME) */ - hbool_t mpio_coll_opt_valid; /* Whether parallel transfer option is valid */ + bool mpio_coll_opt_valid; /* Whether parallel transfer option is valid */ H5FD_mpio_chunk_opt_t mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ - hbool_t mpio_chunk_opt_mode_valid; /* Whether collective chunk option is valid */ + bool mpio_chunk_opt_mode_valid; /* Whether collective chunk option is valid */ unsigned mpio_chunk_opt_num; /* Collective chunk threshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ - hbool_t mpio_chunk_opt_num_valid; /* Whether collective chunk threshold is valid */ + bool mpio_chunk_opt_num_valid; /* Whether collective chunk threshold is valid */ unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ - hbool_t mpio_chunk_opt_ratio_valid; /* Whether collective chunk ratio is valid */ + bool mpio_chunk_opt_ratio_valid; /* Whether collective chunk ratio is valid */ #endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ - hbool_t err_detect_valid; /* Whether error detection info is valid */ + bool err_detect_valid; /* Whether error detection info is valid */ H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ - hbool_t filter_cb_valid; /* Whether filter callback function is valid */ + bool filter_cb_valid; /* Whether filter callback function is valid */ H5Z_data_xform_t *data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ - hbool_t data_transform_valid; /* Whether data transform info is valid */ + bool data_transform_valid; /* Whether data transform info is valid */ H5T_vlen_alloc_info_t vl_alloc_info; /* VL datatype alloc info (H5D_XFER_VLEN_*_NAME) */ - hbool_t vl_alloc_info_valid; /* Whether VL datatype alloc info is valid */ + bool vl_alloc_info_valid; /* Whether VL datatype alloc info is valid */ H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ - hbool_t dt_conv_cb_valid; /* Whether datatype conversion struct is valid */ + bool dt_conv_cb_valid; /* Whether datatype conversion struct is valid */ H5D_selection_io_mode_t selection_io_mode; /* Selection I/O mode (H5D_XFER_SELECTION_IO_MODE_NAME) */ - hbool_t selection_io_mode_valid; /* Whether selection I/O mode is valid */ - hbool_t modify_write_buf; /* Whether the library can modify write buffers */ - hbool_t modify_write_buf_valid; /* Whether the modify_write_buf field is valid */ + bool selection_io_mode_valid; /* Whether selection I/O mode is valid */ + bool modify_write_buf; /* Whether the library can modify write buffers */ + bool modify_write_buf_valid; /* Whether the modify_write_buf field is valid */ /* Return-only DXPL properties to return to application */ #ifdef H5_HAVE_PARALLEL H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt; /* Chunk optimization mode used for parallel I/O (H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME) */ - hbool_t mpio_actual_chunk_opt_set; /* Whether chunk optimization mode used for parallel I/O is set */ + bool mpio_actual_chunk_opt_set; /* Whether chunk optimization mode used for parallel I/O is set */ H5D_mpio_actual_io_mode_t mpio_actual_io_mode; /* Actual I/O mode used for parallel I/O (H5D_MPIO_ACTUAL_IO_MODE_NAME) */ - hbool_t mpio_actual_io_mode_set; /* Whether actual I/O mode used for parallel I/O is set */ + bool mpio_actual_io_mode_set; /* Whether actual I/O mode used for parallel I/O is set */ uint32_t mpio_local_no_coll_cause; /* Local reason for breaking collective I/O (H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME) */ - hbool_t mpio_local_no_coll_cause_set; /* Whether local reason for breaking collective I/O is set */ - hbool_t mpio_local_no_coll_cause_valid; /* Whether local reason for breaking collective I/O is valid */ + bool mpio_local_no_coll_cause_set; /* Whether local reason for breaking collective I/O is set */ + bool mpio_local_no_coll_cause_valid; /* Whether local reason for breaking collective I/O is valid */ uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ - hbool_t mpio_global_no_coll_cause_set; /* Whether global reason for breaking collective I/O is set */ - hbool_t mpio_global_no_coll_cause_valid; /* Whether global reason for breaking collective I/O is valid */ + bool mpio_global_no_coll_cause_set; /* Whether global reason for breaking collective I/O is set */ + bool mpio_global_no_coll_cause_valid; /* Whether global reason for breaking collective I/O is valid */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - int mpio_coll_chunk_link_hard; /* Instrumented "collective chunk link hard" value - (H5D_XFER_COLL_CHUNK_LINK_HARD_NAME) */ - hbool_t - mpio_coll_chunk_link_hard_set; /* Whether instrumented "collective chunk link hard" value is set */ - int mpio_coll_chunk_multi_hard; /* Instrumented "collective chunk multi hard" value - (H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME) */ - hbool_t - mpio_coll_chunk_multi_hard_set; /* Whether instrumented "collective chunk multi hard" value is set */ - int mpio_coll_chunk_link_num_true; /* Instrumented "collective chunk link num true" value - (H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME) */ - hbool_t mpio_coll_chunk_link_num_true_set; /* Whether instrumented "collective chunk link num true" value - is set */ - int mpio_coll_chunk_link_num_false; /* Instrumented "collective chunk link num false" value - (H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME) */ - hbool_t mpio_coll_chunk_link_num_false_set; /* Whether instrumented "collective chunk link num false" - value is set */ - int mpio_coll_chunk_multi_ratio_coll; /* Instrumented "collective chunk multi ratio coll" value - (H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME) */ - hbool_t mpio_coll_chunk_multi_ratio_coll_set; /* Whether instrumented "collective chunk multi ratio coll" + int mpio_coll_chunk_link_hard; /* Instrumented "collective chunk link hard" value + (H5D_XFER_COLL_CHUNK_LINK_HARD_NAME) */ + bool mpio_coll_chunk_link_hard_set; /* Whether instrumented "collective chunk link hard" value is set */ + int mpio_coll_chunk_multi_hard; /* Instrumented "collective chunk multi hard" value + (H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME) */ + bool mpio_coll_chunk_multi_hard_set; /* Whether instrumented "collective chunk multi hard" value is set */ + int mpio_coll_chunk_link_num_true; /* Instrumented "collective chunk link num true" value + (H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME) */ + bool mpio_coll_chunk_link_num_true_set; /* Whether instrumented "collective chunk link num true" value + is set */ + int mpio_coll_chunk_link_num_false; /* Instrumented "collective chunk link num false" value + (H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME) */ + bool mpio_coll_chunk_link_num_false_set; /* Whether instrumented "collective chunk link num false" value is set */ - int mpio_coll_chunk_multi_ratio_ind; /* Instrumented "collective chunk multi ratio ind" value - (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ - hbool_t mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind" + int mpio_coll_chunk_multi_ratio_coll; /* Instrumented "collective chunk multi ratio coll" value + (H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME) */ + bool mpio_coll_chunk_multi_ratio_coll_set; /* Whether instrumented "collective chunk multi ratio coll" + value is set */ + int mpio_coll_chunk_multi_ratio_ind; /* Instrumented "collective chunk multi ratio ind" value + (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ + bool mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ - hbool_t mpio_coll_rank0_bcast; /* Instrumented "collective chunk multi ratio ind" value + bool mpio_coll_rank0_bcast; /* Instrumented "collective chunk multi ratio ind" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ - hbool_t - mpio_coll_rank0_bcast_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ + bool mpio_coll_rank0_bcast_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ uint32_t no_selection_io_cause; /* Reason for not performing selection I/O (H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */ - hbool_t no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */ - hbool_t no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */ + bool no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */ + bool no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */ /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ - hbool_t encoding_valid; /* Whether link name character encoding is valid */ + bool encoding_valid; /* Whether link name character encoding is valid */ unsigned intermediate_group; /* Whether to create intermediate groups */ - hbool_t intermediate_group_valid; /* Whether create intermediate group flag is valid */ + bool intermediate_group_valid; /* Whether create intermediate group flag is valid */ /* Cached LAPL properties */ - size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ - hbool_t nlinks_valid; /* Whether number of soft / UD links to traverse is valid */ + size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ + bool nlinks_valid; /* Whether number of soft / UD links to traverse is valid */ /* Cached DCPL properties */ - hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ - hbool_t do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */ + bool do_min_dset_ohdr; /* Whether to minimize dataset object header */ + bool do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */ uint8_t ohdr_flags; /* Object header flags */ - hbool_t ohdr_flags_valid; /* Whether the object headers flags are valid */ + bool ohdr_flags_valid; /* Whether the object headers flags are valid */ /* Cached DAPL properties */ const char *extfile_prefix; /* Prefix for external file */ - hbool_t extfile_prefix_valid; /* Whether the prefix for external file is valid */ + bool extfile_prefix_valid; /* Whether the prefix for external file is valid */ const char *vds_prefix; /* Prefix for VDS */ - hbool_t vds_prefix_valid; /* Whether the prefix for VDS is valid */ + bool vds_prefix_valid; /* Whether the prefix for VDS is valid */ /* Cached FAPL properties */ H5F_libver_t low_bound; /* low_bound property for H5Pset_libver_bounds() */ - hbool_t low_bound_valid; /* Whether low_bound property is valid */ + bool low_bound_valid; /* Whether low_bound property is valid */ H5F_libver_t high_bound; /* high_bound property for H5Pset_libver_bounds */ - hbool_t high_bound_valid; /* Whether high_bound property is valid */ + bool high_bound_valid; /* Whether high_bound property is valid */ /* Cached VOL settings */ H5VL_connector_prop_t vol_connector_prop; /* Property for VOL connector ID & info */ - hbool_t vol_connector_prop_valid; /* Whether property for VOL connector ID & info is valid */ - void *vol_wrap_ctx; /* VOL connector's "wrap context" for creating IDs */ - hbool_t vol_wrap_ctx_valid; /* Whether VOL connector's "wrap context" for creating IDs is valid */ + bool vol_connector_prop_valid; /* Whether property for VOL connector ID & info is valid */ + void *vol_wrap_ctx; /* VOL connector's "wrap context" for creating IDs */ + bool vol_wrap_ctx_valid; /* Whether VOL connector's "wrap context" for creating IDs is valid */ } H5CX_t; /* Typedef for nodes on the API context stack */ @@ -383,7 +380,7 @@ typedef struct H5CX_dxpl_cache_t { H5D_selection_io_mode_t selection_io_mode; /* Selection I/O mode (H5D_XFER_SELECTION_IO_MODE_NAME) */ uint32_t no_selection_io_cause; /* Reasons for not performing selection I/O (H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */ - hbool_t modify_write_buf; /* Whether the library can modify write buffers */ + bool modify_write_buf; /* Whether the library can modify write buffers */ } H5CX_dxpl_cache_t; /* Typedef for cached default link creation property list information */ @@ -402,7 +399,7 @@ typedef struct H5CX_lapl_cache_t { /* Typedef for cached default dataset creation property list information */ /* (Same as the cached DXPL struct, above, except for the default DCPL) */ typedef struct H5CX_dcpl_cache_t { - hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ + bool do_min_dset_ohdr; /* Whether to minimize dataset object header */ uint8_t ohdr_flags; /* Object header flags */ } H5CX_dcpl_cache_t; @@ -427,7 +424,7 @@ typedef struct H5CX_fapl_cache_t { static H5CX_node_t **H5CX__get_context(void); #endif /* H5_HAVE_THREADSAFE */ static void H5CX__push_common(H5CX_node_t *cnode); -static H5CX_node_t *H5CX__pop_common(hbool_t update_dxpl_props); +static H5CX_node_t *H5CX__pop_common(bool update_dxpl_props); /*********************/ /* Package Variables */ @@ -688,7 +685,7 @@ H5CX_term_package(void) /* Pop the top context node from the stack */ /* (Can't check for errors, as rest of library is shut down) */ - cnode = H5CX__pop_common(FALSE); + cnode = H5CX__pop_common(false); /* Free the context node */ /* (Allocated with malloc() in H5CX_push_special() ) */ @@ -881,7 +878,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) H5CX_RETRIEVE_PLIST(dcpl, FAIL) /* Copy the DCPL ID */ - if (((*api_state)->dcpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.dcpl, FALSE)) < 0) + if (((*api_state)->dcpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.dcpl, false)) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ else @@ -893,7 +890,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) H5CX_RETRIEVE_PLIST(dxpl, FAIL) /* Copy the DXPL ID */ - if (((*api_state)->dxpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.dxpl, FALSE)) < 0) + if (((*api_state)->dxpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.dxpl, false)) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ else @@ -905,7 +902,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) H5CX_RETRIEVE_PLIST(lapl, FAIL) /* Copy the LAPL ID */ - if (((*api_state)->lapl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.lapl, FALSE)) < 0) + if (((*api_state)->lapl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.lapl, false)) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ else @@ -917,7 +914,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) H5CX_RETRIEVE_PLIST(lcpl, FAIL) /* Copy the LCPL ID */ - if (((*api_state)->lcpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.lcpl, FALSE)) < 0) + if (((*api_state)->lcpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.lcpl, false)) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ else @@ -957,7 +954,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) } /* end if */ /* Increment the refcount on the connector ID */ - if (H5I_inc_ref((*api_state)->vol_connector_prop.connector_id, FALSE) < 0) + if (H5I_inc_ref((*api_state)->vol_connector_prop.connector_id, false) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTINC, FAIL, "incrementing VOL connector ID failed"); } /* end if */ } /* end if */ @@ -1026,13 +1023,13 @@ H5CX_restore_state(const H5CX_state_t *api_state) /* Restore the VOL wrapper context */ (*head)->ctx.vol_wrap_ctx = api_state->vol_wrap_ctx; if (NULL != (*head)->ctx.vol_wrap_ctx) - (*head)->ctx.vol_wrap_ctx_valid = TRUE; + (*head)->ctx.vol_wrap_ctx_valid = true; /* Restore the VOL connector info */ if (api_state->vol_connector_prop.connector_id) { H5MM_memcpy(&(*head)->ctx.vol_connector_prop, &api_state->vol_connector_prop, sizeof(H5VL_connector_prop_t)); - (*head)->ctx.vol_connector_prop_valid = TRUE; + (*head)->ctx.vol_connector_prop_valid = true; } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -1112,15 +1109,15 @@ done: * * Purpose: Checks if the API context is using the library's default DXPL * - * Return: TRUE / FALSE (can't fail) + * Return: true / false (can't fail) * *------------------------------------------------------------------------- */ -hbool_t +bool H5CX_is_def_dxpl(void) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ - hbool_t is_def_dxpl = FALSE; /* Flag to indicate DXPL is default */ + bool is_def_dxpl = false; /* Flag to indicate DXPL is default */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1213,8 +1210,8 @@ H5CX_set_libver_bounds(H5F_t *f) (*head)->ctx.high_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_HIGH_BOUND(f); /* Mark the values as valid */ - (*head)->ctx.low_bound_valid = TRUE; - (*head)->ctx.high_bound_valid = TRUE; + (*head)->ctx.low_bound_valid = true; + (*head)->ctx.high_bound_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_libver_bounds() */ @@ -1288,7 +1285,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ loc_id, - hbool_t + bool #ifndef H5_HAVE_PARALLEL H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ @@ -1318,7 +1315,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, #ifdef H5CX_DEBUG /* Sanity check the access property list class */ - if (TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) + if (true != H5P_isa_class(*acspl_id, *libclass->class_id)) HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not the required access property list"); #endif /* H5CX_DEBUG*/ @@ -1359,7 +1356,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, /* If collective metadata read requested, set collective metadata read flag */ if (H5P_USER_TRUE == md_coll_read) - is_collective = TRUE; + is_collective = true; } /* end if */ #endif /* H5_HAVE_PARALLEL */ } /* end else */ @@ -1368,7 +1365,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, /* Check for collective operation */ if (is_collective) { /* Set collective metadata read flag */ - (*head)->ctx.coll_metadata_read = TRUE; + (*head)->ctx.coll_metadata_read = true; /* If parallel is enabled and the file driver used is the MPI-IO * VFD, issue an MPI barrier for easier debugging if the API function @@ -1422,7 +1419,7 @@ H5CX_set_loc(hid_t assert(head && *head); /* Set collective metadata read flag */ - (*head)->ctx.coll_metadata_read = TRUE; + (*head)->ctx.coll_metadata_read = true; /* If parallel is enabled and the file driver used is the MPI-IO * VFD, issue an MPI barrier for easier debugging if the API function @@ -1474,7 +1471,7 @@ H5CX_set_vol_wrap_ctx(void *vol_wrap_ctx) (*head)->ctx.vol_wrap_ctx = vol_wrap_ctx; /* Mark the value as valid */ - (*head)->ctx.vol_wrap_ctx_valid = TRUE; + (*head)->ctx.vol_wrap_ctx_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_vol_wrap_ctx() */ @@ -1504,7 +1501,7 @@ H5CX_set_vol_connector_prop(const H5VL_connector_prop_t *vol_connector_prop) H5MM_memcpy(&(*head)->ctx.vol_connector_prop, vol_connector_prop, sizeof(H5VL_connector_prop_t)); /* Mark the value as valid */ - (*head)->ctx.vol_connector_prop_valid = TRUE; + (*head)->ctx.vol_connector_prop_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_vol_connector_prop() */ @@ -1697,15 +1694,15 @@ H5CX_get_ring(void) * * Purpose: Retrieves the "do collective metadata reads" flag for the current API call context. * - * Return: TRUE / FALSE on success / + * Return: true / false on success / * *------------------------------------------------------------------------- */ -hbool_t +bool H5CX_get_coll_metadata_read(void) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ - hbool_t coll_md_read = FALSE; + bool coll_md_read = false; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1756,15 +1753,15 @@ H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype) * * Purpose: Retrieves the "flushing an MPI-opened file" flag for the current API call context. * - * Return: TRUE / FALSE on success / + * Return: true / false on success / * *------------------------------------------------------------------------- */ -hbool_t +bool H5CX_get_mpi_file_flushing(void) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ - hbool_t flushing = FALSE; + bool flushing = false; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1788,11 +1785,11 @@ H5CX_get_mpi_file_flushing(void) * *------------------------------------------------------------------------- */ -hbool_t +bool H5CX_get_mpio_rank0_bcast(void) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ - hbool_t do_rank0_bcast = FALSE; + bool do_rank0_bcast = false; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2341,7 +2338,7 @@ H5CX_get_data_transform(H5Z_data_xform_t **data_transform) } /* end else */ /* Mark the value as valid */ - (*head)->ctx.data_transform_valid = TRUE; + (*head)->ctx.data_transform_valid = true; } /* end if */ /* Get the value */ @@ -2403,7 +2400,7 @@ H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info) } /* end else */ /* Mark the value as valid */ - (*head)->ctx.vl_alloc_info_valid = TRUE; + (*head)->ctx.vl_alloc_info_valid = true; } /* end if */ /* Get the value */ @@ -2522,7 +2519,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_get_modify_write_buf(hbool_t *modify_write_buf) +H5CX_get_modify_write_buf(bool *modify_write_buf) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2687,7 +2684,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag) +H5CX_get_dset_min_ohdr_flag(bool *dset_min_ohdr_flag) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2755,7 +2752,7 @@ H5CX_get_ext_file_prefix(const char **extfile_prefix) } /* end else */ /* Mark the value as valid */ - (*head)->ctx.extfile_prefix_valid = TRUE; + (*head)->ctx.extfile_prefix_valid = true; } /* end if */ /* Get the value */ @@ -2810,7 +2807,7 @@ H5CX_get_vds_prefix(const char **vds_prefix) } /* end else */ /* Mark the value as valid */ - (*head)->ctx.vds_prefix_valid = TRUE; + (*head)->ctx.vds_prefix_valid = true; } /* end if */ /* Get the value */ @@ -2882,7 +2879,7 @@ H5CX_set_ring(H5AC_ring_t ring) *------------------------------------------------------------------------- */ void -H5CX_set_coll_metadata_read(hbool_t cmdr) +H5CX_set_coll_metadata_read(bool cmdr) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ @@ -2953,7 +2950,7 @@ H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode) (*head)->ctx.io_xfer_mode = io_xfer_mode; /* Mark the value as valid */ - (*head)->ctx.io_xfer_mode_valid = TRUE; + (*head)->ctx.io_xfer_mode_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_io_xfer_mode() */ @@ -2983,7 +2980,7 @@ H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt) (*head)->ctx.mpio_coll_opt = mpio_coll_opt; /* Mark the value as valid */ - (*head)->ctx.mpio_coll_opt_valid = TRUE; + (*head)->ctx.mpio_coll_opt_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_mpio_coll_opt() */ @@ -2998,7 +2995,7 @@ H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt) *------------------------------------------------------------------------- */ void -H5CX_set_mpi_file_flushing(hbool_t flushing) +H5CX_set_mpi_file_flushing(bool flushing) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ @@ -3024,7 +3021,7 @@ H5CX_set_mpi_file_flushing(hbool_t flushing) *------------------------------------------------------------------------- */ void -H5CX_set_mpio_rank0_bcast(hbool_t rank0_bcast) +H5CX_set_mpio_rank0_bcast(bool rank0_bcast) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ @@ -3068,7 +3065,7 @@ H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free (*head)->ctx.vl_alloc_info.free_info = free_info; /* Mark the value as valid */ - (*head)->ctx.vl_alloc_info_valid = TRUE; + (*head)->ctx.vl_alloc_info_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_vlen_alloc_info() */ @@ -3098,7 +3095,7 @@ H5CX_set_nlinks(size_t nlinks) (*head)->ctx.nlinks = nlinks; /* Mark the value as valid */ - (*head)->ctx.nlinks_valid = TRUE; + (*head)->ctx.nlinks_valid = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_set_nlinks() */ @@ -3128,7 +3125,7 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_actual_chunk_opt = mpio_actual_chunk_opt; - (*head)->ctx.mpio_actual_chunk_opt_set = TRUE; + (*head)->ctx.mpio_actual_chunk_opt_set = true; FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_mpio_actual_chunk_opt() */ @@ -3156,7 +3153,7 @@ H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_actual_io_mode = mpio_actual_io_mode; - (*head)->ctx.mpio_actual_io_mode_set = TRUE; + (*head)->ctx.mpio_actual_io_mode_set = true; FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_mpio_actual_chunk_opt() */ @@ -3186,7 +3183,7 @@ H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause) if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_local_no_coll_cause = mpio_local_no_coll_cause; - (*head)->ctx.mpio_local_no_coll_cause_set = TRUE; + (*head)->ctx.mpio_local_no_coll_cause_set = true; } /* end if */ FUNC_LEAVE_NOAPI_VOID @@ -3217,7 +3214,7 @@ H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_global_no_coll_cause = mpio_global_no_coll_cause; - (*head)->ctx.mpio_global_no_coll_cause_set = TRUE; + (*head)->ctx.mpio_global_no_coll_cause_set = true; } /* end if */ FUNC_LEAVE_NOAPI_VOID @@ -3420,7 +3417,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_test_set_mpio_coll_rank0_bcast(hbool_t mpio_coll_rank0_bcast) +H5CX_test_set_mpio_coll_rank0_bcast(bool mpio_coll_rank0_bcast) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3466,7 +3463,7 @@ H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause) if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.no_selection_io_cause = no_selection_io_cause; - (*head)->ctx.no_selection_io_cause_set = TRUE; + (*head)->ctx.no_selection_io_cause_set = true; } /* end if */ FUNC_LEAVE_NOAPI_VOID @@ -3514,7 +3511,7 @@ done: *------------------------------------------------------------------------- */ static H5CX_node_t * -H5CX__pop_common(hbool_t update_dxpl_props) +H5CX__pop_common(bool update_dxpl_props) { H5CX_node_t **head = NULL; /* Pointer to head of API context list */ H5CX_node_t *ret_value = NULL; /* Return value */ @@ -3563,7 +3560,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_pop(hbool_t update_dxpl_props) +H5CX_pop(bool update_dxpl_props) { H5CX_node_t *cnode; /* Context node */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index f0bec20..aa6883b 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -43,8 +43,8 @@ typedef struct H5CX_state_t { #ifdef H5_HAVE_PARALLEL /* Internal: Parallel I/O settings */ - hbool_t coll_metadata_read; /* Whether to use collective I/O for metadata read */ -#endif /* H5_HAVE_PARALLEL */ + bool coll_metadata_read; /* Whether to use collective I/O for metadata read */ +#endif /* H5_HAVE_PARALLEL */ } H5CX_state_t; /*****************************/ @@ -58,10 +58,10 @@ typedef struct H5CX_state_t { /* Library private routines */ #ifndef H5private_H H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); +H5_DLL herr_t H5CX_pop(bool update_dxpl_props); #endif /* H5private_H */ -H5_DLL void H5CX_push_special(void); -H5_DLL hbool_t H5CX_is_def_dxpl(void); +H5_DLL void H5CX_push_special(void); +H5_DLL bool H5CX_is_def_dxpl(void); /* API context state routines */ H5_DLL herr_t H5CX_retrieve_state(H5CX_state_t **api_state); @@ -74,8 +74,7 @@ H5_DLL void H5CX_set_lcpl(hid_t lcpl_id); H5_DLL void H5CX_set_lapl(hid_t lapl_id); H5_DLL void H5CX_set_dcpl(hid_t dcpl_id); H5_DLL herr_t H5CX_set_libver_bounds(H5F_t *f); -H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t loc_id, - hbool_t is_collective); +H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t loc_id, bool is_collective); H5_DLL herr_t H5CX_set_loc(hid_t loc_id); H5_DLL herr_t H5CX_set_vol_wrap_ctx(void *wrap_ctx); H5_DLL herr_t H5CX_set_vol_connector_prop(const H5VL_connector_prop_t *vol_connector_prop); @@ -88,10 +87,10 @@ H5_DLL herr_t H5CX_get_vol_connector_prop(H5VL_connector_prop_t *vol_connec H5_DLL haddr_t H5CX_get_tag(void); H5_DLL H5AC_ring_t H5CX_get_ring(void); #ifdef H5_HAVE_PARALLEL -H5_DLL hbool_t H5CX_get_coll_metadata_read(void); -H5_DLL herr_t H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype); -H5_DLL hbool_t H5CX_get_mpi_file_flushing(void); -H5_DLL hbool_t H5CX_get_mpio_rank0_bcast(void); +H5_DLL bool H5CX_get_coll_metadata_read(void); +H5_DLL herr_t H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype); +H5_DLL bool H5CX_get_mpi_file_flushing(void); +H5_DLL bool H5CX_get_mpio_rank0_bcast(void); #endif /* H5_HAVE_PARALLEL */ /* "Getter" routines for DXPL properties cached in API context */ @@ -117,7 +116,7 @@ H5_DLL herr_t H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info); H5_DLL herr_t H5CX_get_dt_conv_cb(H5T_conv_cb_t *cb_struct); H5_DLL herr_t H5CX_get_selection_io_mode(H5D_selection_io_mode_t *selection_io_mode); H5_DLL herr_t H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause); -H5_DLL herr_t H5CX_get_modify_write_buf(hbool_t *modify_write_buf); +H5_DLL herr_t H5CX_get_modify_write_buf(bool *modify_write_buf); /* "Getter" routines for LCPL properties cached in API context */ H5_DLL herr_t H5CX_get_encoding(H5T_cset_t *encoding); @@ -127,7 +126,7 @@ H5_DLL herr_t H5CX_get_intermediate_group(unsigned *crt_intermed_group); H5_DLL herr_t H5CX_get_nlinks(size_t *nlinks); /* "Getter" routines for DCPL properties cached in API context */ -H5_DLL herr_t H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag); +H5_DLL herr_t H5CX_get_dset_min_ohdr_flag(bool *dset_min_ohdr_flag); H5_DLL herr_t H5CX_get_ohdr_flags(uint8_t *ohdr_flags); /* "Getter" routines for DAPL properties cached in API context */ @@ -141,11 +140,11 @@ H5_DLL herr_t H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high H5_DLL void H5CX_set_tag(haddr_t tag); H5_DLL void H5CX_set_ring(H5AC_ring_t ring); #ifdef H5_HAVE_PARALLEL -H5_DLL void H5CX_set_coll_metadata_read(hbool_t cmdr); +H5_DLL void H5CX_set_coll_metadata_read(bool cmdr); H5_DLL herr_t H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype); H5_DLL herr_t H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt); -H5_DLL void H5CX_set_mpi_file_flushing(hbool_t flushing); -H5_DLL void H5CX_set_mpio_rank0_bcast(hbool_t rank0_bcast); +H5_DLL void H5CX_set_mpi_file_flushing(bool flushing); +H5_DLL void H5CX_set_mpio_rank0_bcast(bool rank0_bcast); #endif /* H5_HAVE_PARALLEL */ /* "Setter" routines for DXPL properties cached in API context */ @@ -176,7 +175,7 @@ H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_li H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll); H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind); -H5_DLL herr_t H5CX_test_set_mpio_coll_rank0_bcast(hbool_t rank0_bcast); +H5_DLL herr_t H5CX_test_set_mpio_coll_rank0_bcast(bool rank0_bcast); #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index c65d942..6e3db09 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -339,7 +339,7 @@ done: */ herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, - hbool_t + bool #if !H5C_COLLECT_CACHE_STATS H5_ATTR_UNUSED #endif /* H5C_COLLECT_CACHE_STATS */ @@ -779,13 +779,13 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) * of protect / unprotect calls prior to this call. * * If either the parent or the child is not in the metadata - * cache, the function sets *fd_exists_ptr to FALSE. + * cache, the function sets *fd_exists_ptr to false. * * If both are in the cache, the child's list of parents is * searched for the proposed parent. If the proposed parent * is found in the child's parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, - * the function sets *fd_exists_ptr FALSE. + * *fd_exists_ptr to true. In all other non-error cases, + * the function sets *fd_exists_ptr false. * * Return: SUCCEED on success/FAIL on failure. Note that * *fd_exists_ptr is undefined on failure. @@ -794,12 +794,12 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) */ #ifndef NDEBUG herr_t -H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr) +H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, bool *fd_exists_ptr) { - hbool_t fd_exists = FALSE; /* whether flush dependency exists */ + bool fd_exists = false; /* whether flush dependency exists */ H5C_cache_entry_t *parent_ptr; /* Ptr to parent entry */ H5C_cache_entry_t *child_ptr; /* Ptr to child entry */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -821,7 +821,7 @@ H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child for (u = 0; u < child_ptr->flush_dep_nparents; u++) { if (child_ptr->flush_dep_parent[u] == parent_ptr) { - fd_exists = TRUE; + fd_exists = true; assert(parent_ptr->flush_dep_nchildren > 0); break; } /* end if */ @@ -1025,7 +1025,7 @@ done: *------------------------------------------------------------------------- */ #ifndef NDEBUG -hbool_t +bool H5C_get_serialization_in_progress(const H5C_t *cache_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1044,19 +1044,19 @@ H5C_get_serialization_in_progress(const H5C_t *cache_ptr) * metadata cache are clean from the outermost ring, inwards * to the inner ring specified. * - * Returns TRUE if all specified rings are clean, and FALSE + * Returns true if all specified rings are clean, and false * if not. Throws an assertion failure on error. * - * Return: TRUE if the indicated ring(s) are clean, and FALSE otherwise. + * Return: true if the indicated ring(s) are clean, and false otherwise. * *------------------------------------------------------------------------- */ #ifndef NDEBUG -hbool_t +bool H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) { H5C_ring_t ring = H5C_RING_USER; - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1067,7 +1067,7 @@ H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) while (ring <= inner_ring) { if (cache_ptr->dirty_index_ring_size[ring] > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); ring++; } /* end while */ @@ -1085,12 +1085,12 @@ done: * type field contains the expted value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * to true, and *type_ok_ptr is set to true or false depending * on whether the entries type field matches the expected_type * parameter. * * If the target entry is not in cache, *in_cache_ptr is - * set to FALSE, and *type_ok_ptr is undefined. + * set to false, and *type_ok_ptr is undefined. * * Note that this function is only defined if NDEBUG * is not defined. @@ -1101,8 +1101,8 @@ done: */ #ifndef NDEBUG herr_t -H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, - hbool_t *type_ok_ptr) +H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, bool *in_cache_ptr, + bool *type_ok_ptr) { H5C_cache_entry_t *entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -1122,9 +1122,9 @@ H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expecte /* the entry doesn't exist in the cache -- report this * and quit. */ - *in_cache_ptr = FALSE; + *in_cache_ptr = false; else { - *in_cache_ptr = TRUE; + *in_cache_ptr = true; if (entry_ptr->prefetched) *type_ok_ptr = (expected_type->id == entry_ptr->prefetch_type_id); @@ -1485,18 +1485,18 @@ done: * is in present. We need this, as it is possible for * an entry to be in the skip list twice. * - * Return: FALSE if the entry is not in the skip list, and TRUE + * Return: false if the entry is not in the skip list, and true * if it is. * *------------------------------------------------------------------------- */ #ifdef H5C_DO_SLIST_SANITY_CHECKS -hbool_t +bool H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) { H5SL_node_t *node_ptr; - hbool_t in_slist; - hbool_t ret_value; + bool in_slist; + bool ret_value; FUNC_ENTER_PACKAGE @@ -1505,7 +1505,7 @@ H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) assert(cache_ptr->slist_ptr); node_ptr = H5SL_first(cache_ptr->slist_ptr); - in_slist = FALSE; + in_slist = false; while ((node_ptr != NULL) && (!in_slist)) { H5C_cache_entry_t *entry_ptr; @@ -1516,7 +1516,7 @@ H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) assert(entry_ptr->in_slist); if (entry_ptr == target_ptr) - in_slist = TRUE; + in_slist = true; else node_ptr = H5SL_next(node_ptr); } @@ -1540,9 +1540,9 @@ done: */ herr_t #if H5C_COLLECT_CACHE_STATS -H5C__image_stats(H5C_t *cache_ptr, hbool_t print_header) +H5C__image_stats(H5C_t *cache_ptr, bool print_header) #else /* H5C_COLLECT_CACHE_STATS */ -H5C__image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header) +H5C__image_stats(H5C_t *cache_ptr, bool H5_ATTR_UNUSED print_header) #endif /* H5C_COLLECT_CACHE_STATS */ { #if H5C_COLLECT_CACHE_STATS diff --git a/src/H5Centry.c b/src/H5Centry.c index 9b93a96..353cc1f 100644 --- a/src/H5Centry.c +++ b/src/H5Centry.c @@ -58,14 +58,13 @@ typedef H5C_cache_entry_t *H5C_cache_entry_ptr_t; /* Local Prototypes */ /********************/ static herr_t H5C__pin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); -static herr_t H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp); -static herr_t H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp); +static herr_t H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, bool update_rp); +static herr_t H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, bool update_rp); static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); -static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len, - hbool_t actual); +static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len, bool actual); static void *H5C__load_entry(H5F_t *f, #ifdef H5_HAVE_PARALLEL - hbool_t coll_access, + bool coll_access, #endif /* H5_HAVE_PARALLEL */ const H5C_class_t *type, haddr_t addr, void *udata); static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t *entry); @@ -129,13 +128,13 @@ H5C__pin_entry_from_client(H5C_t HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "entry is already pinned"); } /* end if */ else { - entry_ptr->is_pinned = TRUE; + entry_ptr->is_pinned = true; H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr); } /* end else */ /* Mark that the entry was pinned through an explicit pin from a client */ - entry_ptr->pinned_from_client = TRUE; + entry_ptr->pinned_from_client = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -151,7 +150,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp) +H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, bool update_rp) { herr_t ret_value = SUCCEED; /* Return value */ @@ -171,7 +170,7 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t up H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL); /* Unpin the entry now */ - entry_ptr->is_pinned = FALSE; + entry_ptr->is_pinned = false; /* Update the stats for an unpin operation */ H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr); @@ -192,7 +191,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp) +H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, bool update_rp) { herr_t ret_value = SUCCEED; /* Return value */ @@ -214,7 +213,7 @@ H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbo HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry"); /* Mark the entry as explicitly unpinned by the client */ - entry_ptr->pinned_from_client = FALSE; + entry_ptr->pinned_from_client = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -355,7 +354,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) if (entry_ptr->addr == old_addr) { /* Delete the entry from the hash table and the slist */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE, FAIL); + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, false, FAIL); /* Update the entry for its new address */ entry_ptr->addr = new_addr; @@ -378,7 +377,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) H5C_IMAGE_EXTRA_SPACE)); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ - entry_ptr->image_up_to_date = TRUE; + entry_ptr->image_up_to_date = true; /* Propagate the fact that the entry is serialized up the * flush dependency chain if appropriate. Since the image must @@ -425,19 +424,19 @@ herr_t H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) { H5C_t *cache_ptr; /* Cache for file */ - hbool_t destroy; /* external flag */ - hbool_t clear_only; /* external flag */ - hbool_t free_file_space; /* external flag */ - hbool_t take_ownership; /* external flag */ - hbool_t del_from_slist_on_destroy; /* external flag */ - hbool_t during_flush; /* external flag */ - hbool_t write_entry; /* internal flag */ - hbool_t destroy_entry; /* internal flag */ - hbool_t generate_image; /* internal flag */ - hbool_t update_page_buffer; /* internal flag */ - hbool_t was_dirty; - hbool_t suppress_image_entry_writes = FALSE; - hbool_t suppress_image_entry_frees = FALSE; + bool destroy; /* external flag */ + bool clear_only; /* external flag */ + bool free_file_space; /* external flag */ + bool take_ownership; /* external flag */ + bool del_from_slist_on_destroy; /* external flag */ + bool during_flush; /* external flag */ + bool write_entry; /* internal flag */ + bool destroy_entry; /* internal flag */ + bool generate_image; /* internal flag */ + bool update_page_buffer; /* internal flag */ + bool was_dirty; + bool suppress_image_entry_writes = false; + bool suppress_image_entry_frees = false; haddr_t entry_addr = HADDR_UNDEF; herr_t ret_value = SUCCEED; /* Return value */ @@ -464,7 +463,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * and 'destroy' flags */ if (take_ownership) - destroy_entry = FALSE; + destroy_entry = false; else destroy_entry = destroy; @@ -472,15 +471,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * clear only flag is not set. */ if (entry_ptr->is_dirty && !clear_only) - write_entry = TRUE; + write_entry = true; else - write_entry = FALSE; + write_entry = false; /* if we have received close warning, and we have been instructed to * generate a metadata cache image, and we have actually constructed - * the entry images, set suppress_image_entry_frees to TRUE. + * the entry images, set suppress_image_entry_frees to true. * - * Set suppress_image_entry_writes to TRUE if indicated by the + * Set suppress_image_entry_writes to true if indicated by the * image_ctl flags. */ if (cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image && @@ -493,10 +492,10 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) assert((!take_ownership) || !(entry_ptr->include_in_image)); assert((!free_file_space) || !(entry_ptr->include_in_image)); - suppress_image_entry_frees = TRUE; + suppress_image_entry_frees = true; if (cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) - suppress_image_entry_writes = TRUE; + suppress_image_entry_writes = true; } /* end if */ /* run initial sanity checks */ @@ -526,14 +525,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Attempt to flush a protected entry -- scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry"); - /* Set entry_ptr->flush_in_progress = TRUE and set - * entry_ptr->flush_marker = FALSE + /* Set entry_ptr->flush_in_progress = true and set + * entry_ptr->flush_marker = false * - * We will set flush_in_progress back to FALSE at the end if the + * We will set flush_in_progress back to false at the end if the * entry still exists at that point. */ - entry_ptr->flush_in_progress = TRUE; - entry_ptr->flush_marker = FALSE; + entry_ptr->flush_in_progress = true; + entry_ptr->flush_marker = false; /* Preserve current dirty state for later */ was_dirty = entry_ptr->is_dirty; @@ -583,7 +582,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Write the image to disk unless the write is suppressed. * * This happens if both suppress_image_entry_writes and - * entry_ptr->include_in_image are TRUE, or if the + * entry_ptr->include_in_image are true, or if the * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ @@ -691,7 +690,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) #ifdef H5_HAVE_PARALLEL /* Check for collective read access flag */ if (entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; + entry_ptr->coll_access = false; H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL); } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -724,7 +723,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * entry clean. Also, call the clear callback * if defined. */ - entry_ptr->is_dirty = FALSE; + entry_ptr->is_dirty = false; H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr, FAIL); @@ -751,7 +750,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end else */ /* reset the flush_in progress flag */ - entry_ptr->flush_in_progress = FALSE; + entry_ptr->flush_in_progress = false; /* capture the cache entry address for the log_flush call at the * end before the entry_ptr gets freed @@ -854,7 +853,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) if (destroy_entry) { if (entry_ptr->is_dirty) { /* Reset dirty flag */ - entry_ptr->is_dirty = FALSE; + entry_ptr->is_dirty = false; /* If the entry's type has a 'notify' callback send a * 'entry cleaned' notice now that the entry is fully @@ -920,7 +919,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len, hbool_t actual) +H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len, bool actual) { H5FD_mem_t cooked_type; /* Modified type, accounting for switching global heaps */ haddr_t eoa; /* End-of-allocation in the file */ @@ -978,11 +977,11 @@ done: void * H5C__load_entry(H5F_t *f, #ifdef H5_HAVE_PARALLEL - hbool_t coll_access, + bool coll_access, #endif /* H5_HAVE_PARALLEL */ const H5C_class_t *type, haddr_t addr, void *udata) { - hbool_t dirty = FALSE; /* Flag indicating whether thing was dirtied during deserialize */ + bool dirty = false; /* Flag indicating whether thing was dirtied during deserialize */ uint8_t *image = NULL; /* Buffer for disk image */ void *thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t *entry = NULL; /* Alias for thing loaded, as cache entry */ @@ -1021,7 +1020,7 @@ H5C__load_entry(H5F_t *f, /* Check for possible speculative read off the end of the file */ if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) - if (H5C__verify_len_eoa(f, type, addr, &len, FALSE) < 0) + if (H5C__verify_len_eoa(f, type, addr, &len, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "invalid len with respect to EOA"); /* Allocate the buffer for reading the on-disk entry image */ @@ -1048,7 +1047,7 @@ H5C__load_entry(H5F_t *f, size_t actual_len = len; /* The actual length, after speculative reads have been resolved */ uint64_t nanosec = 1; /* # of nanoseconds to sleep between retries */ void *new_image; /* Pointer to image */ - hbool_t len_changed = TRUE; /* Whether to re-check speculative entries */ + bool len_changed = true; /* Whether to re-check speculative entries */ /* Get the # of read attempts */ max_tries = tries = H5F_GET_READ_ATTEMPTS(f); @@ -1112,7 +1111,7 @@ H5C__load_entry(H5F_t *f, /* Check for the length changing */ if (actual_len != len) { /* Verify that the length isn't past the EOA for the file */ - if (H5C__verify_len_eoa(f, type, addr, &actual_len, TRUE) < 0) + if (H5C__verify_len_eoa(f, type, addr, &actual_len, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA"); /* Expand buffer to new size */ @@ -1161,7 +1160,7 @@ H5C__load_entry(H5F_t *f, } /* end if (actual_len != len) */ else { /* The length has stabilized */ - len_changed = FALSE; + len_changed = false; /* Set the final length */ len = actual_len; @@ -1177,7 +1176,7 @@ H5C__load_entry(H5F_t *f, /* Verify the checksum for the metadata image */ if ((chk_ret = type->verify_chksum(image, actual_len, udata)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "failure from verify_chksum callback"); - if (chk_ret == TRUE) + if (chk_ret == true) break; /* Sleep for some time */ @@ -1215,7 +1214,7 @@ H5C__load_entry(H5F_t *f, * * In the following assert: * - * assert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); + * assert( ( dirty == false ) || ( type->id == 5 || type->id == 6 ) ); * * note that type ids 5 & 6 are associated with object headers in the * metadata cache. @@ -1225,7 +1224,7 @@ H5C__load_entry(H5F_t *f, * metadata cache. */ - assert((dirty == FALSE) || (type->id == 5 || type->id == 6)); + assert((dirty == false) || (type->id == 5 || type->id == 6)); entry->cache_ptr = f->shared->cache; entry->addr = addr; @@ -1235,20 +1234,20 @@ H5C__load_entry(H5F_t *f, entry->image_up_to_date = !dirty; entry->type = type; entry->is_dirty = dirty; - entry->dirtied = FALSE; - entry->is_protected = FALSE; - entry->is_read_only = FALSE; + entry->dirtied = false; + entry->is_protected = false; + entry->is_read_only = false; entry->ro_ref_count = 0; - entry->is_pinned = FALSE; - entry->in_slist = FALSE; - entry->flush_marker = FALSE; + entry->is_pinned = false; + entry->in_slist = false; + entry->flush_marker = false; #ifdef H5_HAVE_PARALLEL - entry->clear_on_unprotect = FALSE; - entry->flush_immediately = FALSE; + entry->clear_on_unprotect = false; + entry->flush_immediately = false; entry->coll_access = coll_access; #endif /* H5_HAVE_PARALLEL */ - entry->flush_in_progress = FALSE; - entry->destroy_in_progress = FALSE; + entry->flush_in_progress = false; + entry->destroy_in_progress = false; entry->ring = H5C_RING_UNDEFINED; @@ -1278,18 +1277,18 @@ H5C__load_entry(H5F_t *f, #endif /* H5_HAVE_PARALLEL */ /* initialize cache image related fields */ - entry->include_in_image = FALSE; + entry->include_in_image = false; entry->lru_rank = 0; - entry->image_dirty = FALSE; + entry->image_dirty = false; entry->fd_parent_count = 0; entry->fd_parent_addrs = NULL; entry->fd_child_count = 0; entry->fd_dirty_child_count = 0; entry->image_fd_height = 0; - entry->prefetched = FALSE; + entry->prefetched = false; entry->prefetch_type_id = 0; entry->age = 0; - entry->prefetched_dirty = FALSE; + entry->prefetched_dirty = false; #ifndef NDEBUG /* debugging field */ entry->serialization_count = 0; #endif @@ -1559,11 +1558,11 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry assert(!entry_ptr->flush_in_progress); assert(entry_ptr->type); - /* Set entry_ptr->flush_in_progress to TRUE so the target entry - * will not be evicted out from under us. Must set it back to FALSE + /* Set entry_ptr->flush_in_progress to true so the target entry + * will not be evicted out from under us. Must set it back to false * when we are done. */ - entry_ptr->flush_in_progress = TRUE; + entry_ptr->flush_in_progress = true; /* Allocate buffer for the entry image if required. */ if (NULL == entry_ptr->image_ptr) { @@ -1581,7 +1580,7 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "Can't generate image for cache entry"); /* Reset the flush_in progress flag */ - entry_ptr->flush_in_progress = FALSE; + entry_ptr->flush_in_progress = false; done: assert((ret_value != SUCCEED) || (!entry_ptr->flush_in_progress)); @@ -1619,9 +1618,9 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e #ifndef NDEBUG unsigned entries_visited = 0; #endif - int fd_children_found = 0; - hbool_t found; - herr_t ret_value = SUCCEED; /* Return value */ + int fd_children_found = 0; + bool found; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1647,7 +1646,7 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e /* Re-init */ u = 0; - found = FALSE; + found = false; /* Sanity checks */ assert(entry_ptr->type); @@ -1663,7 +1662,7 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e /* Correct entry? */ if (pf_entry_ptr == entry_ptr->flush_dep_parent[u]) - found = TRUE; + found = true; u++; } /* end while */ @@ -1685,11 +1684,11 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e * entry_ptr->fd_parent_addrs and entry_ptr->flush_dep_parent * can list parents in different order. */ - found = FALSE; + found = false; u = 0; while (!found && u < entry_ptr->fd_parent_count) { if (pf_entry_ptr->addr == entry_ptr->fd_parent_addrs[u]) - found = TRUE; + found = true; u++; } /* end while */ assert(found); @@ -1724,7 +1723,7 @@ done: * Note that the on disk image of the entry is not freed -- * a pointer to it is stored in the deserialized entries' * image_ptr field, and its image_up_to_date field is set to - * TRUE unless the entry is dirtied by the deserialize call. + * true unless the entry is dirtied by the deserialize call. * * If the prefetched entry is a flush dependency child, * destroy that flush dependency prior to calling the @@ -1751,7 +1750,7 @@ static herr_t H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { - hbool_t dirty = FALSE; /* Flag indicating whether thing was + bool dirty = false; /* Flag indicating whether thing was * dirtied during deserialize */ size_t len; /* Size of image in file */ @@ -1865,7 +1864,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t * * In the following assert: * - * assert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); + * assert( ( dirty == false ) || ( type->id == 5 || type->id == 6 ) ); * * note that type ids 5 & 6 are associated with object headers in the * metadata cache. @@ -1882,7 +1881,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t * hence the value assigned to ds_entry_ptr->is_dirty below. */ - assert((dirty == FALSE) || (type->id == 5 || type->id == 6)); + assert((dirty == false) || (type->id == 5 || type->id == 6)); ds_entry_ptr->cache_ptr = f->shared->cache; ds_entry_ptr->addr = addr; @@ -1892,20 +1891,20 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t ds_entry_ptr->image_up_to_date = !dirty; ds_entry_ptr->type = type; ds_entry_ptr->is_dirty = dirty | pf_entry_ptr->is_dirty; - ds_entry_ptr->dirtied = FALSE; - ds_entry_ptr->is_protected = FALSE; - ds_entry_ptr->is_read_only = FALSE; + ds_entry_ptr->dirtied = false; + ds_entry_ptr->is_protected = false; + ds_entry_ptr->is_read_only = false; ds_entry_ptr->ro_ref_count = 0; - ds_entry_ptr->is_pinned = FALSE; - ds_entry_ptr->in_slist = FALSE; - ds_entry_ptr->flush_marker = FALSE; + ds_entry_ptr->is_pinned = false; + ds_entry_ptr->in_slist = false; + ds_entry_ptr->flush_marker = false; #ifdef H5_HAVE_PARALLEL - ds_entry_ptr->clear_on_unprotect = FALSE; - ds_entry_ptr->flush_immediately = FALSE; - ds_entry_ptr->coll_access = FALSE; + ds_entry_ptr->clear_on_unprotect = false; + ds_entry_ptr->flush_immediately = false; + ds_entry_ptr->coll_access = false; #endif /* H5_HAVE_PARALLEL */ - ds_entry_ptr->flush_in_progress = FALSE; - ds_entry_ptr->destroy_in_progress = FALSE; + ds_entry_ptr->flush_in_progress = false; + ds_entry_ptr->destroy_in_progress = false; ds_entry_ptr->ring = pf_entry_ptr->ring; @@ -1936,15 +1935,15 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t #endif /* H5_HAVE_PARALLEL */ /* Initialize cache image related fields */ - ds_entry_ptr->include_in_image = FALSE; + ds_entry_ptr->include_in_image = false; ds_entry_ptr->lru_rank = 0; - ds_entry_ptr->image_dirty = FALSE; + ds_entry_ptr->image_dirty = false; ds_entry_ptr->fd_parent_count = 0; ds_entry_ptr->fd_parent_addrs = NULL; ds_entry_ptr->fd_child_count = pf_entry_ptr->fd_child_count; ds_entry_ptr->fd_dirty_child_count = 0; ds_entry_ptr->image_fd_height = 0; - ds_entry_ptr->prefetched = FALSE; + ds_entry_ptr->prefetched = false; ds_entry_ptr->prefetch_type_id = 0; ds_entry_ptr->age = 0; ds_entry_ptr->prefetched_dirty = pf_entry_ptr->prefetched_dirty; @@ -2022,7 +2021,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t i = 0; if (fd_children != NULL) { H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, ds_entry_ptr, FAIL); - ds_entry_ptr->is_protected = TRUE; + ds_entry_ptr->is_protected = true; while (fd_children[i] != NULL) { /* Sanity checks */ assert((fd_children[i])->prefetched); @@ -2031,14 +2030,14 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t #ifndef NDEBUG { - int j; - hbool_t found; + int j; + bool found; j = 0; - found = FALSE; + found = false; while ((j < (int)((fd_children[i])->fd_parent_count)) && (!found)) { if ((fd_children[i])->fd_parent_addrs[j] == ds_entry_ptr->addr) - found = TRUE; + found = true; j++; } /* end while */ @@ -2053,7 +2052,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t } /* end while */ H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, ds_entry_ptr, FAIL); - ds_entry_ptr->is_protected = FALSE; + ds_entry_ptr->is_protected = false; } /* end if ( fd_children != NULL ) */ assert((unsigned)i == ds_entry_ptr->fd_child_count); @@ -2091,17 +2090,17 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u { H5C_t *cache_ptr; H5AC_ring_t ring = H5C_RING_UNDEFINED; - hbool_t insert_pinned; - hbool_t flush_last; + bool insert_pinned; + bool flush_last; #ifdef H5_HAVE_PARALLEL - hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ -#endif /* H5_HAVE_PARALLEL */ - hbool_t set_flush_marker; - hbool_t write_permitted = TRUE; + bool coll_access = false; /* whether access to the cache entry is done collectively */ +#endif /* H5_HAVE_PARALLEL */ + bool set_flush_marker; + bool write_permitted = true; size_t empty_space; H5C_cache_entry_t *entry_ptr = NULL; H5C_cache_entry_t *test_entry_ptr; - hbool_t entry_tagged = FALSE; + bool entry_tagged = false; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2153,37 +2152,37 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u entry_ptr->type = type; entry_ptr->image_ptr = NULL; - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = false; - entry_ptr->is_protected = FALSE; - entry_ptr->is_read_only = FALSE; + entry_ptr->is_protected = false; + entry_ptr->is_read_only = false; entry_ptr->ro_ref_count = 0; entry_ptr->is_pinned = insert_pinned; entry_ptr->pinned_from_client = insert_pinned; - entry_ptr->pinned_from_cache = FALSE; + entry_ptr->pinned_from_cache = false; entry_ptr->flush_me_last = flush_last; /* newly inserted entries are assumed to be dirty */ - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = true; /* not protected, so can't be dirtied */ - entry_ptr->dirtied = FALSE; + entry_ptr->dirtied = false; /* Retrieve the size of the thing */ if ((type->image_len)(thing, &(entry_ptr->size)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "can't get size of thing"); assert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); - entry_ptr->in_slist = FALSE; + entry_ptr->in_slist = false; #ifdef H5_HAVE_PARALLEL - entry_ptr->clear_on_unprotect = FALSE; - entry_ptr->flush_immediately = FALSE; + entry_ptr->clear_on_unprotect = false; + entry_ptr->flush_immediately = false; #endif /* H5_HAVE_PARALLEL */ - entry_ptr->flush_in_progress = FALSE; - entry_ptr->destroy_in_progress = FALSE; + entry_ptr->flush_in_progress = false; + entry_ptr->destroy_in_progress = false; entry_ptr->ring = ring; @@ -2214,18 +2213,18 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u #endif /* H5_HAVE_PARALLEL */ /* initialize cache image related fields */ - entry_ptr->include_in_image = FALSE; + entry_ptr->include_in_image = false; entry_ptr->lru_rank = 0; - entry_ptr->image_dirty = FALSE; + entry_ptr->image_dirty = false; entry_ptr->fd_parent_count = 0; entry_ptr->fd_parent_addrs = NULL; entry_ptr->fd_child_count = 0; entry_ptr->fd_dirty_child_count = 0; entry_ptr->image_fd_height = 0; - entry_ptr->prefetched = FALSE; + entry_ptr->prefetched = false; entry_ptr->prefetch_type_id = 0; entry_ptr->age = 0; - entry_ptr->prefetched_dirty = FALSE; + entry_ptr->prefetched_dirty = false; #ifndef NDEBUG /* debugging field */ entry_ptr->serialization_count = 0; #endif @@ -2238,7 +2237,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u /* Apply tag to newly inserted entry */ if (H5C__tag_entry(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry"); - entry_tagged = TRUE; + entry_tagged = true; H5C__RESET_CACHE_ENTRY_STATS(entry_ptr); @@ -2258,7 +2257,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u size_t space_needed; if (empty_space <= entry_ptr->size) - cache_ptr->cache_full = TRUE; + cache_ptr->cache_full = true; if (cache_ptr->check_write_permitted != NULL) { if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) @@ -2331,13 +2330,13 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u /* Make sure the size of the collective entries in the cache remain in check */ if (H5P_USER_TRUE == H5F_COLL_MD_READ(f)) { if (cache_ptr->max_cache_size * 80 < cache_ptr->coll_list_size * 100) { - if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) + if (H5C_clear_coll_entries(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear collective metadata entries"); } /* end if */ } /* end if */ else { if (cache_ptr->max_cache_size * 40 < cache_ptr->coll_list_size * 100) { - if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) + if (H5C_clear_coll_entries(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear collective metadata entries"); } /* end if */ } /* end else */ @@ -2395,11 +2394,11 @@ H5C_mark_entry_dirty(void *thing) assert(!((entry_ptr)->is_read_only)); /* set the dirtied flag */ - entry_ptr->dirtied = TRUE; + entry_ptr->dirtied = true; /* reset image_up_to_date */ if (entry_ptr->image_up_to_date) { - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = false; if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) @@ -2408,8 +2407,8 @@ H5C_mark_entry_dirty(void *thing) } /* end if */ } /* end if */ else if (entry_ptr->is_pinned) { - hbool_t was_clean; /* Whether the entry was previously clean */ - hbool_t image_was_up_to_date; + bool was_clean; /* Whether the entry was previously clean */ + bool image_was_up_to_date; /* Remember previous dirty status */ was_clean = !entry_ptr->is_dirty; @@ -2418,8 +2417,8 @@ H5C_mark_entry_dirty(void *thing) image_was_up_to_date = entry_ptr->image_up_to_date; /* Mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; - entry_ptr->image_up_to_date = FALSE; + entry_ptr->is_dirty = true; + entry_ptr->image_up_to_date = false; /* Modify cache data structures */ if (was_clean) @@ -2490,22 +2489,22 @@ H5C_mark_entry_clean(void *_thing) if (entry_ptr->is_protected) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "entry is protected"); else if (entry_ptr->is_pinned) { - hbool_t was_dirty; /* Whether the entry was previously dirty */ + bool was_dirty; /* Whether the entry was previously dirty */ /* Remember previous dirty status */ was_dirty = entry_ptr->is_dirty; /* Mark the entry as clean if it isn't already */ - entry_ptr->is_dirty = FALSE; + entry_ptr->is_dirty = false; /* Also reset the 'flush_marker' flag, since the entry shouldn't be flushed now */ - entry_ptr->flush_marker = FALSE; + entry_ptr->flush_marker = false; /* Modify cache data structures */ if (was_dirty) H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr, FAIL); if (entry_ptr->in_slist) - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE, FAIL); + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, false, FAIL); /* Update stats for entry being marked clean */ H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr); @@ -2560,7 +2559,7 @@ H5C_mark_entry_unserialized(void *thing) /* Reset image_up_to_date */ if (entry->image_up_to_date) { - entry->image_up_to_date = FALSE; + entry->image_up_to_date = false; if (entry->flush_dep_nparents > 0) if (H5C__mark_flush_dep_unserialized(entry) < 0) @@ -2605,7 +2604,7 @@ H5C_mark_entry_serialized(void *_thing) /* Check for entry changing status and do notifications, etc. */ if (!entry->image_up_to_date) { /* Set the image_up_to_date flag */ - entry->image_up_to_date = TRUE; + entry->image_up_to_date = true; /* Propagate the serialize up the flush dependency chain, if appropriate */ if (entry->flush_dep_nparents > 0) @@ -2697,24 +2696,24 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd if (entry_ptr->in_slist) { assert(cache_ptr->slist_ptr); - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE, FAIL); + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, false, FAIL); } /* end if */ } /* end if */ entry_ptr->addr = new_addr; if (!entry_ptr->destroy_in_progress) { - hbool_t was_dirty; /* Whether the entry was previously dirty */ + bool was_dirty; /* Whether the entry was previously dirty */ /* Remember previous dirty status */ was_dirty = entry_ptr->is_dirty; /* Mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = true; /* This shouldn't be needed, but it keeps the test code happy */ if (entry_ptr->image_up_to_date) { - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = false; if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, @@ -2802,17 +2801,17 @@ H5C_resize_entry(void *thing, size_t new_size) /* update for change in entry size if necessary */ if (entry_ptr->size != new_size) { - hbool_t was_clean; + bool was_clean; /* make note of whether the entry was clean to begin with */ was_clean = !entry_ptr->is_dirty; /* mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = true; /* Reset the image up-to-date status */ if (entry_ptr->image_up_to_date) { - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = false; if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, @@ -2968,15 +2967,15 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign { H5C_t *cache_ptr; H5AC_ring_t ring = H5C_RING_UNDEFINED; - hbool_t hit; - hbool_t have_write_permitted = FALSE; - hbool_t read_only = FALSE; - hbool_t flush_last; + bool hit; + bool have_write_permitted = false; + bool read_only = false; + bool flush_last; #ifdef H5_HAVE_PARALLEL - hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ -#endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted = FALSE; - hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ + bool coll_access = false; /* whether access to the cache entry is done collectively */ +#endif /* H5_HAVE_PARALLEL */ + bool write_permitted = false; + bool was_loaded = false; /* Whether the entry was loaded as a result of the protect */ size_t empty_space; void *thing; H5C_cache_entry_t *entry_ptr; @@ -3001,7 +3000,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign /* Load the cache image, if requested */ if (cache_ptr->load_image) { - cache_ptr->load_image = FALSE; + cache_ptr->load_image = false; if (H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't load cache image"); } /* end if */ @@ -3083,7 +3082,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code) /* Mark the entry as collective and insert into the collective list */ - entry_ptr->coll_access = TRUE; + entry_ptr->coll_access = true; H5C__INSERT_IN_COLL_LIST(cache_ptr, entry_ptr, NULL); } /* end if */ else if (entry_ptr->coll_access) @@ -3094,7 +3093,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign #ifdef H5C_DO_TAGGING_SANITY_CHECKS { /* Verify tag value */ - if (cache_ptr->ignore_tags != TRUE) { + if (cache_ptr->ignore_tags != true) { haddr_t tag; /* Tag value */ /* The entry is already in the cache, but make sure that the tag value @@ -3112,12 +3111,12 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign } #endif - hit = TRUE; + hit = true; thing = (void *)entry_ptr; } else { /* must try to load the entry from disk. */ - hit = FALSE; + hit = false; if (NULL == (thing = H5C__load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, @@ -3162,17 +3161,17 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign size_t space_needed; if (empty_space <= entry_ptr->size) - cache_ptr->cache_full = TRUE; + cache_ptr->cache_full = true; if (cache_ptr->check_write_permitted != NULL) { if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 1"); else - have_write_permitted = TRUE; + have_write_permitted = true; } /* end if */ else { write_permitted = cache_ptr->write_permitted; - have_write_permitted = TRUE; + have_write_permitted = true; } /* end else */ assert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); @@ -3237,7 +3236,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign /* Record that the entry was loaded, to trigger a notify callback later */ /* (After the entry is fully added to the cache) */ - was_loaded = TRUE; + was_loaded = true; } /* end else */ assert(entry_ptr->addr == addr); @@ -3254,12 +3253,12 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign else { H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL); - entry_ptr->is_protected = TRUE; + entry_ptr->is_protected = true; if (read_only) { - entry_ptr->is_read_only = TRUE; + entry_ptr->is_read_only = true; entry_ptr->ro_ref_count = 1; } /* end if */ - entry_ptr->dirtied = FALSE; + entry_ptr->dirtied = false; } /* end else */ H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit); @@ -3276,11 +3275,11 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted"); else - have_write_permitted = TRUE; + have_write_permitted = true; } else { write_permitted = cache_ptr->write_permitted; - have_write_permitted = TRUE; + have_write_permitted = true; } } @@ -3289,7 +3288,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed"); if (cache_ptr->size_decreased) { - cache_ptr->size_decreased = FALSE; + cache_ptr->size_decreased = false; /* check to see if the cache is now oversized due to the cache * size reduction. If it is, try to evict enough entries to @@ -3308,7 +3307,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign ((empty_space + cache_ptr->clean_index_size) < cache_ptr->min_clean_size)) { if (cache_ptr->index_size > cache_ptr->max_cache_size) - cache_ptr->cache_full = TRUE; + cache_ptr->cache_full = true; if (H5C__make_space_in_cache(f, (size_t)0, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed"); @@ -3334,12 +3333,12 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign if (coll_access) { if (H5P_USER_TRUE == H5F_COLL_MD_READ(f)) { if (cache_ptr->max_cache_size * 80 < cache_ptr->coll_list_size * 100) - if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) + if (H5C_clear_coll_entries(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, "can't clear collective metadata entries"); } /* end if */ else { if (cache_ptr->max_cache_size * 40 < cache_ptr->coll_list_size * 100) - if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) + if (H5C_clear_coll_entries(cache_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, "can't clear collective metadata entries"); } /* end else */ } /* end if */ @@ -3386,7 +3385,7 @@ H5C_unpin_entry(void *_entry_ptr) #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* Unpin the entry */ - if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) + if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client"); done: @@ -3413,7 +3412,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * If the deleted flag is TRUE, simply remove the target entry + * If the deleted flag is true, simply remove the target entry * from the cache, clear it, and free it without writing it to * disk. * @@ -3424,17 +3423,17 @@ done: herr_t H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) { - H5C_t *cache_ptr; - hbool_t deleted; - hbool_t dirtied; - hbool_t set_flush_marker; - hbool_t pin_entry; - hbool_t unpin_entry; - hbool_t free_file_space; - hbool_t take_ownership; - hbool_t was_clean; + H5C_t *cache_ptr; + bool deleted; + bool dirtied; + bool set_flush_marker; + bool pin_entry; + bool unpin_entry; + bool free_file_space; + bool take_ownership; + bool was_clean; #ifdef H5_HAVE_PARALLEL - hbool_t clear_entry = FALSE; + bool clear_entry = false; #endif /* H5_HAVE_PARALLEL */ H5C_cache_entry_t *entry_ptr; H5C_cache_entry_t *test_entry_ptr; @@ -3507,7 +3506,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) } else if (unpin_entry) { /* Unpin the entry from a client */ - if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client"); } /* end if */ } @@ -3519,7 +3518,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if (dirtied) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??"); - entry_ptr->is_read_only = FALSE; + entry_ptr->is_read_only = false; entry_ptr->ro_ref_count = 0; } /* end if */ @@ -3543,9 +3542,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Sanity check */ assert(entry_ptr->is_dirty); - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = false; if (!dirtied) - clear_entry = TRUE; + clear_entry = true; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -3555,7 +3554,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Mark the entry as dirty if appropriate */ entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); if (dirtied && entry_ptr->image_up_to_date) { - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = false; if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, @@ -3611,16 +3610,16 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) } else if (unpin_entry) { /* Unpin the entry from a client */ - if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client"); } /* end if */ /* H5C__UPDATE_RP_FOR_UNPROTECT will place the unprotected entry on - * the pinned entry list if entry_ptr->is_pinned is TRUE. + * the pinned entry list if entry_ptr->is_pinned is true. */ H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL); - entry_ptr->is_protected = FALSE; + entry_ptr->is_protected = false; /* if the entry is dirty, 'or' its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. @@ -3628,7 +3627,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if (entry_ptr->is_dirty) { entry_ptr->flush_marker |= set_flush_marker; if (!entry_ptr->in_slist) - /* this is a no-op if cache_ptr->slist_enabled is FALSE */ + /* this is a no-op if cache_ptr->slist_enabled is false */ H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); } /* end if */ @@ -3742,7 +3741,7 @@ H5C_unsettle_entry_ring(void *_entry) if (cache->rdfsm_settled) { if (cache->flush_in_progress || cache->close_warning_received) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected rdfsm ring unsettle"); - cache->rdfsm_settled = FALSE; + cache->rdfsm_settled = false; } /* end if */ break; @@ -3750,12 +3749,12 @@ H5C_unsettle_entry_ring(void *_entry) if (cache->mdfsm_settled) { if (cache->flush_in_progress || cache->close_warning_received) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected mdfsm ring unsettle"); - cache->mdfsm_settled = FALSE; + cache->mdfsm_settled = false; } /* end if */ break; default: - assert(FALSE); /* this should be un-reachable */ + assert(false); /* this should be un-reachable */ break; } /* end switch */ @@ -3824,12 +3823,12 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) assert(!parent_entry->pinned_from_cache); /* Pin the parent entry */ - parent_entry->is_pinned = TRUE; + parent_entry->is_pinned = true; H5C__UPDATE_STATS_FOR_PIN(cache_ptr, parent_entry); } /* end else */ /* Mark the entry as pinned from the cache's action (possibly redundantly) */ - parent_entry->pinned_from_cache = TRUE; + parent_entry->pinned_from_cache = true; /* Check if we need to resize the child's parent array */ if (child_entry->flush_dep_nparents >= child_entry->flush_dep_parent_nalloc) { @@ -3971,11 +3970,11 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing) /* Check if we should unpin parent entry now */ if (!parent_entry->pinned_from_client) - if (H5C__unpin_entry_real(cache_ptr, parent_entry, TRUE) < 0) + if (H5C__unpin_entry_real(cache_ptr, parent_entry, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry"); /* Mark the entry as unpinned from the cache's action */ - parent_entry->pinned_from_cache = FALSE; + parent_entry->pinned_from_cache = false; } /* end if */ /* Adjust parent entry's ndirty_children */ @@ -4151,7 +4150,7 @@ H5C_remove_entry(void *_entry) */ /* Update stats, as if we are "destroying" and taking ownership of the entry */ - H5C__UPDATE_STATS_FOR_EVICTION(cache, entry, TRUE); + H5C__UPDATE_STATS_FOR_EVICTION(cache, entry, true); /* If the entry's type has a 'notify' callback, send a 'before eviction' * notice while the entry is still fully integrated in the cache. @@ -4172,7 +4171,7 @@ H5C_remove_entry(void *_entry) #ifdef H5_HAVE_PARALLEL /* Check for collective read access flag */ if (entry->coll_access) { - entry->coll_access = FALSE; + entry->coll_access = false; H5C__REMOVE_FROM_COLL_LIST(cache, entry, FAIL); } /* end if */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index ed161e8..ef105f8 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -60,8 +60,7 @@ static herr_t H5C__epoch_marker_get_initial_load_size(void *udata_ptr, size_t *i static herr_t H5C__epoch_marker_get_final_load_size(const void *image_ptr, size_t image_len_ptr, void *udata_ptr, size_t *actual_len); static htri_t H5C__epoch_marker_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5C__epoch_marker_deserialize(const void *image_ptr, size_t len, void *udata, - hbool_t *dirty_ptr); +static void *H5C__epoch_marker_deserialize(const void *image_ptr, size_t len, void *udata, bool *dirty_ptr); static herr_t H5C__epoch_marker_image_len(const void *thing, size_t *image_len_ptr); static herr_t H5C__epoch_marker_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, @@ -137,12 +136,12 @@ H5C__epoch_marker_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn."); - FUNC_LEAVE_NOAPI(FALSE) + FUNC_LEAVE_NOAPI(false) } /* end H5C__epoch_marker_verify_chksum() */ static void * H5C__epoch_marker_deserialize(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, - void H5_ATTR_UNUSED *udata, hbool_t H5_ATTR_UNUSED *dirty_ptr) + void H5_ATTR_UNUSED *udata, bool H5_ATTR_UNUSED *dirty_ptr) { FUNC_ENTER_PACKAGE_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 4fa3a1c..f461365 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -133,7 +133,7 @@ static herr_t H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_p static herr_t H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr); static herr_t H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr); static H5C_cache_entry_t *H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **buf); -static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create); +static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, bool create); static herr_t H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr); static herr_t H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr); static herr_t H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr); @@ -161,17 +161,17 @@ H5FL_DEFINE(H5C_cache_entry_t); * load is pending (i.e. will be executed on the next * protect or insert) * - * Returns TRUE if a cache image load is pending, and FALSE + * Returns true if a cache image load is pending, and false * if not. Throws an assertion failure on error. * - * Return: TRUE if a cache image load is pending, and FALSE otherwise. + * Return: true if a cache image load is pending, and false otherwise. * *------------------------------------------------------------------------- */ -hbool_t +bool H5C_cache_image_pending(const H5C_t *cache_ptr) { - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -191,19 +191,19 @@ H5C_cache_image_pending(const H5C_t *cache_ptr) * cache image has either been queued or executed, and if * construction of a cache image has been requested. * - * This done, it set *load_ci_ptr to TRUE if a cache image + * This done, it set *load_ci_ptr to true if a cache image * has either been loaded or a load has been requested, and - * to FALSE otherwise. + * to false otherwise. * - * Similarly, set *write_ci_ptr to TRUE if construction of - * a cache image has been requested, and to FALSE otherwise. + * Similarly, set *write_ci_ptr to true if construction of + * a cache image has been requested, and to false otherwise. * * Return: SUCCEED on success, and FAIL on failure. * *------------------------------------------------------------------------- */ herr_t -H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) +H5C_cache_image_status(H5F_t *f, bool *load_ci_ptr, bool *write_ci_ptr) { H5C_t *cache_ptr; @@ -638,7 +638,7 @@ H5C__load_cache_image(H5F_t *f) */ H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr); - cache_ptr->image_loaded = TRUE; + cache_ptr->image_loaded = true; } /* end if */ /* If directed, free the on disk metadata cache image */ @@ -688,7 +688,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw) +H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, bool rw) { H5C_t *cache_ptr; @@ -703,7 +703,7 @@ H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_ /* Set information needed to load cache image */ cache_ptr->image_addr = addr; cache_ptr->image_len = len; - cache_ptr->load_image = TRUE; + cache_ptr->load_image = true; cache_ptr->delete_image = rw; FUNC_LEAVE_NOAPI(SUCCEED) @@ -806,7 +806,7 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) *------------------------------------------------------------------------- */ herr_t -H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) +H5C__prep_image_for_file_close(H5F_t *f, bool *image_generated) { H5C_t *cache_ptr = NULL; haddr_t eoa_frag_addr = HADDR_UNDEF; @@ -828,7 +828,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * it exists) has not been read yet. Do this now if required. */ if (cache_ptr->load_image) { - cache_ptr->load_image = FALSE; + cache_ptr->load_image = false; if (H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image"); } /* end if */ @@ -872,7 +872,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * cache_ptr->image_ctl.flags. */ if (cache_ptr->image_ctl.flags & H5C_CI__GEN_MDCI_SBE_MESG) - if (H5C__write_cache_image_superblock_msg(f, TRUE) < 0) + if (H5C__write_cache_image_superblock_msg(f, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "creation of cache image SB mesg failed."); /* Serialize the cache */ @@ -993,7 +993,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * cache_ptr->image_ctl.flags. */ if (cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) - if (H5C__write_cache_image_superblock_msg(f, FALSE) < 0) + if (H5C__write_cache_image_superblock_msg(f, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "update of cache image SB mesg failed"); /* At this point: @@ -1026,7 +1026,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * * If the metadata cache image will be empty, delete the * metadata cache image superblock extension message, set - * cache_ptr->image_ctl.generate_image to FALSE. This will + * cache_ptr->image_ctl.generate_image to false. This will * allow the file close to continue normally without the * unnecessary generation of the metadata cache image. */ @@ -1051,11 +1051,11 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove MDC image msg from superblock ext"); - cache_ptr->image_ctl.generate_image = FALSE; + cache_ptr->image_ctl.generate_image = false; } /* end else */ /* Indicate that a cache image was generated */ - *image_generated = TRUE; + *image_generated = true; } /* end if */ done: @@ -1175,9 +1175,9 @@ H5C_validate_cache_image_config(H5C_cache_image_ctl_t *ctl_ptr) /* At present, we do not support inclusion of the adaptive resize * configuration in the cache image. Thus the save_resize_status - * field must be FALSE. + * field must be false. */ - if (ctl_ptr->save_resize_status != FALSE) + if (ctl_ptr->save_resize_status != false) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unexpected value in save_resize_status field"); /* At present, we do not support prefetched entry ageouts. Thus @@ -1276,7 +1276,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t * { uint8_t version; uint8_t flags; - hbool_t have_resize_status = FALSE; + bool have_resize_status = false; size_t actual_header_len; size_t expected_header_len; const uint8_t *p; @@ -1305,7 +1305,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t * /* Decode flags */ flags = *p++; if (flags & H5C__MDCI_HEADER_HAVE_RESIZE_STATUS) - have_resize_status = TRUE; + have_resize_status = true; if (have_resize_status) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "MDC resize status not yet supported"); @@ -1355,10 +1355,10 @@ done: static herr_t H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint8_t **buf, unsigned entry_num) { - hbool_t is_dirty = FALSE; - hbool_t in_lru = FALSE; /* Only used in assertions */ - hbool_t is_fd_parent = FALSE; /* Only used in assertions */ - hbool_t is_fd_child = FALSE; /* Only used in assertions */ + bool is_dirty = false; + bool in_lru = false; /* Only used in assertions */ + bool is_fd_parent = false; /* Only used in assertions */ + bool is_fd_child = false; /* Only used in assertions */ haddr_t addr; hsize_t size = 0; void *image_ptr; @@ -1397,13 +1397,13 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint /* Decode flags */ flags = *p++; if (flags & H5C__MDCI_ENTRY_DIRTY_FLAG) - is_dirty = TRUE; + is_dirty = true; if (flags & H5C__MDCI_ENTRY_IN_LRU_FLAG) - in_lru = TRUE; + in_lru = true; if (flags & H5C__MDCI_ENTRY_IS_FD_PARENT_FLAG) - is_fd_parent = TRUE; + is_fd_parent = true; if (flags & H5C__MDCI_ENTRY_IS_FD_CHILD_FLAG) - is_fd_child = TRUE; + is_fd_child = true; /* Decode ring */ ring = *p++; @@ -1725,7 +1725,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) unsigned external_parent_fd_refs_removed = 0; unsigned external_child_fd_refs_removed = 0; #endif - hbool_t done = FALSE; + bool done = false; unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; @@ -1741,9 +1741,9 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) * that the child will have dirty children of its own, this may take * multiple passes through the index list. */ - done = FALSE; + done = false; while (!done) { - done = TRUE; + done = true; entry_ptr = cache_ptr->il_head; while (entry_ptr != NULL) { /* Should this entry be in the image */ @@ -1762,7 +1762,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) #ifndef NDEBUG entries_removed_from_image++; #endif - entry_ptr->include_in_image = FALSE; + entry_ptr->include_in_image = false; } /* end if */ } /* for */ } /* end if */ @@ -2010,7 +2010,7 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) sizeof(H5C_image_entry_t) * (size_t)(cache_ptr->num_entries_in_image + 1)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for image_entries"); - /* Initialize (non-zero/NULL/FALSE) fields */ + /* Initialize (non-zero/NULL/false) fields */ for (u = 0; u <= cache_ptr->num_entries_in_image; u++) { image_entries[u].addr = HADDR_UNDEF; image_entries[u].ring = H5C_RING_UNDEFINED; @@ -2124,7 +2124,7 @@ static herr_t H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) { H5C_cache_entry_t *entry_ptr; - hbool_t include_in_image; + bool include_in_image; int lru_rank = 1; #ifndef NDEBUG unsigned entries_visited = 0; @@ -2167,9 +2167,9 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) * of these entries later. */ if (entry_ptr->ring > H5C_MAX_RING_IN_IMAGE) - include_in_image = FALSE; + include_in_image = false; else - include_in_image = TRUE; + include_in_image = true; entry_ptr->include_in_image = include_in_image; if (include_in_image) { @@ -2450,7 +2450,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) * Do this now, and then uprotect when done. */ H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, parent_ptr, FAIL); - parent_ptr->is_protected = TRUE; + parent_ptr->is_protected = true; /* Setup the flush dependency */ if (H5C_create_flush_dependency(parent_ptr, pf_entry_ptr) < 0) @@ -2458,7 +2458,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) /* And now unprotect */ H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, parent_ptr, FAIL); - parent_ptr->is_protected = FALSE; + parent_ptr->is_protected = false; } /* end for */ } /* end for */ @@ -2531,7 +2531,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) /* cache is oversized -- call H5C__make_space_in_cache() with zero * space needed to repair the situation if possible. */ - hbool_t write_permitted = FALSE; + bool write_permitted = false; if (cache_ptr->check_write_permitted && (cache_ptr->check_write_permitted)(f, &write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "Can't get write_permitted"); @@ -2565,14 +2565,14 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b { H5C_cache_entry_t *pf_entry_ptr = NULL; /* Reconstructed cache entry */ uint8_t flags = 0; - hbool_t is_dirty = FALSE; + bool is_dirty = false; #ifndef NDEBUG /* only used in assertions */ - hbool_t in_lru = FALSE; - hbool_t is_fd_parent = FALSE; - hbool_t is_fd_child = FALSE; + bool in_lru = false; + bool is_fd_parent = false; + bool is_fd_child = false; #endif const uint8_t *p; - hbool_t file_is_rw; + bool file_is_rw; H5C_cache_entry_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -2598,14 +2598,14 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b /* Decode flags */ flags = *p++; if (flags & H5C__MDCI_ENTRY_DIRTY_FLAG) - is_dirty = TRUE; + is_dirty = true; #ifndef NDEBUG /* only used in assertions */ if (flags & H5C__MDCI_ENTRY_IN_LRU_FLAG) - in_lru = TRUE; + in_lru = true; if (flags & H5C__MDCI_ENTRY_IS_FD_PARENT_FLAG) - is_fd_parent = TRUE; + is_fd_parent = true; if (flags & H5C__MDCI_ENTRY_IS_FD_CHILD_FLAG) - is_fd_child = TRUE; + is_fd_child = true; #endif /* Force dirty entries to clean if the file read only -- must do @@ -2696,11 +2696,11 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b p += pf_entry_ptr->size; /* Initialize the rest of the fields in the prefetched entry */ - /* (Only need to set non-zero/NULL/FALSE fields, due to calloc() above) */ + /* (Only need to set non-zero/NULL/false fields, due to calloc() above) */ pf_entry_ptr->cache_ptr = cache_ptr; - pf_entry_ptr->image_up_to_date = TRUE; + pf_entry_ptr->image_up_to_date = true; pf_entry_ptr->type = H5AC_PREFETCHED_ENTRY; - pf_entry_ptr->prefetched = TRUE; + pf_entry_ptr->prefetched = true; pf_entry_ptr->prefetched_dirty = is_dirty && (!file_is_rw); /* Sanity checks */ @@ -2734,7 +2734,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create) +H5C__write_cache_image_superblock_msg(H5F_t *f, bool create) { H5C_t *cache_ptr; H5O_mdci_t mdci_msg; /* metadata cache image message */ diff --git a/src/H5Cint.c b/src/H5Cint.c index eb9b64c..31a947a 100644 --- a/src/H5Cint.c +++ b/src/H5Cint.c @@ -47,9 +47,9 @@ /* Local Prototypes */ /********************/ static herr_t H5C__autoadjust__ageout(H5F_t *f, double hit_rate, enum H5C_resize_status *status_ptr, - size_t *new_max_cache_size_ptr, hbool_t write_permitted); + size_t *new_max_cache_size_ptr, bool write_permitted); static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr); -static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted); +static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, bool write_permitted); static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr); static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); @@ -83,11 +83,11 @@ static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); *------------------------------------------------------------------------- */ herr_t -H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) +H5C__auto_adjust_cache_size(H5F_t *f, bool write_permitted) { H5C_t *cache_ptr = f->shared->cache; - hbool_t reentrant_call = FALSE; - hbool_t inserted_epoch_marker = FALSE; + bool reentrant_call = false; + bool inserted_epoch_marker = false; size_t new_max_cache_size = 0; size_t old_max_cache_size = 0; size_t new_min_clean_size = 0; @@ -104,17 +104,17 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) assert(0.0 <= cache_ptr->resize_ctl.min_clean_fraction); assert(cache_ptr->resize_ctl.min_clean_fraction <= 100.0); - /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this + /* check to see if cache_ptr->resize_in_progress is true. If it, this * is a re-entrant call via a client callback called in the resize * process. To avoid an infinite recursion, set reentrant_call to - * TRUE, and goto done. + * true, and goto done. */ if (cache_ptr->resize_in_progress) { - reentrant_call = TRUE; + reentrant_call = true; HGOTO_DONE(SUCCEED); } /* end if */ - cache_ptr->resize_in_progress = TRUE; + cache_ptr->resize_in_progress = true; if (!cache_ptr->resize_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled"); @@ -185,7 +185,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (H5C__autoadjust__ageout__insert_new_marker(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't insert new epoch marker"); - inserted_epoch_marker = TRUE; + inserted_epoch_marker = true; } /* don't run the cache size decrease code unless the cache size @@ -274,9 +274,9 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) cache_ptr->min_clean_size = new_min_clean_size; if (status == increase) - cache_ptr->cache_full = FALSE; + cache_ptr->cache_full = false; else if (status == decrease) - cache_ptr->size_decreased = TRUE; + cache_ptr->size_decreased = true; /* update flash cache size increase fields as appropriate */ if (cache_ptr->flash_size_increase_possible) { @@ -312,7 +312,7 @@ done: /* Sanity checks */ assert(cache_ptr->resize_in_progress); if (!reentrant_call) - cache_ptr->resize_in_progress = FALSE; + cache_ptr->resize_in_progress = false; assert((!reentrant_call) || (cache_ptr->resize_in_progress)); FUNC_LEAVE_NOAPI(ret_value) @@ -335,7 +335,7 @@ done: */ static herr_t H5C__autoadjust__ageout(H5F_t *f, double hit_rate, enum H5C_resize_status *status_ptr, - size_t *new_max_cache_size_ptr, hbool_t write_permitted) + size_t *new_max_cache_size_ptr, bool write_permitted) { H5C_t *cache_ptr = f->shared->cache; size_t test_size; @@ -433,7 +433,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow"); cache_ptr->epoch_marker_ringbuf_size -= 1; - if (cache_ptr->epoch_marker_active[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != true) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?"); H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, (cache_ptr)->LRU_tail_ptr, @@ -497,13 +497,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted) +H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, bool write_permitted) { H5C_t *cache_ptr = f->shared->cache; size_t eviction_size_limit; size_t bytes_evicted = 0; - hbool_t prev_is_dirty = FALSE; - hbool_t restart_scan; + bool prev_is_dirty = false; + bool restart_scan; H5C_cache_entry_t *entry_ptr; H5C_cache_entry_t *next_ptr; H5C_cache_entry_t *prev_ptr; @@ -526,11 +526,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte eviction_size_limit = cache_ptr->index_size; /* i.e. infinity */ if (write_permitted) { - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->LRU_tail_ptr; while (entry_ptr != NULL && entry_ptr->type->id != H5AC_EPOCH_MARKER_ID && bytes_evicted < eviction_size_limit) { - hbool_t skipping_entry = FALSE; + bool skipping_entry = false; assert(!(entry_ptr->is_protected)); assert(!(entry_ptr->is_read_only)); @@ -547,7 +547,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte /* dirty corked entry is skipped */ if (entry_ptr->tag_info && entry_ptr->tag_info->corked) - skipping_entry = TRUE; + skipping_entry = true; else { /* reset entries_removed_counter and * last_entry_removed_ptr prior to the call to @@ -565,7 +565,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte if (cache_ptr->entries_removed_counter > 1 || cache_ptr->last_entry_removed_ptr == prev_ptr) - restart_scan = TRUE; + restart_scan = true; } /* end else */ } /* end if */ else if (!entry_ptr->prefetched_dirty) { @@ -579,7 +579,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte assert(!entry_ptr->is_dirty); assert(entry_ptr->prefetched_dirty); - skipping_entry = TRUE; + skipping_entry = true; } /* end else */ if (prev_ptr != NULL) { @@ -590,7 +590,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte /* Something has happened to the LRU -- start over * from the tail. */ - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr); @@ -656,7 +656,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte } /* end else */ if (cache_ptr->index_size < cache_ptr->max_cache_size) - cache_ptr->cache_full = FALSE; + cache_ptr->cache_full = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -697,7 +697,7 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr) assert(((cache_ptr->epoch_markers)[i]).next == NULL); assert(((cache_ptr->epoch_markers)[i]).prev == NULL); - (cache_ptr->epoch_marker_active)[i] = TRUE; + (cache_ptr->epoch_marker_active)[i] = true; cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); @@ -752,7 +752,7 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow"); cache_ptr->epoch_marker_ringbuf_size -= 1; - if (cache_ptr->epoch_marker_active[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != true) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?"); /* remove the epoch marker from the LRU list */ @@ -760,7 +760,7 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) /* mark the epoch marker as unused. */ - cache_ptr->epoch_marker_active[i] = FALSE; + cache_ptr->epoch_marker_active[i] = false; assert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); assert(cache_ptr->epoch_markers[i].next == NULL); @@ -816,7 +816,7 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow"); cache_ptr->epoch_marker_ringbuf_size -= 1; - if (cache_ptr->epoch_marker_active[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != true) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?"); /* remove the epoch marker from the LRU list */ @@ -824,7 +824,7 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) /* mark the epoch marker as unused. */ - cache_ptr->epoch_marker_active[i] = FALSE; + cache_ptr->epoch_marker_active[i] = false; assert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); assert(cache_ptr->epoch_markers[i].next == NULL); @@ -1133,7 +1133,7 @@ static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr; - hbool_t restart_slist_scan; + bool restart_slist_scan; uint32_t protected_entries = 0; int32_t i; uint32_t cur_ring_pel_len; @@ -1238,20 +1238,20 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) /* Set the cache_ptr->slist_changed to false. * - * This flag is set to TRUE by H5C__flush_single_entry if the slist + * This flag is set to true by H5C__flush_single_entry if the slist * is modified by a pre_serialize, serialize, or notify callback. * * H5C__flush_invalidate_ring() uses this flag to detect any * modifications to the slist that might corrupt the scan of * the slist -- and restart the scan in this event. */ - cache_ptr->slist_changed = FALSE; + cache_ptr->slist_changed = false; /* this done, start the scan of the slist */ - restart_slist_scan = TRUE; + restart_slist_scan = true; while (restart_slist_scan || (node_ptr != NULL)) { if (restart_slist_scan) { - restart_slist_scan = FALSE; + restart_slist_scan = false; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); @@ -1335,8 +1335,8 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * This has the potential to corrupt the * scan through the slist, so restart it. */ - restart_slist_scan = TRUE; - cache_ptr->slist_changed = FALSE; + restart_slist_scan = true; + cache_ptr->slist_changed = false; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); } /* end if */ } /* end else-if */ @@ -1355,8 +1355,8 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * This has the potential to corrupt the * scan through the slist, so restart it. */ - restart_slist_scan = TRUE; - cache_ptr->slist_changed = FALSE; + restart_slist_scan = true; + cache_ptr->slist_changed = false; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); } /* end if */ } /* end else */ @@ -1509,7 +1509,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if ((cur_ring_pel_len > 0) && (cur_ring_pel_len >= old_ring_pel_len)) { /* Don't error if allowed to have pinned entries remaining */ if (evict_flags) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); HGOTO_ERROR( H5E_CACHE, H5E_CANTFLUSH, FAIL, @@ -1572,11 +1572,11 @@ herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr = f->shared->cache; - hbool_t flushed_entries_last_pass; - hbool_t flush_marked_entries; - hbool_t ignore_protected; - hbool_t tried_to_flush_protected_entry = FALSE; - hbool_t restart_slist_scan; + bool flushed_entries_last_pass; + bool flush_marked_entries; + bool ignore_protected; + bool tried_to_flush_protected_entry = false; + bool restart_slist_scan; uint32_t protected_entries = 0; H5SL_node_t *node_ptr = NULL; H5C_cache_entry_t *entry_ptr = NULL; @@ -1617,20 +1617,20 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * Thus we track whether we have flushed any entries in the last * pass, and terminate if we haven't. */ - flushed_entries_last_pass = TRUE; + flushed_entries_last_pass = true; /* Set the cache_ptr->slist_changed to false. * - * This flag is set to TRUE by H5C__flush_single_entry if the + * This flag is set to true by H5C__flush_single_entry if the * slist is modified by a pre_serialize, serialize, or notify callback. * H5C_flush_cache uses this flag to detect any modifications * to the slist that might corrupt the scan of the slist -- and * restart the scan in this event. */ - cache_ptr->slist_changed = FALSE; + cache_ptr->slist_changed = false; while ((cache_ptr->slist_ring_len[ring] > 0) && (protected_entries == 0) && (flushed_entries_last_pass)) { - flushed_entries_last_pass = FALSE; + flushed_entries_last_pass = false; #ifdef H5C_DO_SANITY_CHECKS /* For sanity checking, try to verify that the skip list has @@ -1671,10 +1671,10 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) */ #endif /* H5C_DO_SANITY_CHECKS */ - restart_slist_scan = TRUE; + restart_slist_scan = true; while ((restart_slist_scan) || (node_ptr != NULL)) { if (restart_slist_scan) { - restart_slist_scan = FALSE; + restart_slist_scan = false; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); @@ -1750,7 +1750,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * flush everything we can before we decide * whether to flag an error. */ - tried_to_flush_protected_entry = TRUE; + tried_to_flush_protected_entry = true; protected_entries++; } /* end if */ else { @@ -1765,12 +1765,12 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * This has the potential to corrupt the * scan through the slist, so restart it. */ - restart_slist_scan = TRUE; - cache_ptr->slist_changed = FALSE; + restart_slist_scan = true; + cache_ptr->slist_changed = false; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); } /* end if */ - flushed_entries_last_pass = TRUE; + flushed_entries_last_pass = true; } /* end else */ } /* end if */ } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ @@ -1826,7 +1826,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) +H5C__make_space_in_cache(H5F_t *f, size_t space_needed, bool write_permitted) { H5C_t *cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS @@ -1837,10 +1837,10 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) uint32_t entries_examined = 0; uint32_t initial_list_len; size_t empty_space; - hbool_t reentrant_call = FALSE; - hbool_t prev_is_dirty = FALSE; - hbool_t didnt_flush_entry = FALSE; - hbool_t restart_scan; + bool reentrant_call = false; + bool prev_is_dirty = false; + bool didnt_flush_entry = false; + bool restart_scan; H5C_cache_entry_t *entry_ptr; H5C_cache_entry_t *prev_ptr; H5C_cache_entry_t *next_ptr; @@ -1856,20 +1856,20 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) assert(cache_ptr); assert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); - /* check to see if cache_ptr->msic_in_progress is TRUE. If it, this + /* check to see if cache_ptr->msic_in_progress is true. If it, this * is a re-entrant call via a client callback called in the make * space in cache process. To avoid an infinite recursion, set - * reentrant_call to TRUE, and goto done. + * reentrant_call to true, and goto done. */ if (cache_ptr->msic_in_progress) { - reentrant_call = TRUE; + reentrant_call = true; HGOTO_DONE(SUCCEED); } /* end if */ - cache_ptr->msic_in_progress = TRUE; + cache_ptr->msic_in_progress = true; if (write_permitted) { - restart_scan = FALSE; + restart_scan = false; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; @@ -1896,11 +1896,11 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #ifndef NDEBUG ++num_corked_entries; #endif - didnt_flush_entry = TRUE; + didnt_flush_entry = true; } else if ((entry_ptr->type->id != H5AC_EPOCH_MARKER_ID) && !entry_ptr->flush_in_progress && !entry_ptr->prefetched_dirty) { - didnt_flush_entry = FALSE; + didnt_flush_entry = false; if (entry_ptr->is_dirty) { #if H5C_COLLECT_CACHE_STATS if ((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) @@ -1924,7 +1924,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) if ((cache_ptr->entries_removed_counter > 1) || (cache_ptr->last_entry_removed_ptr == prev_ptr)) - restart_scan = TRUE; + restart_scan = true; } else if ((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size #ifdef H5_HAVE_PARALLEL @@ -1945,7 +1945,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #if H5C_COLLECT_CACHE_STATS clean_entries_skipped++; #endif /* H5C_COLLECT_CACHE_STATS */ - didnt_flush_entry = TRUE; + didnt_flush_entry = true; } #if H5C_COLLECT_CACHE_STATS @@ -1958,7 +1958,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) * of being flushed, and entries marked as prefetched_dirty * (occurs in the R/O case only). */ - didnt_flush_entry = TRUE; + didnt_flush_entry = true; #if H5C_COLLECT_CACHE_STATS if (entry_ptr->prefetched_dirty) @@ -1980,7 +1980,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) /* something has happened to the LRU -- start over * from the tail. */ - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr); } @@ -2074,7 +2074,7 @@ done: /* Sanity checks */ assert(cache_ptr->msic_in_progress); if (!reentrant_call) - cache_ptr->msic_in_progress = FALSE; + cache_ptr->msic_in_progress = false; assert((!reentrant_call) || (cache_ptr->msic_in_progress)); FUNC_LEAVE_NOAPI(ret_value) @@ -2187,14 +2187,14 @@ H5C__serialize_cache(H5F_t *f) } /* end block */ #endif - /* set cache_ptr->serialization_in_progress to TRUE, and back - * to FALSE at the end of the function. Must maintain this flag + /* set cache_ptr->serialization_in_progress to true, and back + * to false at the end of the function. Must maintain this flag * to support H5C_get_serialization_in_progress(), which is in * turn required to support sanity checking in some cache * clients. */ assert(!cache_ptr->serialization_in_progress); - cache_ptr->serialization_in_progress = TRUE; + cache_ptr->serialization_in_progress = true; /* Serialize each ring, starting from the outermost ring and * working inward. @@ -2253,7 +2253,7 @@ H5C__serialize_cache(H5F_t *f) #endif done: - cache_ptr->serialization_in_progress = FALSE; + cache_ptr->serialization_in_progress = false; FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_cache() */ @@ -2286,7 +2286,7 @@ done: static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) { - hbool_t done = FALSE; + bool done = false; H5C_t *cache_ptr; H5C_cache_entry_t *entry_ptr; herr_t ret_value = SUCCEED; @@ -2387,7 +2387,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; - done = TRUE; /* set to FALSE if any activity in inner loop */ + done = true; /* set to false if any activity in inner loop */ entry_ptr = cache_ptr->il_head; while (entry_ptr != NULL) { /* Verify that either the entry is already serialized, or @@ -2403,7 +2403,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) * ring that is not marked flush me last, we are not done. */ if (!entry_ptr->image_up_to_date) - done = FALSE; + done = false; /* Serialize the entry if its image is not up to date * and it has no unserialized flush dependency children. diff --git a/src/H5Clog.c b/src/H5Clog.c index dfbc699..255b28f 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -72,7 +72,7 @@ *------------------------------------------------------------------------- */ herr_t -H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, hbool_t start_immediately) +H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, bool start_immediately) { int mpi_rank = -1; /* -1 indicates serial (no MPI rank) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -108,7 +108,7 @@ H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, h HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unknown logging style"); /* Set logging flags */ - cache->log_info->enabled = TRUE; + cache->log_info->enabled = true; /* Start logging if requested */ if (start_immediately) @@ -140,7 +140,7 @@ H5C_log_tear_down(H5C_t *cache) assert(cache); /* Check logging flags */ - if (FALSE == cache->log_info->enabled) + if (false == cache->log_info->enabled) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "logging not enabled"); /* Stop logging if that's going on */ @@ -154,7 +154,7 @@ H5C_log_tear_down(H5C_t *cache) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific tear down call failed"); /* Unset logging flags */ - cache->log_info->enabled = FALSE; + cache->log_info->enabled = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -180,7 +180,7 @@ H5C_start_logging(H5C_t *cache) assert(cache); /* Check logging flags */ - if (FALSE == cache->log_info->enabled) + if (false == cache->log_info->enabled) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "logging not enabled"); /* Start logging */ @@ -189,7 +189,7 @@ H5C_start_logging(H5C_t *cache) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific start call failed"); /* Set logging flags */ - cache->log_info->logging = TRUE; + cache->log_info->logging = true; /* Write a log message */ if (cache->log_info->cls->write_start_log_msg) @@ -220,9 +220,9 @@ H5C_stop_logging(H5C_t *cache) assert(cache); /* Check logging flags */ - if (FALSE == cache->log_info->enabled) + if (false == cache->log_info->enabled) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "logging not enabled"); - if (FALSE == cache->log_info->logging) + if (false == cache->log_info->logging) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "logging not in progress"); /* Write a log message */ @@ -236,7 +236,7 @@ H5C_stop_logging(H5C_t *cache) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific stop call failed"); /* Set logging flags */ - cache->log_info->logging = FALSE; + cache->log_info->logging = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -253,7 +253,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_logging_status(const H5C_t *cache, hbool_t *is_enabled, hbool_t *is_currently_logging) +H5C_get_logging_status(const H5C_t *cache, bool *is_enabled, bool *is_currently_logging) { FUNC_ENTER_NOAPI_NOERR diff --git a/src/H5Clog.h b/src/H5Clog.h index b8ea5ed..eb74a33 100644 --- a/src/H5Clog.h +++ b/src/H5Clog.h @@ -78,8 +78,8 @@ typedef struct H5C_log_class_t { /* Logging information */ struct H5C_log_info_t { - hbool_t enabled; /* Was the logging set up? */ - hbool_t logging; /* Are we currently logging? */ + bool enabled; /* Was the logging set up? */ + bool logging; /* Are we currently logging? */ const H5C_log_class_t *cls; /* Callbacks for writing log messages */ void *udata; /* Log-specific data */ }; @@ -92,7 +92,7 @@ struct H5C_log_info_t { /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, - hbool_t start_immediately); + bool start_immediately); H5_DLL herr_t H5C_log_tear_down(H5C_t *cache); H5_DLL herr_t H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value); diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index a7de3c8..099fa63 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -315,14 +315,14 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha total_entries_to_flush++; #endif entries_to_flush[entry_ptr->ring]++; - entry_ptr->flush_immediately = TRUE; + entry_ptr->flush_immediately = true; } /* end if */ else { #ifndef NDEBUG total_entries_to_clear++; #endif entries_to_clear[entry_ptr->ring]++; - entry_ptr->clear_on_unprotect = TRUE; + entry_ptr->clear_on_unprotect = true; } /* end else */ /* Entries marked as collectively accessed and are in the @@ -332,7 +332,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha * ranks. */ if (entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; + entry_ptr->coll_access = false; H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL); } /* end if */ } /* end for */ @@ -613,7 +613,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr H5C_t *cache_ptr; unsigned entries_cleared; unsigned pinned_entries_cleared; - hbool_t progress; + bool progress; unsigned entries_examined; unsigned initial_list_len; haddr_t addr; @@ -688,12 +688,12 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr /* Make sure first that we clear the collective flag from it so it can be cleared */ - if (TRUE == entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; + if (true == entry_ptr->coll_access) { + entry_ptr->coll_access = false; H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL); } /* end if */ - entry_ptr->clear_on_unprotect = TRUE; + entry_ptr->clear_on_unprotect = true; if (entry_ptr->is_pinned) pinned_entries_marked++; #ifdef H5C_DO_SANITY_CHECKS @@ -730,7 +730,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr entry_ptr = cache_ptr->LRU_tail_ptr; while (entry_ptr != NULL && entries_examined <= initial_list_len && entries_cleared < ce_array_len) { if (entry_ptr->clear_on_unprotect) { - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = false; clear_ptr = entry_ptr; entry_ptr = entry_ptr->prev; entries_cleared++; @@ -753,18 +753,18 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr * pinned list. Must scan that also. */ pinned_entries_cleared = 0; - progress = TRUE; + progress = true; while ((pinned_entries_cleared < pinned_entries_marked) && progress) { - progress = FALSE; + progress = false; entry_ptr = cache_ptr->pel_head_ptr; while (entry_ptr != NULL) { if (entry_ptr->clear_on_unprotect && entry_ptr->flush_dep_ndirty_children == 0) { - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = false; clear_ptr = entry_ptr; entry_ptr = entry_ptr->next; entries_cleared++; pinned_entries_cleared++; - progress = TRUE; + progress = true; if (H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | @@ -815,7 +815,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) +H5C_clear_coll_entries(H5C_t *cache_ptr, bool partial) { uint32_t clear_cnt; H5C_cache_entry_t *entry_ptr = NULL; @@ -836,7 +836,7 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) assert(entry_ptr->coll_access); /* Mark entry as independent */ - entry_ptr->coll_access = FALSE; + entry_ptr->coll_access = false; H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL); /* Decrement entry count */ @@ -1065,7 +1065,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry"); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - cache_ptr->flush_in_progress = TRUE; + cache_ptr->flush_in_progress = true; /* flush each ring, starting from the outermost ring and * working inward. @@ -1079,7 +1079,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES } /* end while */ done: - cache_ptr->flush_in_progress = FALSE; + cache_ptr->flush_in_progress = false; FUNC_LEAVE_NOAPI(ret_value) } /* H5C__flush_candidate_entries() */ @@ -1121,8 +1121,8 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear) { H5C_t *cache_ptr; - hbool_t progress; - hbool_t restart_scan = FALSE; + bool progress; + bool restart_scan = false; unsigned entries_flushed = 0; unsigned entries_cleared = 0; #ifdef H5C_DO_SANITY_CHECKS @@ -1167,11 +1167,11 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * * It is possible that this will change -- hence the assertion. */ - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->LRU_tail_ptr; while (((entries_flushed < entries_to_flush) || (entries_cleared < entries_to_clear)) && (entry_ptr != NULL)) { - hbool_t prev_is_dirty = FALSE; + bool prev_is_dirty = false; H5C_cache_entry_t *next_ptr; /* Entries in the LRU must not have flush dependency children */ @@ -1195,7 +1195,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu next_ptr = entry_ptr->next; /* Reset entry flag */ - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = false; entries_cleared++; } /* end if */ else if (entry_ptr->flush_immediately) { @@ -1209,7 +1209,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu next_ptr = entry_ptr->next; /* Reset entry flag */ - entry_ptr->flush_immediately = FALSE; + entry_ptr->flush_immediately = false; entries_flushed++; } /* end else-if */ else { @@ -1247,7 +1247,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry"); if (cache_ptr->entries_removed_counter != 0 || cache_ptr->last_entry_removed_ptr != NULL) - restart_scan = TRUE; + restart_scan = true; } /* end if */ } /* end if */ else { @@ -1278,9 +1278,9 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu assert(!entry_ptr->is_protected); assert(!entry_ptr->is_pinned); - assert(FALSE); /* see comment above */ + assert(false); /* see comment above */ - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr); @@ -1308,14 +1308,14 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * this may change, and to that end, I have included code to detect * such changes and cause this function to fail if they are detected. */ - progress = TRUE; + progress = true; while (progress && ((entries_flushed < entries_to_flush) || (entries_cleared < entries_to_clear))) { - progress = FALSE; + progress = false; entry_ptr = cache_ptr->pel_head_ptr; while ((entry_ptr != NULL) && ((entries_flushed < entries_to_flush) || (entries_cleared < entries_to_clear))) { H5C_cache_entry_t *prev_ptr; - hbool_t next_is_dirty = FALSE; + bool next_is_dirty = false; assert(entry_ptr->is_pinned); @@ -1332,9 +1332,9 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu op_flags = clear_flags; /* Reset entry flag */ - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = false; entries_cleared++; - progress = TRUE; + progress = true; } /* end if */ else if (entry_ptr->flush_immediately) { assert(entry_ptr->is_dirty); @@ -1344,9 +1344,9 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu op_flags = flush_flags; /* Reset entry flag */ - entry_ptr->flush_immediately = FALSE; + entry_ptr->flush_immediately = false; entries_flushed++; - progress = TRUE; + progress = true; } /* end else-if */ else /* No operation for this entry */ @@ -1379,7 +1379,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry"); if (cache_ptr->entries_removed_counter != 0 || cache_ptr->last_entry_removed_ptr != NULL) - restart_scan = TRUE; + restart_scan = true; } /* end if */ } /* end if */ @@ -1409,9 +1409,9 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * present. Hence the following assertion which should be * removed if the above changes. */ - assert(FALSE); + assert(false); - restart_scan = FALSE; + restart_scan = false; entry_ptr = cache_ptr->pel_head_ptr; diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index cccb47f..5417684 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -61,7 +61,7 @@ * NULL on entry in the insertion macros. * * Finally, observe that the sanity checking macros evaluate to the empty - * string when H5C_DO_SANITY_CHECKS is FALSE. They also contain calls + * string when H5C_DO_SANITY_CHECKS is false. They also contain calls * to the HGOTO_ERROR macro, which may not be appropriate in all cases. * If so, we will need versions of the insertion and deletion macros which * do not reference the sanity checking macros. @@ -758,7 +758,7 @@ if ((cache_ptr) == NULL || \ #define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) \ if ((cache_ptr) == NULL || (cache_ptr)->index_len <= 0 || \ - (entry_ptr) == NULL || (entry_ptr)->is_dirty != FALSE || \ + (entry_ptr) == NULL || (entry_ptr)->is_dirty != false || \ (cache_ptr)->index_size < (entry_ptr)->size || \ (cache_ptr)->dirty_index_size < (entry_ptr)->size || \ (cache_ptr)->index_size != ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) || \ @@ -778,7 +778,7 @@ if ((cache_ptr) == NULL || (cache_ptr)->index_len <= 0 || \ #define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) \ if ((cache_ptr) == NULL || (cache_ptr)->index_len <= 0 || \ - (entry_ptr) == NULL || (entry_ptr)->is_dirty != TRUE || \ + (entry_ptr) == NULL || (entry_ptr)->is_dirty != true || \ (cache_ptr)->index_size < (entry_ptr)->size || \ (cache_ptr)->clean_index_size < (entry_ptr)->size || \ (cache_ptr)->index_size != ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) || \ @@ -1001,7 +1001,7 @@ do { \ #else /* H5C_DO_SLIST_SANITY_CHECKS */ -#define H5C__ENTRY_IN_SLIST(cache_ptr, entry_ptr) FALSE +#define H5C__ENTRY_IN_SLIST(cache_ptr, entry_ptr) false #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -1067,8 +1067,8 @@ do { \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &((entry_ptr)->addr)) < 0) \ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list"); \ \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_changed = TRUE; \ + (entry_ptr)->in_slist = true; \ + (cache_ptr)->slist_changed = true; \ (cache_ptr)->slist_len++; \ (cache_ptr)->slist_size += (entry_ptr)->size; \ ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ @@ -1118,7 +1118,7 @@ do { \ assert((cache_ptr)->slist_len > 0); \ if(!(during_flush)) \ - (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_changed = true; \ (cache_ptr)->slist_len--; \ assert((cache_ptr)->slist_size >= (entry_ptr)->size); \ (cache_ptr)->slist_size -= (entry_ptr)->size; \ @@ -1126,7 +1126,7 @@ do { assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] >= (entry_ptr)->size); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ H5C__SLIST_REMOVE_ENTRY_SC(cache_ptr, entry_ptr); \ - (entry_ptr)->in_slist = FALSE; \ + (entry_ptr)->in_slist = false; \ } else { /* slist disabled */ \ assert((cache_ptr)->slist_len == 0); \ assert((cache_ptr)->slist_size == 0); \ @@ -1911,7 +1911,7 @@ typedef struct H5C_tag_info_t { haddr_t tag; /* Tag (address) of the entries (must be first, for skiplist) */ H5C_cache_entry_t *head; /* Head of the list of entries for this tag */ size_t entry_cnt; /* Number of entries on list */ - hbool_t corked; /* Whether this object is corked */ + bool corked; /* Whether this object is corked */ /* Hash table fields */ UT_hash_handle hh; /* Hash table handle (must be LAST) */ @@ -2004,8 +2004,8 @@ typedef struct H5C_tag_info_t { * be useful to disable all cache evictions, and thereby postpone metadata * writes. The following field is used to implement this. * - * evictions_enabled: Boolean flag that is initialized to TRUE. When - * this flag is set to FALSE, the metadata cache will not + * evictions_enabled: Boolean flag that is initialized to true. When + * this flag is set to false, the metadata cache will not * attempt to evict entries to make space for newly protected * entries, and instead the will grow without limit. * @@ -2161,7 +2161,7 @@ typedef struct H5C_tag_info_t { * on flush and close, it is maintained only when needed. * * To do this, we add a flag to control maintenanace of the skip list. - * This flag is initially set to FALSE, which disables all operations + * This flag is initially set to false, which disables all operations * on the skip list. * * At the beginning of either flush or close, we scan the index list, @@ -2178,8 +2178,8 @@ typedef struct H5C_tag_info_t { * the next flush or close. * * slist_enabled: Boolean flag used to control operation of the skip - * list. If this filed is FALSE, operations on the slist are - * no-ops, and the slist must be empty. If it is TRUE, + * list. If this filed is false, operations on the slist are + * no-ops, and the slist must be empty. If it is true, * operations on the skip list proceed as usual, and all dirty * entries in the metadata cache must be listed in the skip list. * @@ -2228,7 +2228,7 @@ typedef struct H5C_tag_info_t { * The cache must deal with the case in which entries may be dirtied, moved, * or have their sizes changed during a flush. To allow sanity checks in this * situation, the following two fields have been added. They are only - * compiled in when H5C_DO_SANITY_CHECKS is TRUE. + * compiled in when H5C_DO_SANITY_CHECKS is true. * * slist_len_increase: Number of entries that have been added to the * skip list since the last time this field was set to zero. @@ -2473,10 +2473,10 @@ typedef struct H5C_tag_info_t { * full, so we can refrain from increasing the size of a * cache which hasn't used up the space allotted to it. * - * The field is initialized to FALSE, and then set to TRUE + * The field is initialized to false, and then set to true * whenever we attempt to make space in the cache. * - * size_decreased: Boolean flag set to TRUE whenever the maximum cache + * size_decreased: Boolean flag set to true whenever the maximum cache * size is decreased. The flag triggers a call to * H5C__make_space_in_cache() on the next call to H5C_protect(). * @@ -2576,7 +2576,7 @@ typedef struct H5C_tag_info_t { * image_ctl: Instance of H5C_cache_image_ctl_t containing configuration * data for generation of a cache image on file close. * - * serialization_in_progress: Boolean field that is set to TRUE iff + * serialization_in_progress: Boolean field that is set to true iff * the cache is in the process of being serialized. This field is * needed to support the H5C_serialization_in_progress() call, which * is in turn required for sanity checks in some cache clients. @@ -2593,7 +2593,7 @@ typedef struct H5C_tag_info_t { * superblock message should be deleted and the cache image * file space freed after they have been read and decoded. * - * This flag should be set to TRUE iff the file is opened + * This flag should be set to true iff the file is opened * R/W and there is a cache image to be read. * * image_addr: The base address of the on-disk metadata cache image, or @@ -2998,7 +2998,7 @@ typedef struct H5C_tag_info_t { * ****************************************************************************/ struct H5C_t { - hbool_t flush_in_progress; + bool flush_in_progress; H5C_log_info_t * log_info; void * aux_ptr; int32_t max_type_id; @@ -3006,10 +3006,10 @@ struct H5C_t { size_t max_cache_size; size_t min_clean_size; H5C_write_permitted_func_t check_write_permitted; - hbool_t write_permitted; + bool write_permitted; H5C_log_flush_func_t log_flush; - hbool_t evictions_enabled; - hbool_t close_warning_received; + bool evictions_enabled; + bool close_warning_received; /* Fields for maintaining the [hash table] index of entries */ uint32_t index_len; @@ -3032,8 +3032,8 @@ struct H5C_t { H5C_cache_entry_t * entry_watched_for_removal; /* Fields for maintaining list of in-order entries, for flushing */ - hbool_t slist_enabled; - hbool_t slist_changed; + bool slist_enabled; + bool slist_changed; uint32_t slist_len; size_t slist_size; uint32_t slist_ring_len[H5C_RING_NTYPES]; @@ -3047,7 +3047,7 @@ struct H5C_t { /* Fields for maintaining list of tagged entries */ H5C_tag_info_t * tag_list; - hbool_t ignore_tags; + bool ignore_tags; uint32_t num_objs_corked; /* Fields for tracking protected entries */ @@ -3094,20 +3094,20 @@ struct H5C_t { #endif /* H5_HAVE_PARALLEL */ /* Fields for automatic cache size adjustment */ - hbool_t size_increase_possible; - hbool_t flash_size_increase_possible; + bool size_increase_possible; + bool flash_size_increase_possible; size_t flash_size_increase_threshold; - hbool_t size_decrease_possible; - hbool_t resize_enabled; - hbool_t cache_full; - hbool_t size_decreased; - hbool_t resize_in_progress; - hbool_t msic_in_progress; + bool size_decrease_possible; + bool resize_enabled; + bool cache_full; + bool size_decreased; + bool resize_in_progress; + bool msic_in_progress; H5C_auto_size_ctl_t resize_ctl; /* Fields for epoch markers used in automatic cache size adjustment */ int32_t epoch_markers_active; - hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; + bool epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1]; int32_t epoch_marker_ringbuf_first; int32_t epoch_marker_ringbuf_last; @@ -3120,10 +3120,10 @@ struct H5C_t { /* fields supporting generation of a cache image on file close */ H5C_cache_image_ctl_t image_ctl; - hbool_t serialization_in_progress; - hbool_t load_image; - hbool_t image_loaded; - hbool_t delete_image; + bool serialization_in_progress; + bool load_image; + bool image_loaded; + bool delete_image; haddr_t image_addr; hsize_t image_len; hsize_t image_data_len; @@ -3136,8 +3136,8 @@ struct H5C_t { void * image_buffer; /* Free Space Manager Related fields */ - hbool_t rdfsm_settled; - hbool_t mdfsm_settled; + bool rdfsm_settled; + bool mdfsm_settled; #if H5C_COLLECT_CACHE_STATS /* stats fields */ @@ -3245,10 +3245,10 @@ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated); +H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, bool *image_generated); /* General routines */ -H5_DLL herr_t H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted); +H5_DLL herr_t H5C__auto_adjust_cache_size(H5F_t *f, bool write_permitted); H5_DLL herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr); H5_DLL herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr); H5_DLL herr_t H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t new_entry_size); @@ -3259,10 +3259,10 @@ H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr); H5_DLL herr_t H5C__load_cache_image(H5F_t *f); H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed, - hbool_t write_permitted); + bool write_permitted); H5_DLL herr_t H5C__serialize_cache(H5F_t *f); H5_DLL herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); -H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, +H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, bool match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); /* Routines for operating on entry tags */ @@ -3271,11 +3271,11 @@ H5_DLL herr_t H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry); /* Routines for operating on cache images */ H5_DLL herr_t H5C__get_cache_image_config(const H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr); -H5_DLL herr_t H5C__image_stats(H5C_t *cache_ptr, hbool_t print_header); +H5_DLL herr_t H5C__image_stats(H5C_t *cache_ptr, bool print_header); /* Debugging routines */ #ifdef H5C_DO_SLIST_SANITY_CHECKS -H5_DLL hbool_t H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr); +H5_DLL bool H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr); #endif #ifdef H5C_DO_EXTREME_SANITY_CHECKS H5_DLL herr_t H5C__validate_lru_list(H5C_t *cache_ptr); @@ -3285,7 +3285,7 @@ H5_DLL herr_t H5C__validate_protected_entry_list(H5C_t *cache_ptr); /* Testing functions */ #ifdef H5C_TESTING -H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_t status); +H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, bool status); #endif /* H5C_TESTING */ #endif /* H5Cpkg_H */ diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 1e90b7c..1a89067 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -58,7 +58,7 @@ static herr_t H5C__prefetched_entry_get_final_load_size(const void *image_ptr, s void *udata_ptr, size_t *actual_len_ptr); static htri_t H5C__prefetched_entry_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5C__prefetched_entry_deserialize(const void *image_ptr, size_t len, void *udata, - hbool_t *dirty_ptr); + bool *dirty_ptr); static herr_t H5C__prefetched_entry_image_len(const void *thing, size_t *image_len_ptr); static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, @@ -147,7 +147,7 @@ H5C__prefetched_entry_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t static void * H5C__prefetched_entry_deserialize(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, - void H5_ATTR_UNUSED *udata, hbool_t H5_ATTR_UNUSED *dirty_ptr) + void H5_ATTR_UNUSED *udata, bool H5_ATTR_UNUSED *dirty_ptr) { FUNC_ENTER_PACKAGE_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 2e818d2..5aadd9e 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -485,8 +485,8 @@ typedef struct H5C_t H5C_t; * * If the deserialize function has to clean up file corruption * left over from an old bug in the HDF5 library, it must set - * *dirty_ptr to TRUE. If it doesn't, no action is needed as - * *dirty_ptr will be set to FALSE before the deserialize call. + * *dirty_ptr to true. If it doesn't, no action is needed as + * *dirty_ptr will be set to false before the deserialize call. * * If the operation fails for any reason (i.e. bad data in buffer, bad * buffer length, malloc failure, etc.) the function must return NULL and @@ -866,8 +866,7 @@ typedef herr_t (*H5C_get_initial_load_size_func_t)(void *udata_ptr, size_t *imag typedef herr_t (*H5C_get_final_load_size_func_t)(const void *image_ptr, size_t image_len, void *udata_ptr, size_t *actual_len_ptr); typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, size_t len, void *udata_ptr); -typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, size_t len, void *udata_ptr, - hbool_t *dirty_ptr); +typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, size_t len, void *udata_ptr, bool *dirty_ptr); typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr); typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); @@ -895,8 +894,8 @@ typedef struct H5C_class_t { } H5C_class_t; /* Type definitions of callback functions used by the cache as a whole */ -typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, hbool_t *write_permitted_ptr); -typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, unsigned flags); +typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, bool *write_permitted_ptr); +typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, bool was_dirty, unsigned flags); /**************************************************************************** * @@ -988,7 +987,7 @@ typedef int H5C_ring_t; * callbacks must be used to update this image before it is * written to disk * - * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr + * image_up_to_date: Boolean flag that is set to true when *image_ptr * is up to date, and set to false when the entry is dirtied. * * type: Pointer to the instance of H5C_class_t containing pointers @@ -1006,8 +1005,8 @@ typedef int H5C_ring_t; * dirtied: Boolean flag used to indicate that the entry has been * dirtied while protected. * - * This field is set to FALSE in the protect call, and may - * be set to TRUE by the H5C_mark_entry_dirty() call at any + * This field is set to false in the protect call, and may + * be set to true by the H5C_mark_entry_dirty() call at any * time prior to the unprotect call. * * The H5C_mark_entry_dirty() call exists as a convenience @@ -1027,11 +1026,11 @@ typedef int H5C_ring_t; * and inserted on the protected list. * * is_read_only: Boolean flag that is only meaningful if is_protected is - * TRUE. In this circumstance, it indicates whether the + * true. In this circumstance, it indicates whether the * entry has been protected read-only, or read/write. * * If the entry has been protected read-only (i.e. is_protected - * and is_read_only are both TRUE), we allow the entry to be + * and is_read_only are both true), we allow the entry to be * protected more than once. * * In this case, the number of readers is maintained in the @@ -1042,7 +1041,7 @@ typedef int H5C_ring_t; * ro_ref_count: Integer field used to maintain a count of the number of * outstanding read-only protects on this entry. This field * must be zero whenever either is_protected or is_read_only - * are TRUE. + * are true. * * is_pinned: Boolean flag indicating whether the entry has been pinned * in the cache. @@ -1107,7 +1106,7 @@ typedef int H5C_ring_t; * When a distributed metadata write is triggered at a * sync point, this field is used to mark entries that * must be flushed before leaving the sync point. At all - * other times, this field should be set to FALSE. + * other times, this field should be set to false. * * flush_in_progress: Boolean flag that is set to true iff the entry * is in the process of being flushed. This allows the cache @@ -1298,7 +1297,7 @@ typedef int H5C_ring_t; * include_in_image: Boolean flag indicating whether this entry should * be included in the metadata cache image. This field should * always be false prior to the H5C_prep_for_file_close() call. - * During that call, it should be set to TRUE for all entries + * During that call, it should be set to true for all entries * that are to be included in the metadata cache image. At * present, only the superblock, the superblock extension * object header and its chunks (if any) are omitted from @@ -1313,7 +1312,7 @@ typedef int H5C_ring_t; * * image_dirty: Boolean flag indicating whether the entry should be marked * as dirty in the metadata cache image. The flag is set to - * TRUE iff the entry is dirty when H5C_prep_for_file_close() + * true iff the entry is dirty when H5C_prep_for_file_close() * is called. * * fd_parent_count: If the entry is a child in one or more flush dependency @@ -1324,7 +1323,7 @@ typedef int H5C_ring_t; * * Note that while this count is initially taken from the * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents + * cache image (i.e. include_in_image is true), any parents * that are not in the image are removed from this count and * from the fd_parent_addrs array below. * @@ -1343,7 +1342,7 @@ typedef int H5C_ring_t; * * Note that while this list of addresses is initially taken * from the flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents + * cache image (i.e. include_in_image is true), any parents * that are not in the image are removed from this list, and * and from the fd_parent_count above. * @@ -1360,7 +1359,7 @@ typedef int H5C_ring_t; * * Note that while this count is initially taken from the * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any children + * cache image (i.e. include_in_image is true), any children * that are not in the image are removed from this count. * * fd_dirty_child_count: If the entry is a parent in a flush dependency @@ -1371,7 +1370,7 @@ typedef int H5C_ring_t; * * Note that while this count is initially taken from the * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any dirty + * cache image (i.e. include_in_image is true), any dirty * children that are not in the image are removed from this * count. * @@ -1444,7 +1443,7 @@ typedef int H5C_ring_t; * entry. This ID must match the ID of the type provided in any * protect call on the prefetched entry. * - * The value of this field is undefined in prefetched is FALSE. + * The value of this field is undefined in prefetched is false. * * age: Number of times a prefetched entry has appeared in * subsequent cache images. The field exists to allow @@ -1452,9 +1451,9 @@ typedef int H5C_ring_t; * entry can appear in subsequent cache images without being * converted to a regular entry. * - * This field must be zero if prefetched is FALSE. + * This field must be zero if prefetched is false. * - * prefetched_dirty: Boolean field that must be set to FALSE unless the + * prefetched_dirty: Boolean field that must be set to false unless the * following conditions hold: * * 1) The file has been opened R/O. @@ -1549,24 +1548,24 @@ typedef struct H5C_cache_entry_t { haddr_t addr; size_t size; void *image_ptr; - hbool_t image_up_to_date; + bool image_up_to_date; const H5C_class_t *type; - hbool_t is_dirty; - hbool_t dirtied; - hbool_t is_protected; - hbool_t is_read_only; + bool is_dirty; + bool dirtied; + bool is_protected; + bool is_read_only; int ro_ref_count; - hbool_t is_pinned; - hbool_t in_slist; - hbool_t flush_marker; - hbool_t flush_me_last; + bool is_pinned; + bool in_slist; + bool flush_marker; + bool flush_me_last; #ifdef H5_HAVE_PARALLEL - hbool_t clear_on_unprotect; - hbool_t flush_immediately; - hbool_t coll_access; + bool clear_on_unprotect; + bool flush_immediately; + bool coll_access; #endif /* H5_HAVE_PARALLEL */ - hbool_t flush_in_progress; - hbool_t destroy_in_progress; + bool flush_in_progress; + bool destroy_in_progress; /* fields supporting rings for purposes of flush ordering */ H5C_ring_t ring; @@ -1578,8 +1577,8 @@ typedef struct H5C_cache_entry_t { unsigned flush_dep_nchildren; unsigned flush_dep_ndirty_children; unsigned flush_dep_nunser_children; - hbool_t pinned_from_client; - hbool_t pinned_from_cache; + bool pinned_from_client; + bool pinned_from_cache; /* fields supporting the hash table: */ struct H5C_cache_entry_t *ht_next; @@ -1600,18 +1599,18 @@ typedef struct H5C_cache_entry_t { #endif /* H5_HAVE_PARALLEL */ /* fields supporting cache image */ - hbool_t include_in_image; + bool include_in_image; int32_t lru_rank; - hbool_t image_dirty; + bool image_dirty; uint64_t fd_parent_count; haddr_t *fd_parent_addrs; uint64_t fd_child_count; uint64_t fd_dirty_child_count; uint32_t image_fd_height; - hbool_t prefetched; + bool prefetched; int prefetch_type_id; int32_t age; - hbool_t prefetched_dirty; + bool prefetched_dirty; #ifndef NDEBUG /* debugging field */ int serialization_count; @@ -1700,7 +1699,7 @@ typedef struct H5C_cache_entry_t { * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are + * (i.e. include_in_image is true), any parents that are * not in the image are removed from this count and * from the fd_parent_addrs array below. * @@ -1722,7 +1721,7 @@ typedef struct H5C_cache_entry_t { * Note that while this list of addresses is initially taken * from the flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not + * (i.e. include_in_image is true), any parents that are not * in the image are removed from this list, and from the * fd_parent_count above. * @@ -1742,7 +1741,7 @@ typedef struct H5C_cache_entry_t { * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any children + * (i.e. include_in_image is true), any children * that are not in the image are removed from this count. * * fd_dirty_child_count: If the entry is a parent in a flush dependency @@ -1754,7 +1753,7 @@ typedef struct H5C_cache_entry_t { * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children + * (i.e. include_in_image is true), any dirty children * that are not in the image are removed from this count. * * image_ptr: Pointer to void. When not NULL, this field points to a @@ -1773,7 +1772,7 @@ typedef struct H5C_image_entry_t { int32_t age; int32_t type_id; int32_t lru_rank; - hbool_t is_dirty; + bool is_dirty; unsigned image_fd_height; uint64_t fd_parent_count; haddr_t *fd_parent_addrs; @@ -1805,7 +1804,7 @@ typedef struct H5C_image_entry_t { * * set_initial_size: Boolean flag indicating whether the size of the * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the + * the initial_size field. If set_initial_size is false, the * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is @@ -2039,7 +2038,7 @@ typedef struct H5C_auto_size_ctl_t { /* general configuration fields: */ int32_t version; H5C_auto_resize_rpt_fcn rpt_fcn; - hbool_t set_initial_size; + bool set_initial_size; size_t initial_size; double min_clean_fraction; size_t max_size; @@ -2050,7 +2049,7 @@ typedef struct H5C_auto_size_ctl_t { enum H5C_cache_incr_mode incr_mode; double lower_hr_threshold; double increment; - hbool_t apply_max_increment; + bool apply_max_increment; size_t max_increment; enum H5C_cache_flash_incr_mode flash_incr_mode; double flash_multiple; @@ -2060,10 +2059,10 @@ typedef struct H5C_auto_size_ctl_t { enum H5C_cache_decr_mode decr_mode; double upper_hr_threshold; double decrement; - hbool_t apply_max_decrement; + bool apply_max_decrement; size_t max_decrement; int32_t epochs_before_eviction; - hbool_t apply_empty_reserve; + bool apply_empty_reserve; double empty_reserve; } H5C_auto_size_ctl_t; @@ -2139,16 +2138,16 @@ typedef struct H5C_auto_size_ctl_t { #define H5C__DEFAULT_CACHE_IMAGE_CTL \ { \ H5C__CURR_CACHE_IMAGE_CTL_VER, /* = version */ \ - FALSE, /* = generate_image */ \ - FALSE, /* = save_resize_status */ \ + false, /* = generate_image */ \ + false, /* = save_resize_status */ \ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, /* = entry_ageout */ \ H5C_CI__ALL_FLAGS /* = flags */ \ } typedef struct H5C_cache_image_ctl_t { int32_t version; - hbool_t generate_image; - hbool_t save_resize_status; + bool generate_image; + bool save_resize_status; int32_t entry_ageout; unsigned flags; } H5C_cache_image_ctl_t; @@ -2162,7 +2161,7 @@ typedef enum H5C_log_style_t { H5C_LOG_STYLE_JSON, H5C_LOG_STYLE_TRACE } H5C_log H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, const H5C_class_t *const *class_table_ptr, - H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, + H5C_write_permitted_func_t check_write_permitted, bool write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr); H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, @@ -2173,7 +2172,7 @@ H5_DLL herr_t H5C_evict(H5F_t *f); H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); -H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); +H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, bool match_global); H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag); #ifdef H5C_DO_TAGGING_SANITY_CHECKS @@ -2183,17 +2182,17 @@ H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C_get_cache_size(const H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr); -H5_DLL herr_t H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr); +H5_DLL herr_t H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, bool *flush_in_progress_ptr); H5_DLL herr_t H5C_get_cache_hit_rate(const H5C_t *cache_ptr, double *hit_rate_ptr); -H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, - hbool_t *is_dirty_ptr, hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, - hbool_t *is_corked_ptr, hbool_t *is_flush_dep_parent_ptr, - hbool_t *is_flush_dep_child_ptr, hbool_t *image_up_to_date_ptr); -H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr); +H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, bool *in_cache_ptr, + bool *is_dirty_ptr, bool *is_protected_ptr, bool *is_pinned_ptr, + bool *is_corked_ptr, bool *is_flush_dep_parent_ptr, + bool *is_flush_dep_child_ptr, bool *image_up_to_date_ptr); +H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, bool *evictions_enabled_ptr); H5_DLL void *H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL herr_t H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); +H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, bool rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_mark_entry_clean(void *thing); H5_DLL herr_t H5C_mark_entry_unserialized(void *thing); @@ -2207,10 +2206,10 @@ H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr); H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr); -H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); -H5_DLL herr_t H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_slist); +H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, bool evictions_enabled); +H5_DLL herr_t H5C_set_slist_enabled(H5C_t *cache_ptr, bool slist_enabled, bool clear_slist); H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix); -H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, hbool_t display_detailed_stats); +H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, bool display_detailed_stats); H5_DLL void H5C_stats__reset(H5C_t *cache_ptr); H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); @@ -2218,45 +2217,45 @@ H5_DLL herr_t H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned int fl H5_DLL herr_t H5C_validate_cache_image_config(H5C_cache_image_ctl_t *ctl_ptr); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); -H5_DLL hbool_t H5C_get_ignore_tags(const H5C_t *cache_ptr); +H5_DLL bool H5C_get_ignore_tags(const H5C_t *cache_ptr); H5_DLL uint32_t H5C_get_num_objs_corked(const H5C_t *cache_ptr); H5_DLL herr_t H5C_retag_entries(H5C_t *cache_ptr, haddr_t src_tag, haddr_t dest_tag); -H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked); +H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, bool *corked); H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring); H5_DLL herr_t H5C_unsettle_entry_ring(void *thing); H5_DLL herr_t H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring); H5_DLL herr_t H5C_remove_entry(void *thing); -H5_DLL herr_t H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr); -H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); +H5_DLL herr_t H5C_cache_image_status(H5F_t *f, bool *load_ci_ptr, bool *write_ci_ptr); +H5_DLL bool H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(const H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); /* Logging functions */ H5_DLL herr_t H5C_start_logging(H5C_t *cache); H5_DLL herr_t H5C_stop_logging(H5C_t *cache); -H5_DLL herr_t H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, - /*OUT*/ hbool_t *is_currently_logging); +H5_DLL herr_t H5C_get_logging_status(const H5C_t *cache, /*OUT*/ bool *is_enabled, + /*OUT*/ bool *is_currently_logging); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size); H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr); H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr); -H5_DLL herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial); +H5_DLL herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, bool partial); H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ #ifndef NDEBUG /* debugging functions */ -H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); -H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); -H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); -H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); -H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); -H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr); -H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, - hbool_t *fd_exists_ptr); -H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, - hbool_t *in_cache_ptr, hbool_t *type_ok_ptr); -H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); +H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); +H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); +H5_DLL bool H5C_get_serialization_in_progress(const H5C_t *cache_ptr); +H5_DLL bool H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); +H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); +H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr); +H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, + bool *fd_exists_ptr); +H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, + bool *in_cache_ptr, bool *type_ok_ptr); +H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); #endif /* NDEBUG */ #endif /* H5Cprivate_H */ diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 73e46d1..2df9bb1 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -84,7 +84,7 @@ H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *co *config_ptr = cache_ptr->resize_ctl; - config_ptr->set_initial_size = FALSE; + config_ptr->set_initial_size = false; config_ptr->initial_size = cache_ptr->max_cache_size; done: @@ -142,7 +142,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr) +H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, bool *flush_in_progress_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -214,10 +214,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, - hbool_t *is_dirty_ptr, hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, - hbool_t *is_corked_ptr, hbool_t *is_flush_dep_parent_ptr, - hbool_t *is_flush_dep_child_ptr, hbool_t *image_up_to_date_ptr) +H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, bool *in_cache_ptr, bool *is_dirty_ptr, + bool *is_protected_ptr, bool *is_pinned_ptr, bool *is_corked_ptr, + bool *is_flush_dep_parent_ptr, bool *is_flush_dep_child_ptr, bool *image_up_to_date_ptr) { H5C_t *cache_ptr; H5C_cache_entry_t *entry_ptr = NULL; @@ -242,10 +241,10 @@ H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in /* the entry doesn't exist in the cache -- report this * and quit. */ - *in_cache_ptr = FALSE; + *in_cache_ptr = false; } /* end if */ else { - *in_cache_ptr = TRUE; + *in_cache_ptr = true; if (size_ptr != NULL) *size_ptr = entry_ptr->size; if (is_dirty_ptr != NULL) @@ -255,7 +254,7 @@ H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in if (is_pinned_ptr != NULL) *is_pinned_ptr = entry_ptr->is_pinned; if (is_corked_ptr != NULL) - *is_corked_ptr = entry_ptr->tag_info ? entry_ptr->tag_info->corked : FALSE; + *is_corked_ptr = entry_ptr->tag_info ? entry_ptr->tag_info->corked : false; if (is_flush_dep_parent_ptr != NULL) *is_flush_dep_parent_ptr = (entry_ptr->flush_dep_nchildren > 0); if (is_flush_dep_child_ptr != NULL) @@ -279,7 +278,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr) +H5C_get_evictions_enabled(const H5C_t *cache_ptr, bool *evictions_enabled_ptr) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 082b57e..a1a9f42 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -49,19 +49,19 @@ /* Typedef for tagged entry iterator callback context - evict tagged entries */ typedef struct { - H5F_t *f; /* File pointer for evicting entry */ - hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry - * was evicted when iterating over - * cache - */ - hbool_t pinned_entries_need_evicted; /* Flag to indicate that a pinned - * entry was attempted to be evicted - */ - hbool_t skipped_pf_dirty_entries; /* Flag indicating that one or more - * entries marked prefetched_dirty - * were encountered and not - * evicted. - */ + H5F_t *f; /* File pointer for evicting entry */ + bool evicted_entries_last_pass; /* Flag to indicate that an entry + * was evicted when iterating over + * cache + */ + bool pinned_entries_need_evicted; /* Flag to indicate that a pinned + * entry was attempted to be evicted + */ + bool skipped_pf_dirty_entries; /* Flag indicating that one or more + * entries marked prefetched_dirty + * were encountered and not + * evicted. + */ } H5C_tag_iter_evict_ctx_t; /* Typedef for tagged entry iterator callback context - expunge tag type metadata */ @@ -73,7 +73,7 @@ typedef struct { /* Typedef for tagged entry iterator callback context - mark corked */ typedef struct { - hbool_t cork_val; /* Corked value */ + bool cork_val; /* Corked value */ } H5C_tag_iter_cork_ctx_t; /********************/ @@ -125,7 +125,7 @@ H5C_ignore_tags(H5C_t *cache) assert(cache != NULL); /* Set variable to ignore tag values upon assignment */ - cache->ignore_tags = TRUE; + cache->ignore_tags = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5C_ignore_tags */ @@ -139,7 +139,7 @@ H5C_ignore_tags(H5C_t *cache) * *------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5C_get_ignore_tags(const H5C_t *cache) { FUNC_ENTER_NOAPI_NOERR @@ -370,7 +370,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx) +H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, bool match_global, H5C_tag_iter_cb_t cb, void *cb_ctx) { herr_t ret_value = SUCCEED; /* Return value */ @@ -430,17 +430,17 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) /* Can't evict at this time, but let's note that we hit a pinned entry and we'll loop back around again (as evicting other entries will hopefully unpin this entry) */ - ctx->pinned_entries_need_evicted = TRUE; + ctx->pinned_entries_need_evicted = true; else if (!entry->prefetched_dirty) { /* Evict the Entry */ if (H5C__flush_single_entry(ctx->f, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, H5_ITER_ERROR, "Entry eviction failed."); - ctx->evicted_entries_last_pass = TRUE; + ctx->evicted_entries_last_pass = true; } else - ctx->skipped_pf_dirty_entries = TRUE; + ctx->skipped_pf_dirty_entries = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -456,7 +456,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global) +H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, bool match_global) { H5C_t *cache; /* Pointer to cache structure */ H5C_tag_iter_evict_ctx_t ctx; /* Context for iterator callback */ @@ -477,16 +477,16 @@ H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global) /* Start evicting entries */ do { /* Reset pinned/evicted tracking flags */ - ctx.pinned_entries_need_evicted = FALSE; - ctx.evicted_entries_last_pass = FALSE; - ctx.skipped_pf_dirty_entries = FALSE; + ctx.pinned_entries_need_evicted = false; + ctx.evicted_entries_last_pass = false; + ctx.skipped_pf_dirty_entries = false; /* Iterate through entries in the cache */ if (H5C__iter_tagged_entries(cache, tag, match_global, H5C__evict_tagged_entries_cb, &ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "Iteration of tagged entries failed"); /* Keep doing this until we have stopped evicted entries */ - } while (TRUE == ctx.evicted_entries_last_pass); + } while (true == ctx.evicted_entries_last_pass); /* In most cases, fail if we have finished evicting entries and pinned * entries still need evicted @@ -511,7 +511,7 @@ H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global) * entries from becoming unpinned. * * Thus we must ignore ctx.pinned_entries_need_evicted if - * ctx.skipped_pf_dirty_entries is TRUE. + * ctx.skipped_pf_dirty_entries is true. */ if ((!ctx.skipped_pf_dirty_entries) && (ctx.pinned_entries_need_evicted)) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entries still need evicted?!"); @@ -541,7 +541,7 @@ H5C__mark_tagged_entries_cb(H5C_cache_entry_t *entry, void H5_ATTR_UNUSED *_ctx) /* We only want to set the flush marker on entries that * actually need flushed (i.e., dirty ones) */ if (entry->is_dirty) - entry->flush_marker = TRUE; + entry->flush_marker = true; FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* H5C__mark_tagged_entries_cb() */ @@ -570,7 +570,7 @@ H5C__mark_tagged_entries(H5C_t *cache, haddr_t tag) /* Iterate through hash table entries, marking those with specified tag, as * well as any major global entries which should always be flushed * when flushing based on tag value */ - if (H5C__iter_tagged_entries(cache, tag, TRUE, H5C__mark_tagged_entries_cb, NULL) < 0) + if (H5C__iter_tagged_entries(cache, tag, true, H5C__mark_tagged_entries_cb, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "Iteration of tagged entries failed"); done: @@ -597,18 +597,18 @@ H5C__flush_marked_entries(H5F_t *f) assert(f != NULL); /* Enable the slist, as it is needed in the flush */ - if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed"); /* Flush all marked entries */ if (H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache"); - /* Disable the slist. Set the clear_slist parameter to TRUE + /* Disable the slist. Set the clear_slist parameter to true * since we called H5C_flush_cache() with the * H5C__FLUSH_MARKED_ENTRIES_FLAG. */ - if (H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed"); done: @@ -823,7 +823,7 @@ H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags ctx.flags = flags; /* Iterate through hash table entries, expunge those with specified tag and type id */ - if (H5C__iter_tagged_entries(cache, tag, FALSE, H5C__expunge_tag_type_metadata_cb, &ctx) < 0) + if (H5C__iter_tagged_entries(cache, tag, false, H5C__expunge_tag_type_metadata_cb, &ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "Iteration of tagged entries failed"); done: diff --git a/src/H5Ctest.c b/src/H5Ctest.c index d0e4917..c2af1dc 100644 --- a/src/H5Ctest.c +++ b/src/H5Ctest.c @@ -49,7 +49,7 @@ /* Typedef for tagged entry iterator callback context - verify cork tag */ typedef struct { - hbool_t status; /* Corked status */ + bool status; /* Corked status */ } H5C_tag_iter_vct_ctx_t; /********************/ @@ -81,7 +81,7 @@ static int H5C__verify_cork_tag_test_cb(H5C_cache_entry_t *entry, void *_ctx) { H5C_tag_iter_vct_ctx_t *ctx = (H5C_tag_iter_vct_ctx_t *)_ctx; /* Get pointer to iterator context */ - hbool_t is_corked; /* Corked status for entry */ + bool is_corked; /* Corked status for entry */ int ret_value = H5_ITER_CONT; /* Return value */ /* Function enter macro */ @@ -92,7 +92,7 @@ H5C__verify_cork_tag_test_cb(H5C_cache_entry_t *entry, void *_ctx) assert(ctx); /* Retrieve corked status for entry */ - is_corked = entry->tag_info ? entry->tag_info->corked : FALSE; + is_corked = entry->tag_info ? entry->tag_info->corked : false; /* Verify corked status for entry */ if (is_corked != ctx->status) @@ -113,7 +113,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_t status) +H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, bool status) { H5F_t *f; /* File Pointer */ H5C_t *cache; /* Cache Pointer */ @@ -140,7 +140,7 @@ H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_t status) ctx.status = status; /* Iterate through tagged entries in the cache */ - if (H5C__iter_tagged_entries(cache, tag, FALSE, H5C__verify_cork_tag_test_cb, &ctx) < 0) + if (H5C__iter_tagged_entries(cache, tag, false, H5C__verify_cork_tag_test_cb, &ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed"); done: diff --git a/src/H5D.c b/src/H5D.c index 2b20a91..c1f662b 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -107,19 +107,19 @@ H5D__create_api_common(hid_t loc_id, const char *name, hid_t type_id, hid_t spac HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_DACC, TRUE, &dapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_DACC, true, &dapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Get link creation property list */ if (H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + else if (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "lcpl_id is not a link creation property list"); /* Get dataset creation property list */ if (H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) + else if (true != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "dcpl_id is not a dataset create property list ID"); @@ -135,7 +135,7 @@ H5D__create_api_common(hid_t loc_id, const char *name, hid_t type_id, hid_t spac HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create dataset"); /* Get an ID for the dataset */ - if ((ret_value = H5VL_register(H5I_DATASET, dset, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATASET, dset, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset"); done: @@ -283,19 +283,19 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t /* Check arguments */ if (H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) + else if (true != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not dataset create property list ID"); if (H5P_DEFAULT == dapl_id) dapl_id = H5P_DATASET_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) + else if (true != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not dataset access property list ID"); /* Set the DCPL for the API context */ H5CX_set_dcpl(dcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* get the location object */ @@ -313,7 +313,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset"); /* Get an ID for the dataset */ - if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset"); done: @@ -355,7 +355,7 @@ H5D__open_api_common(hid_t loc_id, const char *name, hid_t dapl_id, void **token HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_DACC, FALSE, &dapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_DACC, false, &dapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Open the dataset */ @@ -364,7 +364,7 @@ H5D__open_api_common(hid_t loc_id, const char *name, hid_t dapl_id, void **token HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset"); /* Register an atom for the dataset */ - if ((ret_value = H5VL_register(H5I_DATASET, dset, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATASET, dset, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset ID"); done: @@ -999,7 +999,7 @@ H5D__read_api_common(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t m /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Read the data */ @@ -1216,7 +1216,7 @@ H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fil /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID"); /* Set up VOL callback arguments */ @@ -1308,7 +1308,7 @@ H5D__write_api_common(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Write the data */ @@ -1534,7 +1534,7 @@ H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *of /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID"); /* Set up VOL callback arguments */ @@ -1572,7 +1572,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ H5T_t *type; /* Datatype */ H5S_t *dst_space; /* Dataspace */ H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ const void *src_buf = NULL; /* Source (contiguous) data buffer */ size_t src_buf_nbytes = 0; /* Size of src_buf */ size_t type_size; /* Datatype element size */ @@ -1608,7 +1608,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ /* Initialize selection iterator */ if (H5S_select_iter_init(iter, dst_space, type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information"); - iter_init = TRUE; + iter_init = true; /* Loop until all data has been scattered */ while (nelmts > 0) { @@ -1666,7 +1666,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf H5T_t *type; /* Datatype */ H5S_t *src_space; /* Dataspace */ H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ size_t type_size; /* Datatype element size */ hssize_t nelmts; /* Number of remaining elements in selection */ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ @@ -1714,7 +1714,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf /* Initialize selection iterator */ if (H5S_select_iter_init(iter, src_space, type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information"); - iter_init = TRUE; + iter_init = true; /* Loop until all data has been scattered */ while (nelmts > 0) { @@ -2477,7 +2477,7 @@ H5Dchunk_iter(hid_t dset_id, hid_t dxpl_id, H5D_chunk_iter_op_t op, void *op_dat /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID"); /* Set up VOL callback arguments */ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index cb7aa1d..43ec98f 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -97,36 +97,36 @@ static herr_t H5D__btree_new_node(H5F_t *f, H5B_ins_t, void *_lt_key, void *_ haddr_t *addr_p /*out*/); static int H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5D__btree_found(H5F_t *f, haddr_t addr, const void *_lt_key, hbool_t *found, void *_udata); -static H5B_ins_t H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, - void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, +static htri_t H5D__btree_found(H5F_t *f, haddr_t addr, const void *_lt_key, bool *found, void *_udata); +static H5B_ins_t H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, bool *lt_key_changed, void *_md_key, + void *_udata, void *_rt_key, bool *rt_key_changed, haddr_t *new_node /*out*/); -static H5B_ins_t H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, - void *_udata, void *_rt_key, hbool_t *rt_key_changed); +static H5B_ins_t H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key, bool *lt_key_changed, void *_udata, + void *_rt_key, bool *rt_key_changed); static herr_t H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); /* Chunked layout indexing callbacks */ -static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, - haddr_t dset_ohdr_addr); -static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, - const H5D_t *dset); -static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst); -static herr_t H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); -static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr); +static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, + const H5D_t *dset); +static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static int H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, + H5O_storage_chunk_t *storage_dst); +static herr_t H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__btree_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info); /*********************/ /* Package Variables */ @@ -134,7 +134,7 @@ static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info); /* v1 B-tree indexed chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{ - FALSE, /* v1 B-tree indices does not support SWMR access */ + false, /* v1 B-tree indices does not support SWMR access */ H5D__btree_idx_init, /* insert */ H5D__btree_idx_create, /* create */ H5D__btree_idx_is_space_alloc, /* is_space_alloc */ @@ -166,8 +166,8 @@ static H5B_class_t H5B_BTREE[1] = {{ H5D__btree_cmp3, /*cmp3 */ H5D__btree_found, /*found */ H5D__btree_insert, /*insert */ - FALSE, /*follow min branch? */ - FALSE, /*follow max branch? */ + false, /*follow min branch? */ + false, /*follow max branch? */ H5B_LEFT, /*critical key */ H5D__btree_remove, /*remove */ H5D__btree_decode_key, /*decode */ @@ -397,7 +397,7 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) *------------------------------------------------------------------------- */ static htri_t -H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, hbool_t *found, void *_udata) +H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, bool *found, void *_udata) { H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *)_udata; const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *)_lt_key; @@ -416,7 +416,7 @@ H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, hbo /* Is this *really* the requested chunk? */ for (u = 0; u < udata->common.layout->ndims; u++) if (udata->common.scaled[u] >= (lt_key->scaled[u] + 1)) { - *found = FALSE; + *found = false; HGOTO_DONE(SUCCEED); } @@ -425,7 +425,7 @@ H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, hbo udata->chunk_block.offset = addr; udata->chunk_block.length = lt_key->nbytes; udata->filter_mask = lt_key->filter_mask; - *found = TRUE; + *found = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -436,18 +436,18 @@ done: * * Purpose: Determines if two chunks are disjoint. * - * Return: Success: FALSE if they are not disjoint. - * TRUE if they are disjoint. + * Return: Success: false if they are not disjoint. + * true if they are disjoint. * * Note: Assumes that the chunk offsets are scaled coordinates * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__chunk_disjoint(unsigned n, const hsize_t *scaled1, const hsize_t *scaled2) { unsigned u; /* Local index variable */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -459,7 +459,7 @@ H5D__chunk_disjoint(unsigned n, const hsize_t *scaled1, const hsize_t *scaled2) /* Loop over two chunks, detecting disjointness and getting out quickly */ for (u = 0; u < n; u++) if ((scaled1[u] + 1) <= scaled2[u] || (scaled2[u] + 1) <= scaled1[u]) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -492,8 +492,8 @@ done: */ static H5B_ins_t H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED addr, void *_lt_key, - hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, - hbool_t H5_ATTR_UNUSED *rt_key_changed, haddr_t *new_node_p /*out*/) + bool *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, + bool H5_ATTR_UNUSED *rt_key_changed, haddr_t *new_node_p /*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key; H5D_btree_key_t *md_key = (H5D_btree_key_t *)_md_key; @@ -534,7 +534,7 @@ H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED *new_node_p = udata->chunk_block.offset; H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); lt_key->filter_mask = udata->filter_mask; - *lt_key_changed = TRUE; + *lt_key_changed = true; ret_value = H5B_INS_CHANGE; } else { @@ -576,9 +576,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */, hbool_t *lt_key_changed /*out */, +H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */, bool *lt_key_changed /*out */, void H5_ATTR_UNUSED *_udata /*in,out */, void H5_ATTR_UNUSED *_rt_key /*in,out */, - hbool_t *rt_key_changed /*out */) + bool *rt_key_changed /*out */) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key; H5B_ins_t ret_value = H5B_INS_REMOVE; /* Return value */ @@ -591,8 +591,8 @@ H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */, hbool_t *lt HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk"); /* Mark keys as unchanged */ - *lt_key_changed = FALSE; - *rt_key_changed = FALSE; + *lt_key_changed = false; + *rt_key_changed = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -874,7 +874,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -882,7 +882,7 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__btree_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -935,8 +935,8 @@ done: static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) { - hbool_t found; /* Whether chunk was found */ - herr_t ret_value = SUCCEED; /* Return value */ + bool found; /* Whether chunk was found */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -950,7 +950,7 @@ H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat assert(udata); /* Go get the chunk information from the B-tree */ - found = FALSE; + found = false; if (H5B_find(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, &found, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFIND, FAIL, "can't check for chunk in B-tree"); @@ -1259,7 +1259,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__btree_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR @@ -1343,7 +1343,7 @@ H5D_btree_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, un H5D_btree_dbg_t udata; /* User data for B-tree callback */ H5O_storage_chunk_t storage; /* Storage information for B-tree callback */ H5O_layout_chunk_t layout; /* Layout information for B-tree callback */ - hbool_t shared_init = FALSE; /* Whether B-tree shared info is initialized */ + bool shared_init = false; /* Whether B-tree shared info is initialized */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1362,7 +1362,7 @@ H5D_btree_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, un /* Allocate the shared structure */ if (H5D__btree_shared_create(f, &storage, &layout) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info"); - shared_init = TRUE; + shared_init = true; /* Set up user data for callback */ udata.common.layout = &layout; diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 7fe8397..b6aeeeb 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -108,27 +108,27 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata); /* Callback for H5B2_update() which is called in H5D__bt2_idx_insert() */ -static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed); +static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, bool *changed); /* Chunked layout indexing callbacks for v2 B-tree indexing */ -static herr_t H5D__bt2_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, - haddr_t dset_ohdr_addr); -static herr_t H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, - const H5D_t *dset); -static herr_t H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst); -static herr_t H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); -static herr_t H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__bt2_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr); +static herr_t H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, + const H5D_t *dset); +static herr_t H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static int H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst); +static herr_t H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info); /*********************/ /* Package Variables */ @@ -136,7 +136,7 @@ static herr_t H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info); /* Chunked dataset I/O ops for v2 B-tree indexing */ const H5D_chunk_ops_t H5D_COPS_BT2[1] = {{ - TRUE, /* Fixed array indices support SWMR access */ + true, /* Fixed array indices support SWMR access */ H5D__bt2_idx_init, /* init */ H5D__bt2_idx_create, /* create */ H5D__bt2_idx_is_space_alloc, /* is_space_alloc */ @@ -608,7 +608,7 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.btree.dset_ohdr_addr; /* Get header */ - if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) + if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Retrieve the dataset's object header proxy */ @@ -766,7 +766,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -774,7 +774,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__bt2_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -790,7 +790,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) +H5D__bt2_mod_cb(void *_record, void *_op_data, bool *changed) { H5D_bt2_ud_t *op_data = (H5D_bt2_ud_t *)_op_data; /* User data for v2 B-tree calls */ H5D_chunk_rec_t *record = (H5D_chunk_rec_t *)_record; /* Chunk record */ @@ -811,7 +811,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) *record = op_data->rec; /* Note that the record changed */ - *changed = TRUE; + *changed = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__bt2_mod_cb() */ @@ -928,7 +928,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) H5D_bt2_ud_t bt2_udata; /* User data for v2 B-tree calls */ H5D_chunk_rec_t found_rec; /* Record found from searching for object */ unsigned u; /* Local index variable */ - hbool_t found; /* Whether chunk was found */ + bool found; /* Whether chunk was found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -970,7 +970,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) bt2_udata.rec.scaled[u] = udata->common.scaled[u]; /* Go get chunk information from v2 B-tree */ - found = FALSE; + found = false; if (H5B2_find(bt2, &bt2_udata, &found, H5D__bt2_found_cb, &found_rec) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFIND, FAIL, "can't check for chunk in v2 B-tree"); @@ -1376,7 +1376,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 956baf3..6b56697 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -125,9 +125,9 @@ /* Raw data chunks are cached. Each entry in the cache is: */ typedef struct H5D_rdcc_ent_t { - hbool_t locked; /*entry is locked in cache */ - hbool_t dirty; /*needs to be written to disk? */ - hbool_t deleted; /*chunk about to be deleted */ + bool locked; /*entry is locked in cache */ + bool dirty; /*needs to be written to disk? */ + bool deleted; /*chunk about to be deleted */ unsigned edge_chunk_state; /*states related to edge chunks (see above) */ hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */ uint32_t rd_count; /*bytes remaining to be read */ @@ -150,12 +150,12 @@ typedef struct H5D_chunk_it_ud1_t { const H5D_io_info_t *io_info; /* I/O info for dataset operation */ const H5D_dset_io_info_t *dset_info; /* Dataset specific I/O info */ const hsize_t *space_dim; /* New dataset dimensions */ - const hbool_t *shrunk_dim; /* Dimensions which have been shrunk */ + const bool *shrunk_dim; /* Dimensions which have been shrunk */ H5S_t *chunk_space; /* Dataspace for a chunk */ uint32_t elmts_per_chunk; /* Elements in chunk */ hsize_t *hyper_start; /* Starting location of hyperslab */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init; /* Whether the fill value buffer has been initialized */ + bool fb_info_init; /* Whether the fill value buffer has been initialized */ } H5D_chunk_it_ud1_t; /* Callback info for iteration to obtain chunk address and the index of the chunk for all chunks in the @@ -176,7 +176,7 @@ typedef struct H5D_chunk_it_ud3_t { void *buf; /* Buffer to hold chunk data for read/write */ void *bkg; /* Buffer for background information during type conversion */ size_t buf_size; /* Buffer size */ - hbool_t do_convert; /* Whether to perform type conversions */ + bool do_convert; /* Whether to perform type conversions */ /* needed for converting variable-length data */ hid_t tid_src; /* Datatype ID for source datatype */ @@ -199,14 +199,14 @@ typedef struct H5D_chunk_it_ud3_t { H5O_copy_t *cpy_info; /* Copy options */ /* needed for getting raw data from chunk cache */ - hbool_t chunk_in_cache; + bool chunk_in_cache; uint8_t *chunk; /* the unfiltered chunk data */ } H5D_chunk_it_ud3_t; /* Callback info for iteration to dump index */ typedef struct H5D_chunk_it_ud4_t { FILE *stream; /* Output stream */ - hbool_t header_displayed; /* Node's header is displayed? */ + bool header_displayed; /* Node's header is displayed? */ unsigned ndims; /* Number of dimensions for chunk/dataset */ uint32_t *chunk_dim; /* Chunk dimensions */ } H5D_chunk_it_ud4_t; @@ -234,7 +234,7 @@ typedef struct H5D_chunk_info_iter_ud_t { hsize_t chunk_idx; /* Chunk index, where the iteration needs to stop */ hsize_t curr_idx; /* Current index, where the iteration is */ unsigned idx_hint; /* Index of chunk in cache, if present */ - hbool_t found; /* Whether the chunk was found */ + bool found; /* Whether the chunk was found */ } H5D_chunk_info_iter_ud_t; #ifdef H5_HAVE_PARALLEL @@ -244,7 +244,7 @@ typedef struct H5D_chunk_coll_fill_info_t { struct chunk_coll_fill_info { haddr_t addr; /* File address of the chunk */ size_t chunk_size; /* Size of the chunk in the file */ - hbool_t unfiltered_partial_chunk; + bool unfiltered_partial_chunk; } * chunk_info; } H5D_chunk_coll_fill_info_t; #endif /* H5_HAVE_PARALLEL */ @@ -291,7 +291,7 @@ static herr_t H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned nd const hsize_t *max_dims); static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); static herr_t H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata); -static hbool_t H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata); +static bool H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata); static herr_t H5D__create_piece_map_single(H5D_dset_io_info_t *di, H5D_io_info_t *io_info); static herr_t H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info); static herr_t H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *di, H5D_io_info_t *io_info); @@ -303,14 +303,14 @@ static herr_t H5D__piece_mem_cb(void *elem, const H5T_t *type, unsigned ndims, void *_opdata); static herr_t H5D__chunk_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info); static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); -static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset); -static herr_t H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush); +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, bool reset); +static herr_t H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, bool flush); static void *H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, - H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk); + H5D_chunk_ud_t *udata, bool relax, bool prev_unfilt_chunk); static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, - const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); + const H5D_chunk_ud_t *udata, bool dirty, void *chunk, uint32_t naccessed); static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size); -static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); +static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, bool new_unfilt_chunk); #ifdef H5_HAVE_PARALLEL static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_fill_info, const void *fill_buf, const void *partial_chunk_fill_buf); @@ -384,7 +384,7 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t H5F_block_t old_chunk; /* Offset/length of old chunk */ H5D_chk_idx_info_t idx_info; /* Chunked index info */ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) @@ -394,7 +394,7 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t /* Allocate dataspace and initialize it if it hasn't been. */ if (!H5D__chunk_is_space_alloc(&layout->storage)) - if (H5D__alloc_storage(dset, H5D_ALLOC_WRITE, FALSE, NULL) < 0) + if (H5D__alloc_storage(dset, H5D_ALLOC_WRITE, false, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage"); /* Calculate the index of this chunk */ @@ -429,7 +429,7 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t if (0 == idx_info.pline->nused && H5_addr_defined(old_chunk.offset)) /* If there are no filters and we are overwriting the chunk we can just set values */ - need_insert = FALSE; + need_insert = false; else { /* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk * if its size has changed. @@ -450,7 +450,7 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t if (UINT_MAX != udata.idx_hint) { const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - if (H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], FALSE) < 0) + if (H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk"); } /* end if */ @@ -525,13 +525,13 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, vo /* Check if the requested chunk exists in the chunk cache */ if (UINT_MAX != udata.idx_hint) { H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; - hbool_t flush; + bool flush; /* Sanity checks */ assert(udata.idx_hint < rdcc->nslots); assert(rdcc->slot[udata.idx_hint]); - flush = (ent->dirty == TRUE) ? TRUE : FALSE; + flush = (ent->dirty == true) ? true : false; /* Flush the chunk to disk and clear the cache entry */ if (H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], flush) < 0) @@ -625,9 +625,9 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage assert(rdcc->slot[udata.idx_hint]); /* If the cached chunk is dirty, it must be flushed to get accurate size */ - if (ent->dirty == TRUE) { + if (ent->dirty == true) { /* Flush the chunk to disk and clear the cache entry */ - if (H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], TRUE) < 0) + if (H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk"); /* Reset fields about the chunk we are looking for */ @@ -856,7 +856,7 @@ H5D__chunk_construct(H5F_t H5_ATTR_UNUSED *f, H5D_t *dset) } /* end for */ /* Reset address and pointer of the array struct for the chunked storage index */ - if (H5D_chunk_idx_reset(&dset->shared->layout.storage.u.chunk, TRUE) < 0) + if (H5D_chunk_idx_reset(&dset->shared->layout.storage.u.chunk, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index"); done: @@ -982,11 +982,11 @@ done: * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__chunk_is_space_alloc(const H5O_storage_t *storage) { const H5O_storage_chunk_t *sc = &(storage->u.chunk); - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -1009,7 +1009,7 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage) * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset) { FUNC_ENTER_PACKAGE_NOERR @@ -1035,7 +1035,7 @@ H5D__chunk_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) const H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ H5D_chunk_map_t *fm; /* Convenience pointer to chunk map */ hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ - htri_t file_space_normalized = FALSE; /* File dataspace was normalized */ + htri_t file_space_normalized = false; /* File dataspace was normalized */ unsigned f_ndims; /* The number of dimensions of the file's dataspace */ int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */ unsigned u; /* Local index variable */ @@ -1115,7 +1115,7 @@ H5D__chunk_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) } done: - if (file_space_normalized == TRUE) + if (file_space_normalized == true) if (H5S_hyper_denormalize_offset(dinfo->file_space, old_offset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't denormalize selection"); @@ -1139,7 +1139,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) const H5T_t *mem_type; /* Local pointer to memory datatype */ H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ char bogus; /* "bogus" buffer to pass to selection iterator */ H5D_io_info_wrap_t io_info_wrap; herr_t ret_value = SUCCEED; /* Return value */ @@ -1163,12 +1163,12 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) #endif /* H5_HAVE_PARALLEL */ && H5S_SEL_ALL != H5S_GET_SELECT_TYPE(dinfo->file_space)) { /* Initialize skip list for chunk selections */ - fm->use_single = TRUE; + fm->use_single = true; /* Initialize single chunk dataspace */ if (NULL == dataset->shared->cache.chunk.single_space) { /* Make a copy of the dataspace for the dataset */ - if ((dataset->shared->cache.chunk.single_space = H5S_copy(dinfo->file_space, TRUE, FALSE)) == + if ((dataset->shared->cache.chunk.single_space = H5S_copy(dinfo->file_space, true, false)) == NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file space"); @@ -1177,7 +1177,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust chunk dimensions"); /* Set the single chunk dataspace to 'all' selection */ - if (H5S_select_all(dataset->shared->cache.chunk.single_space, TRUE) < 0) + if (H5S_select_all(dataset->shared->cache.chunk.single_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to set all selection"); } /* end if */ fm->single_space = dataset->shared->cache.chunk.single_space; @@ -1199,7 +1199,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) "unable to create chunk selections for single element"); } /* end if */ else { - hbool_t sel_hyper_flag; /* Whether file selection is a hyperslab */ + bool sel_hyper_flag; /* Whether file selection is a hyperslab */ /* Initialize skip list for chunk selections */ if (NULL == dataset->shared->cache.chunk.sel_chunks) @@ -1209,7 +1209,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) assert(fm->dset_sel_pieces); /* We are not using single element mode */ - fm->use_single = FALSE; + fm->use_single = false; /* Get type of selection on disk & in memory */ if ((fm->fsel_type = H5S_GET_SELECT_TYPE(dinfo->file_space)) < H5S_SEL_NONE) @@ -1217,11 +1217,11 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) if ((fm->msel_type = H5S_GET_SELECT_TYPE(dinfo->mem_space)) < H5S_SEL_NONE) HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection"); - /* If the selection is NONE or POINTS, set the flag to FALSE */ + /* If the selection is NONE or POINTS, set the flag to false */ if (fm->fsel_type == H5S_SEL_POINTS || fm->fsel_type == H5S_SEL_NONE) - sel_hyper_flag = FALSE; + sel_hyper_flag = false; else - sel_hyper_flag = TRUE; + sel_hyper_flag = true; /* Check if file selection is a not a hyperslab selection */ if (sel_hyper_flag) { @@ -1261,7 +1261,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) } /* end else */ /* Build the memory selection for each chunk */ - if (sel_hyper_flag && H5S_SELECT_SHAPE_SAME(dinfo->file_space, dinfo->mem_space) == TRUE) { + if (sel_hyper_flag && H5S_SELECT_SHAPE_SAME(dinfo->file_space, dinfo->mem_space) == true) { /* Reset chunk template information */ fm->mchunk_tmpl = NULL; @@ -1281,7 +1281,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) size_t elmt_size; /* Memory datatype size */ /* Make a copy of equivalent memory space */ - if ((tmp_mspace = H5S_copy(dinfo->mem_space, TRUE, FALSE)) == NULL) + if ((tmp_mspace = H5S_copy(dinfo->mem_space, true, false)) == NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space"); /* De-select the mem space copy */ @@ -1301,7 +1301,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid"); if (H5S_select_iter_init(&(fm->mem_iter), dinfo->mem_space, elmt_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - iter_init = TRUE; /* Selection iteration info has been initialized */ + iter_init = true; /* Selection iteration info has been initialized */ /* set opdata for H5D__piece_mem_cb */ io_info_wrap.io_info = io_info; @@ -1466,7 +1466,7 @@ H5D__free_piece_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * if (!piece_info->fspace_shared) (void)H5S_close(piece_info->fspace); else - H5S_select_all(piece_info->fspace, TRUE); + H5S_select_all(piece_info->fspace, true); /* Close the piece's memory dataspace, if it's not shared */ if (!piece_info->mspace_shared && piece_info->mspace) @@ -1533,7 +1533,7 @@ H5D__create_piece_map_single(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) H5VM_array_offset_pre(fm->f_ndims, di->layout->u.chunk.down_chunks, piece_info->scaled); /* Copy selection for file's dataspace into chunk dataspace */ - if (H5S_select_copy(fm->single_space, di->file_space, FALSE) < 0) + if (H5S_select_copy(fm->single_space, di->file_space, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file selection"); /* Move selection back to have correct offset in chunk */ @@ -1544,16 +1544,16 @@ H5D__create_piece_map_single(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) piece_info->fspace = fm->single_space; /* Indicate that the chunk's file dataspace is shared */ - piece_info->fspace_shared = TRUE; + piece_info->fspace_shared = true; /* Just point at the memory dataspace & selection */ piece_info->mspace = di->mem_space; /* Indicate that the chunk's memory dataspace is shared */ - piece_info->mspace_shared = TRUE; + piece_info->mspace_shared = true; /* Initialize in-place type conversion info. Start with it disabled. */ - piece_info->in_place_tconv = FALSE; + piece_info->in_place_tconv = false; piece_info->buf_off = 0; /* make connection to related dset info from this piece_info */ @@ -1590,7 +1590,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) hsize_t chunk_index; /* "Index" of chunk */ hsize_t curr_partial_clip[H5S_MAX_RANK]; /* Current partial dimension sizes to clip against */ hsize_t partial_dim_size[H5S_MAX_RANK]; /* Size of a partial dimension */ - hbool_t is_partial_dim[H5S_MAX_RANK]; /* Whether a dimension is currently a partial chunk */ + bool is_partial_dim[H5S_MAX_RANK]; /* Whether a dimension is currently a partial chunk */ unsigned num_partial_dims; /* Current number of partial dimensions */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1628,12 +1628,12 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) partial_dim_size[u] = file_dims[u] % fm->chunk_dim[u]; if (file_dims[u] < fm->chunk_dim[u]) { curr_partial_clip[u] = partial_dim_size[u]; - is_partial_dim[u] = TRUE; + is_partial_dim[u] = true; num_partial_dims++; } /* end if */ else { curr_partial_clip[u] = fm->chunk_dim[u]; - is_partial_dim[u] = FALSE; + is_partial_dim[u] = false; } /* end else */ } /* end for */ @@ -1661,9 +1661,9 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) new_piece_info->index = chunk_index; /* Set the file chunk dataspace */ - if (NULL == (new_piece_info->fspace = H5S_copy(tmp_fchunk, TRUE, FALSE))) + if (NULL == (new_piece_info->fspace = H5S_copy(tmp_fchunk, true, false))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy chunk dataspace"); - new_piece_info->fspace_shared = FALSE; + new_piece_info->fspace_shared = false; /* If there are partial dimensions for this chunk, set the hyperslab for them */ if (num_partial_dims > 0) @@ -1673,7 +1673,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) /* Set the memory chunk dataspace */ new_piece_info->mspace = NULL; - new_piece_info->mspace_shared = FALSE; + new_piece_info->mspace_shared = false; /* Copy the chunk's scaled coordinates */ H5MM_memcpy(new_piece_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); @@ -1683,7 +1683,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) new_piece_info->dset_info = di; /* Initialize in-place type conversion info. Start with it disabled. */ - new_piece_info->in_place_tconv = FALSE; + new_piece_info->in_place_tconv = false; new_piece_info->buf_off = 0; /* Insert the new chunk into the skip list */ @@ -1732,7 +1732,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) /* Reset partial chunk information for this dimension */ curr_partial_clip[curr_dim] = fm->chunk_dim[curr_dim]; - is_partial_dim[curr_dim] = FALSE; + is_partial_dim[curr_dim] = false; num_partial_dims--; } /* end if */ @@ -1755,7 +1755,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) if (!is_partial_dim[curr_dim] && file_dims[curr_dim] <= end[curr_dim]) { /* Set partial chunk information for this dimension */ curr_partial_clip[curr_dim] = partial_dim_size[curr_dim]; - is_partial_dim[curr_dim] = TRUE; + is_partial_dim[curr_dim] = true; num_partial_dims++; /* Sanity check */ @@ -1834,7 +1834,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, H5D_io_info_t *io_in /* Iterate through each chunk in the dataset */ while (sel_points) { /* Check for intersection of current chunk and file selection */ - if (TRUE == H5S_SELECT_INTERSECT_BLOCK(dinfo->file_space, coords, end)) { + if (true == H5S_SELECT_INTERSECT_BLOCK(dinfo->file_space, coords, end)) { H5D_piece_info_t *new_piece_info; /* chunk information to insert into skip list */ hsize_t chunk_points; /* Number of elements in chunk selection */ @@ -1867,12 +1867,12 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, H5D_io_info_t *io_in /* Set the file chunk dataspace */ new_piece_info->fspace = tmp_fchunk; - new_piece_info->fspace_shared = FALSE; + new_piece_info->fspace_shared = false; tmp_fchunk = NULL; /* Set the memory chunk dataspace */ new_piece_info->mspace = NULL; - new_piece_info->mspace_shared = FALSE; + new_piece_info->mspace_shared = false; /* Copy the chunk's scaled coordinates */ H5MM_memcpy(new_piece_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); @@ -1882,7 +1882,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, H5D_io_info_t *io_in new_piece_info->dset_info = dinfo; /* Initialize in-place type conversion info. Start with it disabled. */ - new_piece_info->in_place_tconv = FALSE; + new_piece_info->in_place_tconv = false; new_piece_info->buf_off = 0; /* Add piece to global piece_count */ @@ -2001,7 +2001,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) piece_info->mspace = dinfo->mem_space; /* Indicate that the piece's memory space is shared */ - piece_info->mspace_shared = TRUE; + piece_info->mspace_shared = true; } /* end if */ else { /* Get bounding box for file selection */ @@ -2039,7 +2039,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) /* Copy the information */ /* Copy the memory dataspace */ - if ((piece_info->mspace = H5S_copy(dinfo->mem_space, TRUE, FALSE)) == NULL) + if ((piece_info->mspace = H5S_copy(dinfo->mem_space, true, false)) == NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space"); /* Get the chunk's selection type */ @@ -2062,7 +2062,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) assert(H5S_SEL_HYPERSLABS == chunk_sel_type); /* Copy the file chunk's selection */ - if (H5S_SELECT_COPY(piece_info->mspace, piece_info->fspace, FALSE) < 0) + if (H5S_SELECT_COPY(piece_info->mspace, piece_info->fspace, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection"); /* Compute the adjustment for this chunk */ @@ -2126,7 +2126,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) piece_info->mspace = dinfo->mem_space; /* Indicate that the chunk's memory space is shared */ - piece_info->mspace_shared = TRUE; + piece_info->mspace_shared = true; } /* end if */ else { hsize_t mem_sel_start[H5S_MAX_RANK]; /* Offset of low bound of file selection */ @@ -2148,7 +2148,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) assert(piece_info); /* Copy the memory dataspace */ - if ((piece_info->mspace = H5S_copy(dinfo->mem_space, TRUE, FALSE)) == NULL) + if ((piece_info->mspace = H5S_copy(dinfo->mem_space, true, false)) == NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space"); chunk_points = H5S_GET_SELECT_NPOINTS(piece_info->fspace); @@ -2240,11 +2240,11 @@ H5D__piece_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, /* Set the file chunk dataspace */ piece_info->fspace = fspace; - piece_info->fspace_shared = FALSE; + piece_info->fspace_shared = false; /* Set the memory chunk dataspace */ piece_info->mspace = NULL; - piece_info->mspace_shared = FALSE; + piece_info->mspace_shared = false; /* Set the number of selected elements in chunk to zero */ piece_info->piece_points = 0; @@ -2254,7 +2254,7 @@ H5D__piece_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, piece_info->scaled[fm->f_ndims] = 0; /* Initialize in-place type conversion info. Start with it disabled. */ - piece_info->in_place_tconv = FALSE; + piece_info->in_place_tconv = false; piece_info->buf_off = 0; /* Make connection to related dset info from this piece_info */ @@ -2342,7 +2342,7 @@ H5D__piece_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u /* Check if the chunk already has a memory space */ if (NULL == piece_info->mspace) /* Copy the template memory chunk dataspace */ - if (NULL == (piece_info->mspace = H5S_copy(fm->mchunk_tmpl, FALSE, FALSE))) + if (NULL == (piece_info->mspace = H5S_copy(fm->mchunk_tmpl, false, false))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy file space"); /* Update the "last chunk seen" information */ @@ -2433,16 +2433,16 @@ done: * Purpose: A small internal function to if it's possible to load the * chunk into cache. * - * Return: TRUE or FALSE + * Return: true or false * *------------------------------------------------------------------------- */ htri_t H5D__chunk_cacheable(const H5D_io_info_t H5_ATTR_PARALLEL_USED *io_info, H5D_dset_io_info_t *dset_info, - haddr_t caddr, hbool_t write_op) + haddr_t caddr, bool write_op) { const H5D_t *dataset = NULL; /* Local pointer to dataset info */ - hbool_t has_filters = FALSE; /* Whether there are filters on the chunk or not */ + bool has_filters = false; /* Whether there are filters on the chunk or not */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -2462,11 +2462,11 @@ H5D__chunk_cacheable(const H5D_io_info_t H5_ATTR_PARALLEL_USED *io_info, H5D_dse dset_info->store->chunk.scaled, dataset->shared->curr_dims); } /* end if */ else - has_filters = TRUE; + has_filters = true; } /* end if */ if (has_filters) - ret_value = TRUE; + ret_value = true; else { #ifdef H5_HAVE_PARALLEL /* If MPI based VFD is used and the file is opened for write access, must @@ -2475,7 +2475,7 @@ H5D__chunk_cacheable(const H5D_io_info_t H5_ATTR_PARALLEL_USED *io_info, H5D_dse * write-through of only the elements requested. */ if (io_info->using_mpi_vfd && (H5F_ACC_RDWR & H5F_INTENT(dataset->oloc.file))) - ret_value = FALSE; + ret_value = false; else { #endif /* H5_HAVE_PARALLEL */ /* If the chunk is too large to keep in the cache and if we don't @@ -2498,15 +2498,15 @@ H5D__chunk_cacheable(const H5D_io_info_t H5_ATTR_PARALLEL_USED *io_info, H5D_dse (fill->fill_time == H5D_FILL_TIME_IFSET && (fill_status == H5D_FILL_VALUE_USER_DEFINED || fill_status == H5D_FILL_VALUE_DEFAULT))) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; } else - ret_value = FALSE; + ret_value = false; } else - ret_value = TRUE; + ret_value = true; #ifdef H5_HAVE_PARALLEL } /* end else */ #endif /* H5_HAVE_PARALLEL */ @@ -2522,7 +2522,7 @@ done: * Purpose: A small internal function to if it may be possible to use * selection I/O. * - * Return: TRUE or FALSE + * Return: true or false * *------------------------------------------------------------------------- */ @@ -2547,7 +2547,7 @@ H5D__chunk_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *d io_info->no_selection_io_cause |= H5D_SEL_IO_DATASET_FILTER; } else { - hbool_t page_buf_enabled; + bool page_buf_enabled; /* Check if the page buffer is enabled */ if (H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW, &page_buf_enabled) < 0) @@ -2603,7 +2603,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) H5D_dset_io_info_t ctg_dset_info; /* Contiguous I/O dset info object */ H5D_dset_io_info_t cpt_dset_info; /* Compact I/O dset info object */ uint32_t src_accessed_bytes = 0; /* Total accessed size in a chunk */ - hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ + bool skip_missing_chunks = false; /* Whether to skip missing chunks */ H5S_t **chunk_mem_spaces = NULL; /* Array of chunk memory spaces */ H5S_t *chunk_mem_spaces_local[8]; /* Local buffer for chunk_mem_spaces */ H5S_t **chunk_file_spaces = NULL; /* Array of chunk file spaces */ @@ -2640,7 +2640,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) if (fill->fill_time == H5D_FILL_TIME_NEVER || (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED && fill_status != H5D_FILL_VALUE_DEFAULT)) - skip_missing_chunks = TRUE; + skip_missing_chunks = true; } /* Different blocks depending on whether we're using selection I/O */ @@ -2786,7 +2786,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ H5D_io_info_t cpt_io_info; /* Compact I/O info object */ H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ - hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + bool cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ /* Set up contiguous I/O info object */ H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); @@ -2839,7 +2839,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) dset_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ - if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, FALSE)) < + if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable"); if (cacheable) { @@ -2852,7 +2852,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.src_type_size; /* Lock the chunk into the cache */ - if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, FALSE, FALSE))) + if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, false, false))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk"); /* Set up the storage buffer information for this chunk */ @@ -2884,7 +2884,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Release the cache lock on the chunk. */ if (chunk && - H5D__chunk_unlock(io_info, dset_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) + H5D__chunk_unlock(io_info, dset_info, &udata, false, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk"); } /* end if */ @@ -2931,7 +2931,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) H5D_io_info_t cpt_io_info; /* Compact I/O info object */ H5D_dset_io_info_t cpt_dset_info; /* Compact I/O dset info object */ H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ - hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + bool cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ H5S_t **chunk_mem_spaces = NULL; /* Array of chunk memory spaces */ H5S_t *chunk_mem_spaces_local[8]; /* Local buffer for chunk_mem_spaces */ @@ -3017,7 +3017,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_chunk_ud_t udata; /* Index pass-through */ htri_t cacheable; /* Whether the chunk is cacheable */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* Get the actual chunk information from the skip list node */ chunk_info = H5D_CHUNK_GET_NODE_INFO(dset_info, chunk_node); @@ -3037,13 +3037,13 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) dset_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ - if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, TRUE)) < 0) + if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable"); if (cacheable) { /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - void *chunk; /* Pointer to locked chunk buffer */ - hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ + void *chunk; /* Pointer to locked chunk buffer */ + bool entire_chunk = true; /* Whether whole chunk is selected */ /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(dset_info->type_info.dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); @@ -3056,10 +3056,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) (chunk_info->piece_points * dset_info->type_info.src_type_size) != ctg_store.contig.dset_size || dset_info->layout_io_info.chunk_map->fsel_type == H5S_SEL_POINTS) - entire_chunk = FALSE; + entire_chunk = false; /* Lock the chunk into the cache */ - if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, entire_chunk, FALSE))) + if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, entire_chunk, false))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk"); /* Set up the storage buffer information for this chunk */ @@ -3082,7 +3082,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed"); /* Release the cache lock on the chunk */ - if (H5D__chunk_unlock(io_info, dset_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) + if (H5D__chunk_unlock(io_info, dset_info, &udata, true, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk"); } /* end if */ else { @@ -3187,7 +3187,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) void *chunk; /* Pointer to locked chunk buffer */ H5D_chunk_ud_t udata; /* Index pass-through */ htri_t cacheable; /* Whether the chunk is cacheable */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* Get the actual chunk information from the skip list node */ chunk_info = H5D_CHUNK_GET_NODE_INFO(dset_info, chunk_node); @@ -3204,12 +3204,12 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) dset_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ - if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, TRUE)) < 0) + if ((cacheable = H5D__chunk_cacheable(io_info, dset_info, udata.chunk_block.offset, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable"); if (cacheable) { /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ + bool entire_chunk = true; /* Whether whole chunk is selected */ /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(dset_info->type_info.dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); @@ -3222,10 +3222,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) (chunk_info->piece_points * dset_info->type_info.src_type_size) != ctg_store.contig.dset_size || dset_info->layout_io_info.chunk_map->fsel_type == H5S_SEL_POINTS) - entire_chunk = FALSE; + entire_chunk = false; /* Lock the chunk into the cache */ - if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, entire_chunk, FALSE))) + if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, entire_chunk, false))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk"); /* Set up the storage buffer information for this chunk */ @@ -3281,7 +3281,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Release the cache lock on the chunk, or insert chunk into index. */ if (chunk) { - if (H5D__chunk_unlock(io_info, dset_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) + if (H5D__chunk_unlock(io_info, dset_info, &udata, true, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk"); } /* end if */ else { @@ -3342,7 +3342,7 @@ H5D__chunk_flush(H5D_t *dset) /* Loop over all entries in the chunk cache */ for (ent = rdcc->head; ent; ent = next) { next = ent->next; - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) nerrors++; } /* end for */ if (nerrors) @@ -3384,7 +3384,7 @@ H5D__chunk_io_term(H5D_io_info_t H5_ATTR_UNUSED *io_info, H5D_dset_io_info_t *di assert(fm->single_piece_info->mspace_shared); /* Reset the selection for the single element I/O */ - H5S_select_all(fm->single_space, TRUE); + H5S_select_all(fm->single_space, true); } /* end if */ else { /* Release the nodes on the list of selected pieces, or the last (only) @@ -3442,7 +3442,7 @@ H5D__chunk_dest(H5D_t *dset) /* Flush all the cached chunks */ for (ent = rdcc->head; ent; ent = next) { next = ent->next; - if (H5D__chunk_cache_evict(dset, ent, TRUE) < 0) + if (H5D__chunk_cache_evict(dset, ent, true) < 0) nerrors++; } /* end for */ @@ -3479,7 +3479,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3516,7 +3516,7 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) assert(last); /* Indicate that the cached info is not valid */ - last->valid = FALSE; + last->valid = false; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5D__chunk_cinfo_cache_reset() */ @@ -3549,7 +3549,7 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud last->filter_mask = udata->filter_mask; /* Indicate that the cached info is valid */ - last->valid = TRUE; + last->valid = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5D__chunk_cinfo_cache_update() */ @@ -3559,14 +3559,14 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud * * Purpose: Look for chunk info in cache * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -3583,7 +3583,7 @@ H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *uda /* Check that the scaled offset is the same */ for (u = 0; u < udata->common.layout->ndims; u++) if (last->scaled[u] != udata->common.scaled[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Retrieve the information from the cache */ udata->chunk_block.offset = last->addr; @@ -3592,7 +3592,7 @@ H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *uda udata->filter_mask = last->filter_mask; /* Indicate that the data was found */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ done: @@ -3704,11 +3704,11 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); unsigned idx = 0; /* Index of chunk in cache, if present */ - hbool_t found = FALSE; /* In cache? */ + bool found = false; /* In cache? */ #ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t md_reads_file_flag; - hbool_t md_reads_context_flag; - hbool_t restore_md_reads_state = FALSE; + bool md_reads_context_flag; + bool restore_md_reads_state = false; #endif herr_t ret_value = SUCCEED; /* Return value */ @@ -3730,7 +3730,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat udata->chunk_block.offset = HADDR_UNDEF; udata->chunk_block.length = 0; udata->filter_mask = 0; - udata->new_unfilt_chunk = FALSE; + udata->new_unfilt_chunk = false; /* Check for chunk in cache */ if (dset->shared->cache.chunk.nslots > 0) { @@ -3743,12 +3743,12 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat unsigned u; /* Counter */ /* Speculatively set the 'found' flag */ - found = TRUE; + found = true; /* Verify that the cache entry is the correct chunk */ for (u = 0; u < dset->shared->ndims; u++) if (scaled[u] != ent->scaled[u]) { - found = FALSE; + found = false; break; } /* end if */ } /* end if */ @@ -3782,9 +3782,9 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat */ if (H5F_HAS_FEATURE(idx_info.f, H5FD_FEAT_HAS_MPI)) { md_reads_file_flag = H5P_FORCE_FALSE; - md_reads_context_flag = FALSE; + md_reads_context_flag = false; H5F_set_coll_metadata_reads(idx_info.f, &md_reads_file_flag, &md_reads_context_flag); - restore_md_reads_state = TRUE; + restore_md_reads_state = true; } #endif /* H5_HAVE_PARALLEL */ @@ -3850,10 +3850,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) +H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, bool reset) { void *buf = NULL; /* Temporary buffer */ - hbool_t point_of_no_return = FALSE; + bool point_of_no_return = false; H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -3869,8 +3869,8 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) if (ent->dirty) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_chunk_ud_t udata; /* pass through B-tree */ - hbool_t must_alloc = FALSE; /* Whether the chunk must be allocated */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool must_alloc = false; /* Whether the chunk must be allocated */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* Set up user data for index callbacks */ udata.common.layout = &dset->shared->layout.u.chunk; @@ -3912,7 +3912,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) * The only safe option is to continue with the reset * even if we can't write the data to disk. */ - point_of_no_return = TRUE; + point_of_no_return = true; ent->chunk = NULL; } /* end else */ H5_CHECKED_ASSIGN(nbytes, size_t, udata.chunk_block.length, hsize_t); @@ -3927,11 +3927,11 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) H5_CHECKED_ASSIGN(udata.chunk_block.length, hsize_t, nbytes, size_t); /* Indicate that the chunk must be allocated */ - must_alloc = TRUE; + must_alloc = true; } /* end if */ else if (!H5_addr_defined(udata.chunk_block.offset)) { /* Indicate that the chunk must be allocated */ - must_alloc = TRUE; + must_alloc = true; /* This flag could be set for this chunk, just remove and ignore it */ @@ -3940,7 +3940,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) else if (ent->edge_chunk_state & H5D_RDCC_NEWLY_DISABLED_FILTERS) { /* Chunk on disk is still filtered, must insert to allocate correct * size */ - must_alloc = TRUE; + must_alloc = true; /* Set the disable filters field back to the standard disable * filters setting, as it no longer needs to be inserted with every @@ -3989,7 +3989,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, &udata); /* Mark cache entry as clean */ - ent->dirty = FALSE; + ent->dirty = false; /* Increment # of flushed entries */ dset->shared->cache.chunk.stats.nflushes++; @@ -3997,7 +3997,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) /* Reset, but do not free or removed from list */ if (reset) { - point_of_no_return = FALSE; + point_of_no_return = false; if (buf == ent->chunk) buf = NULL; if (ent->chunk != NULL) @@ -4039,7 +4039,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) +H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, bool flush) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -4054,7 +4054,7 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) if (flush) { /* Flush */ - if (H5D__chunk_flush_entry(dset, ent, TRUE) < 0) + if (H5D__chunk_flush_entry(dset, ent, true) < 0) HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); } /* end if */ else { @@ -4190,7 +4190,7 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) if (n[j] == cur) n[j] = cur->next; } /* end for */ - if (H5D__chunk_cache_evict(dset, cur, TRUE) < 0) + if (H5D__chunk_cache_evict(dset, cur, true) < 0) nerrors++; } /* end if */ } /* end for */ @@ -4235,7 +4235,7 @@ done: */ static void * H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_dset_io_info_t *dset_info, - H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk) + H5D_chunk_ud_t *udata, bool relax, bool prev_unfilt_chunk) { const H5D_t *dset; /* Convenience pointer to the dataset */ H5O_pline_t *pline; /* I/O pipeline info - always equal to the pline passed to H5D__chunk_mem_alloc */ @@ -4243,11 +4243,11 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds const H5O_layout_t *layout; /* Dataset layout */ const H5O_fill_t *fill; /* Fill value info */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + bool fb_info_init = false; /* Whether the fill value buffer has been initialized */ H5D_rdcc_t *rdcc; /*raw data chunk cache*/ H5D_rdcc_ent_t *ent; /*cache entry */ size_t chunk_size; /*size of a chunk */ - hbool_t disable_filters = FALSE; /* Whether to disable filters (when adding to cache) */ + bool disable_filters = false; /* Whether to disable filters (when adding to cache) */ void *chunk = NULL; /*the file chunk */ void *ret_value = NULL; /* Return value */ @@ -4392,7 +4392,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); /* Disable the filters for writing */ - disable_filters = TRUE; + disable_filters = true; pline = NULL; } /* end if */ else if (prev_unfilt_chunk) { @@ -4409,7 +4409,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds dset_info->store->chunk.scaled, dset->shared->curr_dims)) { /* Disable the filters for both writing and reading */ - disable_filters = TRUE; + disable_filters = true; old_pline = NULL; pline = NULL; } /* end if */ @@ -4513,7 +4513,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info"); - fb_info_init = TRUE; + fb_info_init = true; /* Check for VL datatype & non-default fill value */ if (fb_info.has_vlen_fill_type) @@ -4539,7 +4539,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds if (!ent || !ent->locked) { /* Preempt enough things from the cache to make room */ if (ent) { - if (H5D__chunk_cache_evict(dset, ent, TRUE) < 0) + if (H5D__chunk_cache_evict(dset, ent, true) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache"); } /* end if */ if (H5D__chunk_cache_prune(dset, chunk_size) < 0) @@ -4592,7 +4592,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* Lock the chunk into the cache */ if (ent) { assert(!ent->locked); - ent->locked = TRUE; + ent->locked = true; chunk = ent->chunk; } /* end if */ else @@ -4640,7 +4640,7 @@ done: */ static herr_t H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_dset_io_info_t *dset_info, - const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed) + const H5D_chunk_ud_t *udata, bool dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout; /* Dataset layout */ const H5D_rdcc_t *rdcc; @@ -4664,13 +4664,13 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ * It's not in the cache, probably because it's too big. If it's * dirty then flush it to disk. In any case, free the chunk. */ - hbool_t is_unfiltered_edge_chunk = FALSE; /* Whether the chunk is an unfiltered edge chunk */ + bool is_unfiltered_edge_chunk = false; /* Whether the chunk is an unfiltered edge chunk */ /* Check if we should disable filters on this chunk */ if (udata->new_unfilt_chunk) { assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); - is_unfiltered_edge_chunk = TRUE; + is_unfiltered_edge_chunk = true; } /* end if */ else if (layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) { /* Check if the chunk is an edge chunk, and disable filters if so */ @@ -4683,7 +4683,7 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ H5D_rdcc_ent_t fake_ent; /* "fake" chunk cache entry */ memset(&fake_ent, 0, sizeof(fake_ent)); - fake_ent.dirty = TRUE; + fake_ent.dirty = true; if (is_unfiltered_edge_chunk) fake_ent.edge_chunk_state = H5D_RDCC_DISABLE_FILTERS; if (udata->new_unfilt_chunk) @@ -4695,7 +4695,7 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ fake_ent.chunk_block.length = udata->chunk_block.length; fake_ent.chunk = (uint8_t *)chunk; - if (H5D__chunk_flush_entry(dset, &fake_ent, TRUE) < 0) + if (H5D__chunk_flush_entry(dset, &fake_ent, true) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); } /* end if */ else { @@ -4718,12 +4718,12 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ ent = rdcc->slot[udata->idx_hint]; assert(ent->locked); if (dirty) { - ent->dirty = TRUE; + ent->dirty = true; ent->wr_count -= MIN(ent->wr_count, naccessed); } /* end if */ else ent->rd_count -= MIN(ent->rd_count, naccessed); - ent->locked = FALSE; + ent->locked = false; } /* end else */ done: @@ -4782,7 +4782,7 @@ H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); /* Compose chunked index info struct */ @@ -4815,7 +4815,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old_dim[]) +H5D__chunk_allocate(const H5D_t *dset, bool full_overwrite, const hsize_t old_dim[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_chunk_ops_t *ops = dset->shared->layout.storage.u.chunk.ops; /* Chunk operations */ @@ -4832,27 +4832,27 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old H5O_pline_t def_pline = H5O_CRT_PIPELINE_DEF; /* Default pipeline */ const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ H5D_fill_value_t fill_status; /* The fill value status */ - hbool_t should_fill = FALSE; /* Whether fill values should be written */ + bool should_fill = false; /* Whether fill values should be written */ void *unfilt_fill_buf = NULL; /* Unfiltered fill value buffer */ void **fill_buf = NULL; /* Pointer to the fill buffer to use for a chunk */ #ifdef H5_HAVE_PARALLEL - hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ - hbool_t using_mpi = - FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ + bool blocks_written = false; /* Flag to indicate that chunk was actually written */ + bool using_mpi = + false; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ H5D_chunk_coll_fill_info_t chunk_fill_info; /* chunk address information for doing I/O */ #endif /* H5_HAVE_PARALLEL */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + bool carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Dataset's dataspace dimensions */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ unsigned op_dim; /* Current operating dimension */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - hbool_t has_unfilt_edge_chunks = FALSE; /* Whether there are partial edge chunks with disabled filters */ - hbool_t unfilt_edge_chunk_dim[H5O_LAYOUT_NDIMS]; /* Whether there are unfiltered edge chunks at the edge + bool fb_info_init = false; /* Whether the fill value buffer has been initialized */ + bool has_unfilt_edge_chunks = false; /* Whether there are partial edge chunks with disabled filters */ + bool unfilt_edge_chunk_dim[H5O_LAYOUT_NDIMS]; /* Whether there are unfiltered edge chunks at the edge of each dimension */ - hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each - dimension */ + hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each + dimension */ unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */ H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); /* Convenience variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4884,7 +4884,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old /* Retrieve MPI parameters */ if (H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI)) { /* Set the MPI-capable file driver flag */ - using_mpi = TRUE; + using_mpi = true; /* init chunk info stuff for collective I/O */ chunk_fill_info.num_chunks = 0; @@ -4905,15 +4905,15 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old /* Calculate if there are unfiltered edge chunks at the edge of this * dimension. Note the edge_chunk_scaled is uninitialized for - * dimensions where unfilt_edge_chunk_dim is FALSE. Also */ + * dimensions where unfilt_edge_chunk_dim is false. Also */ if ((layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && pline->nused > 0 && space_dim[op_dim] % chunk_dim[op_dim] != 0) { - has_unfilt_edge_chunks = TRUE; - unfilt_edge_chunk_dim[op_dim] = TRUE; + has_unfilt_edge_chunks = true; + unfilt_edge_chunk_dim[op_dim] = true; edge_chunk_scaled[op_dim] = max_unalloc[op_dim]; } /* end if */ else - unfilt_edge_chunk_dim[op_dim] = FALSE; + unfilt_edge_chunk_dim[op_dim] = false; } /* end for */ /* Get original chunk size */ @@ -4933,7 +4933,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old (fill->fill_time == H5D_FILL_TIME_IFSET && (fill_status == H5D_FILL_VALUE_USER_DEFINED || fill_status == H5D_FILL_VALUE_DEFAULT)))) || pline->nused > 0) - should_fill = TRUE; + should_fill = true; /* Check if fill values should be written to chunks */ if (should_fill) { @@ -4943,7 +4943,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, orig_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); - fb_info_init = TRUE; + fb_info_init = true; /* Initialize the fill_buf pointer to the buffer in fb_info. If edge * chunk filters are disabled, we will switch the buffer as appropriate @@ -5049,11 +5049,11 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old } /* end if */ } /* end if */ - carry = FALSE; + carry = false; } /* end else */ while (!carry) { - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* Look up this chunk */ if (H5D__chunk_lookup(dset, scaled, &udata) < 0) @@ -5067,12 +5067,12 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old * original dimensions */ { unsigned v; /* Local index variable */ - hbool_t outside_orig = FALSE; + bool outside_orig = false; for (v = 0; v < space_ndims; v++) { assert((scaled[v] * chunk_dim[v]) < space_dim[v]); if ((scaled[v] * chunk_dim[v]) >= old_dim[v]) - outside_orig = TRUE; + outside_orig = true; } /* end for */ assert(outside_orig); } /* end block */ @@ -5182,7 +5182,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old chunk_fill_info.num_chunks++; /* Indicate that blocks will be written */ - blocks_written = TRUE; + blocks_written = true; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ @@ -5200,7 +5200,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index"); /* Increment indices and adjust the edge chunk state */ - carry = TRUE; + carry = true; for (i = ((int)space_ndims - 1); i >= 0; --i) { scaled[i]++; if (scaled[i] > max_unalloc[i]) { @@ -5234,7 +5234,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old } /* end if */ } /* end if */ - carry = FALSE; + carry = false; break; } /* end else */ } /* end for */ @@ -5295,8 +5295,8 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) dimension */ hsize_t max_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* largest offset of chunks that might need to be modified in each dimension */ - hbool_t new_full_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of chunks in this dimension needs to be - modified */ + bool new_full_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of chunks in this dimension needs to be + modified */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ hsize_t chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ @@ -5308,7 +5308,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) H5D_storage_t chk_store; /* Chunk storage information */ H5D_dset_io_info_t chk_dset_info; /* Chunked I/O dset info object */ void *chunk; /* The file chunk */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + bool carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5353,7 +5353,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) */ for (op_dim = 0; op_dim < space_ndims; op_dim++) { /* Start off with this dimension marked as not needing to be modified */ - new_full_dim[op_dim] = FALSE; + new_full_dim[op_dim] = false; /* Validate this chunk dimension */ if (chunk_dim[op_dim] == 0) @@ -5377,7 +5377,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Check if the dataspace expanded enough to cause the old edge chunks * in this dimension to become full */ if ((space_dim[op_dim] / chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1)) - new_full_dim[op_dim] = TRUE; + new_full_dim[op_dim] = true; } /* end for */ /* Main loop: fix old edge chunks */ @@ -5392,7 +5392,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) memset(chunk_sc, 0, (space_ndims * sizeof(chunk_sc[0]))); chunk_sc[op_dim] = old_edge_chunk_sc[op_dim]; - carry = FALSE; + carry = false; } /* end if */ while (!carry) { @@ -5412,23 +5412,23 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Lock the chunk into cache. H5D__chunk_lock will take care of * updating the chunk to no longer be an edge chunk. */ if (NULL == - (chunk = (void *)H5D__chunk_lock(&chk_io_info, &chk_dset_info, &chk_udata, FALSE, TRUE))) + (chunk = (void *)H5D__chunk_lock(&chk_io_info, &chk_dset_info, &chk_udata, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk"); /* Unlock the chunk */ - if (H5D__chunk_unlock(&chk_io_info, &chk_dset_info, &chk_udata, TRUE, chunk, (uint32_t)0) < 0) + if (H5D__chunk_unlock(&chk_io_info, &chk_dset_info, &chk_udata, true, chunk, (uint32_t)0) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk"); } /* end if */ /* Increment indices */ - carry = TRUE; + carry = true; for (i = ((int)space_ndims - 1); i >= 0; --i) { if ((unsigned)i != op_dim) { ++chunk_sc[i]; if (chunk_sc[i] > (hsize_t)max_edge_chunk_sc[i]) chunk_sc[i] = 0; else { - carry = FALSE; + carry = false; break; } /* end else */ } /* end if */ @@ -5480,8 +5480,8 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ int *block_lens = NULL; MPI_Datatype mem_type = MPI_BYTE, file_type = MPI_BYTE; H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ - hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ - hbool_t need_sort = FALSE; + bool have_xfer_mode = false; /* Whether the previous xffer mode has been retrieved */ + bool need_sort = false; size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -5524,7 +5524,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ /* Check if we have any chunks to write on this rank */ if (num_blocks > 0 || (leftover && leftover > mpi_rank)) { MPI_Aint partial_fill_buf_disp = 0; - hbool_t all_same_block_len = TRUE; + bool all_same_block_len = true; /* Allocate buffers */ if (NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint)))) @@ -5564,10 +5564,10 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ */ for (i = 1; i < chunk_fill_info->num_chunks; i++) { if (chunk_fill_info->chunk_info[i].addr < chunk_fill_info->chunk_info[i - 1].addr) - need_sort = TRUE; + need_sort = true; if (chunk_fill_info->chunk_info[i].chunk_size != chunk_fill_info->chunk_info[i - 1].chunk_size) - all_same_block_len = FALSE; + all_same_block_len = false; } if (need_sort) @@ -5677,7 +5677,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ /* Get current transfer mode */ if (H5CX_get_io_xfer_mode(&prev_xfer_mode) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode"); - have_xfer_mode = TRUE; + have_xfer_mode = true; /* Set transfer mode */ if (H5CX_set_io_xfer_mode(H5FD_MPIO_COLLECTIVE) < 0) @@ -5738,7 +5738,7 @@ H5D__chunk_cmp_coll_fill_info(const void *_entry1, const void *_entry2) *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) +H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, bool new_unfilt_chunk) { const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ const H5D_t *dset = udata->dset_info->dset; /* Local pointer to the dataset info */ @@ -5746,7 +5746,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ const hsize_t *scaled = udata->common.scaled; /* Scaled chunk offset */ H5S_sel_iter_t *chunk_iter = NULL; /* Memory selection iteration info */ - hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */ + bool chunk_iter_init = false; /* Whether the chunk iterator has been initialized */ hsize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ size_t chunk_size; /*size of a chunk */ @@ -5778,7 +5778,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); - udata->fb_info_init = TRUE; + udata->fb_info_init = true; } /* end if */ /* Compute the # of elements to leave with existing value, in each dimension */ @@ -5788,7 +5788,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) } /* end for */ /* Select all elements in chunk, to begin with */ - if (H5S_select_all(udata->chunk_space, TRUE) < 0) + if (H5S_select_all(udata->chunk_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to select space"); /* "Subtract out" the elements to keep */ @@ -5796,7 +5796,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to select hyperslab"); /* Lock the chunk into the cache, to get a pointer to the chunk buffer */ - if (NULL == (chunk = (void *)H5D__chunk_lock(io_info, udata->dset_info, &chk_udata, FALSE, FALSE))) + if (NULL == (chunk = (void *)H5D__chunk_lock(io_info, udata->dset_info, &chk_udata, false, false))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk"); /* Fill the selection in the memory buffer */ @@ -5821,7 +5821,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Create a selection iterator for scattering the elements to memory buffer */ if (H5S_select_iter_init(chunk_iter, udata->chunk_space, layout->u.chunk.dim[rank], 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunk selection information"); - chunk_iter_init = TRUE; + chunk_iter_init = true; /* Scatter the data into memory */ if (H5D__scatter_mem(udata->fb_info.fill_buf, chunk_iter, (size_t)sel_nelmts, chunk /*out*/) < 0) @@ -5833,7 +5833,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ - if (H5D__chunk_unlock(io_info, udata->dset_info, &chk_udata, TRUE, chunk, bytes_accessed) < 0) + if (H5D__chunk_unlock(io_info, udata->dset_info, &chk_udata, true, chunk, bytes_accessed) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk"); done: @@ -5948,32 +5948,32 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) hsize_t max_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */ hssize_t max_fill_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk that might be filled in each dimension */ - hbool_t fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be + bool fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be filled */ hsize_t min_partial_chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of first partial (or empty) chunk in each dimension */ - hbool_t new_unfilt_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension are newly + bool new_unfilt_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension are newly unfiltered */ - H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_io_info_t chk_io_info; /* Chunked I/O info object */ - H5D_dset_io_info_t chk_dset_info; /* Chunked I/O dset info object */ - H5D_storage_t chk_store; /* Chunk storage information */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_io_info_t chk_io_info; /* Chunked I/O info object */ + H5D_dset_io_info_t chk_dset_info; /* Chunked I/O dset info object */ + H5D_storage_t chk_store; /* Chunk storage information */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Current dataspace dimensions */ unsigned op_dim; /* Current operating dimension */ - hbool_t shrunk_dim[H5O_LAYOUT_NDIMS]; /* Dimensions which have shrunk */ + bool shrunk_dim[H5O_LAYOUT_NDIMS]; /* Dimensions which have shrunk */ H5D_chunk_it_ud1_t udata; /* Chunk index iterator user data */ - hbool_t udata_init = FALSE; /* Whether the chunk index iterator user data has been initialized */ + bool udata_init = false; /* Whether the chunk index iterator user data has been initialized */ H5D_chunk_common_ud_t idx_udata; /* User data for index removal routine */ H5S_t *chunk_space = NULL; /* Dataspace for a chunk */ hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */ hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled offset of current chunk */ hsize_t hyper_start[H5O_LAYOUT_NDIMS]; /* Starting location of hyperslab */ uint32_t elmts_per_chunk; /* Elements in chunk */ - hbool_t disable_edge_filters = FALSE; /* Whether to disable filters on partial edge chunks */ - hbool_t new_unfilt_chunk = FALSE; /* Whether the chunk is newly unfiltered */ + bool disable_edge_filters = false; /* Whether to disable filters on partial edge chunks */ + bool new_unfilt_chunk = false; /* Whether the chunk is newly unfiltered */ unsigned u; /* Local index variable */ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -6052,7 +6052,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) udata.elmts_per_chunk = elmts_per_chunk; udata.chunk_space = chunk_space; udata.hyper_start = hyper_start; - udata_init = TRUE; + udata_init = true; /* Initialize user data for removal */ idx_udata.layout = &layout->u.chunk; @@ -6093,23 +6093,23 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Determine if we need to fill chunks in this dimension */ if ((hssize_t)min_mod_chunk_sc[op_dim] == max_fill_chunk_sc[op_dim]) { - fill_dim[op_dim] = TRUE; + fill_dim[op_dim] = true; /* If necessary, check if chunks in this dimension that need to * be filled are new partial edge chunks */ if (disable_edge_filters && old_dim[op_dim] >= (min_mod_chunk_sc[op_dim] + 1)) - new_unfilt_dim[op_dim] = TRUE; + new_unfilt_dim[op_dim] = true; else - new_unfilt_dim[op_dim] = FALSE; + new_unfilt_dim[op_dim] = false; } /* end if */ else { - fill_dim[op_dim] = FALSE; - new_unfilt_dim[op_dim] = FALSE; + fill_dim[op_dim] = false; + new_unfilt_dim[op_dim] = false; } /* end else */ } /* end if */ else { - fill_dim[op_dim] = FALSE; - new_unfilt_dim[op_dim] = FALSE; + fill_dim[op_dim] = false; + new_unfilt_dim[op_dim] = false; } /* end else */ /* If necessary, calculate the smallest offset of non-previously full @@ -6121,9 +6121,9 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Main loop: fill or remove chunks */ for (op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) { - hbool_t dims_outside_fill[H5O_LAYOUT_NDIMS]; /* Dimensions in chunk offset outside fill dimensions */ - int ndims_outside_fill; /* Number of dimensions in chunk offset outside fill dimensions */ - hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + bool dims_outside_fill[H5O_LAYOUT_NDIMS]; /* Dimensions in chunk offset outside fill dimensions */ + int ndims_outside_fill; /* Number of dimensions in chunk offset outside fill dimensions */ + bool carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ /* Check if modification along this dimension is really necessary */ if (!shrunk_dim[op_dim]) @@ -6139,14 +6139,14 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) ndims_outside_fill = 0; for (u = 0; u < space_ndims; u++) if ((hssize_t)scaled[u] > max_fill_chunk_sc[u]) { - dims_outside_fill[u] = TRUE; + dims_outside_fill[u] = true; ndims_outside_fill++; } /* end if */ else - dims_outside_fill[u] = FALSE; + dims_outside_fill[u] = false; } /* end else */ - carry = FALSE; + carry = false; while (!carry) { int i; /* Local index variable */ @@ -6161,10 +6161,10 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Determine if the chunk just became an unfiltered chunk */ if (new_unfilt_dim[op_dim]) { - new_unfilt_chunk = TRUE; + new_unfilt_chunk = true; for (u = 0; u < space_ndims; u++) if (scaled[u] == min_partial_chunk_sc[u]) { - new_unfilt_chunk = FALSE; + new_unfilt_chunk = false; break; } /* end if */ } /* end if */ @@ -6186,11 +6186,11 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) #ifndef NDEBUG /* Make sure this chunk is really outside the new dimensions */ { - hbool_t outside_dim = FALSE; + bool outside_dim = false; for (u = 0; u < space_ndims; u++) if ((scaled[u] * chunk_dim[u]) >= space_dim[u]) { - outside_dim = TRUE; + outside_dim = true; break; } /* end if */ assert(outside_dim); @@ -6204,7 +6204,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Evict the entry from the cache if present, but do not flush * it to disk */ if (UINT_MAX != chk_udata.idx_hint) - if (H5D__chunk_cache_evict(dset, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) + if (H5D__chunk_cache_evict(dset, rdcc->slot[chk_udata.idx_hint], false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk"); /* Remove the chunk from disk, if present */ @@ -6220,7 +6220,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) } /* end else */ /* Increment indices */ - carry = TRUE; + carry = true; for (i = (int)(space_ndims - 1); i >= 0; --i) { scaled[i]++; if (scaled[i] > max_mod_chunk_sc[i]) { @@ -6229,14 +6229,14 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) if ((unsigned)i == op_dim) { scaled[i] = min_mod_chunk_sc[i]; if (dims_outside_fill[i] && fill_dim[i]) { - dims_outside_fill[i] = FALSE; + dims_outside_fill[i] = false; ndims_outside_fill--; } /* end if */ } /* end if */ else { scaled[i] = 0; if (dims_outside_fill[i] && max_fill_chunk_sc[i] >= 0) { - dims_outside_fill[i] = FALSE; + dims_outside_fill[i] = false; ndims_outside_fill--; } /* end if */ } /* end else */ @@ -6244,12 +6244,12 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) else { /* Check if we just went outside the fill dimension */ if (!dims_outside_fill[i] && (hssize_t)scaled[i] > max_fill_chunk_sc[i]) { - dims_outside_fill[i] = TRUE; + dims_outside_fill[i] = true; ndims_outside_fill++; } /* end if */ /* We found the next chunk, so leave the loop */ - carry = FALSE; + carry = false; break; } /* end else */ } /* end for */ @@ -6371,9 +6371,9 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_layout_t layout; /* Dataset layout message */ - hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */ + bool layout_read = false; /* Whether the layout message was read from the file */ H5O_pline_t pline; /* I/O pipeline message */ - hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ + bool pline_read = false; /* Whether the I/O pipeline message was read from the file */ htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ @@ -6391,7 +6391,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) else if (exists) { if (NULL == H5O_msg_read_oh(f, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O pipeline message"); - pline_read = TRUE; + pline_read = true; } /* end else if */ else memset(&pline, 0, sizeof(pline)); @@ -6402,7 +6402,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) else if (exists) { if (NULL == H5O_msg_read_oh(f, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message"); - layout_read = TRUE; + layout_read = true; } /* end else if */ else HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "can't find layout message"); @@ -6480,8 +6480,8 @@ H5D__chunk_update_cache(H5D_t *dset) /* Check if there is already a chunk at this chunk's new location */ old_ent = rdcc->slot[ent->idx]; if (old_ent != NULL) { - assert(old_ent->locked == FALSE); - assert(old_ent->deleted == FALSE); + assert(old_ent->locked == false); + assert(old_ent->deleted == false); /* Insert the old entry into the temporary list, but do not * evict (yet). Make sure we do not make any calls to the index @@ -6527,7 +6527,7 @@ H5D__chunk_update_cache(H5D_t *dset) ent = tmp_head.tmp_next; /* Remove the old entry from the cache */ - if (H5D__chunk_cache_evict(dset, ent, TRUE) < 0) + if (H5D__chunk_cache_evict(dset, ent, true) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks"); } /* end while */ @@ -6553,9 +6553,9 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_it_ud3_t *udata = (H5D_chunk_it_ud3_t *)_udata; /* User data for callback */ H5D_chunk_ud_t udata_dst; /* User data about new destination chunk */ - hbool_t is_vlen = FALSE; /* Whether datatype is variable-length */ - hbool_t fix_ref = FALSE; /* Whether to fix up references in the dest. file */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + bool is_vlen = false; /* Whether datatype is variable-length */ + bool fix_ref = false; /* Whether to fix up references in the dest. file */ + bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* General information about chunk copy */ void *bkg = udata->bkg; /* Background buffer for datatype conversion */ @@ -6564,7 +6564,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) const H5O_pline_t *pline = udata->pline; /* I/O pipeline for applying filters */ /* needed for compressed variable length data */ - hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */ + bool must_filter = false; /* Whether chunk must be filtered during copy */ size_t nbytes; /* Size of chunk in file (in bytes) */ H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ @@ -6581,20 +6581,20 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Check for filtered chunks */ /* Check for an edge chunk that is not filtered */ if (pline && pline->nused) { - must_filter = TRUE; + must_filter = true; if ((udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) - must_filter = FALSE; + must_filter = false; } /* Check parameter for type conversion */ if (udata->do_convert) { - if (H5T_detect_class(udata->dt_src, H5T_VLEN, FALSE) > 0) - is_vlen = TRUE; - else if ((H5T_get_class(udata->dt_src, FALSE) == H5T_REFERENCE) && + if (H5T_detect_class(udata->dt_src, H5T_VLEN, false) > 0) + is_vlen = true; + else if ((H5T_get_class(udata->dt_src, false) == H5T_REFERENCE) && (udata->file_src != udata->idx_info_dst->f)) - fix_ref = TRUE; + fix_ref = true; else HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy dataset elements"); } /* end if */ @@ -6643,12 +6643,12 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) ent = shared_fo->cache.chunk.slot[idx]; if (ent) { /* Speculatively set the 'found' flag */ - udata->chunk_in_cache = TRUE; + udata->chunk_in_cache = true; /* Verify that the cache entry is the correct chunk */ for (u = 0; u < shared_fo->ndims; u++) if (chunk_rec->scaled[u] != ent->scaled[u]) { - udata->chunk_in_cache = FALSE; + udata->chunk_in_cache = false; break; } /* end if */ } /* end if */ @@ -6751,7 +6751,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata->buf_size = buf_size; } /* end if */ - udata->chunk_in_cache = FALSE; + udata->chunk_in_cache = false; udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1, udata_dst.common.layout->max_down_chunks, @@ -6818,8 +6818,8 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk H5S_t *buf_space = NULL; /* Dataspace describing buffer */ hid_t sid_buf = -1; /* ID for buffer dataspace */ uint32_t nelmts = 0; /* Number of elements in buffer */ - hbool_t do_convert = FALSE; /* Indicate that type conversions should be performed */ - hbool_t copy_setup_done = FALSE; /* Indicate that 'copy setup' is done */ + bool do_convert = false; /* Indicate that type conversions should be performed */ + bool copy_setup_done = false; /* Indicate that 'copy setup' is done */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -6844,7 +6844,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk pline = pline_src; /* Layout is not created in the destination file, reset index address */ - if (H5D_chunk_idx_reset(storage_dst, TRUE) < 0) + if (H5D_chunk_idx_reset(storage_dst, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest"); /* Initialize layout information */ @@ -6876,14 +6876,14 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk if ((storage_src->ops->copy_setup)(&idx_info_src, &idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up index-specific chunk copying information"); - copy_setup_done = TRUE; + copy_setup_done = true; /* Create datatype ID for src datatype */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) + if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); /* If there's a VLEN source datatype, set up type conversion information */ - if (H5T_detect_class(dt_src, H5T_VLEN, FALSE) > 0) { + if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { H5T_t *dt_dst; /* Destination datatype */ H5T_t *dt_mem; /* Memory datatype */ size_t mem_dt_size; /* Memory datatype size */ @@ -6895,7 +6895,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { + if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); } /* end if */ @@ -6907,7 +6907,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { + if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); } /* end if */ @@ -6939,7 +6939,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); /* Register */ - if ((sid_buf = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { + if ((sid_buf = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { (void)H5S_close(buf_space); HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); } /* end if */ @@ -6953,12 +6953,12 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for raw data chunk"); /* Indicate that type conversion should be performed */ - do_convert = TRUE; + do_convert = true; } /* end if */ else { - if (H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) { + if (H5T_get_class(dt_src, false) == H5T_REFERENCE) { /* Indicate that type conversion should be performed */ - do_convert = TRUE; + do_convert = true; } /* end if */ H5_CHECKED_ASSIGN(buf_size, size_t, layout_src->size, uint32_t); @@ -6972,7 +6972,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for raw data chunk"); /* Check for reference datatype and no expanding references & clear background buffer */ - if (!cpy_info->expand_ref && ((H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) && (f_src != f_dst))) + if (!cpy_info->expand_ref && ((H5T_get_class(dt_src, false) == H5T_REFERENCE) && (f_src != f_dst))) /* Reset value to zero */ memset(bkg, 0, buf_size); } /* end if */ @@ -7005,7 +7005,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk udata.dset_ndims = (unsigned)sndims; udata.dset_dims = curr_dims; udata.cpy_info = cpy_info; - udata.chunk_in_cache = FALSE; + udata.chunk_in_cache = false; udata.chunk = NULL; /* Iterate over chunks to copy data */ @@ -7026,7 +7026,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk if (!H5_addr_defined(ent->chunk_block.offset)) { H5MM_memcpy(chunk_rec.scaled, ent->scaled, sizeof(chunk_rec.scaled)); udata.chunk = ent->chunk; - udata.chunk_in_cache = TRUE; + udata.chunk_in_cache = true; if (H5D__chunk_copy_cb(&chunk_rec, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy chunk data in cache"); } @@ -7081,8 +7081,8 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_ H5O_pline_t pline; /* I/O pipeline message */ H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); htri_t exists; /* Flag if header message of interest exists */ - hbool_t idx_info_init = FALSE; /* Whether the chunk index info has been initialized */ - hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read */ + bool idx_info_init = false; /* Whether the chunk index info has been initialized */ + bool pline_read = false; /* Whether the I/O pipeline message was read */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7101,7 +7101,7 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_ else if (exists) { if (NULL == H5O_msg_read_oh(loc->file, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't find I/O pipeline message"); - pline_read = TRUE; + pline_read = true; } /* end else if */ else memset(&pline, 0, sizeof(pline)); @@ -7119,7 +7119,7 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_ /* Allocate any indexing structures */ if (sc->ops->init && (sc->ops->init)(&idx_info, space, loc->addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information"); - idx_info_init = TRUE; + idx_info_init = true; /* Get size of index structure */ if (sc->ops->size && (sc->ops->size)(&idx_info, index_size) < 0) @@ -7165,7 +7165,7 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) fprintf(udata->stream, " ========== ======== ========== ==============================\n"); /* Set flag that the headers has been printed */ - udata->header_displayed = TRUE; + udata->header_displayed = true; } /* end if */ /* Print information about this chunk */ @@ -7220,7 +7220,7 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream) /* Set up user data for callback */ udata.stream = stream; - udata.header_displayed = FALSE; + udata.header_displayed = false; udata.ndims = dset->shared->layout.u.chunk.ndims; udata.chunk_dim = dset->shared->layout.u.chunk.dim; @@ -7248,7 +7248,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_stats(const H5D_t *dset, hbool_t headers) +H5D__chunk_stats(const H5D_t *dset, bool headers) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); double miss_rate; @@ -7270,7 +7270,7 @@ H5D__chunk_stats(const H5D_t *dset, hbool_t headers) #ifdef H5AC_DEBUG if (H5DEBUG(AC)) - headers = TRUE; + headers = true; #endif if (headers) { @@ -7317,7 +7317,7 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size { H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + bool fb_info_init = false; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7327,7 +7327,7 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, udata->dset->shared->type_id, (size_t)0, len) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); - fb_info_init = TRUE; + fb_info_init = true; /* Check for VL datatype & fill the buffer with VL datatype fill values */ if (fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) @@ -7403,12 +7403,12 @@ done: * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims, const hsize_t scaled[], const hsize_t *dset_dims) { unsigned u; /* Local index variable */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -7421,7 +7421,7 @@ H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims /* check if this is a partial edge chunk */ for (u = 0; u < dset_ndims; u++) if (((scaled[u] + 1) * chunk_dims[u]) > dset_dims[u]) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7441,10 +7441,10 @@ done: */ herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, - H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled) + H5F_block_t *new_chunk, bool *need_insert, const hsize_t *scaled) { - hbool_t alloc_chunk = FALSE; /* Whether to allocate chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + bool alloc_chunk = false; /* Whether to allocate chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7457,7 +7457,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old assert(new_chunk); assert(need_insert); - *need_insert = FALSE; + *need_insert = false; /* Check for filters on chunks */ if (idx_info->pline->nused > 0) { @@ -7498,7 +7498,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old if (!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, old_chunk->offset, old_chunk->length) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk"); - alloc_chunk = TRUE; + alloc_chunk = true; } /* end if */ else { /* Don't need to reallocate chunk, but send its address back up */ @@ -7508,13 +7508,13 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old } /* end if */ else { assert(!H5_addr_defined(new_chunk->offset)); - alloc_chunk = TRUE; + alloc_chunk = true; } /* end else */ } /* end if */ else { assert(!H5_addr_defined(new_chunk->offset)); assert(new_chunk->length == idx_info->layout->size); - alloc_chunk = TRUE; + alloc_chunk = true; } /* end else */ /* Actually allocate space for the chunk in the file */ @@ -7541,7 +7541,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, (hsize_t)new_chunk->length); if (!H5_addr_defined(new_chunk->offset)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed"); - *need_insert = TRUE; + *need_insert = true; break; case H5D_CHUNK_IDX_NTYPES: @@ -7692,7 +7692,7 @@ done: * Function: H5D__chunk_index_empty_cb * * Purpose: Callback function that simply stops iteration and sets the - * `empty` parameter to FALSE if called. If this callback is + * `empty` parameter to false if called. If this callback is * entered, it means that the chunk index contains at least * one chunk, so is not empty. * @@ -7703,12 +7703,12 @@ done: static int H5D__chunk_index_empty_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *_udata) { - hbool_t *empty = (hbool_t *)_udata; - int ret_value = H5_ITER_STOP; + bool *empty = (bool *)_udata; + int ret_value = H5_ITER_STOP; FUNC_ENTER_PACKAGE_NOERR - *empty = FALSE; + *empty = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_index_empty_cb() */ @@ -7729,7 +7729,7 @@ H5D__chunk_index_empty_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *------------------------------------------------------------------------- */ herr_t -H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty) +H5D__chunk_index_empty(const H5D_t *dset, bool *empty) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_rdcc_ent_t *ent; /* Cache entry */ @@ -7748,7 +7748,7 @@ H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty) /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); /* Compose chunked index info struct */ @@ -7757,7 +7757,7 @@ H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty) idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; - *empty = TRUE; + *empty = true; if (H5_addr_defined(idx_info.storage->idx_addr)) { /* Iterate over the allocated chunks */ @@ -7834,7 +7834,7 @@ H5D__get_num_chunks(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); /* Compose chunked index info struct */ @@ -7892,7 +7892,7 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) chunk_info->nbytes = chunk_rec->nbytes; for (ii = 0; ii < chunk_info->ndims; ii++) chunk_info->scaled[ii] = chunk_rec->scaled[ii]; - chunk_info->found = TRUE; + chunk_info->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -7942,7 +7942,7 @@ H5D__get_chunk_info(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); /* Compose chunked index info struct */ @@ -7966,7 +7966,7 @@ H5D__get_chunk_info(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ udata.nbytes = 0; udata.filter_mask = 0; udata.chunk_addr = HADDR_UNDEF; - udata.found = FALSE; + udata.found = false; /* Iterate over the allocated chunks */ if ((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_chunk_info_cb, &udata) < @@ -8007,7 +8007,7 @@ static int H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_info_iter_ud_t *chunk_info = (H5D_chunk_info_iter_ud_t *)_udata; - hbool_t different = FALSE; /* TRUE when a scaled value pair mismatch */ + bool different = false; /* true when a scaled value pair mismatch */ hsize_t ii; /* Local index value */ int ret_value = H5_ITER_CONT; /* Callback return value */ @@ -8020,14 +8020,14 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Going through the scaled, stop when a mismatch is found */ for (ii = 0; ii < chunk_info->ndims && !different; ii++) if (chunk_info->scaled[ii] != chunk_rec->scaled[ii]) - different = TRUE; + different = true; /* Same scaled coords means the chunk is found, copy the chunk info */ if (!different) { chunk_info->nbytes = chunk_rec->nbytes; chunk_info->filter_mask = chunk_rec->filter_mask; chunk_info->chunk_addr = chunk_rec->chunk_addr; - chunk_info->found = TRUE; + chunk_info->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -8075,7 +8075,7 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer"); /* Set addr & size for when dset is not written or queried chunk is not found */ @@ -8101,7 +8101,7 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned udata.nbytes = 0; udata.filter_mask = 0; udata.chunk_addr = HADDR_UNDEF; - udata.found = FALSE; + udata.found = false; /* Iterate over the allocated chunks to find the requested chunk */ if ((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_chunk_info_by_coord_cb, @@ -8194,7 +8194,7 @@ H5D__chunk_iter(H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data) /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0) + if (H5D__chunk_flush_entry(dset, ent, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "cannot flush indexed storage buffer"); /* Compose chunked index info struct */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index c16b24b..4a8fa0d 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -58,7 +58,7 @@ typedef struct H5D_compact_iovv_memmanage_ud_t { /* Layout operation callbacks */ static herr_t H5D__compact_construct(H5F_t *f, H5D_t *dset); -static hbool_t H5D__compact_is_space_alloc(const H5O_storage_t *storage); +static bool H5D__compact_is_space_alloc(const H5O_storage_t *storage); static herr_t H5D__compact_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); static herr_t H5D__compact_iovv_memmanage_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata); static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, @@ -113,7 +113,7 @@ herr_t H5D__compact_fill(const H5D_t *dset) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + bool fb_info_init = false; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -130,7 +130,7 @@ H5D__compact_fill(const H5D_t *dset) &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); - fb_info_init = TRUE; + fb_info_init = true; /* Check for VL datatype & non-default fill value */ if (fb_info.has_vlen_fill_type) @@ -189,7 +189,7 @@ H5D__compact_construct(H5F_t *f, H5D_t *dset) /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. */ - max_comp_data_size = H5O_MESG_MAX_SIZE - H5D__layout_meta_size(f, &(dset->shared->layout), FALSE); + max_comp_data_size = H5O_MESG_MAX_SIZE - H5D__layout_meta_size(f, &(dset->shared->layout), false); if (dset->shared->layout.storage.u.compact.size > max_comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "compact dataset size is bigger than header message maximum size"); @@ -207,7 +207,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__compact_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -216,7 +216,7 @@ H5D__compact_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) assert(storage); /* Compact storage is currently always allocated */ - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5D__compact_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -396,7 +396,7 @@ H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dse } /* Mark the compact dataset's buffer as dirty */ - *dset_info->store->compact.dirty = TRUE; + *dset_info->store->compact.dirty = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -423,9 +423,9 @@ H5D__compact_flush(H5D_t *dset) /* Check if the buffered compact information is dirty */ if (dset->shared->layout.storage.u.compact.dirty) { - dset->shared->layout.storage.u.compact.dirty = FALSE; + dset->shared->layout.storage.u.compact.dirty = false; if (H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout)) < 0) { - dset->shared->layout.storage.u.compact.dirty = TRUE; + dset->shared->layout.storage.u.compact.dirty = true; HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message"); } } /* end if */ @@ -497,11 +497,11 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds storage_src = &(shared_fo->layout.storage.u.compact); /* Create datatype ID for src datatype, so it gets freed */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) + if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); /* If there's a VLEN source datatype, do type conversion information */ - if (H5T_detect_class(dt_src, H5T_VLEN, FALSE) > 0) { + if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { H5T_path_t *tpath_src_mem, *tpath_mem_dst; /* Datatype conversion paths */ H5T_t *dt_dst; /* Destination datatype */ H5T_t *dt_mem; /* Memory datatype */ @@ -516,7 +516,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { + if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); } /* end if */ @@ -528,7 +528,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { + if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); } /* end if */ @@ -564,7 +564,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { + if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); } /* end if */ @@ -602,7 +602,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data"); } /* end if */ - else if (H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) { + else if (H5T_get_class(dt_src, false) == H5T_REFERENCE) { if (f_src != f_dst) { /* Check for expanding references */ if (cpy_info->expand_ref) { @@ -625,7 +625,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds H5MM_memcpy(storage_dst->buf, storage_src->buf, storage_src->size); /* Mark destination buffer as dirty */ - storage_dst->dirty = TRUE; + storage_dst->dirty = true; done: if (buf_sid > 0 && H5I_dec_ref(buf_sid) < 0) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 4624d83..db156fd 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -191,12 +191,12 @@ H5D__contig_fill(H5D_t *dset) MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ int mpi_code; /* MPI return code */ - hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ - hbool_t using_mpi = - FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ + bool blocks_written = false; /* Flag to indicate that chunk was actually written */ + bool using_mpi = + false; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ #endif /* H5_HAVE_PARALLEL */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + bool fb_info_init = false; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -220,7 +220,7 @@ H5D__contig_fill(H5D_t *dset) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); /* Set the MPI-capable file driver flag */ - using_mpi = TRUE; + using_mpi = true; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -241,7 +241,7 @@ H5D__contig_fill(H5D_t *dset) if (H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, npoints, max_temp_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); - fb_info_init = TRUE; + fb_info_init = true; /* Start at the beginning of the dataset */ offset = 0; @@ -287,14 +287,14 @@ H5D__contig_fill(H5D_t *dset) /* If writing fails, push an error and stop writing, but * still participate in following MPI_Barrier. */ - blocks_written = TRUE; + blocks_written = true; HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset"); break; } } /* Indicate that blocks are being written */ - blocks_written = TRUE; + blocks_written = true; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ @@ -506,10 +506,10 @@ done: * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__contig_is_space_alloc(const H5O_storage_t *storage) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -517,7 +517,7 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage) assert(storage); /* Set return value */ - ret_value = (hbool_t)H5_addr_defined(storage->u.contig.addr); + ret_value = (bool)H5_addr_defined(storage->u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__contig_is_space_alloc() */ @@ -531,7 +531,7 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage) * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__contig_is_data_cached(const H5D_shared_t *shared_dset) { FUNC_ENTER_PACKAGE_NOERR @@ -557,7 +557,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ - htri_t file_space_normalized = FALSE; /* File dataspace was normalized */ + htri_t file_space_normalized = false; /* File dataspace was normalized */ int sf_ndims; /* The number of dimensions of the file dataspace (signed) */ @@ -598,7 +598,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) H5S_t *tmp_fspace; /* Temporary file dataspace */ /* Create "temporary" chunk for selection operations (copy file space) */ - if (NULL == (tmp_fspace = H5S_copy(dinfo->file_space, TRUE, FALSE))) + if (NULL == (tmp_fspace = H5S_copy(dinfo->file_space, true, false))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space"); /* Add temporary chunk to the list of pieces */ @@ -614,7 +614,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Set the file chunk dataspace */ new_piece_info->fspace = tmp_fspace; - new_piece_info->fspace_shared = FALSE; + new_piece_info->fspace_shared = false; /* Set the memory chunk dataspace */ /* same as one chunk, just use dset mem space */ @@ -624,7 +624,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) * fspace gets free by application H5Sclose(), and * doesn't require providing layout_ops.io_term() for H5D_LOPS_CONTIG. */ - new_piece_info->mspace_shared = TRUE; + new_piece_info->mspace_shared = true; /* Set the number of points */ new_piece_info->piece_points = dinfo->nelmts; @@ -641,7 +641,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) new_piece_info->faddr = dinfo->dset->shared->layout.storage.u.contig.addr; /* Initialize in-place type conversion info. Start with it disabled. */ - new_piece_info->in_place_tconv = FALSE; + new_piece_info->in_place_tconv = false; new_piece_info->buf_off = 0; /* Calculate type conversion buffer size and check for in-place conversion if necessary. Currently @@ -715,7 +715,7 @@ H5D__contig_mdio_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) * Purpose: A small internal function to if it may be possible to use * selection I/O. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -752,7 +752,7 @@ H5D__contig_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t * io_info->no_selection_io_cause |= H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; } else { - hbool_t page_buf_enabled; + bool page_buf_enabled; assert(dset_info->layout_ops.writevv == H5D__contig_writevv); @@ -1029,7 +1029,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void * H5MM_memcpy(buf, dset_contig->sieve_buf, len); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end else */ } /* end if */ else { @@ -1058,7 +1058,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void * HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed"); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end if */ } /* end if */ @@ -1076,7 +1076,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void * HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed"); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end if */ /* Determine the new sieve buffer size & location */ @@ -1106,7 +1106,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void * H5MM_memcpy(buf, dset_contig->sieve_buf, len); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end else */ } /* end else */ } /* end else */ @@ -1295,7 +1295,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void H5MM_memcpy(dset_contig->sieve_buf, buf, len); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = TRUE; + dset_contig->sieve_dirty = true; /* Stash local copies of these values */ sieve_start = dset_contig->sieve_loc; @@ -1315,7 +1315,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void H5MM_memcpy(base_sieve_buf, buf, len); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = TRUE; + dset_contig->sieve_dirty = true; } /* end if */ /* Entire request is not within this data sieve buffer */ else { @@ -1332,7 +1332,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed"); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end if */ /* Force the sieve buffer to be re-read the next time */ @@ -1381,7 +1381,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed"); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty = FALSE; + dset_contig->sieve_dirty = false; } /* end if */ /* Determine the new sieve buffer size & location */ @@ -1414,7 +1414,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void H5MM_memcpy(dset_contig->sieve_buf, buf, len); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty = TRUE; + dset_contig->sieve_dirty = true; } /* end else */ } /* end else */ } /* end else */ @@ -1613,11 +1613,11 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f H5S_t *buf_space = NULL; /* Dataspace describing buffer */ hid_t buf_sid = -1; /* ID for buffer dataspace */ hsize_t buf_dim[1] = {0}; /* Dimension for buffer */ - hbool_t is_vlen = FALSE; /* Flag to indicate that VL type conversion should occur */ - hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */ + bool is_vlen = false; /* Flag to indicate that VL type conversion should occur */ + bool fix_ref = false; /* Flag to indicate that ref values should be fixed */ H5D_shared_t *shared_fo = (H5D_shared_t *)cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ - hbool_t try_sieve = FALSE; /* Try to get data from the sieve buffer */ + bool try_sieve = false; /* Try to get data from the sieve buffer */ haddr_t sieve_start = HADDR_UNDEF; /* Start location of sieve buffer */ haddr_t sieve_end = HADDR_UNDEF; /* End locations of sieve buffer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1644,15 +1644,15 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f /* Create datatype ID for src datatype. We may or may not use this ID, * but this ensures that the src datatype will be freed. */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) + if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); /* If there's a VLEN source datatype, set up type conversion information */ - if (H5T_detect_class(dt_src, H5T_VLEN, FALSE) > 0) { + if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { + if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); } /* end if */ @@ -1664,7 +1664,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { + if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); } /* end if */ @@ -1705,20 +1705,20 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { + if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); } /* end if */ /* Set flag to do type conversion */ - is_vlen = TRUE; + is_vlen = true; } /* end if */ else { /* Check for reference datatype */ - if (H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) { + if (H5T_get_class(dt_src, false) == H5T_REFERENCE) { /* Need to fix values of references when copying across files */ if (f_src != f_dst) - fix_ref = TRUE; + fix_ref = true; } /* end if */ /* Set the number of bytes to read & write to the buffer size */ @@ -1747,7 +1747,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f /* If data sieving is enabled and the dataset is open in the file, set up to copy data out of the sieve buffer if deemed possible later */ if (H5F_HAS_FEATURE(f_src, H5FD_FEAT_DATA_SIEVE) && shared_fo && shared_fo->cache.contig.sieve_buf) { - try_sieve = TRUE; + try_sieve = true; sieve_start = shared_fo->cache.contig.sieve_loc; sieve_end = sieve_start + shared_fo->cache.contig.sieve_size; } diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index d8c19c0..04ab2cc 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -117,7 +117,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t if (H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) + else if (true != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not dataset create property list ID"); /* Set the DCPL for the API context */ @@ -138,7 +138,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset"); /* Register the new dataset to get an ID for it */ - if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset"); done: @@ -194,7 +194,7 @@ H5Dopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset"); /* Get an ID for the dataset */ - if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset ID"); done: @@ -323,7 +323,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 93535ac..f14ac33 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -66,7 +66,7 @@ typedef struct H5D_earray_ctx_t { typedef struct H5D_earray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */ - hbool_t filtered; /* Whether the chunks are filtered */ + bool filtered; /* Whether the chunks are filtered */ H5D_chunk_cb_func_t cb; /* Chunk callback routine */ void *udata; /* User data for chunk callback routine */ } H5D_earray_it_ud_t; @@ -103,26 +103,26 @@ static herr_t H5D__earray_filt_decode(const void *raw, void *elmt, size_t nelmts static herr_t H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Chunked layout indexing callbacks */ -static herr_t H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, - haddr_t dset_ohdr_addr); -static herr_t H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, - const H5D_t *dset); -static herr_t H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static herr_t H5D__earray_idx_resize(H5O_layout_chunk_t *layout); -static int H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst); -static herr_t H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); -static herr_t H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr); +static herr_t H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, + const H5D_t *dset); +static herr_t H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static herr_t H5D__earray_idx_resize(H5O_layout_chunk_t *layout); +static int H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, + H5O_storage_chunk_t *storage_dst); +static herr_t H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__earray_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info); /* Generic extensible array routines */ static herr_t H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info); @@ -134,7 +134,7 @@ static herr_t H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info); /* Extensible array indexed chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_EARRAY[1] = {{ - TRUE, /* Extensible array indices support SWMR access */ + true, /* Extensible array indices support SWMR access */ H5D__earray_idx_init, /* init */ H5D__earray_idx_create, /* create */ H5D__earray_idx_is_space_alloc, /* is_space_alloc */ @@ -562,7 +562,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) { H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ - hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ + bool obj_opened = false; /* Flag to indicate that the object header was opened */ H5O_layout_t layout; /* Layout message */ void *ret_value = NULL; /* Return value */ @@ -585,7 +585,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) /* Open the object header where the layout message resides */ if (H5O_open(&obj_loc) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "can't open object header"); - obj_opened = TRUE; + obj_opened = true; /* Read the layout message */ if (NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) @@ -685,7 +685,7 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.earray.dset_ohdr_addr; /* Get header */ - if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) + if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Retrieve the dataset's object header proxy */ @@ -914,7 +914,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -922,7 +922,7 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__earray_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -1611,7 +1611,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__earray_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Defl.c b/src/H5Defl.c index 84f00ed..05ca107 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -170,7 +170,7 @@ done: * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__efl_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -179,7 +179,7 @@ H5D__efl_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) assert(storage); /* EFL storage is currently always treated as allocated */ - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5D__efl_is_space_alloc() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 9235ecd..dae5dd1 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -64,7 +64,7 @@ typedef struct H5D_farray_ctx_t { typedef struct H5D_farray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */ - hbool_t filtered; /* Whether the chunks are filtered */ + bool filtered; /* Whether the chunks are filtered */ H5D_chunk_cb_func_t cb; /* Chunk callback routine */ void *udata; /* User data for chunk callback routine */ } H5D_farray_it_ud_t; @@ -102,25 +102,25 @@ static herr_t H5D__farray_filt_decode(const void *raw, void *elmt, size_t nelmts static herr_t H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Chunked layout indexing callbacks */ -static herr_t H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, - haddr_t dset_ohdr_addr); -static herr_t H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, - const H5D_t *dset); -static herr_t H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst); -static herr_t H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); -static herr_t H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr); +static herr_t H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, + const H5D_t *dset); +static herr_t H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static int H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, + H5O_storage_chunk_t *storage_dst); +static herr_t H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__farray_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info); /* Generic fixed array routines */ static herr_t H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info); @@ -132,7 +132,7 @@ static herr_t H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info); /* Fixed array indexed chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_FARRAY[1] = {{ - TRUE, /* Fixed array indices support SWMR access */ + true, /* Fixed array indices support SWMR access */ H5D__farray_idx_init, /* init */ H5D__farray_idx_create, /* create */ H5D__farray_idx_is_space_alloc, /* is_space_alloc */ @@ -415,7 +415,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) { H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ - hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ + bool obj_opened = false; /* Flag to indicate that the object header was opened */ H5O_layout_t layout; /* Layout message */ void *ret_value = NULL; /* Return value */ @@ -437,7 +437,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) /* Open the object header where the layout message resides */ if (H5O_open(&obj_loc) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "can't open object header"); - obj_opened = TRUE; + obj_opened = true; /* Read the layout message */ if (NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) @@ -681,7 +681,7 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.farray.dset_ohdr_addr; /* Get header */ - if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) + if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Retrieve the dataset's object header proxy */ @@ -862,7 +862,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -870,7 +870,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__farray_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -1468,7 +1468,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__farray_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Dfill.c b/src/H5Dfill.c index ed1ac3e..8f23acd 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -111,7 +111,7 @@ herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_type, H5S_t *space) { H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ - hbool_t mem_iter_init = FALSE; /* Whether the memory selection iterator has been initialized */ + bool mem_iter_init = false; /* Whether the memory selection iterator has been initialized */ H5WB_t *elem_wb = NULL; /* Wrapped buffer for element data */ uint8_t elem_buf[H5T_ELEM_BUF_SIZE]; /* Buffer for element data */ H5WB_t *bkg_elem_wb = NULL; /* Wrapped buffer for background data */ @@ -171,10 +171,10 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ /* Construct source & destination datatype IDs, if we will need them */ if (!H5T_path_noop(tpath)) { - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), FALSE)) < 0) + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); - if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), FALSE)) < 0) + if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } /* end if */ @@ -182,7 +182,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ * then do conversion on each element so that each of them has a copy * of the VL data. */ - if (TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) { + if (true == H5T_detect_class(fill_type, H5T_VLEN, false)) { hsize_t nelmts; /* Number of data elements */ /* Get the number of elements in the selection */ @@ -214,7 +214,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ if (H5S_select_iter_init(mem_iter, space, dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; + mem_iter_init = true; /* Scatter the data into memory */ if (H5D__scatter_mem(tmp_buf, mem_iter, (size_t)nelmts, buf /*out*/) < 0) @@ -330,16 +330,16 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat htri_t has_vlen_type; /* Whether the datatype has a VL component */ /* Detect whether the datatype has a VL component */ - if ((has_vlen_type = H5T_detect_class(dset_type, H5T_VLEN, FALSE)) < 0) + if ((has_vlen_type = H5T_detect_class(dset_type, H5T_VLEN, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to detect vlen datatypes?"); - fb_info->has_vlen_fill_type = (hbool_t)has_vlen_type; + fb_info->has_vlen_fill_type = (bool)has_vlen_type; /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ if (fb_info->has_vlen_fill_type) { /* Create temporary datatype for conversion operation */ if (NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy file datatype"); - if ((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, FALSE)) < 0) + if ((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); /* Retrieve sizes of memory & file datatypes */ @@ -364,7 +364,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Allocate fill buffer */ if (caller_fill_buf) { fb_info->fill_buf = caller_fill_buf; - fb_info->use_caller_fill_buf = TRUE; + fb_info->use_caller_fill_buf = true; } /* end if */ else { if (alloc_func) @@ -417,7 +417,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Allocate temporary buffer */ if (caller_fill_buf) { fb_info->fill_buf = caller_fill_buf; - fb_info->use_caller_fill_buf = TRUE; + fb_info->use_caller_fill_buf = true; } /* end if */ else { if (alloc_func) @@ -450,7 +450,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Use (and zero) caller's buffer, if provided */ if (caller_fill_buf) { fb_info->fill_buf = caller_fill_buf; - fb_info->use_caller_fill_buf = TRUE; + fb_info->use_caller_fill_buf = true; memset(fb_info->fill_buf, 0, fb_info->fill_buf_size); } /* end if */ diff --git a/src/H5Dint.c b/src/H5Dint.c index a547a72..7d38441 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -74,17 +74,17 @@ typedef struct { /********************/ /* General stuff */ -static H5D_shared_t *H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hid_t dapl_id, bool creating, bool vl_type); static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id); static herr_t H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char **file_prefix); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id); -static herr_t H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[]); +static herr_t H5D__init_storage(H5D_t *dset, bool full_overwrite, hsize_t old_dim[]); static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id); static herr_t H5D__close_cb(H5VL_object_t *dset_vol_obj, void **request); -static herr_t H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize); +static herr_t H5D__use_minimized_dset_headers(H5F_t *file, bool *minimize); static herr_t H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc); static size_t H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr); static void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); @@ -238,7 +238,7 @@ H5D_top_term_package(void) * * QAK - 5/13/03 */ - (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); + (void)H5I_clear_type(H5I_DATASET, true, false); n++; /*H5I*/ } @@ -417,7 +417,7 @@ done: *------------------------------------------------------------------------- */ static H5D_shared_t * -H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type) +H5D__new(hid_t dcpl_id, hid_t dapl_id, bool creating, bool vl_type) { H5D_shared_t *new_dset = NULL; /* New dataset object */ H5P_genplist_t *plist; /* Property list created */ @@ -436,7 +436,7 @@ H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type) * don't bother to copy it, just increment the reference count */ if (!vl_type && creating && dcpl_id == H5P_DATASET_CREATE_DEFAULT) { - if (H5I_inc_ref(dcpl_id, FALSE) < 0) + if (H5I_inc_ref(dcpl_id, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment default DCPL ID"); new_dset->dcpl_id = dcpl_id; } /* end if */ @@ -445,11 +445,11 @@ H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type) if (NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list"); - new_dset->dcpl_id = H5P_copy_plist(plist, FALSE); + new_dset->dcpl_id = H5P_copy_plist(plist, false); } /* end else */ if (!vl_type && creating && dapl_id == H5P_DATASET_ACCESS_DEFAULT) { - if (H5I_inc_ref(dapl_id, FALSE) < 0) + if (H5I_inc_ref(dapl_id, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment default DAPL ID"); new_dset->dapl_id = dapl_id; } /* end if */ @@ -458,7 +458,7 @@ H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type) if (NULL == (plist = (H5P_genplist_t *)H5I_object(dapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list"); - new_dset->dapl_id = H5P_copy_plist(plist, FALSE); + new_dset->dapl_id = H5P_copy_plist(plist, false); } /* end else */ /* Set return value */ @@ -490,10 +490,10 @@ done: static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type) { - htri_t relocatable; /* Flag whether the type is relocatable */ - htri_t immutable; /* Flag whether the type is immutable */ - hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t relocatable; /* Flag whether the type is relocatable */ + htri_t immutable; /* Flag whether the type is immutable */ + bool use_at_least_v18; /* Flag indicating to use at least v18 format versions */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -534,12 +534,12 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype"); /* Get a datatype ID for the dataset's datatype */ - if ((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + if ((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type"); } /* end if */ /* Not a custom datatype, just use it directly */ else { - if (H5I_inc_ref(type_id, FALSE) < 0) + if (H5I_inc_ref(type_id, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, FAIL, "Can't increment datatype ID"); /* Use existing datatype */ @@ -614,7 +614,7 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) assert(space); /* Copy dataspace for dataset */ - if (NULL == (dset->shared->space = H5S_copy(space, FALSE, TRUE))) + if (NULL == (dset->shared->space = H5S_copy(space, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataspace"); /* Cache the dataset's dataspace info */ @@ -626,7 +626,7 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype"); /* Set the dataset's dataspace to 'all' selection */ - if (H5S_select_all(dset->shared->space, TRUE) < 0) + if (H5S_select_all(dset->shared->space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set all selection"); done: @@ -646,7 +646,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize) +H5D__use_minimized_dset_headers(H5F_t *file, bool *minimize) { herr_t ret_value = SUCCEED; @@ -660,12 +660,12 @@ H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset object header minimize flag from API context"); - if (FALSE == *minimize) + if (false == *minimize) *minimize = H5F_get_min_dset_ohdr(file); done: if (FAIL == ret_value) - *minimize = FALSE; + *minimize = false; FUNC_LEAVE_NOAPI(ret_value) } /* H5D__use_minimized_dset_headers */ @@ -684,7 +684,7 @@ H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr) { H5T_t *type = NULL; H5O_fill_t *fill_prop = NULL; - hbool_t use_at_least_v18 = FALSE; + bool use_at_least_v18 = false; const char continuation[1] = ""; /* required for work-around */ size_t get_value = 0; size_t ret_value = 0; @@ -846,10 +846,10 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) H5T_t *type; /* Dataset's datatype */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ H5D_fill_value_t fill_status; /* Fill value status */ - hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ - hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ - hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ - hbool_t use_minimized_header = FALSE; /* Flag to use minimized dataset object headers */ + bool fill_changed = false; /* Flag indicating the fill value was changed */ + bool layout_init = false; /* Flag to indicate that chunk information was initialized */ + bool use_at_least_v18; /* Flag indicating to use at least v18 format versions */ + bool use_minimized_header = false; /* Flag to use minimized dataset object headers */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -872,14 +872,14 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined"); /* Special case handling for variable-length types */ - if (H5T_detect_class(type, H5T_VLEN, FALSE)) { + if (H5T_detect_class(type, H5T_VLEN, false)) { /* If the default fill value is chosen for variable-length types, always write it */ if (fill_prop->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_DEFAULT) { /* Update dataset creation property */ fill_prop->fill_time = H5D_FILL_TIME_ALLOC; /* Note that the fill value changed */ - fill_changed = TRUE; + fill_changed = true; } /* end if */ /* Don't allow never writing fill values with variable-length types */ @@ -894,15 +894,15 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) if (fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert fill value to dataset type"); - fill_prop->fill_defined = TRUE; + fill_prop->fill_defined = true; } else if (fill_status == H5D_FILL_VALUE_UNDEFINED) - fill_prop->fill_defined = FALSE; + fill_prop->fill_defined = false; else HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined"); /* Check for invalid fill & allocation time setting */ - if (fill_prop->fill_defined == FALSE && fill_prop->fill_time == H5D_FILL_TIME_ALLOC) + if (fill_prop->fill_defined == false && fill_prop->fill_time == H5D_FILL_TIME_ALLOC) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "fill value writing on allocation set, but no fill value defined"); @@ -923,7 +923,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) if (H5D__use_minimized_dset_headers(file, &use_minimized_header) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get minimize settings"); - if (TRUE == use_minimized_header) { + if (true == use_minimized_header) { if (H5D__prepare_minimized_oh(file, dset, oloc) == FAIL) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header"); } /* end if */ @@ -979,7 +979,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout/pline/efl header message"); /* Indicate that the layout information was initialized */ - layout_init = TRUE; + layout_init = true; #ifdef H5O_ENABLE_BOGUS { @@ -1015,7 +1015,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) * header and doesn't use a separate message -QAK) */ if (!use_at_least_v18) - if (H5O_touch_oh(file, oh, TRUE) < 0) + if (H5O_touch_oh(file, oh, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message"); done: @@ -1136,12 +1136,12 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t H5T_t *dt = NULL; /* Datatype for dataset (non-VOL pointer) */ H5D_t *new_dset = NULL; H5P_genplist_t *dc_plist = NULL; /* New Property list */ - hbool_t has_vl_type = FALSE; /* Flag to indicate a VL-type for dataset */ - hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ - hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ - hbool_t fill_copied = FALSE; /* Flag to indicate that fill-value message was copied */ - hbool_t pline_copied = FALSE; /* Flag to indicate that pipeline message was copied */ - hbool_t efl_copied = FALSE; /* Flag to indicate that external file list message was copied */ + bool has_vl_type = false; /* Flag to indicate a VL-type for dataset */ + bool layout_init = false; /* Flag to indicate that chunk information was initialized */ + bool layout_copied = false; /* Flag to indicate that layout message was copied */ + bool fill_copied = false; /* Flag to indicate that fill-value message was copied */ + bool pline_copied = false; /* Flag to indicate that pipeline message was copied */ + bool efl_copied = false; /* Flag to indicate that external file list message was copied */ H5G_loc_t dset_loc; /* Dataset location */ H5D_t *ret_value = NULL; /* Return value */ @@ -1161,12 +1161,12 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t type = H5T_get_actual_type(dt); /* Check if the datatype is "sensible" for use in a dataset */ - if (H5T_is_sensible(type) != TRUE) + if (H5T_is_sensible(type) != true) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "datatype is not sensible"); /* Check if the datatype is/contains a VL-type */ - if (H5T_detect_class(type, H5T_VLEN, FALSE)) - has_vl_type = TRUE; + if (H5T_detect_class(type, H5T_VLEN, false)) + has_vl_type = true; /* Check if the dataspace has an extent set (or is NULL) */ if (!H5S_has_extent(space)) @@ -1182,7 +1182,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t H5G_loc_reset(&dset_loc); /* Initialize the shared dataset space */ - if (NULL == (new_dset->shared = H5D__new(dcpl_id, dapl_id, TRUE, has_vl_type))) + if (NULL == (new_dset->shared = H5D__new(dcpl_id, dapl_id, true, has_vl_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Copy & initialize datatype for dataset */ @@ -1194,7 +1194,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy dataspace"); /* Set the dataset's checked_filters flag to enable writing */ - new_dset->shared->checked_filters = TRUE; + new_dset->shared->checked_filters = true; /* Check if the dataset has a non-default DCPL & get important values, if so */ if (new_dset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -1202,12 +1202,12 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t H5O_pline_t *pline; /* Dataset's I/O pipeline information */ H5O_fill_t *fill; /* Dataset's fill value info */ H5O_efl_t *efl; /* Dataset's external file list info */ - htri_t ignore_filters = FALSE; /* Ignore optional filters or not */ + htri_t ignore_filters = false; /* Ignore optional filters or not */ if ((ignore_filters = H5Z_ignore_filters(new_dset->shared->dcpl_id, dt, space)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "H5Z_has_optional_filter() failed"); - if (FALSE == ignore_filters) { + if (false == ignore_filters) { /* Check if the filters in the DCPL can be applied to this dataset */ if (H5Z_can_apply(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "I/O filters can't operate on this dataset"); @@ -1225,21 +1225,21 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t pline = &new_dset->shared->dcpl_cache.pline; if (H5P_get(dc_plist, H5O_CRT_PIPELINE_NAME, pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve pipeline filter"); - pline_copied = TRUE; + pline_copied = true; layout = &new_dset->shared->layout; if (H5P_get(dc_plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve layout"); - layout_copied = TRUE; + layout_copied = true; fill = &new_dset->shared->dcpl_cache.fill; if (H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, fill) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve fill value info"); - fill_copied = TRUE; + fill_copied = true; efl = &new_dset->shared->dcpl_cache.efl; if (H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve external file list"); - efl_copied = TRUE; + efl_copied = true; - if (FALSE == ignore_filters) { + if (false == ignore_filters) { /* Check that chunked layout is used if filters are enabled */ if (pline->nused > 0 && H5D_CHUNKED != layout->type) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout"); @@ -1300,7 +1300,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache"); /* Indicate that the layout information was initialized */ - layout_init = TRUE; + layout_init = true; /* Set up append flush parameters for the dataset */ if (H5D__append_flush_setup(new_dset, new_dset->shared->dapl_id) < 0) @@ -1317,7 +1317,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t /* Add the dataset to the list of opened objects in the file */ if (H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't incr object ref. count"); - if (H5FO_insert(new_dset->oloc.file, new_dset->oloc.addr, new_dset->shared, TRUE) < 0) + if (H5FO_insert(new_dset->oloc.file, new_dset->oloc.addr, new_dset->shared, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert dataset into list of open objects"); new_dset->shared->fo_count = 1; @@ -1399,7 +1399,7 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id) H5G_name_t path; /* Dataset group hier. path */ H5O_loc_t oloc; /* Dataset object location */ H5O_type_t obj_type; /* Type of object at location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ + bool loc_found = false; /* Location at 'name' found */ H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1416,7 +1416,7 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id) /* Find the dataset object */ if (H5G_loc_find(loc, name, &dset_loc) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found"); - loc_found = TRUE; + loc_found = true; /* Check that the object found is the correct type */ if (H5O_obj_type(&oloc, &obj_type) < 0) @@ -1494,7 +1494,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found"); /* Add the dataset to the list of opened objects in the file */ - if (H5FO_insert(dataset->oloc.file, dataset->oloc.addr, dataset->shared, FALSE) < 0) + if (H5FO_insert(dataset->oloc.file, dataset->oloc.addr, dataset->shared, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert dataset into list of open objects"); /* Increment object count for the object in the top file */ @@ -1668,8 +1668,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ unsigned alloc_time_state; /* Allocation time state */ htri_t msg_exists; /* Whether a particular type of message exists */ - hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ - hbool_t must_init_storage = FALSE; + bool layout_init = false; /* Flag to indicate that chunk information was initialized */ + bool must_init_storage = false; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) @@ -1677,8 +1677,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) /* check args */ assert(dataset); - /* (Set the 'vl_type' parameter to FALSE since it doesn't matter from here) */ - if (NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, dapl_id, FALSE, FALSE))) + /* (Set the 'vl_type' parameter to false since it doesn't matter from here) */ + if (NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, dapl_id, false, false))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); /* Open the dataset object */ @@ -1700,7 +1700,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't cache dataspace info"); /* Get a datatype ID for the dataset's datatype */ - if ((dataset->shared->type_id = H5I_register(H5I_DATATYPE, dataset->shared->type, FALSE)) < 0) + if ((dataset->shared->type_id = H5I_register(H5I_DATATYPE, dataset->shared->type, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type"); /* Get dataset creation property list object */ @@ -1712,7 +1712,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info"); /* Indicate that the layout information was initialized */ - layout_init = TRUE; + layout_init = true; /* * Now that we've read the dataset's datatype, dataspace and @@ -1829,7 +1829,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) (H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI) && dataset->shared->dcpl_cache.pline.nused == 0)); - if (must_init_storage && (H5D__alloc_storage(dataset, H5D_ALLOC_OPEN, FALSE, NULL) < 0)) + if (must_init_storage && (H5D__alloc_storage(dataset, H5D_ALLOC_OPEN, false, NULL) < 0)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage"); done: @@ -1871,10 +1871,10 @@ done: herr_t H5D_close(H5D_t *dataset) { - hbool_t free_failed = FALSE; /* Set if freeing sub-components failed */ - hbool_t corked; /* Whether the dataset is corked or not */ - hbool_t file_closed = TRUE; /* H5O_close also closed the file? */ - herr_t ret_value = SUCCEED; /* Return value */ + bool free_failed = false; /* Set if freeing sub-components failed */ + bool corked; /* Whether the dataset is corked or not */ + bool file_closed = true; /* H5O_close also closed the file? */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1884,7 +1884,7 @@ H5D_close(H5D_t *dataset) /* Dump debugging info */ #ifdef H5D_CHUNK_DEBUG - H5D__chunk_stats(dataset, FALSE); + H5D__chunk_stats(dataset, false); #endif /* H5D_CHUNK_DEBUG */ dataset->shared->fo_count--; @@ -1898,7 +1898,7 @@ H5D_close(H5D_t *dataset) /* (Avoids problems with flushing datasets twice, when one is holding * the file open and it iterates through dataset to flush them -QAK) */ - dataset->shared->closing = TRUE; + dataset->shared->closing = true; /* Free cached information for each kind of dataset */ switch (dataset->shared->layout.type) { @@ -2021,7 +2021,7 @@ H5D_close(H5D_t *dataset) if (!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { if (H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata"); - if (H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE) < 0) + if (H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, false) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata"); } /* end if */ @@ -2053,7 +2053,7 @@ H5D_close(H5D_t *dataset) /* Release the dataset's path info */ if (H5G_name_free(&(dataset->path)) < 0) - free_failed = TRUE; + free_failed = true; /* Free the dataset's memory structure */ dataset = H5FL_FREE(H5D_t, dataset); @@ -2239,12 +2239,12 @@ H5D_nameof(H5D_t *dataset) *------------------------------------------------------------------------- */ herr_t -H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) +H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, bool full_overwrite, hsize_t old_dim[]) { H5F_t *f; /* The dataset's file pointer */ H5O_layout_t *layout; /* The dataset's layout information */ - hbool_t must_init_space = FALSE; /* Flag to indicate that space should be initialized */ - hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ + bool must_init_space = false; /* Flag to indicate that space should be initialized */ + bool addr_set = false; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2273,13 +2273,13 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr "unable to initialize contiguous storage"); /* Indicate that we should initialize storage space */ - must_init_space = TRUE; + must_init_space = true; } /* end if */ else layout->storage.u.contig.addr = HADDR_UNDEF; /* Indicate that we set the storage addr */ - addr_set = TRUE; + addr_set = true; } /* end if */ break; @@ -2290,10 +2290,10 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage"); /* Indicate that we set the storage addr */ - addr_set = TRUE; + addr_set = true; /* Indicate that we should initialize storage space */ - must_init_space = TRUE; + must_init_space = true; } /* end if */ /* If space allocation is set to 'early' and we are extending @@ -2302,7 +2302,7 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr */ if (dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY && time_alloc == H5D_ALLOC_EXTEND) - must_init_space = TRUE; + must_init_space = true; break; case H5D_COMPACT: @@ -2319,14 +2319,14 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr "unable to allocate memory for compact dataset"); if (!full_overwrite) memset(layout->storage.u.compact.buf, 0, layout->storage.u.compact.size); - layout->storage.u.compact.dirty = TRUE; + layout->storage.u.compact.dirty = true; /* Indicate that we should initialize storage space */ - must_init_space = TRUE; + must_init_space = true; } else { - layout->storage.u.compact.dirty = FALSE; - must_init_space = FALSE; + layout->storage.u.compact.dirty = false; + must_init_space = false; } } /* end if */ break; @@ -2413,7 +2413,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[]) +H5D__init_storage(H5D_t *dset, bool full_overwrite, hsize_t old_dim[]) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2705,7 +2705,7 @@ H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size vlen_bufsize.dset = dset; /* Get a copy of the dataset's dataspace */ - if (NULL == (fspace = H5S_copy(dset->shared->space, FALSE, TRUE))) + if (NULL == (fspace = H5S_copy(dset->shared->space, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to get dataspace"); vlen_bufsize.fspace = fspace; @@ -2861,7 +2861,7 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id /* Create a scalar for the memory dataspace */ if (NULL == (mspace = H5S_create(H5S_SCALAR))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create dataspace"); - if ((vlen_bufsize.mspace_id = H5I_register(H5I_DATASPACE, mspace, TRUE)) < 0) + if ((vlen_bufsize.mspace_id = H5I_register(H5I_DATASPACE, mspace, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); /* Grab the temporary buffers required */ @@ -2874,7 +2874,7 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id /* Set the VL allocation callbacks on a DXPL */ if (NULL == (dxpl = (H5P_genplist_t *)H5I_object(H5P_DATASET_XFER_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get default DXPL"); - if ((vlen_bufsize.dxpl_id = H5P_copy_plist(dxpl, TRUE)) < 0) + if ((vlen_bufsize.dxpl_id = H5P_copy_plist(dxpl, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy property list"); if (NULL == (dxpl = (H5P_genplist_t *)H5I_object(vlen_bufsize.dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get copied DXPL"); @@ -2965,7 +2965,7 @@ H5D__check_filters(H5D_t *dataset) if (H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters"); - dataset->shared->checked_filters = TRUE; + dataset->shared->checked_filters = true; } /* end if */ } /* end if */ } /* end if */ @@ -3023,17 +3023,17 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) /* Don't bother updating things, unless they've changed */ if (changed) { - hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */ - hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */ - hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ + bool shrink = false; /* Flag to indicate a dimension has shrank */ + bool expand = false; /* Flag to indicate a dimension has grown */ + bool update_chunks = false; /* Flag to indicate chunk cache update is needed */ /* Determine if we are shrinking and/or expanding any dimensions */ for (dim_idx = 0; dim_idx < dset->shared->ndims; dim_idx++) { /* Check for various status changes */ if (size[dim_idx] < curr_dims[dim_idx]) - shrink = TRUE; + shrink = true; if (size[dim_idx] > curr_dims[dim_idx]) - expand = TRUE; + expand = true; /* Chunked storage specific checks */ if (H5D_CHUNKED == dset->shared->layout.type && dset->shared->ndims > 1) { @@ -3059,7 +3059,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.nslots) || (scaled <= dset->shared->cache.chunk.nslots && dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) - update_chunks = TRUE; + update_chunks = true; if (!(scaled_power2up = H5VM_power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2"); @@ -3072,7 +3072,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) H5VM_log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ - update_chunks = TRUE; + update_chunks = true; } /* end if */ } /* end if */ } /* end if */ @@ -3123,12 +3123,12 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) /* Mark virtual datasets as not fully initialized so internal * selections are recalculated (at next I/O operation) */ - dset->shared->layout.storage.u.virt.init = FALSE; + dset->shared->layout.storage.u.virt.init = false; } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ if (expand && dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY) - if (H5D__alloc_storage(dset, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) + if (H5D__alloc_storage(dset, H5D_ALLOC_EXTEND, false, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset storage"); /*------------------------------------------------------------------------- @@ -3194,7 +3194,7 @@ H5D__flush_sieve_buf(H5D_t *dataset) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed"); /* Reset sieve buffer dirty flag */ - dataset->shared->cache.contig.sieve_dirty = FALSE; + dataset->shared->cache.contig.sieve_dirty = false; } /* end if */ done: @@ -3284,9 +3284,9 @@ H5D__format_convert(H5D_t *dataset) H5D_chk_idx_info_t new_idx_info; /* Index info for the new layout */ H5D_chk_idx_info_t idx_info; /* Index info for the current layout */ H5O_layout_t *newlayout = NULL; /* The new layout */ - hbool_t init_new_index = FALSE; /* Indicate that the new chunk index is initialized */ - hbool_t delete_old_layout = FALSE; /* Indicate that the old layout message is deleted */ - hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ + bool init_new_index = false; /* Indicate that the new chunk index is initialized */ + bool delete_old_layout = false; /* Indicate that the old layout message is deleted */ + bool add_new_layout = false; /* Indicate that the new layout message is added */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) @@ -3328,7 +3328,7 @@ H5D__format_convert(H5D_t *dataset) (new_idx_info.storage->ops->init)(&new_idx_info, dataset->shared->space, dataset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information"); - init_new_index = TRUE; + init_new_index = true; /* If the current chunk index exists */ if (H5_addr_defined(idx_info.storage->idx_addr)) { @@ -3345,16 +3345,16 @@ H5D__format_convert(H5D_t *dataset) } /* end if */ /* Delete the old "current" layout message */ - if (H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 0) + if (H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message"); - delete_old_layout = TRUE; + delete_old_layout = true; /* Append the new layout message to the object header */ if (H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message"); - add_new_layout = TRUE; + add_new_layout = true; /* Release the old (current) chunk index */ if (idx_info.storage->ops->dest && (idx_info.storage->ops->dest)(&idx_info) < 0) @@ -3389,7 +3389,7 @@ done: if (ret_value < 0 && dataset->shared->layout.type == H5D_CHUNKED) { /* Remove new layout message */ if (add_new_layout) - if (H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 0) + if (H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message"); /* Add back old layout message */ @@ -3535,7 +3535,7 @@ H5D_flush_all(H5F_t *f) assert(f); /* Iterate over all the open datasets */ - if (H5I_iterate(H5I_DATASET, H5D__flush_all_cb, f, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5D__flush_all_cb, f, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info"); done: @@ -3571,7 +3571,7 @@ H5D_get_create_plist(const H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list"); /* Copy the creation property list */ - if ((new_dcpl_id = H5P_copy_plist(dcpl_plist, TRUE)) < 0) + if ((new_dcpl_id = H5P_copy_plist(dcpl_plist, true)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to copy the creation property list"); if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dcpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list"); @@ -3604,7 +3604,7 @@ H5D_get_create_plist(const H5D_t *dset) /* Reset index info, if the chunk ops are set */ if (copied_layout.storage.u.chunk.ops) /* Reset address and pointer of the array struct for the chunked storage index */ - if (H5D_chunk_idx_reset(&copied_layout.storage.u.chunk, TRUE) < 0) + if (H5D_chunk_idx_reset(&copied_layout.storage.u.chunk, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest"); @@ -3651,10 +3651,10 @@ H5D_get_create_plist(const H5D_t *dset) size_t bkg_size; /* Size of background buffer */ /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT), FALSE); + dst_id = H5I_register(H5I_DATATYPE, H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT), false); if (dst_id < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); - src_id = H5I_register(H5I_DATATYPE, H5T_copy(dset->shared->type, H5T_COPY_ALL), FALSE); + src_id = H5I_register(H5I_DATATYPE, H5T_copy(dset->shared->type, H5T_COPY_ALL), false); if (src_id < 0) { H5I_dec_ref(dst_id); HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); @@ -3753,7 +3753,7 @@ H5D_get_access_plist(const H5D_t *dset) /* Make a copy of the dataset's dataset access property list */ if (NULL == (old_plist = (H5P_genplist_t *)H5I_object(dset->shared->dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list"); - if ((new_dapl_id = H5P_copy_plist(old_plist, TRUE)) < 0) + if ((new_dapl_id = H5P_copy_plist(old_plist, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy dataset access property list"); if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); @@ -3869,11 +3869,11 @@ H5D__get_space(const H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update virtual dataset extent"); /* Read the dataspace message and return a dataspace object */ - if (NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE))) + if (NULL == (space = H5S_copy(dset->shared->space, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace"); /* Create an ID */ - if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); done: @@ -3916,7 +3916,7 @@ H5D__get_type(const H5D_t *dset) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); /* Lock copied type */ - if (H5T_lock(dt, FALSE) < 0) + if (H5T_lock(dt, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to lock transient datatype"); /* Create an ID */ @@ -3925,10 +3925,10 @@ H5D__get_type(const H5D_t *dset) * two-level IDs, where the VOL object is a copy of the * returned datatype. */ - if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype"); } /* end if */ - else if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + else if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype"); done: @@ -3951,7 +3951,7 @@ herr_t H5D__refresh(H5D_t *dset, hid_t dset_id) { H5D_virtual_held_file_t *head = NULL; /* Pointer to list of files held open */ - hbool_t virt_dsets_held = FALSE; /* Whether virtual datasets' files are held open */ + bool virt_dsets_held = false; /* Whether virtual datasets' files are held open */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3965,7 +3965,7 @@ H5D__refresh(H5D_t *dset, hid_t dset_id) /* Hold open the source datasets' files */ if (H5D__virtual_hold_source_dset_files(dset, &head) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, FAIL, "unable to hold VDS source files open"); - virt_dsets_held = TRUE; + virt_dsets_held = true; /* Refresh source datasets for virtual dataset */ if (H5D__virtual_refresh_source_dsets(dset) < 0) diff --git a/src/H5Dio.c b/src/H5Dio.c index 8e5a034..543bb56 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -88,7 +88,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) /* projected to a rank equal to that of file_space. */ /* */ /* This field is only used if */ - /* H5S_select_shape_same() returns TRUE when */ + /* H5S_select_shape_same() returns true when */ /* comparing at least one mem_space and data_space, */ /* and the mem_space has a different rank. */ /* */ @@ -189,7 +189,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) * well. */ if (dset_info[i].nelmts > 0 && - TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && + true == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && H5S_GET_EXTENT_NDIMS(dset_info[i].mem_space) != H5S_GET_EXTENT_NDIMS(dset_info[i].file_space)) { ptrdiff_t buf_adj = 0; @@ -255,7 +255,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "filling buf failed"); /* No need to perform any more I/O for this dataset */ - dset_info[i].skip_io = TRUE; + dset_info[i].skip_io = true; io_skipped = io_skipped + 1; } /* end if */ else { @@ -277,7 +277,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].layout_ops.io_init && (dset_info[i].layout_ops.io_init)(&io_info, &(dset_info[i])) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info"); - dset_info[i].skip_io = FALSE; + dset_info[i].skip_io = false; io_op_init++; /* Reset metadata tagging */ @@ -495,7 +495,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) /* projected to a rank equal to that of file_space. */ /* */ /* This field is only used if */ - /* H5S_select_shape_same() returns TRUE when */ + /* H5S_select_shape_same() returns true when */ /* comparing at least one mem_space and data_space, */ /* and the mem_space has a different rank. */ /* */ @@ -523,7 +523,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) /* iterate over all dsets and construct I/O information */ for (i = 0; i < count; i++) { - hbool_t should_alloc_space = FALSE; /* Whether or not to initialize dataset's storage */ + bool should_alloc_space = false; /* Whether or not to initialize dataset's storage */ haddr_t prev_tag = HADDR_UNDEF; /* check args */ @@ -540,7 +540,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (H5Z_can_apply(dset_info[i].dset->shared->dcpl_id, dset_info[i].dset->shared->type_id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters"); - dset_info[i].dset->shared->checked_filters = TRUE; + dset_info[i].dset->shared->checked_filters = true; } /* end if */ /* Check if we are allowed to write to this file */ @@ -615,7 +615,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) * as well. */ if (dset_info[i].nelmts > 0 && - TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && + true == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && H5S_GET_EXTENT_NDIMS(dset_info[i].mem_space) != H5S_GET_EXTENT_NDIMS(dset_info[i].file_space)) { ptrdiff_t buf_adj = 0; @@ -672,7 +672,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (should_alloc_space) { hssize_t file_nelmts; /* Number of elements in file dataset's dataspace */ - hbool_t full_overwrite; /* Whether we are over-writing all the elements */ + bool full_overwrite; /* Whether we are over-writing all the elements */ /* Get the number of elements in file dataset's dataspace */ if ((file_nelmts = H5S_GET_EXTENT_NPOINTS(dset_info[i].file_space)) < 0) @@ -680,10 +680,10 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) "can't retrieve number of elements in file dataset"); /* Always allow fill values to be written if the dataset has a VL datatype */ - if (H5T_detect_class(dset_info[i].dset->shared->type, H5T_VLEN, FALSE)) - full_overwrite = FALSE; + if (H5T_detect_class(dset_info[i].dset->shared->type, H5T_VLEN, false)) + full_overwrite = false; else - full_overwrite = (hbool_t)((hsize_t)file_nelmts == dset_info[i].nelmts ? TRUE : FALSE); + full_overwrite = (bool)((hsize_t)file_nelmts == dset_info[i].nelmts ? true : false); /* Allocate storage */ if (H5D__alloc_storage(dset_info[i].dset, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0) @@ -695,7 +695,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].layout_ops.io_init && (*dset_info[i].layout_ops.io_init)(&io_info, &(dset_info[i])) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info"); - dset_info[i].skip_io = FALSE; + dset_info[i].skip_io = false; io_op_init++; /* Reset metadata tagging */ @@ -940,7 +940,7 @@ H5D__ioinfo_init(size_t count, H5D_io_op_type_t op_type, H5D_dset_io_info_t *dse /* Check if we could potentially use in-place type conversion */ if (op_type == H5D_IO_OP_READ) /* Always on for read (modulo other restrictions that are handled in layout callbacks) */ - io_info->may_use_in_place_tconv = TRUE; + io_info->may_use_in_place_tconv = true; else /* Only enable in-place type conversion if we're allowed to modify the write buffer */ H5CX_get_modify_write_buf(&io_info->may_use_in_place_tconv); @@ -1093,7 +1093,7 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t MAX3(io_info->max_tconv_type_size, type_info->src_type_size, type_info->dst_type_size); /* Check if we need a background buffer */ - if ((io_info->op_type == H5D_IO_OP_WRITE) && H5T_detect_class(dset->shared->type, H5T_VLEN, FALSE)) + if ((io_info->op_type == H5D_IO_OP_WRITE) && H5T_detect_class(dset->shared->type, H5T_VLEN, false)) type_info->need_bkg = H5T_BKG_YES; else { H5T_bkg_t path_bkg; /* Type conversion's background info */ @@ -1169,7 +1169,7 @@ H5D__typeinfo_init_phase2(H5D_io_info_t *io_info) /* Check if we need to fill the background buffer with the destination contents */ if (type_info->need_bkg == H5T_BKG_YES) - io_info->must_fill_bkg = TRUE; + io_info->must_fill_bkg = true; } } @@ -1183,14 +1183,14 @@ H5D__typeinfo_init_phase2(H5D_io_info_t *io_info) io_info->no_selection_io_cause |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; io_info->tconv_buf_size = 0; io_info->bkg_buf_size = 0; - io_info->must_fill_bkg = FALSE; + io_info->must_fill_bkg = false; } if (io_info->bkg_buf_size > max_temp_buf) { io_info->use_select_io = H5D_SELECTION_IO_MODE_OFF; io_info->no_selection_io_cause |= H5D_SEL_IO_BKG_BUF_TOO_SMALL; io_info->tconv_buf_size = 0; io_info->bkg_buf_size = 0; - io_info->must_fill_bkg = FALSE; + io_info->must_fill_bkg = false; } } @@ -1252,7 +1252,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace "); /* Check if we can use the optimized parallel I/O routines */ - if (opt == TRUE) { + if (opt == true) { /* Override the I/O op pointers to the MPI-specific routines, unless * selection I/O is to be used - in this case the file driver will * handle collective I/O */ @@ -1267,7 +1267,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) else { /* Fail when file sync is required, since it requires collective write */ if (io_info->op_type == H5D_IO_OP_WRITE) { - hbool_t mpi_file_sync_required = FALSE; + bool mpi_file_sync_required = false; if (H5F_shared_get_mpi_file_sync_required(io_info->f_sh, &mpi_file_sync_required) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI file_sync_required flag"); @@ -1380,7 +1380,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) if (NULL == (io_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, io_info->tconv_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); - io_info->tconv_buf_allocated = TRUE; + io_info->tconv_buf_allocated = true; } /* Allocate global background buffer (if any) */ @@ -1388,7 +1388,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) if (NULL == (io_info->bkg_buf = H5FL_BLK_MALLOC(type_conv, io_info->bkg_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); - io_info->bkg_buf_allocated = TRUE; + io_info->bkg_buf_allocated = true; } } else { @@ -1410,11 +1410,11 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) /* If the buffer is too small to hold even one element (in the dataset with the largest , try to * make it bigger */ if (target_size < io_info->max_tconv_type_size) { - hbool_t default_buffer_info; /* Whether the buffer information are the defaults */ + bool default_buffer_info; /* Whether the buffer information are the defaults */ /* Detect if we have all default settings for buffers */ - default_buffer_info = (hbool_t)((H5D_TEMP_BUF_SIZE == max_temp_buf) && (NULL == tconv_buf) && - (NULL == bkgr_buf)); + default_buffer_info = + (bool)((H5D_TEMP_BUF_SIZE == max_temp_buf) && (NULL == tconv_buf) && (NULL == bkgr_buf)); /* Check if we are using the default buffer info */ if (default_buffer_info) @@ -1434,7 +1434,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) if (NULL == (io_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); - io_info->tconv_buf_allocated = TRUE; + io_info->tconv_buf_allocated = true; } /* end if */ /* Iterate over datasets */ @@ -1455,7 +1455,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) if (NULL == (io_info->bkg_buf = H5FL_BLK_MALLOC(type_conv, target_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion"); - io_info->bkg_buf_allocated = TRUE; + io_info->bkg_buf_allocated = true; } } } diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index de05364..fa27991 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -155,7 +155,7 @@ done: *------------------------------------------------------------------------- */ size_t -H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data) +H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, bool include_compact_data) { size_t ret_value = 0; /* Return value */ @@ -340,7 +340,7 @@ H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Maximum dimension sizes */ hsize_t cur_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */ unsigned unlim_count = 0; /* Count of unlimited max. dimensions */ - hbool_t single = TRUE; /* Fulfill single chunk indexing */ + bool single = true; /* Fulfill single chunk indexing */ unsigned u; /* Local index variable */ /* Query the dataspace's dimensions */ @@ -352,7 +352,7 @@ H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const if (max_dims[u] == H5S_UNLIMITED) unlim_count++; if (cur_dims[u] != max_dims[u] || cur_dims[u] != layout->u.chunk.dim[u]) - single = FALSE; + single = false; } /* end for */ /* Chunked datasets with unlimited dimension(s) */ @@ -440,7 +440,7 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) H5O_layout_t *layout; /* Dataset's layout information */ const H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ unsigned layout_mesg_flags; /* Flags for inserting layout message */ - hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ + bool layout_init = false; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) @@ -469,14 +469,14 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information"); /* Indicate that the layout information was initialized */ - layout_init = TRUE; + layout_init = true; /* * Allocate storage if space allocate time is early; otherwise delay * allocation until later. */ if (fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY) - if (H5D__alloc_storage(dset, H5D_ALLOC_CREATE, FALSE, NULL) < 0) + if (H5D__alloc_storage(dset, H5D_ALLOC_CREATE, false, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage"); /* Update external storage message, if it's used */ @@ -570,11 +570,11 @@ done: herr_t H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) { - htri_t msg_exists; /* Whether a particular type of message exists */ - hbool_t pline_copied = FALSE; /* Flag to indicate that dcpl_cache.pline's message was copied */ - hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ - hbool_t efl_copied = FALSE; /* Flag to indicate that the EFL message was copied */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t msg_exists; /* Whether a particular type of message exists */ + bool pline_copied = false; /* Flag to indicate that dcpl_cache.pline's message was copied */ + bool layout_copied = false; /* Flag to indicate that layout message was copied */ + bool efl_copied = false; /* Flag to indicate that the EFL message was copied */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -589,7 +589,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) /* Retrieve the I/O pipeline message */ if (NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message"); - pline_copied = TRUE; + pline_copied = true; /* Set the I/O pipeline info in the property list */ if (H5P_set(plist, H5O_CRT_PIPELINE_NAME, &dataset->shared->dcpl_cache.pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set pipeline"); @@ -603,7 +603,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) */ if (NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message"); - layout_copied = TRUE; + layout_copied = true; /* Check for external file list message (which might not exist) */ if ((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID)) < 0) @@ -612,7 +612,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) /* Retrieve the EFL message */ if (NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message"); - efl_copied = TRUE; + efl_copied = true; /* Set the EFL info in the property list */ if (H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &dataset->shared->dcpl_cache.efl) < 0) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 2c4c29e..d8f9444 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -138,7 +138,7 @@ typedef struct H5D_chunk_alloc_info_t { typedef struct H5D_chunk_index_info_t { hsize_t chunk_idx; unsigned filter_mask; - hbool_t need_insert; + bool need_insert; } H5D_chunk_index_info_t; /* @@ -219,8 +219,8 @@ typedef struct H5D_filtered_collective_chunk_info_t { H5D_piece_info_t *chunk_info; H5F_block_t chunk_current; H5F_block_t chunk_new; - hbool_t need_read; - hbool_t skip_filter_pline; + bool need_read; + bool skip_filter_pline; size_t io_size; size_t chunk_buf_size; int orig_owner; @@ -320,10 +320,9 @@ static herr_t H5D__mpio_redistribute_shared_chunks(H5D_filtered_collective_io_in const H5D_io_info_t *io_info, int mpi_rank, int mpi_size, size_t **rank_chunks_assigned_map); static herr_t H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chunk_list, - size_t *num_chunks_assigned_map, - hbool_t all_ranks_involved, - const H5D_io_info_t *io_info, int mpi_rank, - int mpi_size); + size_t *num_chunks_assigned_map, + bool all_ranks_involved, const H5D_io_info_t *io_info, + int mpi_rank, int mpi_size); static herr_t H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk_list, H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, int mpi_rank, int H5_ATTR_NDEBUG_UNUSED mpi_size, @@ -348,14 +347,13 @@ static herr_t H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collecti H5D_chk_idx_info_t *idx_info, int mpi_rank, int mpi_size); static herr_t H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, - hbool_t *contig_type_derived, + bool *contig_type_derived, MPI_Datatype *resized_type, - hbool_t *resized_type_derived); -static herr_t H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_type_derived, - MPI_Datatype *resized_type, hbool_t *resized_type_derived); -static herr_t H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig_type_derived, - MPI_Datatype *resized_type, - hbool_t *resized_type_derived); + bool *resized_type_derived); +static herr_t H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, bool *contig_type_derived, + MPI_Datatype *resized_type, bool *resized_type_derived); +static herr_t H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, bool *contig_type_derived, + MPI_Datatype *resized_type, bool *resized_type_derived); static herr_t H5D__mpio_collective_filtered_vec_io(const H5D_filtered_collective_io_info_t *chunk_list, H5F_shared_t *f_sh, H5D_io_op_type_t op_type); static int H5D__cmp_piece_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); @@ -411,7 +409,7 @@ H5FL_EXTERN(H5S_sel_iter_t); */ static int H5D_mpio_debug_flags_s[256]; static int H5D_mpio_debug_rank_s[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static hbool_t H5D_mpio_debug_inited = FALSE; +static bool H5D_mpio_debug_inited = false; static const char *const trace_in_pre = "-> "; static const char *const trace_out_pre = "<- "; static int debug_indent = 0; @@ -444,7 +442,7 @@ static FILE *debug_stream = NULL; #define H5D_MPIO_TRACE_ENTER(rank) \ do { \ - hbool_t trace_flag = H5D_mpio_debug_flags_s[(int)'t']; \ + bool trace_flag = H5D_mpio_debug_flags_s[(int)'t']; \ \ if (trace_flag) { \ H5D_MPIO_DEBUG_VA(rank, "%s%s", trace_in_pre, __func__); \ @@ -454,7 +452,7 @@ static FILE *debug_stream = NULL; #define H5D_MPIO_TRACE_EXIT(rank) \ do { \ - hbool_t trace_flag = H5D_mpio_debug_flags_s[(int)'t']; \ + bool trace_flag = H5D_mpio_debug_flags_s[(int)'t']; \ \ if (trace_flag) { \ debug_indent -= (int)HDstrlen(trace_out_pre); \ @@ -464,7 +462,7 @@ static FILE *debug_stream = NULL; #define H5D_MPIO_TIME_START(rank, op_name) \ { \ - hbool_t time_flag = H5D_mpio_debug_flags_s[(int)'c']; \ + bool time_flag = H5D_mpio_debug_flags_s[(int)'c']; \ double start_time = 0.0, end_time = 0.0; \ const char *const op = op_name; \ \ @@ -499,7 +497,7 @@ H5D__mpio_parse_debug_str(const char *s) int c = (int)(*s); if (c >= (int)'0' && c <= (int)'9') { - hbool_t range = FALSE; + bool range = false; if (*(s + 1) && *(s + 2)) range = (int)*(s + 1) == '-' && (int)*(s + 2) >= (int)'0' && (int)*(s + 2) <= (int)'9'; @@ -553,7 +551,7 @@ H5D__mpio_debug_init(void) if (H5DEBUG(D)) debug_stream = H5DEBUG(D); - H5D_mpio_debug_inited = TRUE; + H5D_mpio_debug_inited = true; FUNC_LEAVE_NOAPI(ret_value) } @@ -569,7 +567,7 @@ H5D__mpio_debug_init(void) * This was derived from H5D__mpio_opt_possible for * multi-dset work. * - * Return: Success: Non-negative: TRUE or FALSE + * Return: Success: Non-negative: true or false * Failure: Negative * *------------------------------------------------------------------------- @@ -587,7 +585,7 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info) /* [1] Flag if dataset is both: H5S_ALL and small */ unsigned global_cause[2] = {0, 0}; /* Global reason(s) for breaking collective mode */ htri_t is_vl_storage; /* Whether the dataset's datatype is stored in a variable-length form */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -740,14 +738,14 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info) /* Set read-with-rank0-and-bcast flag if possible */ if (global_cause[0] == 0 && global_cause[1] == 0) { - H5CX_set_mpio_rank0_bcast(TRUE); + H5CX_set_mpio_rank0_bcast(true); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - H5CX_test_set_mpio_coll_rank0_bcast(TRUE); + H5CX_test_set_mpio_coll_rank0_bcast(true); #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ } /* end if */ /* Set the return value, based on the global cause */ - ret_value = global_cause[0] > 0 ? FALSE : TRUE; + ret_value = global_cause[0] > 0 ? false : true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1076,12 +1074,12 @@ H5D__piece_io(H5D_io_info_t *io_info) { H5FD_mpio_chunk_opt_t chunk_opt_mode; #ifdef H5Dmpio_DEBUG - hbool_t log_file_flag = FALSE; - FILE *debug_log_file = NULL; + bool log_file_flag = false; + FILE *debug_log_file = NULL; #endif int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; - hbool_t recalc_io_option = FALSE; - hbool_t use_multi_dset = FALSE; + bool recalc_io_option = false; + bool use_multi_dset = false; unsigned one_link_chunk_io_threshold; /* Threshold to use single collective I/O for all chunks */ int sum_chunk = -1; int mpi_rank; @@ -1138,17 +1136,17 @@ H5D__piece_io(H5D_io_info_t *io_info) else if (H5FD_MPIO_CHUNK_MULTI_IO == chunk_opt_mode) io_option = H5D_MULTI_CHUNK_IO; else - recalc_io_option = TRUE; + recalc_io_option = true; /* Check if we can and should use multi dataset path */ if (io_info->count > 1 && (io_option == H5D_ONE_LINK_CHUNK_IO || recalc_io_option)) { /* Use multi dataset path for now */ - use_multi_dset = TRUE; + use_multi_dset = true; /* Check for filtered datasets */ for (i = 0; i < io_info->count; i++) if (io_info->dsets_info[i].dset->shared->dcpl_cache.pline.nused > 0) { - use_multi_dset = FALSE; + use_multi_dset = false; break; } @@ -1170,8 +1168,8 @@ H5D__piece_io(H5D_io_info_t *io_info) * chunk IO. If this threshold is not exceeded for all datasets, no need to check it again * for each individual dataset. */ if ((unsigned)sum_chunk / (unsigned)mpi_size < one_link_chunk_io_threshold) { - recalc_io_option = FALSE; - use_multi_dset = FALSE; + recalc_io_option = false; + use_multi_dset = false; } } } @@ -1226,7 +1224,7 @@ H5D__piece_io(H5D_io_info_t *io_info) /* If the threshold is 0, no need to check number of chunks */ if (one_link_chunk_io_threshold == 0) { io_option = H5D_ONE_LINK_CHUNK_IO_MORE_OPT; - recalc_io_option = FALSE; + recalc_io_option = false; } else { /* Get number of chunks for all processes */ @@ -1260,7 +1258,7 @@ H5D__piece_io(H5D_io_info_t *io_info) * fall back to multi chunk */ if (io_info->count > 1) { io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; - recalc_io_option = TRUE; + recalc_io_option = true; if (H5D__multi_chunk_collective_io(io_info, &io_info->dsets_info[i], mpi_rank, mpi_size) < 0) @@ -1409,17 +1407,16 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran #endif { MPI_Datatype chunk_final_mtype; /* Final memory MPI datatype for all chunks with selection */ - hbool_t chunk_final_mtype_is_derived = FALSE; + bool chunk_final_mtype_is_derived = false; MPI_Datatype chunk_final_ftype; /* Final file MPI datatype for all chunks with selection */ - hbool_t chunk_final_ftype_is_derived = FALSE; + bool chunk_final_ftype_is_derived = false; H5D_storage_t ctg_store; /* Storage info for "fake" contiguous dataset */ MPI_Datatype *chunk_mtype = NULL; MPI_Datatype *chunk_ftype = NULL; MPI_Aint *chunk_file_disp_array = NULL; MPI_Aint *chunk_mem_disp_array = NULL; - hbool_t *chunk_mft_is_derived_array = - NULL; /* Flags to indicate each chunk's MPI file datatype is derived */ - hbool_t *chunk_mbt_is_derived_array = + bool *chunk_mft_is_derived_array = NULL; /* Flags to indicate each chunk's MPI file datatype is derived */ + bool *chunk_mbt_is_derived_array = NULL; /* Flags to indicate each chunk's MPI memory datatype is derived */ int *chunk_mpi_file_counts = NULL; /* Count of MPI file datatype for each chunk */ int *chunk_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each chunk */ @@ -1470,7 +1467,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran /* Set up MPI datatype for chunks selected */ if (num_chunk) { - hbool_t need_sort = FALSE; + bool need_sort = false; /* Check if sel_pieces array is sorted */ assert(io_info->sel_pieces[0]->faddr != HADDR_UNDEF); @@ -1478,7 +1475,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran assert(io_info->sel_pieces[i]->faddr != HADDR_UNDEF); if (io_info->sel_pieces[i]->faddr < io_info->sel_pieces[i - 1]->faddr) { - need_sort = TRUE; + need_sort = true; break; } } @@ -1504,10 +1501,10 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk memory counts buffer"); if (NULL == (chunk_mpi_file_counts = (int *)H5MM_calloc(num_chunk * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file counts buffer"); - if (NULL == (chunk_mbt_is_derived_array = (hbool_t *)H5MM_calloc(num_chunk * sizeof(hbool_t)))) + if (NULL == (chunk_mbt_is_derived_array = (bool *)H5MM_calloc(num_chunk * sizeof(bool)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk memory is derived datatype flags buffer"); - if (NULL == (chunk_mft_is_derived_array = (hbool_t *)H5MM_calloc(num_chunk * sizeof(hbool_t)))) + if (NULL == (chunk_mft_is_derived_array = (bool *)H5MM_calloc(num_chunk * sizeof(bool)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file is derived datatype flags buffer"); @@ -1528,7 +1525,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran out-of-order displacements to the in-order displacements of the MPI datatypes of the point selection of the file space */ - hbool_t is_permuted = FALSE; + bool is_permuted = false; /* Assign convenience pointer to piece info */ piece_info = io_info->sel_pieces[i]; @@ -1542,7 +1539,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran &chunk_ftype[i], /* OUT: datatype created */ &chunk_mpi_file_counts[i], /* OUT */ &(chunk_mft_is_derived_array[i]), /* OUT */ - TRUE, /* this is a file space, + true, /* this is a file space, so permute the datatype if the point selections are out of @@ -1559,7 +1556,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran assert(permute_map); if (H5S_mpio_space_type(piece_info->mspace, piece_info->dset_info->type_info.dst_type_size, &chunk_mtype[i], &chunk_mpi_mem_counts[i], - &(chunk_mbt_is_derived_array[i]), FALSE, /* this is a memory + &(chunk_mbt_is_derived_array[i]), false, /* this is a memory space, so if the file space is not permuted, there is no @@ -1601,7 +1598,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - chunk_final_ftype_is_derived = TRUE; + chunk_final_ftype_is_derived = true; /* Create final MPI derived datatype for memory */ if (MPI_SUCCESS != @@ -1610,7 +1607,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_mtype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - chunk_final_mtype_is_derived = TRUE; + chunk_final_mtype_is_derived = true; /* Free the file & memory MPI datatypes for each chunk */ for (i = 0; i < num_chunk; i++) { @@ -2179,7 +2176,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info { H5D_filtered_collective_io_info_t chunk_list = {0}; unsigned char **chunk_msg_bufs = NULL; - hbool_t have_chunk_to_process; + bool have_chunk_to_process; size_t max_num_chunks; int chunk_msg_bufs_len = 0; int mpi_code; @@ -2373,8 +2370,8 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H H5S_t *mem_space) { int mpi_buf_count; /* # of MPI types */ - hbool_t mbt_is_derived = FALSE; - hbool_t mft_is_derived = FALSE; + bool mbt_is_derived = false; + bool mft_is_derived = false; MPI_Datatype mpi_file_type, mpi_buf_type; int mpi_code; /* MPI return code */ #ifdef H5Dmpio_DEBUG @@ -2400,7 +2397,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H out-of-order displacements to the in-order displacements of the MPI datatypes of the point selection of the file space */ - hbool_t is_permuted = FALSE; + bool is_permuted = false; assert(di); @@ -2411,7 +2408,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H */ if (H5S_mpio_space_type(file_space, di->type_info.src_type_size, &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ - TRUE, /* this is a file space, so + true, /* this is a file space, so permute the datatype if the point selection is out of order */ @@ -2427,7 +2424,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H assert(permute_map); if (H5S_mpio_space_type(mem_space, di->type_info.src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */ - FALSE, /* this is a memory space, so if + false, /* this is a memory space, so if the file space is not permuted, there is no need to permute the datatype if the @@ -2450,8 +2447,8 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H mpi_buf_type = MPI_BYTE; mpi_file_type = MPI_BYTE; mpi_buf_count = 0; - mbt_is_derived = FALSE; - mft_is_derived = FALSE; + mbt_is_derived = false; + mft_is_derived = false; } /* end else */ #ifdef H5Dmpio_DEBUG @@ -2756,8 +2753,8 @@ H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_dset_io_info_t *di, uint8_t as H5SL_node_t *chunk_node; H5D_piece_info_t *chunk_info; H5P_coll_md_read_flag_t md_reads_file_flag; - hbool_t md_reads_context_flag; - hbool_t restore_md_reads_state = FALSE; + bool md_reads_context_flag; + bool restore_md_reads_state = false; MPI_Comm comm; int root; size_t ic; @@ -2826,9 +2823,9 @@ H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_dset_io_info_t *di, uint8_t as */ if (H5F_get_coll_metadata_reads(di->dset->oloc.file)) { md_reads_file_flag = H5P_FORCE_FALSE; - md_reads_context_flag = FALSE; + md_reads_context_flag = false; H5F_set_coll_metadata_reads(di->dset->oloc.file, &md_reads_file_flag, &md_reads_context_flag); - restore_md_reads_state = TRUE; + restore_md_reads_state = true; } /* pre-computing: calculate number of processes and @@ -2880,13 +2877,13 @@ H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_dset_io_info_t *di, uint8_t as #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { - hbool_t coll_op = FALSE; + bool coll_op = false; for (ic = 0; ic < total_chunks; ic++) if (assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { if (H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value"); - coll_op = TRUE; + coll_op = true; break; } /* end if */ @@ -2934,7 +2931,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const { H5D_filtered_collective_chunk_info_t *local_info_array = NULL; H5D_chunk_ud_t udata; - hbool_t filter_partial_edge_chunks; + bool filter_partial_edge_chunks; size_t num_chunks_selected; size_t num_chunks_to_read = 0; herr_t ret_value = SUCCEED; @@ -2956,7 +2953,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const H5D_piece_info_t *chunk_info; H5SL_node_t *chunk_node; hsize_t select_npoints; - hbool_t need_sort = FALSE; + bool need_sort = false; /* Determine whether partial edge chunks should be filtered */ filter_partial_edge_chunks = @@ -3029,7 +3026,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const * must be kept around both before and after I/O in this case. */ if (io_info->op_type == H5D_IO_OP_READ) - local_info_array[i].need_read = TRUE; + local_info_array[i].need_read = true; else { local_info_array[i].need_read = local_info_array[i].io_size < (size_t)di->dset->shared->layout.u.chunk.size; @@ -3038,7 +3035,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const if (local_info_array[i].need_read) num_chunks_to_read++; - local_info_array[i].skip_filter_pline = FALSE; + local_info_array[i].skip_filter_pline = false; if (!filter_partial_edge_chunks) { /* * If this is a partial edge chunk and the "don't filter partial edge @@ -3047,7 +3044,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const if (H5D__chunk_is_partial_edge_chunk(di->dset->shared->ndims, di->dset->shared->layout.u.chunk.dim, chunk_info->scaled, di->dset->shared->curr_dims)) - local_info_array[i].skip_filter_pline = TRUE; + local_info_array[i].skip_filter_pline = true; } /* Initialize the chunk's shared info */ @@ -3065,7 +3062,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const if (!H5_addr_defined(prev_chunk_offset) || !H5_addr_defined(curr_chunk_offset) || (curr_chunk_offset < prev_chunk_offset)) - need_sort = TRUE; + need_sort = true; } /* @@ -3081,7 +3078,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const local_info_array[i].index_info.chunk_idx = chunk_info->index; local_info_array[i].index_info.filter_mask = udata.filter_mask; - local_info_array[i].index_info.need_insert = FALSE; + local_info_array[i].index_info.need_insert = false; chunk_node = H5SL_next(chunk_node); } @@ -3158,7 +3155,7 @@ H5D__mpio_redistribute_shared_chunks(H5D_filtered_collective_io_info_t *chunk_li const H5D_io_info_t *io_info, int mpi_rank, int mpi_size, size_t **rank_chunks_assigned_map) { - hbool_t redistribute_on_all_ranks; + bool redistribute_on_all_ranks; size_t *num_chunks_map = NULL; size_t coll_chunk_list_size = 0; size_t i; @@ -3244,13 +3241,13 @@ done: * Purpose: Routine to perform redistribution of shared chunks during * parallel writes to datasets with filters applied. * - * If `all_ranks_involved` is TRUE, chunk redistribution + * If `all_ranks_involved` is true, chunk redistribution * occurs on all MPI ranks. This is usually done when there * is a relatively small number of chunks involved in order to * cut down on MPI communication overhead while increasing * total memory usage a bit. * - * If `all_ranks_involved` is FALSE, only rank 0 will perform + * If `all_ranks_involved` is false, only rank 0 will perform * chunk redistribution. This is usually done when there is * a relatively large number of chunks involved in order to * cut down on total memory usage at the cost of increased @@ -3291,13 +3288,13 @@ done: */ static herr_t H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chunk_list, - size_t *num_chunks_assigned_map, hbool_t all_ranks_involved, + size_t *num_chunks_assigned_map, bool all_ranks_involved, const H5D_io_info_t *io_info, int mpi_rank, int mpi_size) { MPI_Datatype struct_type; MPI_Datatype packed_type; - hbool_t struct_type_derived = FALSE; - hbool_t packed_type_derived = FALSE; + bool struct_type_derived = false; + bool packed_type_derived = false; size_t i; size_t coll_chunk_list_num_entries = 0; void *coll_chunk_list = NULL; @@ -3510,7 +3507,7 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun * needs to be updated */ if (chunk_list->chunk_infos[j].need_read && (chunk_list->chunk_infos[j].new_owner != mpi_rank)) { - chunk_list->chunk_infos[j].need_read = FALSE; + chunk_list->chunk_infos[j].need_read = false; assert(chunk_list->num_chunks_to_read > 0); chunk_list->num_chunks_to_read--; @@ -3535,7 +3532,7 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun */ for (i = 0; i < chunk_list->num_chunk_infos; i++) { if ((chunk_list->chunk_infos[i].new_owner != mpi_rank) && chunk_list->chunk_infos[i].need_read) { - chunk_list->chunk_infos[i].need_read = FALSE; + chunk_list->chunk_infos[i].need_read = false; assert(chunk_list->num_chunks_to_read > 0); chunk_list->num_chunks_to_read--; @@ -3656,8 +3653,8 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk MPI_Request *send_requests = NULL; MPI_Request *recv_requests = NULL; MPI_Request ibarrier = MPI_REQUEST_NULL; - hbool_t mem_iter_init = FALSE; - hbool_t ibarrier_posted = FALSE; + bool mem_iter_init = false; + bool ibarrier_posted = false; size_t send_bufs_nalloc = 0; size_t num_send_requests = 0; size_t num_recv_requests = 0; @@ -3784,7 +3781,7 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk H5S_SEL_ITER_SHARE_WITH_DATASPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; + mem_iter_init = true; /* Collect the modification data into the buffer */ if (0 == H5D__gather_mem(dset_info->buf.cvp, mem_iter, (size_t)iter_nelmts, mod_data_p)) @@ -3830,7 +3827,7 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release memory selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } } @@ -3930,7 +3927,7 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk /* Post non-blocking barrier */ if (MPI_SUCCESS != (mpi_code = MPI_Ibarrier(io_info->comm, &ibarrier))) HMPI_GOTO_ERROR(FAIL, "MPI_Ibarrier failed", mpi_code) - ibarrier_posted = TRUE; + ibarrier_posted = true; /* * Now that all send requests have completed, free up the @@ -4067,9 +4064,9 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun H5Z_cb_t filter_cb; /* I/O filter callback function */ hsize_t file_chunk_size = 0; hsize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ - hbool_t should_fill = FALSE; - hbool_t fb_info_init = FALSE; - hbool_t index_empty = FALSE; + bool should_fill = false; + bool fb_info_init = false; + bool index_empty = false; H5S_t *fill_space = NULL; void *base_read_buf = NULL; herr_t ret_value = SUCCEED; @@ -4146,7 +4143,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun chunk_entry->chunk_new.length = chunk_entry->chunk_current.length; } else { - chunk_entry->need_read = FALSE; + chunk_entry->need_read = false; /* Update field keeping track of number of chunks to read */ assert(chunk_list->num_chunks_to_read > 0); @@ -4177,7 +4174,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun di->dset->shared->type, di->dset->shared->type_id, 0, file_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill value buffer"); - fb_info_init = TRUE; + fb_info_init = true; } /* Write fill value to memory buffer */ @@ -4195,7 +4192,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun * yet, the chunk index should be empty. In this case, a collective * read of chunks is essentially a no-op, so avoid it here. */ - index_empty = FALSE; + index_empty = false; if (di->dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_INCR) if (H5D__chunk_index_empty(di->dset, &index_empty) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't determine if chunk index is empty"); @@ -4279,10 +4276,10 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch H5Z_cb_t filter_cb; /* I/O filter callback function */ hsize_t file_chunk_size = 0; hsize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ - hbool_t should_fill = FALSE; - hbool_t fb_info_init = FALSE; - hbool_t sel_iter_init = FALSE; - hbool_t index_empty = FALSE; + bool should_fill = false; + bool fb_info_init = false; + bool sel_iter_init = false; + bool index_empty = false; size_t i; H5S_t *dataspace = NULL; H5S_t *fill_space = NULL; @@ -4382,7 +4379,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch chunk_entry->chunk_new.length = chunk_entry->chunk_current.length; } else { - chunk_entry->need_read = FALSE; + chunk_entry->need_read = false; /* Update field keeping track of number of chunks to read */ assert(chunk_list->num_chunks_to_read > 0); @@ -4416,7 +4413,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill value buffer"); - fb_info_init = TRUE; + fb_info_init = true; } /* Write fill value to memory buffer */ @@ -4437,7 +4434,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch * yet, the chunk index should be empty. In this case, a collective * read of chunks is essentially a no-op, so avoid it here. */ - index_empty = FALSE; + index_empty = false; if (di->dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_INCR) if (H5D__chunk_index_empty(di->dset, &index_empty) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't determine if chunk index is empty"); @@ -4518,7 +4515,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch H5S_SEL_ITER_SHARE_WITH_DATASPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - sel_iter_init = TRUE; + sel_iter_init = true; iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace); @@ -4528,7 +4525,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch if (H5S_SELECT_ITER_RELEASE(sel_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator"); - sel_iter_init = FALSE; + sel_iter_init = false; if (dataspace) { if (H5S_close(dataspace) < 0) @@ -4613,9 +4610,9 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t H5D_chunk_alloc_info_t *collective_list = NULL; MPI_Datatype send_type; MPI_Datatype recv_type; - hbool_t send_type_derived = FALSE; - hbool_t recv_type_derived = FALSE; - hbool_t need_sort = FALSE; + bool send_type_derived = false; + bool recv_type_derived = false; + bool need_sort = false; size_t collective_num_entries = 0; size_t num_local_chunks_processed = 0; size_t i; @@ -4683,7 +4680,7 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t /* Perform gather operation */ if (H5_mpio_gatherv_alloc(chunk_list->chunk_infos, (int)chunk_list->num_chunk_infos, send_type, - counts_ptr, displacements_ptr, recv_type, TRUE, 0, io_info->comm, mpi_rank, + counts_ptr, displacements_ptr, recv_type, true, 0, io_info->comm, mpi_rank, mpi_size, &gathered_array, &collective_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "can't gather chunk file space info to/from ranks"); @@ -4697,7 +4694,7 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t * the 'simple' MPI_Allgatherv wrapper for this. */ if (H5_mpio_gatherv_alloc_simple(chunk_list->chunk_infos, (int)chunk_list->num_chunk_infos, send_type, - recv_type, TRUE, 0, io_info->comm, mpi_rank, mpi_size, + recv_type, true, 0, io_info->comm, mpi_rank, mpi_size, &gathered_array, &collective_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "can't gather chunk file space info to/from ranks"); @@ -4707,8 +4704,8 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t collective_list = (H5D_chunk_alloc_info_t *)gathered_array; for (i = 0, num_local_chunks_processed = 0; i < collective_num_entries; i++) { H5D_chunk_alloc_info_t *coll_entry = &collective_list[i]; - hbool_t need_insert; - hbool_t update_local_chunk; + bool need_insert; + bool update_local_chunk; if (H5D__chunk_file_alloc(idx_info, &coll_entry->chunk_current, &coll_entry->chunk_new, &need_insert, NULL) < 0) @@ -4747,7 +4744,7 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t assert(H5_addr_defined(prev_chunk_offset) && H5_addr_defined(curr_chunk_offset)); if (curr_chunk_offset < prev_chunk_offset) - need_sort = TRUE; + need_sort = true; } num_local_chunks_processed++; @@ -4807,8 +4804,8 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * H5D_chunk_ud_t chunk_ud; MPI_Datatype send_type; MPI_Datatype recv_type; - hbool_t send_type_derived = FALSE; - hbool_t recv_type_derived = FALSE; + bool send_type_derived = false; + bool recv_type_derived = false; hsize_t scaled_coords[H5O_LAYOUT_NDIMS]; size_t collective_num_entries = 0; size_t i; @@ -4880,7 +4877,7 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * /* Perform gather operation */ if (H5_mpio_gatherv_alloc(chunk_list->chunk_infos, (int)chunk_list->num_chunk_infos, send_type, - counts_ptr, displacements_ptr, recv_type, TRUE, 0, io_info->comm, mpi_rank, + counts_ptr, displacements_ptr, recv_type, true, 0, io_info->comm, mpi_rank, mpi_size, &gathered_array, &collective_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "can't gather chunk index re-insertion info to/from ranks"); @@ -4894,7 +4891,7 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * * the 'simple' MPI_Allgatherv wrapper for this. */ if (H5_mpio_gatherv_alloc_simple(chunk_list->chunk_infos, (int)chunk_list->num_chunk_infos, send_type, - recv_type, TRUE, 0, io_info->comm, mpi_rank, mpi_size, + recv_type, true, 0, io_info->comm, mpi_rank, mpi_size, &gathered_array, &collective_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "can't gather chunk index re-insertion info to/from ranks"); @@ -4956,7 +4953,7 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * */ for (size_t dbg_idx = 0; dbg_idx < chunk_list->num_chunk_infos; dbg_idx++) { if (coll_entry->index_info.chunk_idx == chunk_list->chunk_infos[dbg_idx].index_info.chunk_idx) { - hbool_t coords_match = + bool coords_match = !memcmp(scaled_coords, chunk_list->chunk_infos[dbg_idx].chunk_info->scaled, di->dset->shared->ndims * sizeof(hsize_t)); @@ -5017,13 +5014,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t *contig_type_derived, - MPI_Datatype *resized_type, hbool_t *resized_type_derived) +H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, bool *contig_type_derived, + MPI_Datatype *resized_type, bool *resized_type_derived) { MPI_Datatype struct_type = MPI_DATATYPE_NULL; - hbool_t struct_type_derived = FALSE; + bool struct_type_derived = false; MPI_Datatype chunk_block_type = MPI_DATATYPE_NULL; - hbool_t chunk_block_type_derived = FALSE; + bool chunk_block_type_derived = false; MPI_Datatype types[5]; MPI_Aint displacements[5]; int block_lengths[5]; @@ -5038,11 +5035,11 @@ H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t * assert(resized_type); assert(resized_type_derived); - *contig_type_derived = FALSE; - *resized_type_derived = FALSE; + *contig_type_derived = false; + *resized_type_derived = false; /* Create struct type for the inner H5F_block_t structure */ - if (H5F_mpi_get_file_block_type(FALSE, &chunk_block_type, &chunk_block_type_derived) < 0) + if (H5F_mpi_get_file_block_type(false, &chunk_block_type, &chunk_block_type_derived) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description"); field_count = 5; @@ -5071,7 +5068,7 @@ H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t * if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - *contig_type_derived = TRUE; + *contig_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -5098,12 +5095,12 @@ H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t * if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, &struct_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - struct_type_derived = TRUE; + struct_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_create_resized( struct_type, 0, sizeof(H5D_filtered_collective_chunk_info_t), resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_resized failed", mpi_code) - *resized_type_derived = TRUE; + *resized_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -5122,12 +5119,12 @@ done: if (*resized_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(resized_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *resized_type_derived = FALSE; + *resized_type_derived = false; } if (*contig_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(contig_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *contig_type_derived = FALSE; + *contig_type_derived = false; } } @@ -5158,13 +5155,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_type_derived, - MPI_Datatype *resized_type, hbool_t *resized_type_derived) +H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, bool *contig_type_derived, + MPI_Datatype *resized_type, bool *resized_type_derived) { MPI_Datatype struct_type = MPI_DATATYPE_NULL; - hbool_t struct_type_derived = FALSE; + bool struct_type_derived = false; MPI_Datatype chunk_block_type = MPI_DATATYPE_NULL; - hbool_t chunk_block_type_derived = FALSE; + bool chunk_block_type_derived = false; MPI_Datatype types[3]; MPI_Aint displacements[3]; int block_lengths[3]; @@ -5179,11 +5176,11 @@ H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_ assert(resized_type); assert(resized_type_derived); - *contig_type_derived = FALSE; - *resized_type_derived = FALSE; + *contig_type_derived = false; + *resized_type_derived = false; /* Create struct type for the inner H5F_block_t structure */ - if (H5F_mpi_get_file_block_type(FALSE, &chunk_block_type, &chunk_block_type_derived) < 0) + if (H5F_mpi_get_file_block_type(false, &chunk_block_type, &chunk_block_type_derived) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description"); field_count = 3; @@ -5205,7 +5202,7 @@ H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - *contig_type_derived = TRUE; + *contig_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -5226,12 +5223,12 @@ H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, &struct_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - struct_type_derived = TRUE; + struct_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_create_resized( struct_type, 0, sizeof(H5D_filtered_collective_chunk_info_t), resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_resized failed", mpi_code) - *resized_type_derived = TRUE; + *resized_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -5250,12 +5247,12 @@ done: if (*resized_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(resized_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *resized_type_derived = FALSE; + *resized_type_derived = false; } if (*contig_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(contig_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *contig_type_derived = FALSE; + *contig_type_derived = false; } } @@ -5288,13 +5285,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig_type_derived, - MPI_Datatype *resized_type, hbool_t *resized_type_derived) +H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, bool *contig_type_derived, + MPI_Datatype *resized_type, bool *resized_type_derived) { MPI_Datatype struct_type = MPI_DATATYPE_NULL; - hbool_t struct_type_derived = FALSE; + bool struct_type_derived = false; MPI_Datatype chunk_block_type = MPI_DATATYPE_NULL; - hbool_t chunk_block_type_derived = FALSE; + bool chunk_block_type_derived = false; MPI_Aint contig_type_extent; MPI_Datatype types[4]; MPI_Aint displacements[4]; @@ -5310,11 +5307,11 @@ H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig assert(resized_type); assert(resized_type_derived); - *contig_type_derived = FALSE; - *resized_type_derived = FALSE; + *contig_type_derived = false; + *resized_type_derived = false; /* Create struct type for an H5F_block_t structure */ - if (H5F_mpi_get_file_block_type(FALSE, &chunk_block_type, &chunk_block_type_derived) < 0) + if (H5F_mpi_get_file_block_type(false, &chunk_block_type, &chunk_block_type_derived) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description"); field_count = 4; @@ -5341,18 +5338,18 @@ H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, &struct_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - struct_type_derived = TRUE; + struct_type_derived = true; contig_type_extent = (MPI_Aint)(sizeof(H5F_block_t) + sizeof(H5D_chunk_index_info_t)); if (MPI_SUCCESS != (mpi_code = MPI_Type_create_resized(struct_type, 0, contig_type_extent, contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_resized failed", mpi_code) - *contig_type_derived = TRUE; + *contig_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(contig_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - struct_type_derived = FALSE; + struct_type_derived = false; if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&struct_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed", mpi_code) @@ -5368,12 +5365,12 @@ H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, &struct_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - struct_type_derived = TRUE; + struct_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_create_resized( struct_type, 0, sizeof(H5D_filtered_collective_chunk_info_t), resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_resized failed", mpi_code) - *resized_type_derived = TRUE; + *resized_type_derived = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(resized_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -5392,12 +5389,12 @@ done: if (*resized_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(resized_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *resized_type_derived = FALSE; + *resized_type_derived = false; } if (*contig_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(contig_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *contig_type_derived = FALSE; + *contig_type_derived = false; } } diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 181016d..472a221 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -51,18 +51,18 @@ /********************/ /* Non Index chunking I/O ops */ -static herr_t H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__none_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__none_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__none_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__none_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__none_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__none_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static int H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__none_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__none_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__none_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__none_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); /*********************/ /* Package Variables */ @@ -70,7 +70,7 @@ static herr_t H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stre /* Non Index chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{ - FALSE, /* Non-indexed chunking don't current support SWMR access */ + false, /* Non-indexed chunking don't current support SWMR access */ NULL, /* init */ H5D__none_idx_create, /* create */ H5D__none_idx_is_space_alloc, /* is_space_alloc */ @@ -149,7 +149,7 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -157,7 +157,7 @@ H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__none_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -416,7 +416,7 @@ H5D__none_idx_size(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, hsize_t *i *------------------------------------------------------------------------- */ static herr_t -H5D__none_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__none_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Doh.c b/src/H5Doh.c index f4a9934..1008948 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -149,8 +149,8 @@ H5O__dset_free_copy_file_udata(void *_udata) * Purpose: Determines if an object has the requisite messages for being * a dataset. * - * Return: Success: TRUE if the required dataset messages are - * present; FALSE otherwise. + * Return: Success: true if the required dataset messages are + * present; false otherwise. * * Failure: FAIL if the existence of certain messages * cannot be determined. @@ -161,7 +161,7 @@ static htri_t H5O__dset_isa(const H5O_t *oh) { htri_t exists; /* Flag if header message of interest exists */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -171,13 +171,13 @@ H5O__dset_isa(const H5O_t *oh) if ((exists = H5O_msg_exists_oh(oh, H5O_DTYPE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header"); else if (!exists) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Layout */ if ((exists = H5O_msg_exists_oh(oh, H5O_SDSPACE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header"); else if (!exists) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); done: FUNC_LEAVE_NOAPI(ret_value) @@ -335,8 +335,8 @@ H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) { H5O_layout_t layout; /* Data storage layout message */ H5O_efl_t efl; /* External File List message */ - hbool_t layout_read = FALSE; /* Whether the layout message was read */ - hbool_t efl_read = FALSE; /* Whether the external file list message was read */ + bool layout_read = false; /* Whether the layout message was read */ + bool efl_read = false; /* Whether the external file list message was read */ htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ @@ -352,7 +352,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) /* Get the layout message from the object header */ if (NULL == H5O_msg_read_oh(loc->file, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message"); - layout_read = TRUE; + layout_read = true; /* Check for chunked dataset storage */ if (layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { @@ -383,7 +383,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) /* Get External File List message from the object header */ if (NULL == H5O_msg_read_oh(loc->file, oh, H5O_EFL_ID, &efl)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message"); - efl_read = TRUE; + efl_read = true; /* Get size of local heap for EFL message's file list */ if (H5D__efl_bh_info(loc->file, &efl, &(bh_info->heap_size)) < 0) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 67dfb83..0dbcb64 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -87,7 +87,7 @@ /* Make sure the memory type is not smaller than the file type, otherwise the memory buffer \ * won't be big enough to serve as the type conversion buffer */ \ if (mem_type_size >= file_type_size) { \ - hbool_t is_contig; \ + bool is_contig; \ hsize_t sel_off; \ \ /* Check if the space is contiguous */ \ @@ -98,7 +98,7 @@ */ \ if (is_contig) { \ H5_CHECK_OVERFLOW(sel_off, hsize_t, size_t); \ - (PIECE_INFO)->in_place_tconv = TRUE; \ + (PIECE_INFO)->in_place_tconv = true; \ (PIECE_INFO)->buf_off = (size_t)sel_off * mem_type_size; \ } \ } \ @@ -127,8 +127,8 @@ typedef struct H5D_type_info_t { /* Computed/derived values */ size_t src_type_size; /* Size of source type */ size_t dst_type_size; /* Size of destination type */ - hbool_t is_conv_noop; /* Whether the type conversion is a NOOP */ - hbool_t is_xform_noop; /* Whether the data transform is a NOOP */ + bool is_conv_noop; /* Whether the type conversion is a NOOP */ + bool is_xform_noop; /* Whether the data transform is a NOOP */ const H5T_subset_info_t *cmpd_subset; /* Info related to the compound subset conversion functions */ H5T_bkg_t need_bkg; /* Type of background buf needed */ size_t request_nelmts; /* Requested strip mine */ @@ -142,8 +142,8 @@ typedef struct H5D_shared_t H5D_shared_t; /* Function pointers for I/O on particular types of dataset layouts */ typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset); typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, const H5D_t *dset, hid_t dapl_id); -typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage); -typedef hbool_t (*H5D_layout_is_data_cached_func_t)(const H5D_shared_t *shared_dset); +typedef bool (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage); +typedef bool (*H5D_layout_is_data_cached_func_t)(const H5D_shared_t *shared_dset); typedef herr_t (*H5D_layout_io_init_func_t)(struct H5D_io_info_t *io_info, struct H5D_dset_io_info_t *dinfo); typedef herr_t (*H5D_layout_mdio_init_func_t)(struct H5D_io_info_t *io_info, struct H5D_dset_io_info_t *dinfo); @@ -225,8 +225,8 @@ typedef struct { } H5D_chunk_storage_t; typedef struct { - void *buf; /* Buffer for compact dataset */ - hbool_t *dirty; /* Pointer to dirty flag to mark */ + void *buf; /* Buffer for compact dataset */ + bool *dirty; /* Pointer to dirty flag to mark */ } H5D_compact_storage_t; typedef union H5D_storage_t { @@ -252,7 +252,7 @@ typedef struct H5D_piece_info_t { unsigned fspace_shared; /* Indicate that the file space for a chunk is shared and shouldn't be freed */ H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ unsigned mspace_shared; /* Indicate that the memory space for a chunk is shared and shouldn't be freed */ - hbool_t in_place_tconv; /* Whether to perform type conversion in-place */ + bool in_place_tconv; /* Whether to perform type conversion in-place */ size_t buf_off; /* Buffer offset for in-place type conversion */ struct H5D_dset_io_info_t *dset_info; /* Pointer to dset_info */ } H5D_piece_info_t; @@ -279,7 +279,7 @@ typedef struct H5D_dset_io_info_t { hid_t mem_type_id; /* memory datatype ID */ H5D_type_info_t type_info; - hbool_t skip_io; /* Whether to skip I/O for this dataset */ + bool skip_io; /* Whether to skip I/O for this dataset */ } H5D_dset_io_info_t; /* I/O info for entire I/O operation */ @@ -288,7 +288,7 @@ typedef struct H5D_io_info_t { H5F_shared_t *f_sh; /* Pointer to shared file struct that dataset is within */ #ifdef H5_HAVE_PARALLEL MPI_Comm comm; /* MPI communicator for file */ - hbool_t using_mpi_vfd; /* Whether the file is using an MPI-based VFD */ + bool using_mpi_vfd; /* Whether the file is using an MPI-based VFD */ #endif /* H5_HAVE_PARALLEL */ H5D_md_io_ops_t md_io_ops; /* Multi dataset I/O operation function pointers */ H5D_io_op_type_t op_type; @@ -307,16 +307,15 @@ typedef struct H5D_io_info_t { H5_flexible_const_ptr_t base_maddr; /* starting mem address */ H5D_selection_io_mode_t use_select_io; /* Whether to use selection I/O */ uint8_t *tconv_buf; /* Datatype conv buffer */ - hbool_t tconv_buf_allocated; /* Whether the type conversion buffer was allocated */ + bool tconv_buf_allocated; /* Whether the type conversion buffer was allocated */ size_t tconv_buf_size; /* Size of type conversion buffer */ uint8_t *bkg_buf; /* Background buffer */ - hbool_t bkg_buf_allocated; /* Whether the background buffer was allocated */ + bool bkg_buf_allocated; /* Whether the background buffer was allocated */ size_t bkg_buf_size; /* Size of background buffer */ size_t max_tconv_type_size; /* Largest of all source and destination type sizes involved in type conversion */ - hbool_t - must_fill_bkg; /* Whether any datasets need a background buffer filled with destination contents */ - hbool_t may_use_in_place_tconv; /* Whether datasets in this I/O could potentially use in-place type + bool must_fill_bkg; /* Whether any datasets need a background buffer filled with destination contents */ + bool may_use_in_place_tconv; /* Whether datasets in this I/O could potentially use in-place type conversion if the type sizes are compatible with it */ #ifdef H5_HAVE_PARALLEL H5D_mpio_actual_io_mode_t actual_io_mode; /* Actual type of collective or independent I/O */ @@ -380,7 +379,7 @@ typedef struct H5D_chunk_ud_t { unsigned idx_hint; /* Index of chunk in cache, if present */ H5F_block_t chunk_block; /* Offset/length of chunk in file */ unsigned filter_mask; /* Excluded filters */ - hbool_t new_unfilt_chunk; /* Whether the chunk just became unfiltered */ + bool new_unfilt_chunk; /* Whether the chunk just became unfiltered */ hsize_t chunk_idx; /* Chunk index for EA, FA indexing */ } H5D_chunk_ud_t; @@ -391,7 +390,7 @@ typedef int (*H5D_chunk_cb_func_t)(const H5D_chunk_rec_t *chunk_rec, void *udata typedef herr_t (*H5D_chunk_init_func_t)(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); typedef herr_t (*H5D_chunk_create_func_t)(const H5D_chk_idx_info_t *idx_info); -typedef hbool_t (*H5D_chunk_is_space_alloc_func_t)(const H5O_storage_chunk_t *storage); +typedef bool (*H5D_chunk_is_space_alloc_func_t)(const H5O_storage_chunk_t *storage); typedef herr_t (*H5D_chunk_insert_func_t)(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); typedef herr_t (*H5D_chunk_get_addr_func_t)(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -405,13 +404,13 @@ typedef herr_t (*H5D_chunk_copy_setup_func_t)(const H5D_chk_idx_info_t *idx_info typedef herr_t (*H5D_chunk_copy_shutdown_func_t)(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst); typedef herr_t (*H5D_chunk_size_func_t)(const H5D_chk_idx_info_t *idx_info, hsize_t *idx_size); -typedef herr_t (*H5D_chunk_reset_func_t)(H5O_storage_chunk_t *storage, hbool_t reset_addr); +typedef herr_t (*H5D_chunk_reset_func_t)(H5O_storage_chunk_t *storage, bool reset_addr); typedef herr_t (*H5D_chunk_dump_func_t)(const H5O_storage_chunk_t *storage, FILE *stream); typedef herr_t (*H5D_chunk_dest_func_t)(const H5D_chk_idx_info_t *idx_info); /* Typedef for grouping chunk I/O routines */ typedef struct H5D_chunk_ops_t { - hbool_t can_swim; /* Flag to indicate that the index supports SWMR access */ + bool can_swim; /* Flag to indicate that the index supports SWMR access */ H5D_chunk_init_func_t init; /* Routine to initialize indexing information in memory */ H5D_chunk_create_func_t create; /* Routine to create chunk index */ H5D_chunk_is_space_alloc_func_t @@ -445,7 +444,7 @@ typedef struct H5D_chunk_map_t { H5S_t *single_space; /* Dataspace for single chunk */ H5D_piece_info_t *single_piece_info; /* Pointer to single chunk's info */ - hbool_t use_single; /* Whether I/O is on a single element */ + bool use_single; /* Whether I/O is on a single element */ hsize_t last_index; /* Index of last chunk operated on */ H5D_piece_info_t *last_piece_info; /* Pointer to last chunk's info */ @@ -455,7 +454,7 @@ typedef struct H5D_chunk_map_t { /* Cached information about a particular chunk */ typedef struct H5D_chunk_cached_t { - hbool_t valid; /*whether cache info is valid*/ + bool valid; /*whether cache info is valid*/ hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled offset of chunk*/ haddr_t addr; /*file address of chunk */ uint32_t nbytes; /*size of stored data */ @@ -510,7 +509,7 @@ typedef struct H5D_rdcdc_t { haddr_t sieve_loc; /* File location (offset) of the data sieve buffer */ size_t sieve_size; /* Size of the data sieve buffer used (in bytes) */ size_t sieve_buf_size; /* Size of the data sieve buffer allocated (in bytes) */ - hbool_t sieve_dirty; /* Flag to indicate that the data sieve buffer is dirty */ + bool sieve_dirty; /* Flag to indicate that the data sieve buffer is dirty */ } H5D_rdcdc_t; /* @@ -521,7 +520,7 @@ typedef struct H5D_rdcdc_t { */ struct H5D_shared_t { size_t fo_count; /* Reference count */ - hbool_t closing; /* Flag to indicate dataset is closing */ + bool closing; /* Flag to indicate dataset is closing */ hid_t type_id; /* ID for dataset's datatype */ H5T_t *type; /* Datatype for this dataset */ H5S_t *space; /* Dataspace of this dataset */ @@ -529,7 +528,7 @@ struct H5D_shared_t { hid_t dapl_id; /* Dataset access property id */ H5D_dcpl_cache_t dcpl_cache; /* Cached DCPL values */ H5O_layout_t layout; /* Data layout */ - hbool_t checked_filters; /* TRUE if dataset passes can_apply check */ + bool checked_filters; /* true if dataset passes can_apply check */ /* Cached dataspace info */ unsigned ndims; /* The dataset's dataspace rank */ @@ -588,7 +587,7 @@ typedef struct H5D_fill_buf_info_t { const H5O_fill_t *fill; /* Pointer to fill value */ void *fill_buf; /* Fill buffer */ size_t fill_buf_size; /* Size of fill buffer */ - hbool_t use_caller_fill_buf; /* Whether the caller provided the fill buffer */ + bool use_caller_fill_buf; /* Whether the caller provided the fill buffer */ void *bkg_buf; /* Background conversion buffer */ size_t bkg_buf_size; /* Size of background buffer */ H5T_t *mem_type; /* Pointer to memory datatype */ @@ -598,7 +597,7 @@ typedef struct H5D_fill_buf_info_t { size_t mem_elmt_size, file_elmt_size; /* Size of element in memory and on disk */ size_t max_elmt_size; /* Max. size of memory or file datatype */ size_t elmts_per_buf; /* # of elements that fit into a buffer */ - hbool_t has_vlen_fill_type; /* Whether the datatype for the fill value has a variable-length component */ + bool has_vlen_fill_type; /* Whether the datatype for the fill value has a variable-length component */ } H5D_fill_buf_info_t; /*****************************/ @@ -638,11 +637,11 @@ H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl H5_DLL hid_t H5D__get_space(const H5D_t *dset); H5_DLL hid_t H5D__get_type(const H5D_t *dset); H5_DLL herr_t H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation); -H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, +H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, bool full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size); H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage_size); -H5_DLL herr_t H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty); +H5_DLL herr_t H5D__chunk_index_empty(const H5D_t *dset, bool *empty); H5_DLL herr_t H5D__get_num_chunks(const H5D_t *dset, const H5S_t *space, hsize_t *nchunks); H5_DLL herr_t H5D__get_chunk_info(const H5D_t *dset, const H5S_t *space, hsize_t chk_idx, hsize_t *coord, unsigned *filter_mask, haddr_t *offset, hsize_t *size); @@ -686,7 +685,7 @@ H5_DLL herr_t H5D__scatgath_write_select(H5D_io_info_t *io_info); /* Functions that operate on dataset's layout information */ H5_DLL herr_t H5D__layout_set_io_ops(const H5D_t *dataset); -H5_DLL size_t H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data); +H5_DLL size_t H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, bool include_compact_data); H5_DLL herr_t H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout); H5_DLL herr_t H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache); @@ -695,37 +694,37 @@ H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dapl_id, H5P_genplist_t *pl H5_DLL herr_t H5D__layout_oh_write(const H5D_t *dataset, H5O_t *oh, unsigned update_flags); /* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage); -H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); -H5_DLL hbool_t H5D__contig_is_data_cached(const H5D_shared_t *shared_dset); -H5_DLL herr_t H5D__contig_fill(H5D_t *dset); -H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -H5_DLL herr_t H5D__contig_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, - H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info); -H5_DLL herr_t H5D__contig_delete(H5F_t *f, const H5O_storage_t *store); +H5_DLL herr_t H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage); +H5_DLL bool H5D__contig_is_space_alloc(const H5O_storage_t *storage); +H5_DLL bool H5D__contig_is_data_cached(const H5D_shared_t *shared_dset); +H5_DLL herr_t H5D__contig_fill(H5D_t *dset); +H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); +H5_DLL herr_t H5D__contig_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); +H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, + H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info); +H5_DLL herr_t H5D__contig_delete(H5F_t *f, const H5O_storage_t *store); /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, haddr_t caddr, - hbool_t write_op); + bool write_op); H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); -H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); -H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset); -H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata); -H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes); -H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old_dim[]); -H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, - H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled); -H5_DLL void *H5D__chunk_mem_alloc(size_t size, void *pline); -H5_DLL void H5D__chunk_mem_free(void *chk, void *pline); -H5_DLL void *H5D__chunk_mem_xfree(void *chk, const void *pline); -H5_DLL void *H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline); -H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]); -H5_DLL hbool_t H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims, - const hsize_t *chunk_scaled, const hsize_t *dset_dims); -H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim); -H5_DLL herr_t H5D__chunk_set_sizes(H5D_t *dset); +H5_DLL bool H5D__chunk_is_space_alloc(const H5O_storage_t *storage); +H5_DLL bool H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset); +H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata); +H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes); +H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, bool full_overwrite, const hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, + H5F_block_t *new_chunk, bool *need_insert, const hsize_t *scaled); +H5_DLL void *H5D__chunk_mem_alloc(size_t size, void *pline); +H5_DLL void H5D__chunk_mem_free(void *chk, void *pline); +H5_DLL void *H5D__chunk_mem_xfree(void *chk, const void *pline); +H5_DLL void *H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline); +H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]); +H5_DLL bool H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims, + const hsize_t *chunk_scaled, const hsize_t *dset_dims); +H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim); +H5_DLL herr_t H5D__chunk_set_sizes(H5D_t *dset); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5D__chunk_addrmap(const H5D_t *dset, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ @@ -742,7 +741,7 @@ H5_DLL herr_t H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *of const void *buf); H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, void *buf); #ifdef H5D_CHUNK_DEBUG -H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); +H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, bool headers); #endif /* H5D_CHUNK_DEBUG */ /* format convert */ @@ -755,21 +754,21 @@ H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info); /* Functions that operate on virtual dataset storage */ -H5_DLL herr_t H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_copy_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset); -H5_DLL herr_t H5D__virtual_reset_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst); -H5_DLL herr_t H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); -H5_DLL hbool_t H5D__virtual_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t **head); -H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset); -H5_DLL herr_t H5D__virtual_release_source_dset_files(H5D_virtual_held_file_t *head); +H5_DLL herr_t H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout); +H5_DLL herr_t H5D__virtual_copy_layout(H5O_layout_t *layout); +H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset); +H5_DLL herr_t H5D__virtual_reset_layout(H5O_layout_t *layout); +H5_DLL herr_t H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage); +H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst); +H5_DLL herr_t H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); +H5_DLL bool H5D__virtual_is_space_alloc(const H5O_storage_t *storage); +H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t **head); +H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset); +H5_DLL herr_t H5D__virtual_release_source_dset_files(H5D_virtual_held_file_t *head); /* Functions that operate on EFL (External File List)*/ -H5_DLL hbool_t H5D__efl_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size); +H5_DLL bool H5D__efl_is_space_alloc(const H5O_storage_t *storage); +H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size); /* Functions that perform fill value operations on datasets */ H5_DLL herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_type, @@ -816,7 +815,7 @@ H5_DLL herr_t H5D__free_piece_info(void *item, void *key, void *opdata); #ifdef H5D_TESTING H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); -H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty); +H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, bool *dirty); H5_DLL herr_t H5D__layout_idx_type_test(hid_t did, H5D_chunk_index_t *idx_type); H5_DLL herr_t H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 8265ac2..118c6cd 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -104,8 +104,8 @@ #define H5D_XFER_COLL_RANK0_BCAST_NAME "coll_rank0_bcast" /* Definitions for general collective I/O instrumentation properties */ -#define H5D_XFER_COLL_RANK0_BCAST_SIZE sizeof(hbool_t) -#define H5D_XFER_COLL_RANK0_BCAST_DEF FALSE +#define H5D_XFER_COLL_RANK0_BCAST_SIZE sizeof(bool) +#define H5D_XFER_COLL_RANK0_BCAST_DEF false #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ /* Default temporary buffer size */ @@ -172,7 +172,7 @@ H5_DLL hid_t H5D_get_create_plist(const H5D_t *dset); H5_DLL hid_t H5D_get_access_plist(const H5D_t *dset); /* Functions that operate on chunked storage */ -H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); +H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); /* Functions that operate on virtual storage */ H5_DLL herr_t H5D_virtual_check_mapping_pre(const H5S_t *vspace, const H5S_t *src_space, diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index a9158bf..cd2027b 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -448,14 +448,14 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ void *buf; /* Local pointer to application buffer */ void *tmp_buf; /* Buffer to use for type conversion */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ - hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ + bool mem_iter_init = false; /* Memory selection iteration info has been initialized */ H5S_sel_iter_t *bkg_iter = NULL; /* Background iteration info*/ - hbool_t bkg_iter_init = FALSE; /* Background iteration info has been initialized */ + bool bkg_iter_init = false; /* Background iteration info has been initialized */ H5S_sel_iter_t *file_iter = NULL; /* File selection iteration info*/ - hbool_t file_iter_init = FALSE; /* File selection iteration info has been initialized */ + bool file_iter_init = false; /* File selection iteration info has been initialized */ hsize_t smine_start; /* Strip mine start loc */ size_t smine_nelmts; /* Elements per strip */ - hbool_t in_place_tconv; /* Whether to perform in-place type_conversion */ + bool in_place_tconv; /* Whether to perform in-place type_conversion */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -483,10 +483,10 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a * background buffer (and therefore could not do the I/O in one operation with in-place conversion * anyways). */ - if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, FALSE) && + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, false) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) - in_place_tconv = FALSE; + in_place_tconv = false; /* Allocate the iterators */ if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -500,13 +500,13 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ if (H5S_select_iter_init(file_iter, dset_info->file_space, dset_info->type_info.src_type_size, H5S_SEL_ITER_GET_SEQ_LIST_SORTED) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information"); - file_iter_init = TRUE; /*file selection iteration info has been initialized */ + file_iter_init = true; /*file selection iteration info has been initialized */ if (H5S_select_iter_init(mem_iter, dset_info->mem_space, dset_info->type_info.dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; /*file selection iteration info has been initialized */ + mem_iter_init = true; /*file selection iteration info has been initialized */ if (H5S_select_iter_init(bkg_iter, dset_info->mem_space, dset_info->type_info.dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information"); - bkg_iter_init = TRUE; /*file selection iteration info has been initialized */ + bkg_iter_init = true; /*file selection iteration info has been initialized */ /* Start strip mining... */ for (smine_start = 0; smine_start < dset_info->nelmts; smine_start += smine_nelmts) { @@ -633,14 +633,14 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset const void *buf; /* Local pointer to application buffer */ void *tmp_buf; /* Buffer to use for type conversion */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ - hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ + bool mem_iter_init = false; /* Memory selection iteration info has been initialized */ H5S_sel_iter_t *bkg_iter = NULL; /* Background iteration info*/ - hbool_t bkg_iter_init = FALSE; /* Background iteration info has been initialized */ + bool bkg_iter_init = false; /* Background iteration info has been initialized */ H5S_sel_iter_t *file_iter = NULL; /* File selection iteration info*/ - hbool_t file_iter_init = FALSE; /* File selection iteration info has been initialized */ + bool file_iter_init = false; /* File selection iteration info has been initialized */ hsize_t smine_start; /* Strip mine start loc */ size_t smine_nelmts; /* Elements per strip */ - hbool_t in_place_tconv; /* Whether to perform in-place type_conversion */ + bool in_place_tconv; /* Whether to perform in-place type_conversion */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -668,10 +668,10 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a * background buffer (and therefore could not do the I/O in one operation with in-place conversion * anyways). */ - if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, FALSE) && + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, false) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) - in_place_tconv = FALSE; + in_place_tconv = false; /* Allocate the iterators */ if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -685,14 +685,14 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset if (H5S_select_iter_init(file_iter, dset_info->file_space, dset_info->type_info.dst_type_size, H5S_SEL_ITER_GET_SEQ_LIST_SORTED) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information"); - file_iter_init = TRUE; /*file selection iteration info has been initialized */ + file_iter_init = true; /*file selection iteration info has been initialized */ if (H5S_select_iter_init(mem_iter, dset_info->mem_space, dset_info->type_info.src_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; /*file selection iteration info has been initialized */ + mem_iter_init = true; /*file selection iteration info has been initialized */ if (H5S_select_iter_init(bkg_iter, dset_info->file_space, dset_info->type_info.dst_type_size, H5S_SEL_ITER_GET_SEQ_LIST_SORTED) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information"); - bkg_iter_init = TRUE; /*file selection iteration info has been initialized */ + bkg_iter_init = true; /*file selection iteration info has been initialized */ /* Start strip mining... */ for (smine_start = 0; smine_start < dset_info->nelmts; smine_start += smine_nelmts) { @@ -817,7 +817,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) { H5S_t **tmp_mem_spaces = NULL; /* Memory spaces to use for read from disk */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ - hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ + bool mem_iter_init = false; /* Memory selection iteration info has been initialized */ void **tmp_bufs = NULL; /* Buffers to use for read from disk */ void *tmp_bkg_buf = NULL; /* Temporary background buffer pointer */ size_t tconv_bytes_used = 0; /* Number of bytes used so far in conversion buffer */ @@ -905,7 +905,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) dset_info->type_info.dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; /* Memory selection iteration info has been initialized */ + mem_iter_init = true; /* Memory selection iteration info has been initialized */ if ((size_t)io_info->sel_pieces[i]->piece_points != H5D__gather_mem(io_info->rbufs[i], mem_iter, @@ -917,7 +917,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } } } @@ -949,7 +949,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; /* Memory selection iteration info has been initialized */ + mem_iter_init = true; /* Memory selection iteration info has been initialized */ /* If the source and destination are compound types and subset of each other * and no conversion is needed, copy the data directly into user's buffer and @@ -1006,7 +1006,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } } @@ -1049,7 +1049,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) H5S_t **write_mem_spaces = NULL; /* Memory spaces to use for write to disk */ size_t spaces_added = 0; /* Number of spaces added to write_mem_spaces */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ - hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ + bool mem_iter_init = false; /* Memory selection iteration info has been initialized */ const void **write_bufs = NULL; /* Buffers to use for write to disk */ size_t tconv_bytes_used = 0; /* Number of bytes used so far in conversion buffer */ size_t bkg_bytes_used = 0; /* Number of bytes used so far in background buffer */ @@ -1113,7 +1113,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - mem_iter_init = TRUE; /* Memory selection iteration info has been initialized */ + mem_iter_init = true; /* Memory selection iteration info has been initialized */ /* Create block memory space */ if (NULL == @@ -1244,7 +1244,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } } diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 06bb696..e018da5 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -75,9 +75,9 @@ static herr_t H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t elmt_size) { H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ - hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ + bool mem_iter_init = false; /* Memory selection iteration info has been initialized */ H5S_sel_iter_t *file_iter = NULL; /* File selection iteration info */ - hbool_t file_iter_init = FALSE; /* File selection iteration info has been initialized */ + bool file_iter_init = false; /* File selection iteration info has been initialized */ hsize_t *mem_off = NULL; /* Pointer to sequence offsets in memory */ hsize_t *file_off = NULL; /* Pointer to sequence offsets in the file */ size_t *mem_len = NULL; /* Pointer to sequence lengths in memory */ @@ -278,8 +278,8 @@ H5D_select_io_mem(void *dst_buf, H5S_t *dst_space, const void *src_buf, H5S_t *s { H5S_sel_iter_t *dst_sel_iter = NULL; /* Destination dataspace iteration info */ H5S_sel_iter_t *src_sel_iter = NULL; /* Source dataspace iteration info */ - hbool_t dst_sel_iter_init = FALSE; /* Destination dataspace selection iterator initialized? */ - hbool_t src_sel_iter_init = FALSE; /* Source dataspace selection iterator initialized? */ + bool dst_sel_iter_init = false; /* Destination dataspace selection iterator initialized? */ + bool src_sel_iter_init = false; /* Source dataspace selection iterator initialized? */ hsize_t *dst_off = NULL; /* Pointer to sequence offsets in destination buffer */ hsize_t *src_off = NULL; /* Pointer to sequence offsets in source buffer */ size_t *dst_len = NULL; /* Pointer to sequence lengths in destination buffer */ @@ -364,12 +364,12 @@ H5D_select_io_mem(void *dst_buf, H5S_t *dst_space, const void *src_buf, H5S_t *s /* Initialize destination selection iterator */ if (H5S_select_iter_init(dst_sel_iter, dst_space, elmt_size, sel_iter_flags) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - dst_sel_iter_init = TRUE; /* Destination selection iteration info has been initialized */ + dst_sel_iter_init = true; /* Destination selection iteration info has been initialized */ /* Initialize source selection iterator */ if (H5S_select_iter_init(src_sel_iter, src_space, elmt_size, H5S_SEL_ITER_SHARE_WITH_DATASPACE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - src_sel_iter_init = TRUE; /* Source selection iteration info has been initialized */ + src_sel_iter_init = true; /* Source selection iteration info has been initialized */ /* Initialize sequence counts */ curr_dst_seq = curr_src_seq = 0; diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 926c78a..9cb18d3 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -47,22 +47,22 @@ /********************/ /* Single Chunk Index chunking I/O ops */ -static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, - haddr_t dset_ohdr_addr); -static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, - const H5D_t *dset); -static herr_t H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, - void *chunk_udata); -static herr_t H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, - const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D__single_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); +static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, + haddr_t dset_ohdr_addr); +static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info); +static bool H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, + const H5D_t *dset); +static herr_t H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); +static int H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, + void *chunk_udata); +static herr_t H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); +static herr_t H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, + const H5D_chk_idx_info_t *idx_info_dst); +static herr_t H5D__single_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); +static herr_t H5D__single_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr); +static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); /*********************/ /* Package Variables */ @@ -70,7 +70,7 @@ static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *st /* Non Index chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{ - FALSE, /* Single Chunk indexing doesn't current support SWMR access */ + false, /* Single Chunk indexing doesn't current support SWMR access */ H5D__single_idx_init, /* init */ H5D__single_idx_create, /* create */ H5D__single_idx_is_space_alloc, /* is_space_alloc */ @@ -174,7 +174,7 @@ H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info) * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { FUNC_ENTER_PACKAGE_NOERR @@ -182,7 +182,7 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /* Check args */ assert(storage); - FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) + FUNC_LEAVE_NOAPI((bool)H5_addr_defined(storage->idx_addr)) } /* end H5D__single_idx_is_space_alloc() */ /*------------------------------------------------------------------------- @@ -466,7 +466,7 @@ H5D__single_idx_size(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, hsize_t *------------------------------------------------------------------------- */ static herr_t -H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__single_idx_reset(H5O_storage_chunk_t *storage, bool reset_addr) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 0038d98..5f700b3 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -136,7 +136,7 @@ done: USAGE herr_t H5D__layout_compact_dirty_test(did, dirty) hid_t did; IN: Dataset to query - hbool_t *dirty; OUT: Pointer to location to place "dirty" info + bool *dirty; OUT: Pointer to location to place "dirty" info RETURNS Non-negative on success, negative on failure DESCRIPTION @@ -148,7 +148,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) +H5D__layout_compact_dirty_test(hid_t did, bool *dirty) { H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 64f1bfe..b14e06f 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -79,11 +79,11 @@ /********************/ /* Layout operation callbacks */ -static hbool_t H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset); -static herr_t H5D__virtual_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -static herr_t H5D__virtual_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -static herr_t H5D__virtual_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -static herr_t H5D__virtual_flush(H5D_t *dset); +static bool H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset); +static herr_t H5D__virtual_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); +static herr_t H5D__virtual_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); +static herr_t H5D__virtual_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); +static herr_t H5D__virtual_flush(H5D_t *dset); /* Other functions */ static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, @@ -570,7 +570,7 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) /* Copy virtual selection */ if (NULL == (ent->source_dset.virtual_select = - H5S_copy(orig_list[i].source_dset.virtual_select, FALSE, TRUE))) + H5S_copy(orig_list[i].source_dset.virtual_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); /* Copy original source names */ @@ -580,7 +580,7 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source dataset name"); /* Copy source selection */ - if (NULL == (ent->source_select = H5S_copy(orig_list[i].source_select, FALSE, TRUE))) + if (NULL == (ent->source_select = H5S_copy(orig_list[i].source_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy source selection"); /* Initialize clipped selections */ @@ -653,18 +653,18 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) if (orig_source_fapl >= 0) { if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(orig_source_fapl, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if ((virt->source_fapl = H5P_copy_plist(plist, FALSE)) < 0) + if ((virt->source_fapl = H5P_copy_plist(plist, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy fapl"); } /* end if */ if (orig_source_dapl >= 0) { if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(orig_source_dapl, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if ((virt->source_dapl = H5P_copy_plist(plist, FALSE)) < 0) + if ((virt->source_dapl = H5P_copy_plist(plist, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dapl"); } /* end if */ /* New layout is not fully initialized */ - virt->init = FALSE; + virt->init = false; done: /* Release allocated resources on failure */ @@ -750,7 +750,7 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) } /* The list is no longer initialized */ - virt->init = FALSE; + virt->init = false; /* Note the lack of a done: label. This is because there are no HGOTO_ERROR * calls. If one is added, a done: label must also be added */ @@ -854,9 +854,9 @@ static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, H5O_storage_virtual_srcdset_t *source_dset) { - H5F_t *src_file = NULL; /* Source file */ - hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *src_file = NULL; /* Source file */ + bool src_file_open = false; /* Whether we have opened and need to close src_file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -881,7 +881,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir /* If we opened the source file here, we should close it when leaving */ if (src_file) - src_file_open = TRUE; + src_file_open = true; else /* Reset the error stack */ H5E_clear_stack(NULL); @@ -908,11 +908,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir /* Reset the error stack */ H5E_clear_stack(NULL); - source_dset->dset_exists = FALSE; + source_dset->dset_exists = false; } /* end if */ else { /* Dataset exists */ - source_dset->dset_exists = TRUE; + source_dset->dset_exists = true; /* Patch the source selection if necessary */ if (virtual_ent->source_space_status != H5O_VIRTUAL_STATUS_CORRECT) { @@ -1392,7 +1392,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) hsize_t curr_dims[H5S_MAX_RANK]; hsize_t clip_size; int rank; - hbool_t changed = FALSE; /* Whether the VDS extent changed */ + bool changed = false; /* Whether the VDS extent changed */ size_t i, j; herr_t ret_value = SUCCEED; /* Return value */ @@ -1473,7 +1473,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Copy virtual selection */ if (NULL == (storage->list[i].source_dset.clipped_virtual_select = H5S_copy( - storage->list[i].source_dset.virtual_select, FALSE, TRUE))) + storage->list[i].source_dset.virtual_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); @@ -1496,7 +1496,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Copy source selection */ if (NULL == (storage->list[i].source_dset.clipped_source_select = - H5S_copy(storage->list[i].source_select, FALSE, TRUE))) + H5S_copy(storage->list[i].source_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy source selection"); @@ -1680,7 +1680,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) else if (new_dims[i] < storage->min_dims[i]) new_dims[i] = storage->min_dims[i]; if (new_dims[i] != curr_dims[i]) - changed = TRUE; + changed = true; } /* end for */ /* Update extent if it changed */ @@ -1721,7 +1721,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Copy virtual selection */ if (NULL == (storage->list[i].source_dset.clipped_virtual_select = - H5S_copy(storage->list[i].source_dset.virtual_select, FALSE, TRUE))) + H5S_copy(storage->list[i].source_dset.virtual_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); /* Clip space to virtual extent */ @@ -1733,7 +1733,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) * match size of virtual selection */ clip_size = H5S_hyper_get_clip_extent(storage->list[i].source_select, - storage->list[i].source_dset.clipped_virtual_select, FALSE); + storage->list[i].source_dset.clipped_virtual_select, false); /* Check if the clip size changed */ if (clip_size != storage->list[i].clip_size_source) { @@ -1748,7 +1748,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Copy source selection */ if (NULL == (storage->list[i].source_dset.clipped_source_select = - H5S_copy(storage->list[i].source_select, FALSE, TRUE))) + H5S_copy(storage->list[i].source_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy source selection"); /* Clip source selection */ @@ -1764,7 +1764,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) else { /* printf mapping */ hsize_t first_inc_block; - hbool_t partial_block; + bool partial_block; /* Get index of first incomplete block in virtual * selection */ @@ -1849,7 +1849,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) } /* end if */ /* Mark layout as fully initialized */ - storage->init = TRUE; + storage->init = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1918,7 +1918,7 @@ H5D__virtual_init_all(const H5D_t *dset) * match size of virtual selection */ clip_size = H5S_hyper_get_clip_extent_match( storage->list[i].source_select, storage->list[i].source_dset.virtual_select, - virtual_dims[storage->list[i].unlim_dim_virtual], FALSE); + virtual_dims[storage->list[i].unlim_dim_virtual], false); /* Close previous clipped virtual selection, if any */ if (storage->list[i].source_dset.clipped_virtual_select) { @@ -1931,7 +1931,7 @@ H5D__virtual_init_all(const H5D_t *dset) /* Copy virtual selection */ if (NULL == (storage->list[i].source_dset.clipped_virtual_select = - H5S_copy(storage->list[i].source_dset.virtual_select, FALSE, TRUE))) + H5S_copy(storage->list[i].source_dset.virtual_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); /* Close previous clipped source selection, if any */ @@ -1945,7 +1945,7 @@ H5D__virtual_init_all(const H5D_t *dset) /* Copy source selection */ if (NULL == (storage->list[i].source_dset.clipped_source_select = - H5S_copy(storage->list[i].source_select, FALSE, TRUE))) + H5S_copy(storage->list[i].source_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy source selection"); /* Check if the clip size is within the current extent of @@ -1969,7 +1969,7 @@ H5D__virtual_init_all(const H5D_t *dset) */ clip_size = H5S_hyper_get_clip_extent_match( storage->list[i].source_dset.virtual_select, storage->list[i].source_select, - source_dims[storage->list[i].unlim_dim_source], FALSE); + source_dims[storage->list[i].unlim_dim_source], false); /* Clip virtual selection to clip_size */ if (H5S_hyper_clip_unlim(storage->list[i].source_dset.clipped_virtual_select, @@ -1991,8 +1991,8 @@ H5D__virtual_init_all(const H5D_t *dset) } /* end if */ else { /* printf mapping */ - size_t sub_dset_max; - hbool_t partial_block; + size_t sub_dset_max; + bool partial_block; /* Get number of sub-source datasets in current extent */ sub_dset_max = (size_t)H5S_hyper_get_first_inc_block( @@ -2109,7 +2109,7 @@ H5D__virtual_init_all(const H5D_t *dset) } /* end else */ /* Mark layout as fully initialized */ - storage->init = TRUE; + storage->init = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -2151,7 +2151,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) * status because this layout could be from an old version held in the * object header message code. We cannot update that held message because * the layout message is constant, so just overwrite the values here (and - * invalidate other fields by setting storage->init to FALSE below). Also + * invalidate other fields by setting storage->init to false below). Also * remove offset from selections. We only have to update * source_space_status and virtual_space_status because others will be based * on these and should therefore already have been normalized. */ @@ -2194,7 +2194,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) H5P_genplist_t *source_fapl = NULL; /* Source file FAPL */ H5F_close_degree_t close_degree = H5F_CLOSE_WEAK; /* Close degree for source files */ - if ((storage->source_fapl = H5F_get_access_plist(f, FALSE)) < 0) + if ((storage->source_fapl = H5F_get_access_plist(f, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fapl"); /* Get property list pointer */ @@ -2224,12 +2224,12 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) /* Copy DAPL to layout */ if (storage->source_dapl <= 0) - if ((storage->source_dapl = H5P_copy_plist(dapl, FALSE)) < 0) + if ((storage->source_dapl = H5P_copy_plist(dapl, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dapl"); /* Mark layout as not fully initialized (must be done prior to I/O for * unlimited/printf selections) */ - storage->init = FALSE; + storage->init = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -2240,25 +2240,25 @@ done: * * Purpose: Query if space is allocated for layout * - * Return: TRUE if space is allocated - * FALSE if it is not + * Return: true if space is allocated + * false if it is not * Negative on failure * *------------------------------------------------------------------------- */ -hbool_t +bool H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR - /* Just return TRUE, since the global heap object containing the mappings is + /* Just return true, since the global heap object containing the mappings is * created when the layout message is encoded, and nothing else needs to be * allocated for virtual datasets. This also ensures that the library never * assumes (falsely) that no data is present in the dataset, causing errors. */ - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_is_space_alloc() */ @@ -2272,12 +2272,12 @@ H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset) { const H5O_storage_virtual_t *storage; /* Convenience pointer */ size_t i, j; /* Local index variables */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -2296,13 +2296,13 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset) storage->list[i].sub_dset[j].dset->shared->layout.ops->is_data_cached && storage->list[i].sub_dset[j].dset->shared->layout.ops->is_data_cached( storage->list[i].sub_dset[j].dset->shared)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ else if (storage->list[i].source_dset.dset && storage->list[i].source_dset.dset->shared->layout.ops->is_data_cached && storage->list[i].source_dset.dset->shared->layout.ops->is_data_cached( storage->list[i].source_dset.dset->shared)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2350,7 +2350,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds start */ hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds end */ int rank = 0; - hbool_t bounds_init = FALSE; /* Whether bounds_start, bounds_end, and rank are valid */ + bool bounds_init = false; /* Whether bounds_start, bounds_end, and rank are valid */ size_t i, j, k; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2377,7 +2377,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag /* Check for "printf" source dataset resolution */ if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { - hbool_t partial_block; + bool partial_block; assert(storage->list[i].unlim_dim_virtual >= 0); @@ -2397,7 +2397,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag bounds_end[j]++; /* Bounds are now initialized */ - bounds_init = TRUE; + bounds_init = true; } /* end if */ /* Get index of first block in virtual selection */ @@ -2462,7 +2462,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag /* Copy virtual selection */ if (NULL == (storage->list[i].sub_dset[j].clipped_virtual_select = - H5S_copy(storage->list[i].sub_dset[j].virtual_select, FALSE, TRUE))) + H5S_copy(storage->list[i].sub_dset[j].virtual_select, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); /* Clip virtual selection to real virtual extent */ @@ -2477,7 +2477,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag if (H5S_select_project_intersection( storage->list[i].sub_dset[j].virtual_select, storage->list[i].source_select, storage->list[i].sub_dset[j].clipped_virtual_select, - &storage->list[i].sub_dset[j].clipped_source_select, TRUE) < 0) + &storage->list[i].sub_dset[j].clipped_source_select, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto memory space"); @@ -2499,7 +2499,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag * onto memory space */ if (H5S_select_project_intersection( file_space, mem_space, storage->list[i].sub_dset[j].clipped_virtual_select, - &storage->list[i].sub_dset[j].projected_mem_space, TRUE) < 0) + &storage->list[i].sub_dset[j].projected_mem_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto memory space"); @@ -2544,7 +2544,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag * memory space */ if (H5S_select_project_intersection( file_space, mem_space, storage->list[i].source_dset.clipped_virtual_select, - &storage->list[i].source_dset.projected_mem_space, TRUE) < 0) + &storage->list[i].source_dset.projected_mem_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto memory space"); @@ -2672,7 +2672,7 @@ H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset * mapping source space */ if (H5S_select_project_intersection(source_dset->clipped_virtual_select, source_dset->clipped_source_select, dset_info->file_space, - &projected_src_space, TRUE) < 0) + &projected_src_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space"); @@ -2779,7 +2779,7 @@ H5D__virtual_read(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_info /* Always write fill value to memory buffer unless it is undefined */ if (fill_status != H5D_FILL_VALUE_UNDEFINED) { /* Start with fill space equal to memory space */ - if (NULL == (fill_space = H5S_copy(dset_info->mem_space, FALSE, TRUE))) + if (NULL == (fill_space = H5S_copy(dset_info->mem_space, false, true))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy memory selection"); /* Iterate over mappings */ @@ -2869,7 +2869,7 @@ H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdse * mapping source space */ if (H5S_select_project_intersection(source_dset->clipped_virtual_select, source_dset->clipped_source_select, dset_info->file_space, - &projected_src_space, TRUE) < 0) + &projected_src_space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space"); @@ -3114,7 +3114,7 @@ H5D__virtual_refresh_source_dset(H5D_t **dset) assert(dset && *dset); /* Get a temporary identifier for this source dataset */ - if ((temp_id = H5VL_wrap_register(H5I_DATASET, *dset, FALSE)) < 0) + if ((temp_id = H5VL_wrap_register(H5I_DATASET, *dset, false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register (temporary) source dataset ID"); /* Refresh source dataset */ diff --git a/src/H5E.c b/src/H5E.c index ea6f201..3df9fce 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -174,7 +174,7 @@ H5E_init(void) (HDstrlen(H5_VERS_SUBRELEASE) > 0 ? "-" H5_VERS_SUBRELEASE : "")); if (NULL == (cls = H5E__register_class(H5E_CLS_NAME, H5E_CLS_LIB_NAME, lib_vers))) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "class initialization failed"); - if ((H5E_ERR_CLS_g = H5I_register(H5I_ERROR_CLASS, cls, FALSE)) < 0) + if ((H5E_ERR_CLS_g = H5I_register(H5I_ERROR_CLASS, cls, false)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error class"); /* Include the automatically generated error code initialization */ @@ -227,11 +227,11 @@ H5E_term_package(void) /* Clear any outstanding error stacks */ if (nstk > 0) - (void)H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_STACK, false, false); /* Clear all the error classes */ if (ncls > 0) { - (void)H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_CLASS, false, false); /* Reset the HDF5 error class, if its been closed */ if (H5I_nmembers(H5I_ERROR_CLASS) == 0) @@ -240,7 +240,7 @@ H5E_term_package(void) /* Clear all the error messages */ if (nmsg > 0) { - (void)H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_MSG, false, false); /* Reset the HDF5 error messages, if they've been closed */ if (H5I_nmembers(H5I_ERROR_MSG) == 0) { @@ -286,7 +286,7 @@ H5E__set_default_auto(H5E_t *stk) stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1; stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5E__print2; - stk->auto_op.is_default = TRUE; + stk->auto_op.is_default = true; #else /* H5_NO_DEPRECATED_SYMBOLS */ stk->auto_op.func2 = (H5E_auto2_t)H5E__print2; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -401,7 +401,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, H5I_INVALID_HID, "can't create error class"); /* Register the new error class to get an ID for it */ - if ((ret_value = H5I_register(H5I_ERROR_CLASS, cls, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_ERROR_CLASS, cls, true)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register error class"); done: @@ -506,7 +506,7 @@ H5E__unregister_class(H5E_cls_t *cls, void H5_ATTR_UNUSED **request) assert(cls); /* Iterate over all the messages and delete those in this error class */ - if (H5I_iterate(H5I_ERROR_MSG, H5E__close_msg_cb, cls, FALSE) < 0) + if (H5I_iterate(H5I_ERROR_MSG, H5E__close_msg_cb, cls, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class"); /* Free error class structure */ @@ -706,7 +706,7 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, H5I_INVALID_HID, "can't create error message"); /* Register the new error class to get an ID for it */ - if ((ret_value = H5I_register(H5I_ERROR_MSG, msg, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_ERROR_MSG, msg, true)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register error message"); done: @@ -815,7 +815,7 @@ H5Ecreate_stack(void) H5E__set_default_auto(stk); /* Register the stack */ - if ((ret_value = H5I_register(H5I_ERROR_STACK, stk, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_ERROR_STACK, stk, true)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, H5I_INVALID_HID, "can't create error stack"); done: @@ -848,7 +848,7 @@ H5Eget_current_stack(void) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, H5I_INVALID_HID, "can't create error stack"); /* Register the stack */ - if ((ret_value = H5I_register(H5I_ERROR_STACK, stk, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_ERROR_STACK, stk, true)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, H5I_INVALID_HID, "can't create error stack"); done: @@ -894,13 +894,13 @@ H5E__get_current_stack(void) new_error = &(estack_copy->slot[u]); /* Increment the IDs to indicate that they are used in this stack */ - if (H5I_inc_ref(current_error->cls_id, FALSE) < 0) + if (H5I_inc_ref(current_error->cls_id, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error class"); new_error->cls_id = current_error->cls_id; - if (H5I_inc_ref(current_error->maj_num, FALSE) < 0) + if (H5I_inc_ref(current_error->maj_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message"); new_error->maj_num = current_error->maj_num; - if (H5I_inc_ref(current_error->min_num, FALSE) < 0) + if (H5I_inc_ref(current_error->min_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message"); new_error->min_num = current_error->min_num; /* The 'func' & 'file' strings are statically allocated (by the compiler) @@ -1009,13 +1009,13 @@ H5E__set_current_stack(H5E_t *estack) new_error = &(estack->slot[u]); /* Increment the IDs to indicate that they are used in this stack */ - if (H5I_inc_ref(new_error->cls_id, FALSE) < 0) + if (H5I_inc_ref(new_error->cls_id, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class"); current_error->cls_id = new_error->cls_id; - if (H5I_inc_ref(new_error->maj_num, FALSE) < 0) + if (H5I_inc_ref(new_error->maj_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class"); current_error->maj_num = new_error->maj_num; - if (H5I_inc_ref(new_error->min_num, FALSE) < 0) + if (H5I_inc_ref(new_error->min_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class"); current_error->min_num = new_error->min_num; /* The 'func' & 'file' strings are statically allocated (by the compiler) @@ -1227,7 +1227,7 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid va_list ap; /* Varargs info */ H5E_t *estack; /* Pointer to error stack to modify */ char *tmp = NULL; /* Buffer to place formatted description in */ - hbool_t va_started = FALSE; /* Whether the variable argument list is open */ + bool va_started = false; /* Whether the variable argument list is open */ herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ @@ -1252,7 +1252,7 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid /* Format the description */ va_start(ap, fmt); - va_started = TRUE; + va_started = true; /* Use the vasprintf() routine, since it does what we're trying to do below */ if (HDvasprintf(&tmp, fmt, ap) < 0) @@ -1373,7 +1373,7 @@ H5E__print2(hid_t err_stack, FILE *stream) } /* end else */ /* Print error stack */ - if (H5E__print(estack, stream, FALSE) < 0) + if (H5E__print(estack, stream, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack"); done: @@ -1528,9 +1528,9 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data) /* Set the automatic error reporting information */ if (func != op.func2_default) - op.is_default = FALSE; + op.is_default = false; else - op.is_default = TRUE; + op.is_default = true; op.vers = 2; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1665,13 +1665,13 @@ H5E__append_stack(H5E_t *dst_stack, const H5E_t *src_stack) dst_error = &(dst_stack->slot[dst_stack->nused]); /* Increment the IDs to indicate that they are used in this stack */ - if (H5I_inc_ref(src_error->cls_id, FALSE) < 0) + if (H5I_inc_ref(src_error->cls_id, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class"); dst_error->cls_id = src_error->cls_id; - if (H5I_inc_ref(src_error->maj_num, FALSE) < 0) + if (H5I_inc_ref(src_error->maj_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error message"); dst_error->maj_num = src_error->maj_num; - if (H5I_inc_ref(src_error->min_num, FALSE) < 0) + if (H5I_inc_ref(src_error->min_num, false) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error message"); dst_error->min_num = src_error->min_num; /* The 'func' & 'file' strings are statically allocated (by the compiler) diff --git a/src/H5EA.c b/src/H5EA.c index 4b0446b..82b7da6 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -63,10 +63,10 @@ typedef herr_t (*H5EA__unprotect_func_t)(void *thing, unsigned cache_flags); /* Local Prototypes */ /********************/ -static herr_t H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, +static herr_t H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, bool will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func); -static H5EA_t *H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata); +static H5EA_t *H5EA__new(H5F_t *f, haddr_t ea_addr, bool from_open, void *ctx_udata); /*********************/ /* Package Variables */ @@ -108,7 +108,7 @@ H5FL_BLK_DEFINE_STATIC(ea_native_elmt); *------------------------------------------------------------------------- */ static H5EA_t * -H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata) +H5EA__new(H5F_t *f, haddr_t ea_addr, bool from_open, void *ctx_udata) { H5EA_t *ea = NULL; /* Pointer to new extensible array */ H5EA_hdr_t *hdr = NULL; /* The extensible array header information */ @@ -190,7 +190,7 @@ H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "can't create extensible array header"); /* Allocate and initialize new extensible array wrapper */ - if (NULL == (ea = H5EA__new(f, ea_addr, FALSE, ctx_udata))) + if (NULL == (ea = H5EA__new(f, ea_addr, false, ctx_udata))) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "allocation and/or initialization failed for extensible array wrapper"); @@ -228,7 +228,7 @@ H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata) assert(H5_addr_defined(ea_addr)); /* Allocate and initialize new extensible array wrapper */ - if (NULL == (ea = H5EA__new(f, ea_addr, TRUE, ctx_udata))) + if (NULL == (ea = H5EA__new(f, ea_addr, true, ctx_udata))) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "allocation and/or initialization failed for extensible array wrapper"); @@ -303,7 +303,7 @@ H5EA_get_addr(const H5EA_t *ea, haddr_t *addr) *------------------------------------------------------------------------- */ static herr_t -H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing, +H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, bool will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func) { @@ -314,8 +314,8 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t H5EA_dblk_page_t *dblk_page = NULL; /* Pointer to data block page for EA */ unsigned iblock_cache_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting index block */ unsigned sblock_cache_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting super block */ - hbool_t stats_changed = FALSE; /* Whether array statistics changed */ - hbool_t hdr_dirty = FALSE; /* Whether the array header changed */ + bool stats_changed = false; /* Whether array statistics changed */ + bool hdr_dirty = false; /* Whether the array header changed */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -347,7 +347,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t hdr->idx_blk_addr = H5EA__iblock_create(hdr, &stats_changed); if (!H5_addr_defined(hdr->idx_blk_addr)) HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL, "unable to create index block"); - hdr_dirty = TRUE; + hdr_dirty = true; } /* end if */ else HGOTO_DONE(SUCCEED); @@ -426,7 +426,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t H5E_EARRAY, H5E_CANTDEPEND, FAIL, "unable to create flush dependency between data block and header, index = %llu", (unsigned long long)idx); - dblock->has_hdr_depend = TRUE; + dblock->has_hdr_depend = true; } /* end if */ /* Set 'thing' info to refer to the data block */ @@ -501,7 +501,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t "unable to create flush dependency between super block and header, address " "= %llu", (unsigned long long)sblock->addr); - sblock->has_hdr_depend = TRUE; + sblock->has_hdr_depend = true; } /* end if */ } /* end if */ else @@ -539,7 +539,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL, "unable to create data block page"); /* Mark data block page as initialized in super block */ - H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM_bit_set(sblock->page_init, page_init_idx, true); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else @@ -559,7 +559,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t "unable to create flush dependency between data block page and header, " "index = %llu", (unsigned long long)idx); - dblk_page->has_hdr_depend = TRUE; + dblk_page->has_hdr_depend = true; } /* end if */ /* Set 'thing' info to refer to the data block page */ @@ -583,7 +583,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t H5E_EARRAY, H5E_CANTDEPEND, FAIL, "unable to create flush dependency between data block and header, index = %llu", (unsigned long long)idx); - dblock->has_hdr_depend = TRUE; + dblock->has_hdr_depend = true; } /* end if */ /* Set 'thing' info to refer to the data block */ @@ -610,7 +610,7 @@ done: /* Check for updating array statistics */ if (stats_changed) - hdr_dirty = TRUE; + hdr_dirty = true; /* Check for header modified */ if (hdr_dirty) @@ -650,7 +650,7 @@ H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt) uint8_t *thing_elmt_buf; /* Pointer to the element buffer for the array metadata */ hsize_t thing_elmt_idx; /* Index of the element in the element buffer for the array metadata */ H5EA__unprotect_func_t thing_unprot_func; /* Function pointer for unprotecting the array metadata */ - hbool_t will_extend; /* Flag indicating if setting the element will extend the array */ + bool will_extend; /* Flag indicating if setting the element will extend the array */ unsigned thing_cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting array metadata */ herr_t ret_value = SUCCEED; @@ -734,7 +734,7 @@ H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt) hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ - if (H5EA__lookup_elmt(ea, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, + if (H5EA__lookup_elmt(ea, idx, false, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to protect array metadata"); @@ -815,7 +815,7 @@ done: herr_t H5EA_close(H5EA_t *ea) { - hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ + bool pending_delete = false; /* Whether the array is pending deletion */ haddr_t ea_addr = HADDR_UNDEF; /* Address of array (for deletion) */ herr_t ret_value = SUCCEED; @@ -839,7 +839,7 @@ H5EA_close(H5EA_t *ea) /* Set local info, so array deletion can occur after decrementing the * header's ref count */ - pending_delete = TRUE; + pending_delete = true; ea_addr = ea->hdr->addr; } /* end if */ } /* end if */ @@ -930,7 +930,7 @@ H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata) /* Check for files using shared array header */ if (hdr->file_rc) - hdr->pending_delete = TRUE; + hdr->pending_delete = true; else { /* Set the shared array header's file context for this operation */ hdr->f = f; diff --git a/src/H5EAcache.c b/src/H5EAcache.c index d482141..36494d3 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -65,7 +65,7 @@ /* Metadata cache (H5AC) callbacks */ static herr_t H5EA__cache_hdr_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5EA__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5EA__cache_hdr_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5EA__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *thing); @@ -73,7 +73,7 @@ static herr_t H5EA__cache_hdr_free_icr(void *thing); static herr_t H5EA__cache_iblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_iblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5EA__cache_iblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5EA__cache_iblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5EA__cache_iblock_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_iblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *thing); @@ -81,7 +81,7 @@ static herr_t H5EA__cache_iblock_free_icr(void *thing); static herr_t H5EA__cache_sblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_sblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5EA__cache_sblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5EA__cache_sblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5EA__cache_sblock_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_sblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *thing); @@ -89,7 +89,7 @@ static herr_t H5EA__cache_sblock_free_icr(void *thing); static herr_t H5EA__cache_dblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_dblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5EA__cache_dblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5EA__cache_dblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5EA__cache_dblock_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); @@ -98,7 +98,7 @@ static herr_t H5EA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5EA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5EA__cache_dblk_page_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *thing); @@ -239,7 +239,7 @@ H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -250,7 +250,7 @@ H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -261,7 +261,7 @@ H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__cache_hdr_verify_chksum() */ @@ -277,7 +277,7 @@ H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5EA_cls_id_t id; /* ID of extensible array class, as found in file */ H5EA_hdr_t *hdr = NULL; /* Extensible array info */ @@ -629,7 +629,7 @@ H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -640,7 +640,7 @@ H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -651,7 +651,7 @@ H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__cache_iblock_verify_chksum() */ @@ -667,7 +667,7 @@ H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN *------------------------------------------------------------------------- */ static void * -H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5EA_iblock_t *iblock = NULL; /* Index block info */ H5EA_hdr_t *hdr = (H5EA_hdr_t *)_udata; /* User data for callback */ @@ -1029,7 +1029,7 @@ H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -1040,7 +1040,7 @@ H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -1051,7 +1051,7 @@ H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__cache_sblock_verify_chksum() */ @@ -1067,7 +1067,7 @@ H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN *------------------------------------------------------------------------- */ static void * -H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5EA_sblock_t *sblock = NULL; /* Super block info */ H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */ @@ -1294,7 +1294,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing) H5E_EARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency between super block and header, address = %llu", (unsigned long long)sblock->addr); - sblock->has_hdr_depend = FALSE; + sblock->has_hdr_depend = false; } /* end if */ break; @@ -1313,7 +1313,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing) H5E_EARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency between super block and header, address = %llu", (unsigned long long)sblock->addr); - sblock->has_hdr_depend = FALSE; + sblock->has_hdr_depend = false; } /* end if */ /* Detach from 'top' proxy for extensible array */ @@ -1435,7 +1435,7 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -1446,7 +1446,7 @@ H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -1457,7 +1457,7 @@ H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__cache_sblock_verify_chksum() */ @@ -1474,7 +1474,7 @@ H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN */ static void * H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5EA_dblock_t *dblock = NULL; /* Data block info */ H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */ @@ -1699,7 +1699,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) H5E_EARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency between direct block and header, address = %llu", (unsigned long long)dblock->addr); - dblock->has_hdr_depend = FALSE; + dblock->has_hdr_depend = false; } /* end if */ break; @@ -1718,7 +1718,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) H5E_EARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency between data block and header, address = %llu", (unsigned long long)dblock->addr); - dblock->has_hdr_depend = FALSE; + dblock->has_hdr_depend = false; } /* end if */ /* Detach from 'top' proxy for extensible array */ @@ -1856,7 +1856,7 @@ H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -1867,7 +1867,7 @@ H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -1878,7 +1878,7 @@ H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__cache_dblk_page_verify_chksum() */ @@ -1894,7 +1894,7 @@ H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR *------------------------------------------------------------------------- */ static void * -H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5EA_dblk_page_t *dblk_page = NULL; /* Data block page info */ H5EA_dblk_page_cache_ud_t *udata = @@ -2069,7 +2069,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) "unable to destroy flush dependency between data block page and header, " "address = %llu", (unsigned long long)dblk_page->addr); - dblk_page->has_hdr_depend = FALSE; + dblk_page->has_hdr_depend = false; } /* end if */ break; @@ -2088,7 +2088,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) "unable to destroy flush dependency between data block page and header, " "address = %llu", (unsigned long long)dblk_page->addr); - dblk_page->has_hdr_depend = FALSE; + dblk_page->has_hdr_depend = false; } /* end if */ /* Detach from 'top' proxy for extensible array */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 3ebbcd7..c13b519 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -131,7 +131,7 @@ herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr) { H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -156,7 +156,7 @@ H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr) /* Cache the new extensible array data block page */ if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, FAIL, "can't add extensible array data block page to cache"); - inserted = TRUE; + inserted = true; /* Add data block page as child of 'top' proxy */ if (hdr->top_proxy) { diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 64b01ed..848985f 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -140,11 +140,11 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts) +H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, bool *stats_changed, hsize_t dblk_off, size_t nelmts) { H5EA_dblock_t *dblock = NULL; /* Extensible array data block */ haddr_t dblock_addr; /* Extensible array data block address */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -182,7 +182,7 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array data block to cache"); - inserted = TRUE; + inserted = true; /* Add data block as child of 'top' proxy */ if (hdr->top_proxy) { @@ -200,7 +200,7 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize hdr->stats.stored.nelmts += nelmts; /* Mark the statistics as changed */ - *stats_changed = TRUE; + *stats_changed = true; /* Set address of data block to return */ ret_value = dblock_addr; diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 1364d7b..348e508 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -333,7 +333,7 @@ haddr_t H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata) { H5EA_hdr_t *hdr = NULL; /* Extensible array header */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -415,7 +415,7 @@ H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata) /* Cache the new extensible array header */ if (H5AC_insert_entry(f, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array header to cache"); - inserted = TRUE; + inserted = true; /* Add header as child of 'top' proxy */ if (hdr->top_proxy) diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 28ffcc3..086d0ad 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -154,11 +154,11 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed) +H5EA__iblock_create(H5EA_hdr_t *hdr, bool *stats_changed) { H5EA_iblock_t *iblock = NULL; /* Extensible array index block */ haddr_t iblock_addr; /* Extensible array index block address */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -209,7 +209,7 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed) if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array index block to cache"); - inserted = TRUE; + inserted = true; /* Add index block as child of 'top' proxy */ if (hdr->top_proxy) { @@ -229,7 +229,7 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed) hdr->stats.stored.nelmts += hdr->cparam.idx_blk_elmts; /* Mark the statistics as changed */ - *stats_changed = TRUE; + *stats_changed = true; /* Set address of index block to return */ ret_value = iblock_addr; diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 5014cc5..90ba02a 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -51,7 +51,7 @@ /* Size of the extensible array header on disk */ #define H5EA_HEADER_SIZE(sizeof_addr, sizeof_size) \ (/* General metadata fields */ \ - H5EA_METADATA_PREFIX_SIZE(TRUE) \ + H5EA_METADATA_PREFIX_SIZE(true) \ \ /* General array information */ \ + 1 /* Element Size */ \ @@ -83,7 +83,7 @@ /* Size of the extensible array index block on disk */ #define H5EA_IBLOCK_SIZE(i) \ (/* General metadata fields */ \ - H5EA_METADATA_PREFIX_SIZE(TRUE) \ + H5EA_METADATA_PREFIX_SIZE(true) \ \ /* Sanity-checking fields */ \ + (i)->hdr->sizeof_addr /* File address of array owning the block */ \ @@ -98,7 +98,7 @@ /* Size of the extensible array super block on disk */ #define H5EA_SBLOCK_SIZE(s) \ (/* General metadata fields */ \ - H5EA_METADATA_PREFIX_SIZE(TRUE) \ + H5EA_METADATA_PREFIX_SIZE(true) \ \ /* Sanity-checking fields */ \ + (s)->hdr->sizeof_addr /* File address of array owning the block */ \ @@ -114,7 +114,7 @@ /* Size of the extensible array data block prefix on disk */ #define H5EA_DBLOCK_PREFIX_SIZE(d) \ (/* General metadata fields */ \ - H5EA_METADATA_PREFIX_SIZE(TRUE) \ + H5EA_METADATA_PREFIX_SIZE(true) \ \ /* Sanity-checking fields */ \ + (d)->hdr->sizeof_addr /* File address of array owning the block */ \ @@ -185,7 +185,7 @@ typedef struct H5EA_hdr_t { size_t size; /* Size of header in file */ H5F_t *f; /* Pointer to file for extensible array */ size_t file_rc; /* Reference count of files using array header */ - hbool_t pending_delete; /* Array is pending deletion */ + bool pending_delete; /* Array is pending deletion */ size_t sizeof_addr; /* Size of file addresses */ size_t sizeof_size; /* Size of file sizes */ unsigned char arr_off_size; /* Size of array offsets (in bytes) */ @@ -201,7 +201,7 @@ typedef struct H5EA_hdr_t { void *cb_ctx; /* Callback context */ /* SWMR / Flush dependency information (not stored) */ - hbool_t swmr_write; /* Flag indicating the file is opened with SWMR-write access */ + bool swmr_write; /* Flag indicating the file is opened with SWMR-write access */ H5AC_proxy_entry_t *top_proxy; /* 'Top' proxy cache entry for all array entries */ void *parent; /* Pointer to 'top' proxy flush dependency * parent, if it exists, otherwise NULL. @@ -263,7 +263,7 @@ typedef struct H5EA_sblock_t { size_t size; /* Size of index block on disk */ /* SWMR / Flush dependency information (not stored) */ - hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */ + bool has_hdr_depend; /* Whether this object has a flush dependency on the header */ H5AC_proxy_entry_t *top_proxy; /* "Top" proxy cache entry for all array entries */ H5EA_iblock_t *parent; /* Parent object for super block (index block) */ @@ -291,7 +291,7 @@ typedef struct H5EA_dblock_t { size_t size; /* Size of data block on disk */ /* SWMR / Flush dependency information (not stored) */ - hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */ + bool has_hdr_depend; /* Whether this object has a flush dependency on the header */ H5AC_proxy_entry_t *top_proxy; /* 'Top' proxy cache entry for all array entries */ void *parent; /* Parent object for data block (index or super block) */ @@ -314,7 +314,7 @@ typedef struct H5EA_dbk_page_t { size_t size; /* Size of data block page on disk */ /* SWMR / Flush dependency information (not stored) */ - hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */ + bool has_hdr_depend; /* Whether this object has a flush dependency on the header */ H5AC_proxy_entry_t *top_proxy; /* "Top" proxy cache entry for all array entries */ H5EA_sblock_t *parent; /* Parent object for data block page (super block) */ @@ -403,7 +403,7 @@ H5_DLL herr_t H5EA__hdr_dest(H5EA_hdr_t *hdr); /* Index block routines */ H5_DLL H5EA_iblock_t *H5EA__iblock_alloc(H5EA_hdr_t *hdr); -H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed); +H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, bool *stats_changed); H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags); H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags); H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr); @@ -411,7 +411,7 @@ H5_DLL herr_t H5EA__iblock_dest(H5EA_iblock_t *iblock); /* Super block routines */ H5_DLL H5EA_sblock_t *H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx); -H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed, +H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, bool *stats_changed, unsigned sblk_idx); H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, unsigned flags); @@ -422,7 +422,7 @@ H5_DLL herr_t H5EA__sblock_dest(H5EA_sblock_t *sblock); /* Data block routines */ H5_DLL H5EA_dblock_t *H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts); -H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off, +H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, bool *stats_changed, hsize_t dblk_off, size_t nelmts); H5_DLL unsigned H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx); H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index aeab902..75dd26a 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -167,12 +167,12 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed, unsigned sblk_idx) +H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, bool *stats_changed, unsigned sblk_idx) { H5EA_sblock_t *sblock = NULL; /* Extensible array super block */ haddr_t sblock_addr; /* Extensible array super block address */ haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill data block addresses with */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -205,7 +205,7 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_chang if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array super block to cache"); - inserted = TRUE; + inserted = true; /* Add super block as child of 'top' proxy */ if (hdr->top_proxy) { @@ -220,7 +220,7 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_chang hdr->stats.stored.super_blk_size += sblock->size; /* Mark the statistics as changed */ - *stats_changed = TRUE; + *stats_changed = true; /* Set address of super block to return */ ret_value = sblock_addr; diff --git a/src/H5ES.c b/src/H5ES.c index 0faedf2..038b719 100644 --- a/src/H5ES.c +++ b/src/H5ES.c @@ -91,7 +91,7 @@ H5EScreate(void) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCREATE, H5I_INVALID_HID, "can't create event set"); /* Register the new event set to get an ID for it */ - if ((ret_value = H5I_register(H5I_EVENTSET, es, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_EVENTSET, es, true)) < 0) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register event set"); done: diff --git a/src/H5ESint.c b/src/H5ESint.c index e148132..7d4ff21 100644 --- a/src/H5ESint.c +++ b/src/H5ESint.c @@ -61,14 +61,14 @@ typedef struct H5ES_wait_ctx_t { H5ES_t *es; /* Event set being operated on */ uint64_t timeout; /* Timeout for wait operation (in ns) */ size_t *num_in_progress; /* Count of # of operations that have not completed */ - hbool_t *op_failed; /* Flag to indicate an operation failed */ + bool *op_failed; /* Flag to indicate an operation failed */ } H5ES_wait_ctx_t; /* Callback context for cancel operations */ typedef struct H5ES_cancel_ctx_t { - H5ES_t *es; /* Event set being operated on */ - size_t *num_not_canceled; /* Count of # of operations were not canceled */ - hbool_t *op_failed; /* Flag to indicate an operation failed */ + H5ES_t *es; /* Event set being operated on */ + size_t *num_not_canceled; /* Count of # of operations were not canceled */ + bool *op_failed; /* Flag to indicate an operation failed */ } H5ES_cancel_ctx_t; /* Callback context for get error info (gei) operations */ @@ -244,7 +244,7 @@ H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app unsigned app_line, const char *caller, const char *api_args) { H5ES_event_t *ev = NULL; /* Event for request */ - hbool_t ev_inserted = FALSE; /* Flag to indicate that event is in active list */ + bool ev_inserted = false; /* Flag to indicate that event is in active list */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -283,7 +283,7 @@ H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app /* Append fully initialized event onto the event set's 'active' list */ H5ES__list_append(&es->active, ev); - ev_inserted = TRUE; + ev_inserted = true; /* Invoke the event set's 'insert' callback, if present */ if (es->ins_func) @@ -322,7 +322,7 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con H5RS_str_t *rs = NULL; /* Ref-counted string to compose formatted argument string in */ const char *api_args; /* Pointer to api_args string from ref-counted string */ va_list ap; /* Varargs for caller */ - hbool_t arg_started = FALSE; /* Whether the va_list has been started */ + bool arg_started = false; /* Whether the va_list has been started */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -343,7 +343,7 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con /* Start working on the API routines arguments */ va_start(ap, caller_args); - arg_started = TRUE; + arg_started = true; /* Copy the app source information */ (void)va_arg(ap, char *); /* Toss the 'app_file' parameter name */ @@ -502,7 +502,7 @@ H5ES__handle_fail(H5ES_t *es, H5ES_event_t *ev) assert(ev); /* Set error flag for event set */ - es->err_occurred = TRUE; + es->err_occurred = true; /* Remove event from normal list */ H5ES__list_remove(&es->active, ev); @@ -643,7 +643,7 @@ H5ES__wait_cb(H5ES_event_t *ev, void *_ctx) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, H5_ITER_ERROR, "unable to release completed event"); /* Record the error */ - *ctx->op_failed = TRUE; + *ctx->op_failed = true; /* Exit from the iteration */ ret_value = H5_ITER_STOP; @@ -690,7 +690,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, hbool_t *op_failed) +H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, bool *op_failed) { H5ES_wait_ctx_t ctx; /* Iterator callback context info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -704,7 +704,7 @@ H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, hbool_t *op_fa /* Set user's parameters to known values */ *num_in_progress = 0; - *op_failed = FALSE; + *op_failed = false; /* Set up context for iterator callbacks */ ctx.es = es; @@ -753,7 +753,7 @@ H5ES__cancel_cb(H5ES_event_t *ev, void *_ctx) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, H5_ITER_ERROR, "unable to handle failed event"); /* Record the error */ - *ctx->op_failed = TRUE; + *ctx->op_failed = true; /* Exit from the iteration */ ret_value = H5_ITER_STOP; @@ -793,7 +793,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed) +H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, bool *op_failed) { H5ES_cancel_ctx_t ctx; /* Iterator callback context info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -807,7 +807,7 @@ H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed) /* Set user's parameters to known values */ *num_not_canceled = 0; - *op_failed = FALSE; + *op_failed = false; /* Set up context for iterator callbacks */ ctx.es = es; diff --git a/src/H5ESpkg.h b/src/H5ESpkg.h index 655efbb..f7c70e8 100644 --- a/src/H5ESpkg.h +++ b/src/H5ESpkg.h @@ -61,7 +61,7 @@ struct H5ES_t { H5ES_event_list_t active; /* List of active events in set */ /* Failed events */ - hbool_t err_occurred; /* Flag for error from an operation */ + bool err_occurred; /* Flag for error from an operation */ H5ES_event_list_t failed; /* List of failed events in set */ }; @@ -77,10 +77,10 @@ typedef int (*H5ES_list_iter_func_t)(H5ES_event_t *ev, void *ctx); /******************************/ H5_DLL H5ES_t *H5ES__create(void); H5_DLL herr_t H5ES__insert_request(H5ES_t *es, H5VL_t *connector, void *token); -H5_DLL herr_t H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, hbool_t *op_failed); +H5_DLL herr_t H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, bool *op_failed); H5_DLL herr_t H5ES__get_requests(H5ES_t *es, H5_iter_order_t order, hid_t *connector_ids, void **requests, size_t array_len); -H5_DLL herr_t H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed); +H5_DLL herr_t H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, bool *op_failed); H5_DLL herr_t H5ES__get_err_info(H5ES_t *es, size_t num_err_info, H5ES_err_info_t err_info[], size_t *num_cleared); diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index bb2954e..d4a2ee9 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -253,7 +253,7 @@ H5Eprint1(FILE *stream) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Print error stack */ - if (H5E__print(estack, stream, TRUE) < 0) + if (H5E__print(estack, stream, true) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack"); done: @@ -381,9 +381,9 @@ H5Eset_auto1(H5E_auto1_t func, void *client_data) /* Set the automatic error reporting information */ auto_op.vers = 1; if (func != auto_op.func1_default) - auto_op.is_default = FALSE; + auto_op.is_default = false; else - auto_op.is_default = TRUE; + auto_op.is_default = true; auto_op.func1 = func; if (H5E__set_auto(estack, &auto_op, client_data) < 0) diff --git a/src/H5Eint.c b/src/H5Eint.c index 9db4e39..b534376 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -396,7 +396,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible) +H5E__print(const H5E_t *estack, FILE *stream, bool bk_compatible) { H5E_print_t eprint; /* Callback information to pass to H5E_walk() */ H5E_walk_op_t walk_op; /* Error stack walking callback */ @@ -457,8 +457,8 @@ done: * CLIENT_DATA pointer passed to H5E_print. * * The function FUNC is also provided for backward compatibility. - * When BK_COMPATIBLE is set to be TRUE, FUNC is used to be - * compatible with older library. If BK_COMPATIBLE is FALSE, + * When BK_COMPATIBLE is set to be true, FUNC is used to be + * compatible with older library. If BK_COMPATIBLE is false, * STACK_FUNC is used. * * Return: SUCCEED/FAIL @@ -623,7 +623,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin { va_list ap; /* Varargs info */ char *tmp = NULL; /* Buffer to place formatted description in */ - hbool_t va_started = FALSE; /* Whether the variable argument list is open */ + bool va_started = false; /* Whether the variable argument list is open */ herr_t ret_value = SUCCEED; /* Return value */ /* @@ -648,7 +648,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin /* Start the variable-argument parsing */ va_start(ap, fmt); - va_started = TRUE; + va_started = true; /* Use the vasprintf() routine, since it does what we're trying to do below */ if (HDvasprintf(&tmp, fmt, ap) < 0) @@ -731,13 +731,13 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line if (estack->nused < H5E_NSLOTS) { /* Increment the IDs to indicate that they are used in this stack */ - if (H5I_inc_ref(cls_id, FALSE) < 0) + if (H5I_inc_ref(cls_id, false) < 0) HGOTO_DONE(FAIL); estack->slot[estack->nused].cls_id = cls_id; - if (H5I_inc_ref(maj_id, FALSE) < 0) + if (H5I_inc_ref(maj_id, false) < 0) HGOTO_DONE(FAIL); estack->slot[estack->nused].maj_num = maj_id; - if (H5I_inc_ref(min_id, FALSE) < 0) + if (H5I_inc_ref(min_id, false) < 0) HGOTO_DONE(FAIL); estack->slot[estack->nused].min_num = min_id; /* The 'func' & 'file' strings are statically allocated (by the compiler) @@ -882,7 +882,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_dump_api_stack(hbool_t is_api) +H5E_dump_api_stack(bool is_api) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Epkg.h b/src/H5Epkg.h index c761179..546e389 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -63,7 +63,7 @@ #ifndef H5_NO_DEPRECATED_SYMBOLS typedef struct { unsigned vers; /* Which version callback to use */ - hbool_t is_default; /* If the printing function is the library's own. */ + bool is_default; /* If the printing function is the library's own. */ H5E_auto1_t func1; /* Old-style callback, NO error stack param. */ H5E_auto2_t func2; /* New-style callback, with error stack param. */ H5E_auto1_t func1_default; /* The saved library's default function - old style. */ @@ -129,7 +129,7 @@ H5_DLL H5E_t *H5E__get_stack(void); H5_DLL herr_t H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL ssize_t H5E__get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type, char *msg, size_t size); -H5_DLL herr_t H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compat); +H5_DLL herr_t H5E__print(const H5E_t *estack, FILE *stream, bool bk_compat); H5_DLL herr_t H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op, void *client_data); H5_DLL herr_t H5E__get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data); diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 9958002..c7e0105 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -41,7 +41,7 @@ typedef struct H5E_t H5E_t; #define HCOMMON_ERROR(maj, min, ...) \ do { \ HERROR(maj, min, __VA_ARGS__); \ - err_occurred = TRUE; \ + err_occurred = true; \ err_occurred = err_occurred; /* Shut GCC warnings up! */ \ } while (0) @@ -188,6 +188,6 @@ H5_DLL herr_t H5E_init(void); H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) H5_ATTR_FORMAT(printf, 8, 9); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); -H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); +H5_DLL herr_t H5E_dump_api_stack(bool is_api); #endif /* H5Eprivate_H */ diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 8db118b..b6cc1cb 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -310,7 +310,7 @@ H5_DLL hid_t H5Eget_current_stack(void); * * \details H5Eappend_stack() appends the messages from error stack * \p src_stack_id to the error stack \p dst_stack_id. - * If \p close_source_stack is \c TRUE, the source error stack + * If \p close_source_stack is \c true, the source error stack * will be closed. * * \since 1.14.0 diff --git a/src/H5F.c b/src/H5F.c index 692331e..e64782f 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -268,19 +268,19 @@ H5Fget_obj_count(hid_t file_id, unsigned types) udata.obj_count = 0; if (types & H5F_OBJ_FILE) - if (H5I_iterate(H5I_FILE, H5F__get_all_count_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_FILE, H5F__get_all_count_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over file IDs failed"); if (types & H5F_OBJ_DATASET) - if (H5I_iterate(H5I_DATASET, H5F__get_all_count_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_DATASET, H5F__get_all_count_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over dataset IDs failed"); if (types & H5F_OBJ_GROUP) - if (H5I_iterate(H5I_GROUP, H5F__get_all_count_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_GROUP, H5F__get_all_count_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over group IDs failed"); if (types & H5F_OBJ_DATATYPE) - if (H5I_iterate(H5I_DATATYPE, H5F__get_all_count_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_DATATYPE, H5F__get_all_count_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over datatype IDs failed"); if (types & H5F_OBJ_ATTR) - if (H5I_iterate(H5I_ATTR, H5F__get_all_count_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_ATTR, H5F__get_all_count_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over attribute IDs failed"); /* Set return value */ @@ -395,19 +395,19 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list / udata.obj_count = 0; if (types & H5F_OBJ_FILE) - if (H5I_iterate(H5I_FILE, H5F__get_all_ids_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_FILE, H5F__get_all_ids_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over file IDs failed"); if (types & H5F_OBJ_DATASET) - if (H5I_iterate(H5I_DATASET, H5F__get_all_ids_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_DATASET, H5F__get_all_ids_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over dataset IDs failed"); if (types & H5F_OBJ_GROUP) - if (H5I_iterate(H5I_GROUP, H5F__get_all_ids_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_GROUP, H5F__get_all_ids_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over group IDs failed"); if (types & H5F_OBJ_DATATYPE) - if (H5I_iterate(H5I_DATATYPE, H5F__get_all_ids_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_DATATYPE, H5F__get_all_ids_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over datatype IDs failed"); if (types & H5F_OBJ_ATTR) - if (H5I_iterate(H5I_ATTR, H5F__get_all_ids_cb, &udata, TRUE) < 0) + if (H5I_iterate(H5I_ATTR, H5F__get_all_ids_cb, &udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, (-1), "iteration over attribute IDs failed"); /* Set return value */ @@ -466,7 +466,7 @@ done: * * Purpose: Check if the file can be opened with the given fapl. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: -1 (includes file does not exist) * *------------------------------------------------------------------------- @@ -475,7 +475,7 @@ htri_t H5Fis_accessible(const char *filename, hid_t fapl_id) { H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */ - hbool_t is_accessible = FALSE; /* Whether file is accessible */ + bool is_accessible = false; /* Whether file is accessible */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -488,7 +488,7 @@ H5Fis_accessible(const char *filename, hid_t fapl_id) /* Check the file access property list */ if (H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + else if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list"); /* Set up VOL callback arguments */ @@ -581,11 +581,11 @@ H5F__create_api_common(const char *filename, unsigned flags, hid_t fcpl_id, hid_ /* Check file creation property list */ if (H5P_DEFAULT == fcpl_id) fcpl_id = H5P_FILE_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) + else if (true != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not file create property list"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get the VOL info from the fapl */ @@ -614,7 +614,7 @@ H5F__create_api_common(const char *filename, unsigned flags, hid_t fcpl_id, hid_ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file"); /* Get an ID for the file */ - if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0) + if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, true)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); done: @@ -775,7 +775,7 @@ H5F__open_api_common(const char *filename, unsigned flags, hid_t fapl_id, void * "SWMR read access on a file open for read-write access is not allowed"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get the VOL info from the fapl */ @@ -796,7 +796,7 @@ H5F__open_api_common(const char *filename, unsigned flags, hid_t fapl_id, void * HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file"); /* Get an ID for the file */ - if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0) + if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, true)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); done: @@ -1139,7 +1139,7 @@ H5Fdelete(const char *filename, hid_t fapl_id) H5P_genplist_t *plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */ - hbool_t is_accessible = FALSE; /* Whether file is accessible */ + bool is_accessible = false; /* Whether file is accessible */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1150,7 +1150,7 @@ H5Fdelete(const char *filename, hid_t fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the VOL info from the fapl */ @@ -1226,7 +1226,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID"); if (H5P_DEFAULT == plist_id) plist_id = H5P_FILE_MOUNT_DEFAULT; - else if (TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) + else if (true != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "plist_id is not a file mount property list ID"); /* Set up collective metadata if appropriate */ @@ -1437,7 +1437,7 @@ H5F__reopen_api_common(hid_t file_id, void **token_ptr) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file"); /* Get an ID for the file */ - if ((ret_value = H5VL_register(H5I_FILE, reopen_file, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_FILE, reopen_file, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); done: diff --git a/src/H5FA.c b/src/H5FA.c index cf4a1d9..d30ea60 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -55,7 +55,7 @@ /********************/ /* Local Prototypes */ /********************/ -static H5FA_t *H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata); +static H5FA_t *H5FA__new(H5F_t *f, haddr_t fa_addr, bool from_open, void *ctx_udata); /*********************/ /* Package Variables */ @@ -97,7 +97,7 @@ H5FL_BLK_DEFINE(fa_native_elmt); *------------------------------------------------------------------------- */ static H5FA_t * -H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata) +H5FA__new(H5F_t *f, haddr_t fa_addr, bool from_open, void *ctx_udata) { H5FA_t *fa = NULL; /* Pointer to new fixed array */ H5FA_hdr_t *hdr = NULL; /* The fixed array header information */ @@ -178,7 +178,7 @@ H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "can't create fixed array header"); /* Allocate and initialize new fixed array wrapper */ - if (NULL == (fa = H5FA__new(f, fa_addr, FALSE, ctx_udata))) + if (NULL == (fa = H5FA__new(f, fa_addr, false, ctx_udata))) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "allocation and/or initialization failed for fixed array wrapper"); @@ -216,7 +216,7 @@ H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata) assert(H5_addr_defined(fa_addr)); /* Allocate and initialize new fixed array wrapper */ - if (NULL == (fa = H5FA__new(f, fa_addr, TRUE, ctx_udata))) + if (NULL == (fa = H5FA__new(f, fa_addr, true, ctx_udata))) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "allocation and/or initialization failed for fixed array wrapper"); @@ -297,9 +297,9 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt) H5FA_dblk_page_t *dblk_page = NULL; /* Pointer to fixed array Data block page */ unsigned dblock_cache_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting fixed array Data block */ unsigned dblk_page_cache_flags = - H5AC__NO_FLAGS_SET; /* Flags to unprotecting FIxed Array Data block page */ - hbool_t hdr_dirty = FALSE; /* Whether header information changed */ - herr_t ret_value = SUCCEED; + H5AC__NO_FLAGS_SET; /* Flags to unprotecting FIxed Array Data block page */ + bool hdr_dirty = false; /* Whether header information changed */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -360,7 +360,7 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt) HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, FAIL, "unable to create data block page"); /* Mark data block page as initialized in data block */ - H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM_bit_set(dblock->dblk_page_init, page_idx, true); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -505,7 +505,7 @@ done: herr_t H5FA_close(H5FA_t *fa) { - hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ + bool pending_delete = false; /* Whether the array is pending deletion */ haddr_t fa_addr = HADDR_UNDEF; /* Address of array (for deletion) */ herr_t ret_value = SUCCEED; @@ -529,7 +529,7 @@ H5FA_close(H5FA_t *fa) /* Set local info, so array deletion can occur after decrementing the * header's ref count */ - pending_delete = TRUE; + pending_delete = true; fa_addr = fa->hdr->addr; } /* end if */ } /* end if */ @@ -620,7 +620,7 @@ H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata) /* Check for files using shared array header */ if (hdr->file_rc) - hdr->pending_delete = TRUE; + hdr->pending_delete = true; else { /* Set the shared array header's file context for this operation */ hdr->f = f; diff --git a/src/H5FAcache.c b/src/H5FAcache.c index d614360..6d9e22e 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -63,7 +63,7 @@ /* Metadata cache (H5AC) callbacks */ static herr_t H5FA__cache_hdr_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FA__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5FA__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5FA__cache_hdr_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5FA__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5FA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *thing); @@ -71,7 +71,7 @@ static herr_t H5FA__cache_hdr_free_icr(void *thing); static herr_t H5FA__cache_dblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FA__cache_dblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5FA__cache_dblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5FA__cache_dblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5FA__cache_dblock_image_len(const void *thing, size_t *image_len); static herr_t H5FA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); @@ -80,7 +80,7 @@ static herr_t H5FA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5FA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5FA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5FA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5FA__cache_dblk_page_image_len(const void *thing, size_t *image_len); static herr_t H5FA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *thing); @@ -185,7 +185,7 @@ H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -196,7 +196,7 @@ H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -207,7 +207,7 @@ H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FA__cache_hdr_verify_chksum() */ @@ -224,7 +224,7 @@ H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE */ static void * H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5FA_cls_id_t id; /* ID of fixed array class, as found in file */ H5FA_hdr_t *hdr = NULL; /* Fixed array info */ @@ -568,7 +568,7 @@ H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -579,7 +579,7 @@ H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -590,7 +590,7 @@ H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FA__cache_dblock_verify_chksum() */ @@ -607,7 +607,7 @@ H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN */ static void * H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5FA_dblock_t *dblock = NULL; /* Data block info */ H5FA_dblock_cache_ud_t *udata = (H5FA_dblock_cache_ud_t *)_udata; /* User data for loading data block */ @@ -970,7 +970,7 @@ H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -981,7 +981,7 @@ H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -992,7 +992,7 @@ H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FA__cache_dblk_page_verify_chksum() */ @@ -1008,7 +1008,7 @@ H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR *------------------------------------------------------------------------- */ static void * -H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5FA_dblk_page_t *dblk_page = NULL; /* Data block page info */ H5FA_dblk_page_cache_ud_t *udata = diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index d51f31a..89f346d 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -134,7 +134,7 @@ herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts) { H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -166,7 +166,7 @@ H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts) /* Cache the new fixed array data block page */ if (H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, FAIL, "can't add fixed array data block page to cache"); - inserted = TRUE; + inserted = true; /* Add data block page as child of 'top' proxy */ if (hdr->top_proxy) { diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index e8cff4f..558d9bf 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -167,11 +167,11 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty) +H5FA__dblock_create(H5FA_hdr_t *hdr, bool *hdr_dirty) { H5FA_dblock_t *dblock = NULL; /* Fixed array data block */ haddr_t dblock_addr; /* Fixed array data block address */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -204,7 +204,7 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty) /* Cache the new fixed array data block */ if (H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add fixed array data block to cache"); - inserted = TRUE; + inserted = true; /* Add data block as child of 'top' proxy */ if (hdr->top_proxy) { @@ -215,7 +215,7 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty) } /* end if */ /* Mark the header dirty (for updating statistics) */ - *hdr_dirty = TRUE; + *hdr_dirty = true; /* Set address of data block to return */ ret_value = dblock_addr; diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 37d3e39..cfe5001 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -162,7 +162,7 @@ haddr_t H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata) { H5FA_hdr_t *hdr = NULL; /* Fixed array header */ - hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ + bool inserted = false; /* Whether the header was inserted into cache */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_PACKAGE @@ -210,7 +210,7 @@ H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata) /* Cache the new Fixed Array header */ if (H5AC_insert_entry(f, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add fixed array header to cache"); - inserted = TRUE; + inserted = true; /* Add header as child of 'top' proxy */ if (hdr->top_proxy) diff --git a/src/H5FApkg.h b/src/H5FApkg.h index c08e575..9c00171 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -55,7 +55,7 @@ /* Size of the Fixed Array header on disk */ #define H5FA_HEADER_SIZE(sizeof_addr, sizeof_size) \ (/* General metadata fields */ \ - H5FA_METADATA_PREFIX_SIZE(TRUE) \ + H5FA_METADATA_PREFIX_SIZE(true) \ \ /* General array information */ \ + 1 /* Element Size */ \ @@ -78,7 +78,7 @@ /* Size of the Fixed Array data block prefix on disk */ #define H5FA_DBLOCK_PREFIX_SIZE(d) \ (/* General metadata fields */ \ - H5FA_METADATA_PREFIX_SIZE(TRUE) \ + H5FA_METADATA_PREFIX_SIZE(true) \ \ /* Sanity-checking fields */ \ + (d)->hdr->sizeof_addr /* File address of Fixed Array header owning the data block */ \ @@ -128,7 +128,7 @@ typedef struct H5FA_hdr_t { size_t size; /* Size of header in file */ H5F_t *f; /* Pointer to file for fixed array */ size_t file_rc; /* Reference count of files using array header */ - hbool_t pending_delete; /* Array is pending deletion */ + bool pending_delete; /* Array is pending deletion */ size_t sizeof_addr; /* Size of file addresses */ size_t sizeof_size; /* Size of file sizes */ @@ -136,7 +136,7 @@ typedef struct H5FA_hdr_t { void *cb_ctx; /* Callback context */ /* SWMR / Flush dependency information (not stored) */ - hbool_t swmr_write; /* Flag indicating the file is opened with SWMR-write access */ + bool swmr_write; /* Flag indicating the file is opened with SWMR-write access */ H5AC_proxy_entry_t *top_proxy; /* 'Top' proxy cache entry for all array entries */ void *parent; /* Pointer to 'top' proxy flush dependency * parent, if it exists, otherwise NULL. @@ -269,7 +269,7 @@ H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr); /* Data block routines */ H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr); -H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty); +H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, bool *hdr_dirty); H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx); H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags); H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags); diff --git a/src/H5FD.c b/src/H5FD.c index e2c32c6..b3dddd8 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -139,7 +139,7 @@ H5FD_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_VFL) > 0) { - (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); + (void)H5I_clear_type(H5I_VFL, false, false); n++; /*H5I*/ } /* end if */ else { @@ -231,7 +231,7 @@ H5FDregister(const H5FD_class_t *cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid free-list mapping"); /* Create the new class ID */ - if ((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) + if ((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID"); done: @@ -255,7 +255,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5FD_register(const void *_cls, size_t size, hbool_t app_ref) +H5FD_register(const void *_cls, size_t size, bool app_ref) { const H5FD_class_t *cls = (const H5FD_class_t *)_cls; H5FD_class_t *saved = NULL; @@ -307,7 +307,7 @@ done: htri_t H5FDis_driver_registered_by_name(const char *driver_name) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "*s", driver_name); @@ -335,7 +335,7 @@ done: htri_t H5FDis_driver_registered_by_value(H5FD_class_value_t driver_value) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_API(FAIL) H5TRACE1("t", "DV", driver_value); @@ -413,7 +413,7 @@ H5FD_get_class(hid_t id) if (NULL == (plist = (H5P_genplist_t *)H5I_object(id))) HGOTO_ERROR(H5E_ID, H5E_BADID, NULL, "can't find object for ID"); - if (TRUE == H5P_isa_class(id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(id, H5P_FILE_ACCESS)) { H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) @@ -695,7 +695,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Check arguments */ if (H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + else if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); /* Call private function */ @@ -775,7 +775,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) * driver ID to prevent it from being freed while this file is open. */ file->driver_id = driver_prop.driver_id; - if (H5I_inc_ref(file->driver_id, FALSE) < 0) + if (H5I_inc_ref(file->driver_id, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver"); file->cls = driver; file->maxaddr = maxaddr; @@ -1080,7 +1080,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request"); if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list"); /* Set DXPL for operation */ @@ -1128,7 +1128,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type"); if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); /* Set DXPL for operation */ @@ -1419,7 +1419,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); /* Set DXPL for operation */ @@ -1465,7 +1465,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); /* Set DXPL for operation */ @@ -1542,7 +1542,7 @@ H5FDread_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1616,7 +1616,7 @@ H5FDwrite_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[] dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1714,7 +1714,7 @@ H5FDread_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count, dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1811,7 +1811,7 @@ H5FDwrite_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1915,7 +1915,7 @@ H5FDread_vector_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2013,7 +2013,7 @@ H5FDwrite_vector_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2111,7 +2111,7 @@ H5FDread_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t c dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2208,7 +2208,7 @@ H5FDwrite_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2248,7 +2248,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); /* Set DXPL for operation */ @@ -2272,7 +2272,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_flush(H5FD_t *file, hbool_t closing) +H5FD_flush(H5FD_t *file, bool closing) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2314,7 +2314,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL"); if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); /* Set DXPL for operation */ @@ -2338,7 +2338,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_truncate(H5FD_t *file, hbool_t closing) +H5FD_truncate(H5FD_t *file, bool closing) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2397,7 +2397,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_lock(H5FD_t *file, hbool_t rw) +H5FD_lock(H5FD_t *file, bool rw) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2624,7 +2624,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL"); if (!file->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL"); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fapl_id parameter is not a file access property list"); if (!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle parameter cannot be NULL"); @@ -2729,7 +2729,7 @@ H5FD_get_base_addr(const H5FD_t *file) *-------------------------------------------------------------------------- */ herr_t -H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) +H5FD_set_paged_aggr(H5FD_t *file, bool paged) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2800,7 +2800,7 @@ H5FDdelete(const char *filename, hid_t fapl_id) if (H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + else if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); /* Call private function */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a48a314..b54b1f1 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -52,10 +52,10 @@ typedef struct H5FD_core_t { haddr_t eoa; /* end of allocated region */ haddr_t eof; /* current allocated size */ size_t increment; /* multiples for mem allocation */ - hbool_t backing_store; /* write to file name on flush */ - hbool_t write_tracking; /* Whether to track writes */ + bool backing_store; /* write to file name on flush */ + bool write_tracking; /* Whether to track writes */ size_t bstore_page_size; /* backing store page size */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; int fd; /* backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ #ifndef H5_HAVE_WIN32_API @@ -85,22 +85,22 @@ typedef struct H5FD_core_t { HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ - hbool_t dirty; /* changes not saved? */ + bool dirty; /* changes not saved? */ H5FD_file_image_callbacks_t fi_callbacks; /* file image callbacks */ H5SL_t *dirty_list; /* dirty parts of the file */ } H5FD_core_t; /* Driver-specific file access properties */ typedef struct H5FD_core_fapl_t { - size_t increment; /* how much to grow memory */ - hbool_t backing_store; /* write to file name on flush */ - hbool_t write_tracking; /* Whether to track writes */ - size_t page_size; /* Page size for tracked writes */ + size_t increment; /* how much to grow memory */ + bool backing_store; /* write to file name on flush */ + bool write_tracking; /* Whether to track writes */ + size_t page_size; /* Page size for tracked writes */ } H5FD_core_fapl_t; /* Allocate memory in multiples of this size by default */ #define H5FD_CORE_INCREMENT 8192 -#define H5FD_CORE_WRITE_TRACKING_FLAG FALSE +#define H5FD_CORE_WRITE_TRACKING_FLAG false #define H5FD_CORE_WRITE_TRACKING_PAGE_SIZE 524288 /* These macros check for overflow of various quantities. These macros @@ -140,9 +140,9 @@ static herr_t H5FD__core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha void *buf); static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__core_lock(H5FD_t *_file, bool rw); static herr_t H5FD__core_unlock(H5FD_t *_file); static herr_t H5FD__core_delete(const char *filename, hid_t fapl_id); static inline const H5FD_core_fapl_t *H5FD__core_get_default_config(void); @@ -192,8 +192,8 @@ static const H5FD_class_t H5FD_core_g = { /* Default configurations, if none provided */ static const H5FD_core_fapl_t H5FD_core_default_config_g = { - (size_t)H5_MB, TRUE, H5FD_CORE_WRITE_TRACKING_FLAG, H5FD_CORE_WRITE_TRACKING_PAGE_SIZE}; -static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {(size_t)H5_MB, TRUE, TRUE, (size_t)4096}; + (size_t)H5_MB, true, H5FD_CORE_WRITE_TRACKING_FLAG, H5FD_CORE_WRITE_TRACKING_PAGE_SIZE}; +static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {(size_t)H5_MB, true, true, (size_t)4096}; /* Define a free list to manage the region type */ H5FL_DEFINE(H5FD_core_region_t); @@ -216,7 +216,7 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) H5FD_core_region_t *item = NULL; haddr_t b_addr = 0; haddr_t a_addr = 0; - hbool_t create_new_node = TRUE; + bool create_new_node = true; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -257,7 +257,7 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) /* We won't need to insert a new node since we can * just update an existing one instead. */ - create_new_node = FALSE; + create_new_node = false; } /* end if */ /* Remove any old nodes that are no longer needed */ @@ -464,14 +464,14 @@ H5FD_core_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) - ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) - ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + ignore_disabled_file_locks_s = false; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ if (H5I_VFL != H5I_get_type(H5FD_CORE_g)) - H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), FALSE); + H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_CORE_g; @@ -683,7 +683,7 @@ H5FD__core_fapl_get(H5FD_t *_file) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); fa->increment = file->increment; - fa->backing_store = (hbool_t)(file->fd >= 0); + fa->backing_store = (bool)(file->fd >= 0); fa->write_tracking = file->write_tracking; fa->page_size = file->bstore_page_size; @@ -927,14 +927,14 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Set up write tracking if the backing store is on */ file->dirty_list = NULL; if (fa->backing_store) { - hbool_t use_write_tracking = FALSE; /* what we're actually doing */ + bool use_write_tracking = false; /* what we're actually doing */ /* default is to have write tracking OFF for create (hence the check to see * if the user explicitly set a page size) and ON with the default page size * on open (when not read-only). */ /* Only use write tracking if the file is open for writing */ - use_write_tracking = (TRUE == fa->write_tracking) /* user asked for write tracking */ + use_write_tracking = (true == fa->write_tracking) /* user asked for write tracking */ && !(o_flags & O_RDONLY) /* file is open for writing (i.e. not read-only) */ && (file->bstore_page_size != 0); /* page size is not zero */ @@ -977,7 +977,7 @@ H5FD__core_close(H5FD_t *_file) FUNC_ENTER_PACKAGE /* Flush any changed buffers */ - if (H5FD__core_flush(_file, (hid_t)-1, TRUE) < 0) + if (H5FD__core_flush(_file, (hid_t)-1, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush core vfd backing store"); /* Destroy the dirty region list */ @@ -1238,7 +1238,7 @@ H5FD__core_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle) * library) QAK - 2009/12/04 */ if (H5P_exist_plist(plist, H5F_ACS_WANT_POSIX_FD_NAME) > 0) { - hbool_t want_posix_fd; /* Setting for retrieving file descriptor from core VFD */ + bool want_posix_fd; /* Setting for retrieving file descriptor from core VFD */ /* Get property */ if (H5P_get(plist, H5F_ACS_WANT_POSIX_FD_NAME, &want_posix_fd) < 0) @@ -1396,7 +1396,7 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN H5MM_memcpy(file->mem + addr, buf, size); /* Mark memory buffer as modified */ - file->dirty = TRUE; + file->dirty = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1413,7 +1413,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_core_t *file = (H5FD_core_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1453,7 +1453,7 @@ H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UN HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store"); } /* end else */ - file->dirty = FALSE; + file->dirty = false; } done: @@ -1493,7 +1493,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_core_t *file = (H5FD_core_t *)_file; size_t new_eof; /* New size of memory buffer */ @@ -1584,15 +1584,15 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD__core_lock(H5FD_t *_file, hbool_t rw) +H5FD__core_lock(H5FD_t *_file, bool rw) { H5FD_core_t *file = (H5FD_core_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ diff --git a/src/H5FDcore.h b/src/H5FDcore.h index e4d792b..235d6fc 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -48,15 +48,15 @@ H5_DLL hid_t H5FD_core_init(void); * be increased each time more memory is required. * * While using H5Fcreate() to create a core file, if the \p - * backing_store is set to 1 (TRUE), the file contents are flushed to a + * backing_store is set to 1 (true), the file contents are flushed to a * file with the same name as this core file when the file is closed or * access to the file is terminated in memory. * * The application is allowed to open an existing file with #H5FD_CORE * driver. While using H5Fopen() to open an existing file, if the \p - * backing_store is set to 1 (TRUE) and the \c flags for H5Fopen() is set to + * backing_store is set to 1 (true) and the \c flags for H5Fopen() is set to * #H5F_ACC_RDWR, any change to the file contents are saved to the file - * when the file is closed. If \p backing_store is set to 0 (FALSE) and the \c + * when the file is closed. If \p backing_store is set to 0 (false) and the \c * flags for H5Fopen() is set to #H5F_ACC_RDWR, any change to the file * contents will be lost when the file is closed. If the flags for * H5Fopen() is set to #H5F_ACC_RDONLY, no change to the file is diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 30a3c90..8e90b8b 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -43,10 +43,10 @@ static htri_t ignore_disabled_file_locks_s = FAIL; /* Driver-specific file access properties */ typedef struct H5FD_direct_fapl_t { - size_t mboundary; /* Memory boundary for alignment */ - size_t fbsize; /* File system block size */ - size_t cbsize; /* Maximal buffer size for copying user data */ - hbool_t must_align; /* Decides if data alignment is required */ + size_t mboundary; /* Memory boundary for alignment */ + size_t fbsize; /* File system block size */ + size_t cbsize; /* Maximal buffer size for copying user data */ + bool must_align; /* Decides if data alignment is required */ } H5FD_direct_fapl_t; /* @@ -69,7 +69,7 @@ typedef struct H5FD_direct_t { haddr_t pos; /*current file I/O position */ int op; /*last operation */ H5FD_direct_fapl_t fa; /*file access properties */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; #ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely @@ -132,8 +132,8 @@ static herr_t H5FD__direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, void *buf); static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__direct_lock(H5FD_t *_file, bool rw); static herr_t H5FD__direct_unlock(H5FD_t *_file); static herr_t H5FD__direct_delete(const char *filename, hid_t fapl_id); @@ -205,14 +205,14 @@ H5FD_direct_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) - ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) - ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + ignore_disabled_file_locks_s = false; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ if (H5I_VFL != H5I_get_type(H5FD_DIRECT_g)) { - H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g, sizeof(H5FD_class_t), FALSE); + H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g, sizeof(H5FD_class_t), false); if (H5I_INVALID_HID == H5FD_DIRECT_g) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register direct"); } @@ -354,7 +354,7 @@ H5FD__direct_populate_config(size_t boundary, size_t block_size, size_t cbuf_siz fa_out->cbsize = CBSIZE_DEF; /* Set the default to be true for data alignment */ - fa_out->must_align = TRUE; + fa_out->must_align = true; /* Copy buffer size must be a multiple of file block size */ if (fa_out->cbsize % fa_out->fbsize != 0) @@ -537,10 +537,10 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad if (HDwrite(file->fd, buf2, file->fa.fbsize) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O"); else - file->fa.must_align = TRUE; + file->fa.must_align = true; } else { - file->fa.must_align = FALSE; + file->fa.must_align = false; if (-1 == HDftruncate(file->fd, (HDoff_t)0)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") } @@ -550,19 +550,19 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad if (HDread(file->fd, buf2, file->fa.fbsize) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O"); else - file->fa.must_align = TRUE; + file->fa.must_align = true; } else { if (o_flags & O_RDWR) { if (HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") if (HDwrite(file->fd, buf1, sizeof(int)) < 0) - file->fa.must_align = TRUE; + file->fa.must_align = true; else - file->fa.must_align = FALSE; + file->fa.must_align = false; } else - file->fa.must_align = FALSE; + file->fa.must_align = false; } } @@ -821,7 +821,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U { H5FD_direct_t *file = (H5FD_direct_t *)_file; ssize_t nbytes; - hbool_t _must_align = TRUE; + bool _must_align = true; herr_t ret_value = SUCCEED; /* Return value */ size_t alloc_size; void *copy_buf = NULL, *p2; @@ -998,7 +998,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ { H5FD_direct_t *file = (H5FD_direct_t *)_file; ssize_t nbytes; - hbool_t _must_align = TRUE; + bool _must_align = true; herr_t ret_value = SUCCEED; /* Return value */ size_t alloc_size; void *copy_buf = NULL, *p1; @@ -1218,7 +1218,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_direct_t *file = (H5FD_direct_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1271,15 +1271,15 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD__direct_lock(H5FD_t *_file, hbool_t rw) +H5FD__direct_lock(H5FD_t *_file, bool rw) { H5FD_direct_t *file = (H5FD_direct_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 8d1ed48..828cdcc 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -63,11 +63,11 @@ typedef struct H5FD_family_t { unsigned flags; /*flags for opening additional members */ /* Information from properties set by 'h5repart' tool */ - hsize_t mem_newsize; /*new member size passed in as private - * property. It's used only by h5repart */ - hbool_t repart_members; /* Whether to mark the superblock dirty - * when it is loaded, so that the family - * member sizes can be re-encoded */ + hsize_t mem_newsize; /*new member size passed in as private + * property. It's used only by h5repart */ + bool repart_members; /* Whether to mark the superblock dirty + * when it is loaded, so that the family + * member sizes can be re-encoded */ } H5FD_family_t; /* Driver-specific file access properties */ @@ -100,9 +100,9 @@ static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, void *_buf /*out*/); static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf); -static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__family_lock(H5FD_t *_file, bool rw); static herr_t H5FD__family_unlock(H5FD_t *_file); static herr_t H5FD__family_delete(const char *filename, hid_t fapl_id); @@ -180,11 +180,11 @@ H5FD__family_get_default_config(H5FD_family_fapl_t *fa_out) */ if (NULL == (def_plist = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - if ((fa_out->memb_fapl_id = H5P_copy_plist(def_plist, FALSE)) < 0) + if ((fa_out->memb_fapl_id = H5P_copy_plist(def_plist, false)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy property list"); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fa_out->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, TRUE) < 0) + if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, true) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set default driver on member FAPL"); done: @@ -285,7 +285,7 @@ H5FD_family_init(void) FUNC_ENTER_NOAPI_NOERR if (H5I_VFL != H5I_get_type(H5FD_FAMILY_g)) - H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE); + H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_FAMILY_g; @@ -339,14 +339,14 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) H5TRACE3("e", "ihi", fapl_id, msize, memb_fapl_id); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5P_DEFAULT == memb_fapl_id) { /* Get default configuration for member FAPL */ if (H5FD__family_get_default_config(&fa) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get default driver configuration info"); } - else if (TRUE != H5P_isa_class(memb_fapl_id, H5P_FILE_ACCESS)) + else if (true != H5P_isa_class(memb_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); /* Initialize driver specific information. */ @@ -395,7 +395,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize /*out*/, hid_t *memb_fapl_id /* if (memb_fapl_id) { if (NULL == (plist = (H5P_genplist_t *)H5I_object(fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); - *memb_fapl_id = H5P_copy_plist(plist, TRUE); + *memb_fapl_id = H5P_copy_plist(plist, true); } /* end if */ done: @@ -430,7 +430,7 @@ H5FD__family_fapl_get(H5FD_t *_file) fa->memb_size = file->memb_size; if (NULL == (plist = (H5P_genplist_t *)H5I_object(file->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); - fa->memb_fapl_id = H5P_copy_plist(plist, FALSE); + fa->memb_fapl_id = H5P_copy_plist(plist, false); /* Set return value */ ret_value = fa; @@ -472,13 +472,13 @@ H5FD__family_fapl_copy(const void *_old_fa) /* Deep copy the property list objects in the structure */ if (old_fa->memb_fapl_id == H5P_FILE_ACCESS_DEFAULT) { - if (H5I_inc_ref(new_fa->memb_fapl_id, FALSE) < 0) + if (H5I_inc_ref(new_fa->memb_fapl_id, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver"); } /* end if */ else { if (NULL == (plist = (H5P_genplist_t *)H5I_object(old_fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); - new_fa->memb_fapl_id = H5P_copy_plist(plist, FALSE); + new_fa->memb_fapl_id = H5P_copy_plist(plist, false); } /* end else */ /* Set return value */ @@ -659,7 +659,7 @@ H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad H5FD_family_t *file = NULL; char *memb_name = NULL, *temp = NULL; hsize_t eof = HADDR_UNDEF; - hbool_t default_config = FALSE; + bool default_config = false; unsigned t_flags = flags & ~H5F_ACC_CREAT; H5FD_t *ret_value = NULL; @@ -686,7 +686,7 @@ H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad file->pmem_size = H5FD_FAM_DEF_MEM_SIZE; /* Member size passed in through property */ file->mem_newsize = 0; /*New member size used by h5repart only */ - default_config = TRUE; + default_config = true; } /* end if */ else { H5P_genplist_t *plist; /* Property list pointer */ @@ -699,7 +699,7 @@ H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad if (H5FD__family_get_default_config(&default_fa) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get default family VFD configuration"); fa = &default_fa; - default_config = TRUE; + default_config = true; } /* Check for new family file size. It's used by h5repart only. */ @@ -709,18 +709,18 @@ H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get new family member size"); /* Set flag for later */ - file->repart_members = TRUE; + file->repart_members = true; } /* end if */ if (fa->memb_fapl_id == H5P_FILE_ACCESS_DEFAULT) { - if (H5I_inc_ref(fa->memb_fapl_id, FALSE) < 0) + if (H5I_inc_ref(fa->memb_fapl_id, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver"); file->memb_fapl_id = fa->memb_fapl_id; } /* end if */ else { if (NULL == (plist = (H5P_genplist_t *)H5I_object(fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); - file->memb_fapl_id = H5P_copy_plist(plist, FALSE); + file->memb_fapl_id = H5P_copy_plist(plist, false); } /* end else */ file->memb_size = fa->memb_size; /* Actual member size to be updated later */ file->pmem_size = fa->memb_size; /* Member size passed in through property */ @@ -1279,7 +1279,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_family_t *file = (H5FD_family_t *)_file; unsigned u, nerrors = 0; @@ -1310,7 +1310,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_family_t *file = (H5FD_family_t *)_file; unsigned u, nerrors = 0; @@ -1334,15 +1334,15 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD__family_lock(H5FD_t *_file, hbool_t rw) +H5FD__family_lock(H5FD_t *_file, bool rw) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ @@ -1417,7 +1417,7 @@ H5FD__family_delete(const char *filename, hid_t fapl_id) H5P_genplist_t *plist; const H5FD_family_fapl_t *fa; H5FD_family_fapl_t default_fa = {0, H5I_INVALID_HID}; - hbool_t default_config = FALSE; + bool default_config = false; hid_t memb_fapl_id = H5I_INVALID_HID; unsigned current_member; char *member_name = NULL; @@ -1436,7 +1436,7 @@ H5FD__family_delete(const char *filename, hid_t fapl_id) if (H5FD__family_get_default_config(&default_fa) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get default family VFD configuration"); memb_fapl_id = default_fa.memb_fapl_id; - default_config = TRUE; + default_config = true; } else { if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -1445,7 +1445,7 @@ H5FD__family_delete(const char *filename, hid_t fapl_id) if (H5FD__family_get_default_config(&default_fa) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get default family VFD configuration"); fa = &default_fa; - default_config = TRUE; + default_config = true; } memb_fapl_id = fa->memb_fapl_id; } diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 7dcd194..d73aa26 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -257,7 +257,7 @@ static herr_t H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha void *buf); static herr_t H5FD__hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); static herr_t H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t *fa); @@ -333,7 +333,7 @@ H5FD_hdfs_init(void) #endif if (H5I_VFL != H5I_get_type(H5FD_HDFS_g)) - H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE); + H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g, sizeof(H5FD_class_t), false); #if HDFS_STATS /* pre-compute statsbin boundaries @@ -1528,8 +1528,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; diff --git a/src/H5FDint.c b/src/H5FDint.c index fcc1b6c..20be6ed 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -353,9 +353,9 @@ herr_t H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], void *bufs[] /* out */) { - hbool_t addrs_cooked = FALSE; - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool addrs_cooked = false; + bool extend_sizes = false; + bool extend_types = false; uint32_t i; size_t size = 0; H5FD_mem_t type = H5FD_MEM_DEFAULT; @@ -401,7 +401,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs addrs[i] += file->base_addr; } - addrs_cooked = TRUE; + addrs_cooked = true; } /* If the file is open for SWMR read access, allow access to data past @@ -413,8 +413,8 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if ((!(file->access_flags & H5F_ACC_SWMR_READ)) && (count > 0)) { haddr_t eoa; - extend_sizes = FALSE; - extend_types = FALSE; + extend_sizes = false; + extend_types = false; for (i = 0; i < count; i++) { @@ -422,7 +422,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if (sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[i - 1]; } else { @@ -435,7 +435,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if (types[i] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[i - 1]; } else { @@ -468,8 +468,8 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* otherwise, implement the vector read as a sequence of regular * read calls. */ - extend_sizes = FALSE; - extend_types = FALSE; + extend_sizes = false; + extend_types = false; uint32_t no_selection_io_cause; for (i = 0; i < count; i++) { @@ -482,7 +482,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if (sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[i - 1]; } else { @@ -495,7 +495,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if (types[i] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[i - 1]; } else { @@ -567,9 +567,9 @@ herr_t H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], const void *bufs[]) { - hbool_t addrs_cooked = FALSE; - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool addrs_cooked = false; + bool extend_sizes = false; + bool extend_types = false; uint32_t i; size_t size = 0; H5FD_mem_t type = H5FD_MEM_DEFAULT; @@ -615,11 +615,11 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr addrs[i] += file->base_addr; } - addrs_cooked = TRUE; + addrs_cooked = true; } - extend_sizes = FALSE; - extend_types = FALSE; + extend_sizes = false; + extend_types = false; for (i = 0; i < count; i++) { @@ -627,7 +627,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[i - 1]; } else { @@ -640,7 +640,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (types[i] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[i - 1]; } else { @@ -672,8 +672,8 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* otherwise, implement the vector write as a sequence of regular * write calls. */ - extend_sizes = FALSE; - extend_types = FALSE; + extend_sizes = false; + extend_types = false; uint32_t no_selection_io_cause; for (i = 0; i < count; i++) { @@ -686,7 +686,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[i - 1]; } else { @@ -699,7 +699,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (types[i] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[i - 1]; } else { @@ -754,12 +754,12 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t uint32_t count, H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */) { - hbool_t extend_sizes = FALSE; - hbool_t extend_bufs = FALSE; + bool extend_sizes = false; + bool extend_bufs = false; uint32_t i; size_t element_size = 0; void *buf = NULL; - hbool_t use_vector = FALSE; + bool use_vector = false; haddr_t addrs_local[H5FD_LOCAL_VECTOR_LEN]; haddr_t *addrs = addrs_local; size_t sizes_local[H5FD_LOCAL_VECTOR_LEN]; @@ -780,8 +780,8 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t size_t seq_nelem; H5S_sel_iter_t *file_iter = NULL; H5S_sel_iter_t *mem_iter = NULL; - hbool_t file_iter_init = FALSE; - hbool_t mem_iter_init = FALSE; + bool file_iter_init = false; + bool mem_iter_init = false; H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; size_t vec_arr_nalloc = H5FD_LOCAL_VECTOR_LEN; size_t vec_arr_nused = 0; @@ -824,7 +824,7 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t if (element_sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; element_size = element_sizes[i - 1]; } else { @@ -837,7 +837,7 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t if (bufs[i] == NULL) { - extend_bufs = TRUE; + extend_bufs = true; buf = bufs[i - 1]; } else { @@ -849,10 +849,10 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t /* Initialize sequence lists for memory and file spaces */ if (H5S_select_iter_init(file_iter, file_spaces[i], element_size, 0) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize sequence list for file space"); - file_iter_init = TRUE; + file_iter_init = true; if (H5S_select_iter_init(mem_iter, mem_spaces[i], element_size, 0) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize sequence list for memory space"); - mem_iter_init = TRUE; + mem_iter_init = true; /* Get the number of elements in selection */ if ((hss_nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(file_spaces[i])) < 0) @@ -988,10 +988,10 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t /* Terminate iterators */ if (H5S_SELECT_ITER_RELEASE(file_iter) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't release file selection iterator"); - file_iter_init = FALSE; + file_iter_init = false; if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't release memory selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } /* Issue vector read call if appropriate */ @@ -1082,7 +1082,7 @@ herr_t H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */) { - hbool_t offsets_cooked = FALSE; + bool offsets_cooked = false; hid_t mem_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN]; hid_t *mem_space_ids = mem_space_ids_local; hid_t file_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN]; @@ -1131,7 +1131,7 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s offsets[i] += file->base_addr; } - offsets_cooked = TRUE; + offsets_cooked = true; } /* If the file is open for SWMR read access, allow access to data past @@ -1172,10 +1172,10 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s /* Create IDs for all dataspaces */ for (; num_spaces < count; num_spaces++) { - if ((mem_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, mem_spaces[num_spaces], TRUE)) < 0) + if ((mem_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, mem_spaces[num_spaces], true)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - if ((file_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, file_spaces[num_spaces], TRUE)) < + if ((file_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, file_spaces[num_spaces], true)) < 0) { if (NULL == H5I_remove(mem_space_ids[num_spaces])) HDONE_ERROR(H5E_VFL, H5E_CANTREMOVE, FAIL, "problem removing id"); @@ -1254,7 +1254,7 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */) { - hbool_t offsets_cooked = FALSE; + bool offsets_cooked = false; H5S_t *mem_spaces_local[H5FD_LOCAL_SEL_ARR_LEN]; H5S_t **mem_spaces = mem_spaces_local; H5S_t *file_spaces_local[H5FD_LOCAL_SEL_ARR_LEN]; @@ -1307,7 +1307,7 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t offsets[i] += file->base_addr; } - offsets_cooked = TRUE; + offsets_cooked = true; } /* If the file is open for SWMR read access, allow access to data past @@ -1411,12 +1411,12 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ uint32_t count, H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], const void *bufs[]) { - hbool_t extend_sizes = FALSE; - hbool_t extend_bufs = FALSE; + bool extend_sizes = false; + bool extend_bufs = false; uint32_t i; size_t element_size = 0; const void *buf = NULL; - hbool_t use_vector = FALSE; + bool use_vector = false; haddr_t addrs_local[H5FD_LOCAL_VECTOR_LEN]; haddr_t *addrs = addrs_local; size_t sizes_local[H5FD_LOCAL_VECTOR_LEN]; @@ -1437,8 +1437,8 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ size_t seq_nelem; H5S_sel_iter_t *file_iter = NULL; H5S_sel_iter_t *mem_iter = NULL; - hbool_t file_iter_init = FALSE; - hbool_t mem_iter_init = FALSE; + bool file_iter_init = false; + bool mem_iter_init = false; H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; size_t vec_arr_nalloc = H5FD_LOCAL_VECTOR_LEN; size_t vec_arr_nused = 0; @@ -1481,7 +1481,7 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ if (element_sizes[i] == 0) { - extend_sizes = TRUE; + extend_sizes = true; element_size = element_sizes[i - 1]; } else { @@ -1494,7 +1494,7 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ if (bufs[i] == NULL) { - extend_bufs = TRUE; + extend_bufs = true; buf = bufs[i - 1]; } else { @@ -1506,10 +1506,10 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ /* Initialize sequence lists for memory and file spaces */ if (H5S_select_iter_init(file_iter, file_spaces[i], element_size, 0) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize sequence list for file space"); - file_iter_init = TRUE; + file_iter_init = true; if (H5S_select_iter_init(mem_iter, mem_spaces[i], element_size, 0) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize sequence list for memory space"); - mem_iter_init = TRUE; + mem_iter_init = true; /* Get the number of elements in selection */ if ((hss_nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(file_spaces[i])) < 0) @@ -1645,10 +1645,10 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ /* Terminate iterators */ if (H5S_SELECT_ITER_RELEASE(file_iter) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't release file selection iterator"); - file_iter_init = FALSE; + file_iter_init = false; if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't release memory selection iterator"); - mem_iter_init = FALSE; + mem_iter_init = false; } /* Issue vector write call if appropriate */ @@ -1737,7 +1737,7 @@ herr_t H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], const void *bufs[]) { - hbool_t offsets_cooked = FALSE; + bool offsets_cooked = false; hid_t mem_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN]; hid_t *mem_space_ids = mem_space_ids_local; hid_t file_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN]; @@ -1786,7 +1786,7 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ offsets[i] += file->base_addr; } - offsets_cooked = TRUE; + offsets_cooked = true; } /* For now at least, only check that the offset is not past the eoa, since @@ -1821,10 +1821,10 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ /* Create IDs for all dataspaces */ for (; num_spaces < count; num_spaces++) { - if ((mem_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, mem_spaces[num_spaces], TRUE)) < 0) + if ((mem_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, mem_spaces[num_spaces], true)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - if ((file_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, file_spaces[num_spaces], TRUE)) < + if ((file_space_ids[num_spaces] = H5I_register(H5I_DATASPACE, file_spaces[num_spaces], true)) < 0) { if (NULL == H5I_remove(mem_space_ids[num_spaces])) HDONE_ERROR(H5E_VFL, H5E_CANTREMOVE, FAIL, "problem removing id"); @@ -1902,7 +1902,7 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], const void *bufs[]) { - hbool_t offsets_cooked = FALSE; + bool offsets_cooked = false; H5S_t *mem_spaces_local[H5FD_LOCAL_SEL_ARR_LEN]; H5S_t **mem_spaces = mem_spaces_local; H5S_t *file_spaces_local[H5FD_LOCAL_SEL_ARR_LEN]; @@ -1955,7 +1955,7 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ offsets[i] += file->base_addr; } - offsets_cooked = TRUE; + offsets_cooked = true; } /* For now at least, only check that the offset is not past the eoa, since @@ -2410,7 +2410,7 @@ H5FD__srt_tmp_cmp(const void *element_1, const void *element_2) * * Purpose: Scan the addrs array to see if it is sorted. * - * If sorted, return TRUE in *was_sorted. + * If sorted, return true in *was_sorted. * * If not sorted, use qsort() to sort the array. * Do this by allocating an array of struct H5FD_srt_tmp_t, @@ -2418,10 +2418,10 @@ H5FD__srt_tmp_cmp(const void *element_1, const void *element_2) * addr and index. Load the array with the contents of the * addrs array and the index of the associated entry. * Then sort the array using qsort(). - * Return *FALSE in was_sorted. + * Return *false in was_sorted. * * This is a common routine used by: - * --H5FD_sort_vector_io_req () + * --H5FD_sort_vector_io_req() * --H5FD_sort_selection_io_req() * * Return: SUCCEED/FAIL @@ -2429,7 +2429,7 @@ H5FD__srt_tmp_cmp(const void *element_1, const void *element_2) *------------------------------------------------------------------------- */ static herr_t -H5FD__sort_io_req_real(size_t count, haddr_t *addrs, hbool_t *was_sorted, struct H5FD_srt_tmp_t **srt_tmp) +H5FD__sort_io_req_real(size_t count, haddr_t *addrs, bool *was_sorted, struct H5FD_srt_tmp_t **srt_tmp) { size_t i; herr_t ret_value = SUCCEED; /* Return value */ @@ -2451,9 +2451,9 @@ H5FD__sort_io_req_real(size_t count, haddr_t *addrs, hbool_t *was_sorted, struct /* if we traversed the entire array without breaking out, then * the array was already sorted */ if (i >= count) - *was_sorted = TRUE; + *was_sorted = true; else - *was_sorted = FALSE; + *was_sorted = false; if (!(*was_sorted)) { size_t srt_tmp_size; @@ -2494,7 +2494,7 @@ done: * Purpose: Determine whether the supplied vector I/O request is * sorted. * - * if is is, set *vector_was_sorted to TRUE, set: + * if is is, set *vector_was_sorted to true, set: * * *s_types_ptr = types * *s_addrs_ptr = addrs @@ -2520,7 +2520,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t types[], haddr_t addrs[], +H5FD_sort_vector_io_req(bool *vector_was_sorted, uint32_t _count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], H5FD_mem_t **s_types_ptr, haddr_t **s_addrs_ptr, size_t **s_sizes_ptr, H5_flexible_const_ptr_t **s_bufs_ptr) { @@ -2667,7 +2667,7 @@ done: * Purpose: Determine whether the supplied selection I/O request is * sorted. * - * if is is, set *selection_was_sorted to TRUE, set: + * if is is, set *selection_was_sorted to true, set: * * *s_mem_space_ids_ptr = mem_space_ids; * *s_file_space_ids_ptr = file_space_ids; @@ -2693,7 +2693,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_sort_selection_io_req(hbool_t *selection_was_sorted, size_t count, hid_t mem_space_ids[], +H5FD_sort_selection_io_req(bool *selection_was_sorted, size_t count, hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], H5_flexible_const_ptr_t bufs[], hid_t **s_mem_space_ids_ptr, hid_t **s_file_space_ids_ptr, haddr_t **s_offsets_ptr, @@ -2897,7 +2897,7 @@ done: * * Note: Matching the driver's name / value, but the driver having * an incompatible version is not an error, but means that the - * driver isn't a "match". Setting the SUCCEED value to FALSE + * driver isn't a "match". Setting the SUCCEED value to false * and not failing for that case allows the plugin framework * to keep looking for other DLLs that match and have a * compatible version. @@ -2907,7 +2907,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, hbool_t *success) +H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, bool *success) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2922,7 +2922,7 @@ H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, hbool_t * if (key->vfd.kind == H5FD_GET_DRIVER_BY_NAME) { /* Check if plugin name matches VFD class name */ if (cls->name && !HDstrcmp(cls->name, key->vfd.u.name)) - *success = TRUE; + *success = true; } else { /* Sanity check */ @@ -2930,7 +2930,7 @@ H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, hbool_t * /* Check if plugin value matches VFD class value */ if (cls->value == key->vfd.u.value) - *success = TRUE; + *success = true; } FUNC_LEAVE_NOAPI(ret_value) @@ -2987,9 +2987,9 @@ H5FD__get_driver_cb(void *obj, hid_t id, void *_op_data) *------------------------------------------------------------------------- */ hid_t -H5FD_register_driver_by_name(const char *name, hbool_t app_ref) +H5FD_register_driver_by_name(const char *name, bool app_ref) { - htri_t driver_is_registered = FALSE; + htri_t driver_is_registered = false; hid_t driver_id = H5I_INVALID_HID; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3041,9 +3041,9 @@ done: *------------------------------------------------------------------------- */ hid_t -H5FD_register_driver_by_value(H5FD_class_value_t value, hbool_t app_ref) +H5FD_register_driver_by_value(H5FD_class_value_t value, bool app_ref) { - htri_t driver_is_registered = FALSE; + htri_t driver_is_registered = false; hid_t driver_id = H5I_INVALID_HID; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3099,7 +3099,7 @@ htri_t H5FD_is_driver_registered_by_name(const char *driver_name, hid_t *registered_id) { H5FD_get_driver_ud_t op_data; /* Callback info for driver search */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3109,14 +3109,14 @@ H5FD_is_driver_registered_by_name(const char *driver_name, hid_t *registered_id) op_data.found_id = H5I_INVALID_HID; /* Find driver with name */ - if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, FALSE) < 0) + if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADITER, FAIL, "can't iterate over VFDs"); /* Found a driver with that name */ if (op_data.found_id != H5I_INVALID_HID) { if (registered_id) *registered_id = op_data.found_id; - ret_value = TRUE; + ret_value = true; } done: @@ -3141,7 +3141,7 @@ htri_t H5FD_is_driver_registered_by_value(H5FD_class_value_t driver_value, hid_t *registered_id) { H5FD_get_driver_ud_t op_data; /* Callback info for driver search */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3151,14 +3151,14 @@ H5FD_is_driver_registered_by_value(H5FD_class_value_t driver_value, hid_t *regis op_data.found_id = H5I_INVALID_HID; /* Find driver with value */ - if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, FALSE) < 0) + if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADITER, FAIL, "can't iterate over VFDs"); /* Found a driver with that value */ if (op_data.found_id != H5I_INVALID_HID) { if (registered_id) *registered_id = op_data.found_id; - ret_value = TRUE; + ret_value = true; } done: @@ -3177,7 +3177,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5FD_get_driver_id_by_name(const char *name, hbool_t is_api) +H5FD_get_driver_id_by_name(const char *name, bool is_api) { H5FD_get_driver_ud_t op_data; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3190,7 +3190,7 @@ H5FD_get_driver_id_by_name(const char *name, hbool_t is_api) op_data.found_id = H5I_INVALID_HID; /* Find driver with specified name */ - if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, FALSE) < 0) + if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VFL drivers"); /* Found a driver with that name */ @@ -3216,7 +3216,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5FD_get_driver_id_by_value(H5FD_class_value_t value, hbool_t is_api) +H5FD_get_driver_id_by_value(H5FD_class_value_t value, bool is_api) { H5FD_get_driver_ud_t op_data; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3229,7 +3229,7 @@ H5FD_get_driver_id_by_value(H5FD_class_value_t value, hbool_t is_api) op_data.found_id = H5I_INVALID_HID; /* Find driver with specified value */ - if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, FALSE) < 0) + if (H5I_iterate(H5I_VFL, H5FD__get_driver_cb, &op_data, false) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VFL drivers"); /* Found a driver with that value */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 660f266..b6efd98 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -73,7 +73,7 @@ typedef struct H5FD_log_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -111,7 +111,7 @@ typedef struct H5FD_log_t { * Whether to eliminate the family driver info and convert this file to * a single file */ - hbool_t fam_to_single; + bool fam_to_single; /* Fields for tracking I/O operations */ unsigned char *nread; /* Number of reads from a file location */ @@ -170,8 +170,8 @@ static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, had void *buf); static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__log_lock(H5FD_t *_file, bool rw); static herr_t H5FD__log_unlock(H5FD_t *_file); static herr_t H5FD__log_delete(const char *filename, hid_t fapl_id); @@ -246,14 +246,14 @@ H5FD_log_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) - ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) - ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + ignore_disabled_file_locks_s = false; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ if (H5I_VFL != H5I_get_type(H5FD_LOG_g)) - H5FD_LOG_g = H5FD_register(&H5FD_log_g, sizeof(H5FD_class_t), FALSE); + H5FD_LOG_g = H5FD_register(&H5FD_log_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_LOG_g; @@ -1536,7 +1536,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1641,7 +1641,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__log_lock(H5FD_t *_file, hbool_t rw) +H5FD__log_lock(H5FD_t *_file, bool rw) { H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 1130fac..ee10483 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -153,8 +153,8 @@ static herr_t H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, const void *buf); static herr_t H5FD__mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__mirror_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__mirror_lock(H5FD_t *_file, bool rw); static herr_t H5FD__mirror_unlock(H5FD_t *_file); static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file); @@ -231,7 +231,7 @@ H5FD_mirror_init(void) LOG_OP_CALL(__func__); if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) { - H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE); + H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), false); if (H5I_INVALID_HID == H5FD_MIRROR_g) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register mirror"); } @@ -330,7 +330,7 @@ H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) * * --------------------------------------------------------------------------- */ -static hbool_t +static bool is_host_little_endian(void) { union { @@ -340,9 +340,9 @@ is_host_little_endian(void) echeck.u32 = 0xA1B2C3D4; if (echeck.u8[0] == 0xD4) - return TRUE; + return true; else - return FALSE; + return false; } /* end is_host_little_endian() */ /* --------------------------------------------------------------------------- @@ -370,7 +370,7 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) assert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); - if (TRUE == is_host_little_endian()) + if (true == is_host_little_endian()) *out = BSWAP_64(n); else *out = n; @@ -476,7 +476,7 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) assert(_dest); - if (TRUE == is_host_little_endian()) + if (true == is_host_little_endian()) n = BSWAP_64(v); H5MM_memcpy(_dest, &n, sizeof(n)); @@ -935,20 +935,20 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_ * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) - return TRUE; + if ((true == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_close() */ /* --------------------------------------------------------------------------- @@ -958,20 +958,20 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) - return TRUE; + if ((true == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_lock() */ /* --------------------------------------------------------------------------- @@ -981,21 +981,21 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) + if ((true == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) - return TRUE; + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_open() */ /* --------------------------------------------------------------------------- @@ -1005,20 +1005,20 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) - return TRUE; + if ((true == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_eoa() */ /* --------------------------------------------------------------------------- @@ -1028,20 +1028,20 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) - return TRUE; + if ((true == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_reply() */ /* --------------------------------------------------------------------------- @@ -1051,20 +1051,20 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) * * Checks header validity and op code. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) { LOG_OP_CALL(__func__); assert(xmit); - if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) - return TRUE; + if ((true == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) + return true; - return FALSE; + return false; } /* end H5FD_mirror_xmit_is_write() */ /* --------------------------------------------------------------------------- @@ -1074,10 +1074,10 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) * * Checks magic number and structure version. * - * Return: TRUE if valid; else FALSE. + * Return: true if valid; else false. * --------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) { LOG_OP_CALL(__func__); @@ -1085,9 +1085,9 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) assert(xmit); if ((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version)) - return FALSE; + return false; - return TRUE; + return true; } /* end H5FD_mirror_xmit_is_xmit() */ /* ---------------------------------------------------------------------------- @@ -1130,7 +1130,7 @@ H5FD__mirror_verify_reply(H5FD_mirror_t *file) if (H5FD_mirror_xmit_decode_reply(&reply, xmit_buf) != H5FD_MIRROR_XMIT_REPLY_SIZE) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unable to decode reply xmit"); - if (H5FD_mirror_xmit_is_reply(&reply) != TRUE) + if (H5FD_mirror_xmit_is_reply(&reply) != true) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "xmit op code was not REPLY"); if (reply.pub.session_token != file->xmit.session_token) @@ -1777,7 +1777,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; @@ -1817,14 +1817,14 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static herr_t -H5FD__mirror_lock(H5FD_t *_file, hbool_t rw) +H5FD__mirror_lock(H5FD_t *_file, bool rw) { H5FD_mirror_xmit_lock_t xmit_lock; unsigned char *xmit_buf = NULL; diff --git a/src/H5FDmirror_priv.h b/src/H5FDmirror_priv.h index f647c21..693d4eb 100644 --- a/src/H5FDmirror_priv.h +++ b/src/H5FDmirror_priv.h @@ -148,7 +148,7 @@ typedef struct H5FD_mirror_xmit_eoa_t { * * `rw` (uint64_t) * The Read/Write mode flag passed into H5FDlock(). - * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit? + * (Natively `bool`, an 'int') TODO: native int may be 64-bit? * * --------------------------------------------------------------------------- */ @@ -300,13 +300,13 @@ H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirr H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x); H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x); -H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); +H5_DLL bool H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); #ifdef __cplusplus } diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 9b5f4e8..127740e 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -214,7 +214,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off /*out*/) *------------------------------------------------------------------------- */ herr_t -H5FD_mpi_get_file_sync_required(H5FD_t *file, hbool_t *file_sync_required) +H5FD_mpi_get_file_sync_required(H5FD_t *file, bool *file_sync_required) { const H5FD_class_t *cls; uint64_t flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index aa83be4..b7cadb7 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -38,10 +38,10 @@ static hid_t H5FD_MPIO_g = 0; /* Whether to allow collective I/O operations */ /* (Can be changed by setting "HDF5_MPI_OPT_TYPES" environment variable to '0' or '1') */ -hbool_t H5FD_mpi_opt_types_g = TRUE; +hbool_t H5FD_mpi_opt_types_g = true; /* Whether the driver initialized MPI on its own */ -static hbool_t H5FD_mpi_self_initialized = FALSE; +static bool H5FD_mpi_self_initialized = false; /* * The view is set to this value @@ -65,7 +65,7 @@ typedef struct H5FD_mpio_t { haddr_t eoa; /* End-of-address marker */ haddr_t last_eoa; /* Last known end-of-address marker */ haddr_t local_eof; /* Local end-of-file address for each process */ - hbool_t mpi_file_sync_required; /* Whether the ROMIO driver requires MPI_File_sync after write */ + bool mpi_file_sync_required; /* Whether the ROMIO driver requires MPI_File_sync after write */ } H5FD_mpio_t; /* Private Prototypes */ @@ -97,25 +97,27 @@ static herr_t H5FD__mpio_write_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H size_t count, hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], const void *bufs[]); -static herr_t H5FD__mpio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__mpio_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); static herr_t H5FD__mpio_delete(const char *filename, hid_t fapl_id); static herr_t H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, void **output); /* Other functions */ -static herr_t H5FD__mpio_vector_build_types( - uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], - haddr_t *s_addrs[], size_t *s_sizes[], H5_flexible_const_ptr_t *s_bufs[], hbool_t *vector_was_sorted, - MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, int *size_i, MPI_Datatype *buf_type, - hbool_t *buf_type_created, MPI_Datatype *file_type, hbool_t *file_type_created, char *unused); - -static herr_t H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_const_ptr_t mbb, +static herr_t H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], + size_t sizes[], H5_flexible_const_ptr_t bufs[], + haddr_t *s_addrs[], size_t *s_sizes[], + H5_flexible_const_ptr_t *s_bufs[], bool *vector_was_sorted, + MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, + int *size_i, MPI_Datatype *buf_type, bool *buf_type_created, + MPI_Datatype *file_type, bool *file_type_created, char *unused); + +static herr_t H5FD__selection_build_types(bool io_op_write, size_t num_pieces, H5_flexible_const_ptr_t mbb, H5S_t **file_spaces, H5S_t **mem_spaces, haddr_t offsets[], H5_flexible_const_ptr_t bufs[], size_t src_element_sizes[], size_t dst_element_sizes[], MPI_Datatype *final_ftype, - hbool_t *final_ftype_is_derived, MPI_Datatype *final_mtype, - hbool_t *final_mtype_is_derived); + bool *final_ftype_is_derived, MPI_Datatype *final_mtype, + bool *final_mtype_is_derived); /* The MPIO file driver information */ static const H5FD_class_t H5FD_mpio_g = { @@ -275,7 +277,7 @@ H5FD_mpio_init(void) /* Register the MPI-IO VFD, if it isn't already */ if (H5I_VFL != H5I_get_type(H5FD_MPIO_g)) { - H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_t), FALSE); + H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_t), false); /* Check if MPI driver has been loaded dynamically */ env = HDgetenv(HDF5_DRIVER); @@ -288,7 +290,7 @@ H5FD_mpio_init(void) if (!mpi_initialized) { if (MPI_SUCCESS != MPI_Init(NULL, NULL)) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, "can't initialize MPI"); - H5FD_mpi_self_initialized = TRUE; + H5FD_mpi_self_initialized = true; } } } @@ -299,7 +301,7 @@ H5FD_mpio_init(void) /* Allow MPI buf-and-file-type optimizations? */ s = HDgetenv("HDF5_MPI_OPT_TYPES"); if (s && isdigit(*s)) - H5FD_mpi_opt_types_g = (0 == strtol(s, NULL, 0)) ? FALSE : TRUE; + H5FD_mpi_opt_types_g = (0 == strtol(s, NULL, 0)) ? false : true; #ifdef H5FDmpio_DEBUG /* Clear the flag buffer */ @@ -343,7 +345,7 @@ H5FD__mpio_term(void) if (!mpi_finalized) MPI_Finalize(); - H5FD_mpi_self_initialized = FALSE; + H5FD_mpi_self_initialized = false; } /* Reset VFL ID */ @@ -719,11 +721,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag) +H5FD_set_mpio_atomicity(H5FD_t *_file, bool flag) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; @@ -736,7 +738,7 @@ H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag) #endif /* set atomicity value */ - if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, (int)(flag != FALSE)))) + if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, (int)(flag != false)))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_atomicity", mpi_code) done: @@ -758,12 +760,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag) +H5FD_get_mpio_atomicity(H5FD_t *_file, bool *flag) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; int temp_flag; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; @@ -780,9 +782,9 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag) HMPI_GOTO_ERROR(FAIL, "MPI_File_get_atomicity", mpi_code) if (0 != temp_flag) - *flag = TRUE; + *flag = true; else - *flag = FALSE; + *flag = false; done: #ifdef H5FDmpio_DEBUG @@ -817,13 +819,13 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR MPI_Info info = MPI_INFO_NULL; /* MPI Info, from plist */ MPI_Info info_used; /* MPI Info returned from MPI_File_open */ MPI_File fh; /* MPI file handle */ - hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */ + bool file_opened = false; /* Flag to indicate that the file was successfully opened */ int mpi_amode; /* MPI file access flags */ int mpi_rank = INT_MAX; /* MPI rank of this process */ int mpi_size; /* Total number of MPI processes */ MPI_Offset file_size; /* File size (of existing files) */ #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = FALSE; + bool H5FD_mpio_debug_t_flag = false; #endif int mpi_code; /* MPI return code */ H5FD_t *ret_value = NULL; /* Return value */ @@ -881,7 +883,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR if (MPI_SUCCESS != (mpi_code = MPI_File_open(comm, name, mpi_amode, info, &fh))) HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mpi_code) - file_opened = TRUE; + file_opened = true; /* Get the MPI-IO hints that actually used by MPI-IO underneath. */ if (MPI_SUCCESS != (mpi_code = MPI_File_get_info(fh, &info_used))) @@ -1013,8 +1015,8 @@ H5FD__mpio_close(H5FD_t *_file) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - int mpi_rank = file->mpi_rank; + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + int mpi_rank = file->mpi_rank; #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1231,12 +1233,12 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU int io_size; /* Actual number of bytes requested */ int n; #endif - hbool_t use_view_this_time = FALSE; - hbool_t derived_type = FALSE; - hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */ + bool use_view_this_time = false; + bool derived_type = false; + bool rank0_bcast = false; /* If read-with-rank0-and-bcast flag was used */ #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; @@ -1279,7 +1281,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU MPI_Datatype file_type; /* Remember that views are used */ - use_view_this_time = TRUE; + use_view_this_time = true; /* Prepare for a full-blown xfer using btype, ftype, and disp */ if (H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) @@ -1323,7 +1325,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU fprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", __func__, file->mpi_rank); #endif /* Indicate path we've taken */ - rank0_bcast = TRUE; + rank0_bcast = true; /* Read on rank 0 Bcast to other ranks */ if (file->mpi_rank == 0) { @@ -1374,7 +1376,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &buf_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - derived_type = TRUE; + derived_type = true; size_i = 1; } @@ -1498,12 +1500,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h int io_size; /* Actual number of bytes requested */ #endif int size_i; - hbool_t use_view_this_time = FALSE; - hbool_t derived_type = FALSE; + bool use_view_this_time = false; + bool derived_type = false; H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */ #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; @@ -1545,7 +1547,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h MPI_Datatype file_type; /* Remember that views are used */ - use_view_this_time = TRUE; + use_view_this_time = true; /* Prepare for a full-blown xfer using btype, ftype, and disp */ if (H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) @@ -1625,7 +1627,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &buf_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - derived_type = TRUE; + derived_type = true; size_i = 1; } @@ -1706,13 +1708,13 @@ done: static herr_t H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], haddr_t *s_addrs[], size_t *s_sizes[], - H5_flexible_const_ptr_t *s_bufs[], hbool_t *vector_was_sorted, - MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, int *size_i, - MPI_Datatype *buf_type, hbool_t *buf_type_created, MPI_Datatype *file_type, - hbool_t *file_type_created, char *unused) + H5_flexible_const_ptr_t *s_bufs[], bool *vector_was_sorted, MPI_Offset *mpi_off, + H5_flexible_const_ptr_t *mpi_bufs_base, int *size_i, MPI_Datatype *buf_type, + bool *buf_type_created, MPI_Datatype *file_type, bool *file_type_created, + char *unused) { hsize_t bigio_count; /* Transition point to create derived type */ - hbool_t fixed_size = FALSE; + bool fixed_size = false; size_t size; H5FD_mem_t *s_types = NULL; int *mpi_block_lengths = NULL; @@ -1774,11 +1776,11 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (H5_mpio_create_large_type(sizes[0], 0, MPI_BYTE, buf_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - *buf_type_created = TRUE; + *buf_type_created = true; if (H5_mpio_create_large_type(sizes[0], 0, MPI_BYTE, file_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - *file_type_created = TRUE; + *file_type_created = true; *size_i = 1; } @@ -1831,7 +1833,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ *size_i = 1; - fixed_size = FALSE; + fixed_size = false; /* load the mpi_block_lengths and mpi_displacements arrays */ for (i = 0; i < (int)count; i++) { @@ -1839,7 +1841,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (!fixed_size) { if ((*s_sizes)[i] == 0) { assert(vector_was_sorted); - fixed_size = TRUE; + fixed_size = true; size = sizes[i - 1]; } else { @@ -1891,7 +1893,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* Create type for large block */ if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &sub_types[i]) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - sub_types_created[i] = TRUE; + sub_types_created[i] = true; /* Only one of these large types for this vector element */ mpi_block_lengths[i] = 1; @@ -1910,7 +1912,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ MPI_BYTE, buf_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed for buf_type failed", mpi_code) - *buf_type_created = TRUE; + *buf_type_created = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(buf_type))) @@ -1926,7 +1928,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ mpi_displacements, MPI_BYTE, file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed for file_type failed", mpi_code) - *file_type_created = TRUE; + *file_type_created = true; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(file_type))) @@ -2066,16 +2068,16 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou haddr_t addrs[], size_t sizes[], void *bufs[]) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - hbool_t vector_was_sorted = TRUE; + bool vector_was_sorted = true; haddr_t *s_addrs = NULL; size_t *s_sizes = NULL; void **s_bufs = NULL; char unused = 0; /* Unused, except for non-NULL pointer value */ void *mpi_bufs_base = NULL; MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ - hbool_t buf_type_created = FALSE; + bool buf_type_created = false; MPI_Datatype file_type = MPI_BYTE; /* MPI description of the selection in file */ - hbool_t file_type_created = FALSE; + bool file_type_created = false; int i; int mpi_code; /* MPI return code */ MPI_Offset mpi_off = 0; @@ -2094,10 +2096,10 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou int io_size; /* Actual number of bytes requested */ int n; #endif - hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */ + bool rank0_bcast = false; /* If read-with-rank0-and-bcast flag was used */ #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif herr_t ret_value = SUCCEED; @@ -2189,7 +2191,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou fprintf(stdout, "%s: doing read-rank0-and-MPI_Bcast\n", __func__); #endif /* Indicate path we've taken */ - rank0_bcast = TRUE; + rank0_bcast = true; /* Read on rank 0 Bcast to other ranks */ if (file->mpi_rank == 0) @@ -2291,7 +2293,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou } else if (count > 0) { haddr_t max_addr = HADDR_MAX; - hbool_t fixed_size = FALSE; + bool fixed_size = false; size_t size; /* The read is part of an independent operation. As a result, @@ -2322,7 +2324,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou /* Calculate I/O size */ if (!fixed_size) { if (sizes[i] == 0) { - fixed_size = TRUE; + fixed_size = true; size = sizes[i - 1]; } else { @@ -2342,7 +2344,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &buf_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - buf_type_created = TRUE; + buf_type_created = true; size_i = 1; } @@ -2466,16 +2468,16 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co haddr_t addrs[], size_t sizes[], const void *bufs[]) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - hbool_t vector_was_sorted = TRUE; + bool vector_was_sorted = true; haddr_t *s_addrs = NULL; size_t *s_sizes = NULL; const void **s_bufs = NULL; char unused = 0; /* Unused, except for non-NULL pointer value */ const void *mpi_bufs_base = NULL; MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ - hbool_t buf_type_created = FALSE; + bool buf_type_created = false; MPI_Datatype file_type = MPI_BYTE; /* MPI description of the selection in file */ - hbool_t file_type_created = FALSE; + bool file_type_created = false; int i; int mpi_code; /* MPI return code */ MPI_Offset mpi_off = 0; @@ -2484,8 +2486,8 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co H5FD_mpio_collective_opt_t coll_opt_mode; /* whether we are doing collective or independent I/O */ int size_i; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif haddr_t max_addr = 0; herr_t ret_value = SUCCEED; @@ -2616,8 +2618,8 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } else if (count > 0) { - hbool_t fixed_size = FALSE; - size_t size; + bool fixed_size = false; + size_t size; /* The read is part of an independent operation. As a result, * we can't use MPI_File_set_view() (since it it a collective operation), @@ -2647,7 +2649,7 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co /* Calculate I/O size */ if (!fixed_size) { if (sizes[i] == 0) { - fixed_size = TRUE; + fixed_size = true; size = sizes[i - 1]; } else { @@ -2667,7 +2669,7 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &buf_type) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "can't create MPI-I/O datatype"); - buf_type_created = TRUE; + buf_type_created = true; size_i = 1; } @@ -2746,22 +2748,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_const_ptr_t mbb, +H5FD__selection_build_types(bool io_op_write, size_t num_pieces, H5_flexible_const_ptr_t mbb, H5S_t **file_spaces, H5S_t **mem_spaces, haddr_t offsets[], H5_flexible_const_ptr_t bufs[], size_t src_element_sizes[], size_t dst_element_sizes[], MPI_Datatype *final_ftype, - hbool_t *final_ftype_is_derived, MPI_Datatype *final_mtype, - hbool_t *final_mtype_is_derived) + bool *final_ftype_is_derived, MPI_Datatype *final_mtype, + bool *final_mtype_is_derived) { MPI_Datatype *piece_mtype = NULL; MPI_Datatype *piece_ftype = NULL; MPI_Aint *piece_file_disp_array = NULL; MPI_Aint *piece_mem_disp_array = NULL; - hbool_t *piece_mft_is_derived_array = - NULL; /* Flags to indicate each piece's MPI file datatype is derived */ + bool *piece_mft_is_derived_array = NULL; /* Flags to indicate each piece's MPI file datatype is derived */ ; - hbool_t *piece_mmt_is_derived_array = + bool *piece_mmt_is_derived_array = NULL; /* Flags to indicate each piece's MPI memory datatype is derived */ int *piece_mpi_file_counts = NULL; /* Count of MPI file datatype for each piece */ int *piece_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each piece */ @@ -2770,9 +2771,9 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ size_t i; /* Local index variable */ int mpi_code; /* MPI return code */ - hbool_t extend_src_sizes = FALSE; - hbool_t extend_dst_sizes = FALSE; - hbool_t extend_bufs = FALSE; + bool extend_src_sizes = false; + bool extend_dst_sizes = false; + bool extend_bufs = false; H5_flexible_const_ptr_t buf; size_t src_element_size, dst_element_size; @@ -2793,10 +2794,10 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate piece memory counts buffer"); if (NULL == (piece_mpi_file_counts = (int *)H5MM_calloc(num_pieces * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate piece file counts buffer"); - if (NULL == (piece_mmt_is_derived_array = (hbool_t *)H5MM_calloc(num_pieces * sizeof(hbool_t)))) + if (NULL == (piece_mmt_is_derived_array = (bool *)H5MM_calloc(num_pieces * sizeof(bool)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate piece memory is derived datatype flags buffer"); - if (NULL == (piece_mft_is_derived_array = (hbool_t *)H5MM_calloc(num_pieces * sizeof(hbool_t)))) + if (NULL == (piece_mft_is_derived_array = (bool *)H5MM_calloc(num_pieces * sizeof(bool)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate piece file is derived datatype flags buffer"); @@ -2810,11 +2811,11 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ out-of-order displacements to the in-order displacements of the MPI datatypes of the point selection of the file space */ - hbool_t is_permuted = FALSE; + bool is_permuted = false; if (!extend_src_sizes) { if (src_element_sizes[i] == 0) { - extend_src_sizes = TRUE; + extend_src_sizes = true; src_element_size = src_element_sizes[i - 1]; } else @@ -2823,7 +2824,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ if (!extend_dst_sizes) { if (dst_element_sizes[i] == 0) { - extend_dst_sizes = TRUE; + extend_dst_sizes = true; dst_element_size = dst_element_sizes[i - 1]; } else @@ -2832,7 +2833,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ if (!extend_bufs) { if (bufs[i].cvp == NULL) { - extend_bufs = TRUE; + extend_bufs = true; buf = bufs[i - 1]; } else @@ -2847,7 +2848,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ if (H5S_mpio_space_type(file_spaces[i], src_element_size, &piece_ftype[i], /* OUT: datatype created */ &piece_mpi_file_counts[i], /* OUT */ &(piece_mft_is_derived_array[i]), /* OUT */ - TRUE, /* this is a file space, + true, /* this is a file space, so permute the datatype if the point selections are out of @@ -2864,7 +2865,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ assert(permute_map); if (H5S_mpio_space_type(mem_spaces[i], dst_element_size, &piece_mtype[i], &piece_mpi_mem_counts[i], - &(piece_mmt_is_derived_array[i]), FALSE, /* this is a memory + &(piece_mmt_is_derived_array[i]), false, /* this is a memory space, so if the file space is not permuted, there is no @@ -2904,7 +2905,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(final_ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - *final_ftype_is_derived = TRUE; + *final_ftype_is_derived = true; /* Create final MPI derived datatype for memory */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct((int)num_pieces, piece_mpi_mem_counts, @@ -2913,7 +2914,7 @@ H5FD__selection_build_types(hbool_t io_op_write, size_t num_pieces, H5_flexible_ if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(final_mtype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - *final_mtype_is_derived = TRUE; + *final_mtype_is_derived = true; /* Free the file & memory MPI datatypes for each piece */ for (i = 0; i < num_pieces; i++) { @@ -2988,17 +2989,17 @@ H5FD__mpio_read_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED d H5FD_mpio_collective_opt_t coll_opt_mode; MPI_Datatype final_mtype; /* Final memory MPI datatype for all pieces with selection */ - hbool_t final_mtype_is_derived = FALSE; + bool final_mtype_is_derived = false; MPI_Datatype final_ftype; /* Final file MPI datatype for all pieces with selection */ - hbool_t final_ftype_is_derived = FALSE; + bool final_ftype_is_derived = false; hid_t *s_mem_space_ids = NULL; hid_t *s_file_space_ids = NULL; haddr_t *s_offsets = NULL; size_t *s_element_sizes = NULL; H5_flexible_const_ptr_t *s_bufs = NULL; - hbool_t selection_was_sorted = TRUE; + bool selection_was_sorted = true; uint32_t i, j; H5S_t **s_mem_spaces = NULL; @@ -3018,10 +3019,10 @@ H5FD__mpio_read_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED d int io_size; /* Actual number of bytes requested */ int n; #endif - hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */ + bool rank0_bcast = false; /* If read-with-rank0-and-bcast flag was used */ #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ H5_flexible_const_ptr_t mbb; @@ -3107,7 +3108,7 @@ H5FD__mpio_read_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED d mpi_bufs_base = s_bufs[j].vp; mbb.vp = mpi_bufs_base; - if (H5FD__selection_build_types(FALSE, count, mbb, s_file_spaces, s_mem_spaces, s_offsets, s_bufs, + if (H5FD__selection_build_types(false, count, mbb, s_file_spaces, s_mem_spaces, s_offsets, s_bufs, s_element_sizes, s_element_sizes, &final_ftype, &final_ftype_is_derived, &final_mtype, &final_mtype_is_derived) < 0) @@ -3166,7 +3167,7 @@ H5FD__mpio_read_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED d fprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", __func__, file->mpi_rank); #endif /* Indicate path we've taken */ - rank0_bcast = TRUE; + rank0_bcast = true; /* Read on rank 0 Bcast to other ranks */ if (file->mpi_rank == 0) { @@ -3361,17 +3362,17 @@ H5FD__mpio_write_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED H5FD_mpio_collective_opt_t coll_opt_mode; MPI_Datatype final_mtype; /* Final memory MPI datatype for all pieces with selection */ - hbool_t final_mtype_is_derived = FALSE; + bool final_mtype_is_derived = false; MPI_Datatype final_ftype; /* Final file MPI datatype for all pieces with selection */ - hbool_t final_ftype_is_derived = FALSE; + bool final_ftype_is_derived = false; hid_t *s_mem_space_ids = NULL; hid_t *s_file_space_ids = NULL; haddr_t *s_offsets = NULL; size_t *s_element_sizes = NULL; H5_flexible_const_ptr_t *s_bufs = NULL; - hbool_t selection_was_sorted = TRUE; + bool selection_was_sorted = true; const void *mpi_bufs_base = NULL; uint32_t i, j; @@ -3392,8 +3393,8 @@ H5FD__mpio_write_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED #endif #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); - hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; @@ -3475,7 +3476,7 @@ H5FD__mpio_write_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED mpi_bufs_base = s_bufs[j].cvp; mbb.cvp = mpi_bufs_base; - if (H5FD__selection_build_types(TRUE, count, mbb, s_file_spaces, s_mem_spaces, s_offsets, s_bufs, + if (H5FD__selection_build_types(true, count, mbb, s_file_spaces, s_mem_spaces, s_offsets, s_bufs, s_element_sizes, s_element_sizes, &final_ftype, &final_ftype_is_derived, &final_mtype, &final_mtype_is_derived) < 0) @@ -3662,11 +3663,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif int mpi_code; /* mpi return code */ herr_t ret_value = SUCCEED; @@ -3717,11 +3718,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; #ifdef H5FDmpio_DEBUG - hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + bool H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); #endif herr_t ret_value = SUCCEED; @@ -3939,7 +3940,7 @@ H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_AT case H5FD_CTL_GET_MPI_FILE_SYNC_OPCODE: assert(output); assert(*output); - **((hbool_t **)output) = file->mpi_file_sync_required; + **((bool **)output) = file->mpi_file_sync_required; break; default: /* unknown op code */ diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 9f8a77c..51e483f 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -24,11 +24,11 @@ #include "hdf5.h" -#ifndef FALSE -#define FALSE 0 +#ifndef false +#define false 0 #endif -#ifndef TRUE -#define TRUE 1 +#ifndef true +#define true 1 #endif /* Windows doesn't like some POSIX names and redefines them with an @@ -107,7 +107,7 @@ typedef struct H5FD_multi_fapl_t { hid_t memb_fapl[H5FD_MEM_NTYPES]; /*member access properties */ char *memb_name[H5FD_MEM_NTYPES]; /*name generators */ haddr_t memb_addr[H5FD_MEM_NTYPES]; /*starting addr per member */ - hbool_t relax; /*less stringent error checking */ + bool relax; /*less stringent error checking */ } H5FD_multi_fapl_t; /* @@ -137,10 +137,10 @@ typedef struct H5FD_multi_dxpl_t { /* Private functions */ static herr_t H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char *raw_ext, - hid_t raw_plist_id, hbool_t relax, H5FD_multi_fapl_t *fa_out); + hid_t raw_plist_id, bool relax, H5FD_multi_fapl_t *fa_out); static herr_t H5FD_multi_populate_config(const H5FD_mem_t *memb_map, const hid_t *memb_fapl, - const char *const *memb_name, const haddr_t *memb_addr, - hbool_t relax, H5FD_multi_fapl_t *fa_out); + const char *const *memb_name, const haddr_t *memb_addr, bool relax, + H5FD_multi_fapl_t *fa_out); static int compute_next(H5FD_multi_t *file); static int open_members(H5FD_multi_t *file); @@ -167,9 +167,9 @@ static herr_t H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, ha void *_buf /*out*/); static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf); -static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD_multi_lock(H5FD_t *_file, bool rw); static herr_t H5FD_multi_unlock(H5FD_t *_file); static herr_t H5FD_multi_delete(const char *filename, hid_t fapl_id); static herr_t H5FD_multi_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, @@ -285,7 +285,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const c /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - if (H5FD_split_populate_config(meta_ext, meta_plist_id, raw_ext, raw_plist_id, TRUE, &fa) < 0) + if (H5FD_split_populate_config(meta_ext, meta_plist_id, raw_ext, raw_plist_id, true, &fa) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "can't setup split driver configuration", -1); @@ -356,7 +356,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const c * * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS); * H5Pset_fapl_multi(fapl, memb_map, memb_fapl, - * memb_name, memb_addr, TRUE); + * memb_name, memb_addr, true); * * * Return: Success: Non-negative @@ -378,7 +378,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f H5Eclear2(H5E_DEFAULT); /* Check arguments and supply default values */ - if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) + if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || true != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1); if (H5FD_multi_populate_config(memb_map, memb_fapl, memb_name, memb_addr, relax, &fa) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "can't setup driver configuration", -1); @@ -413,7 +413,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) + if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || true != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list", -1); if (H5FD_MULTI != H5Pget_driver(fapl_id)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1); @@ -423,7 +423,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl } H5E_END_TRY if (!fa || (H5P_FILE_ACCESS_DEFAULT == fapl_id)) { - if (H5FD_multi_populate_config(NULL, NULL, NULL, NULL, TRUE, &default_fa) < 0) + if (H5FD_multi_populate_config(NULL, NULL, NULL, NULL, true, &default_fa) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTSET, "can't setup default driver configuration", -1); fa = &default_fa; @@ -468,7 +468,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl */ static herr_t H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char *raw_ext, hid_t raw_plist_id, - hbool_t relax, H5FD_multi_fapl_t *fa_out) + bool relax, H5FD_multi_fapl_t *fa_out) { static const char *func = "H5FD_split_populate_config"; /* Function Name for error reporting */ static char @@ -548,7 +548,7 @@ H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char * All members of MEMB_FAPL must be either defaults or actual file * access property lists. */ - if (H5P_DEFAULT != _memb_fapl[mmt] && TRUE != H5Pisa_class(_memb_fapl[mmt], H5P_FILE_ACCESS)) + if (H5P_DEFAULT != _memb_fapl[mmt] && true != H5Pisa_class(_memb_fapl[mmt], H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1); /* All names must be defined */ @@ -594,7 +594,7 @@ H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char */ static herr_t H5FD_multi_populate_config(const H5FD_mem_t *memb_map, const hid_t *memb_fapl, const char *const *memb_name, - const haddr_t *memb_addr, hbool_t relax, H5FD_multi_fapl_t *fa_out) + const haddr_t *memb_addr, bool relax, H5FD_multi_fapl_t *fa_out) { static const char *func = "H5FD_multi_populate_config"; /* Function Name for error reporting */ static const char *letters = "Xsbrglo"; @@ -648,7 +648,7 @@ H5FD_multi_populate_config(const H5FD_mem_t *memb_map, const hid_t *memb_fapl, c * All members of MEMB_FAPL must be either defaults or actual file * access property lists. */ - if (H5P_DEFAULT != memb_fapl[mmt] && TRUE != H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) + if (H5P_DEFAULT != memb_fapl[mmt] && true != H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1); /* All names must be defined */ @@ -827,8 +827,8 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) H5FD_mem_t map[H5FD_MEM_NTYPES]; int i; size_t nseen = 0; - hbool_t map_changed = FALSE; - hbool_t in_use[H5FD_MEM_NTYPES]; + bool map_changed = false; + bool in_use[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; haddr_t memb_eoa[H5FD_MEM_NTYPES]; @@ -858,7 +858,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) for (i = 0; i < 6; i++) { map[i + 1] = (H5FD_mem_t)buf[i]; if (file->fa.memb_map[i + 1] != map[i + 1]) - map_changed = TRUE; + map_changed = true; } UNIQUE_MEMBERS (map, mt) { @@ -905,7 +905,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) /* Close files which are unused now */ memset(in_use, 0, sizeof in_use); UNIQUE_MEMBERS (map, mt) { - in_use[mt] = TRUE; + in_use[mt] = true; } END_MEMBERS ALL_MEMBERS (mt) { @@ -1118,7 +1118,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error); } else { - if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0) + if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, true) < 0) H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error); } @@ -1788,7 +1788,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si *------------------------------------------------------------------------- */ static herr_t -H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, bool closing) { H5FD_multi_t *file = (H5FD_multi_t *)_file; H5FD_mem_t mt; @@ -1858,7 +1858,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) *------------------------------------------------------------------------- */ static herr_t -H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing) { H5FD_multi_t *file = (H5FD_multi_t *)_file; H5FD_mem_t mt; @@ -1899,7 +1899,7 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) *------------------------------------------------------------------------- */ static herr_t -H5FD_multi_lock(H5FD_t *_file, hbool_t rw) +H5FD_multi_lock(H5FD_t *_file, bool rw) { H5FD_multi_t *file = (H5FD_multi_t *)_file; int nerrors = 0; @@ -2112,11 +2112,11 @@ H5FD_multi_delete(const char *filename, hid_t fapl_id) char *env = getenv(HDF5_DRIVER); if (env && !strcmp(env, "split")) { - if (H5FD_split_populate_config(NULL, H5P_DEFAULT, NULL, H5P_DEFAULT, TRUE, &default_fa) < 0) + if (H5FD_split_populate_config(NULL, H5P_DEFAULT, NULL, H5P_DEFAULT, true, &default_fa) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTSET, "can't setup driver configuration", -1); } else { - if (H5FD_multi_populate_config(NULL, NULL, NULL, NULL, TRUE, &default_fa) < 0) + if (H5FD_multi_populate_config(NULL, NULL, NULL, NULL, true, &default_fa) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTSET, "can't setup driver configuration", -1); } diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index 23c3703..a85f2df 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -34,7 +34,7 @@ H5_DLL hid_t H5FD_multi_init(void); * \param[in] memb_name Name generator for names of member files * \param[in] memb_addr The offsets within the virtual address space, from 0 * (zero) to #HADDR_MAX, at which each type of data storage begins - * \param[in] relax Allows read-only access to incomplete file sets when \c TRUE + * \param[in] relax Allows read-only access to incomplete file sets when \c true * \returns \herr_t * * \details H5Pset_fapl_multi() sets the file access property list \p fapl_id to @@ -69,7 +69,7 @@ H5_DLL hid_t H5FD_multi_init(void); * address space, from 0 (zero) to #HADDR_MAX, at which each type of * data storage begins. * - * If \p relax is set to 1 (TRUE), then opening an existing file for + * If \p relax is set to 1 (true), then opening an existing file for * read-only access will not fail if some file members are * missing. This allows a file to be accessed in a limited sense if * just the meta data is available. @@ -145,7 +145,7 @@ H5_DLL hid_t H5FD_multi_init(void); * * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS); * H5Pset_fapl_multi(fapl, memb_map, memb_fapl, - * memb_name, memb_addr, TRUE); + * memb_name, memb_addr, true); * \endcode * * \version 1.6.3 \p memb_name parameter type changed to \Code{const char* const*}. @@ -165,7 +165,7 @@ H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const * \param[out] memb_name Name generator for names of member files * \param[out] memb_addr The offsets within the virtual address space, from 0 * (zero) to #HADDR_MAX, at which each type of data storage begins - * \param[out] relax Allows read-only access to incomplete file sets when \c TRUE + * \param[out] relax Allows read-only access to incomplete file sets when \c true * \returns \herr_t * * \details H5Pget_fapl_multi() returns information about the multi-file access diff --git a/src/H5FDonion.c b/src/H5FDonion.c index a9d11e0..189bd3f 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -125,8 +125,8 @@ static hid_t H5FD_ONION_g = 0; typedef struct H5FD_onion_t { H5FD_t pub; H5FD_onion_fapl_info_t fa; - hbool_t is_open_rw; - hbool_t align_history_on_pages; + bool is_open_rw; + bool align_history_on_pages; /* Onion-related files */ H5FD_t *original_file; @@ -235,7 +235,7 @@ H5FD_onion_init(void) FUNC_ENTER_NOAPI_NOERR if (H5I_VFL != H5I_get_type(H5FD_ONION_g)) - H5FD_ONION_g = H5FD_register(&H5FD_onion_g, sizeof(H5FD_class_t), FALSE); + H5FD_ONION_g = H5FD_register(&H5FD_onion_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_ONION_g; @@ -468,7 +468,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) rec->logical_eof = file->logical_eof; - if ((TRUE == file->is_open_rw) && (H5FD__onion_merge_revision_index_into_archival_index( + if ((true == file->is_open_rw) && (H5FD__onion_merge_revision_index_into_archival_index( file->rev_index, &file->curr_rev_record.archival_index) < 0)) HGOTO_ERROR(H5E_VFL, H5E_INTERNAL, FAIL, "unable to update index to write"); @@ -486,7 +486,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "can't write new revision record"); file->onion_eof = phys_addr + size; - if (TRUE == file->align_history_on_pages) + if (true == file->align_history_on_pages) file->onion_eof = (file->onion_eof + (file->header.page_size - 1)) & (~(file->header.page_size - 1)); /* Update history info to accommodate new revision */ @@ -656,7 +656,7 @@ H5FD__onion_get_legit_fapl_id(hid_t fapl_id) { if (H5P_DEFAULT == fapl_id) return H5P_FILE_ACCESS_DEFAULT; - else if (TRUE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + else if (true == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) return fapl_id; else return H5I_INVALID_HID; @@ -758,7 +758,7 @@ H5FD__onion_create_truncate_onion(H5FD_onion_t *file, const char *filename, cons if (H5FD_write(file->onion_file, H5FD_MEM_DRAW, 0, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "cannot write header to the backing onion file"); file->onion_eof = (haddr_t)size; - if (TRUE == file->align_history_on_pages) + if (true == file->align_history_on_pages) file->onion_eof = (file->onion_eof + (hdr->page_size - 1)) & (~(hdr->page_size - 1)); rec->archival_index.list = NULL; @@ -884,7 +884,7 @@ H5FD__onion_parse_config_str(const char *config_str, H5FD_onion_fapl_info_t *fa) HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, FAIL, "not a property list class"); /* Create the new property list */ - if ((fa->backing_fapl_id = H5P_create_id(pclass, TRUE)) < 0) + if ((fa->backing_fapl_id = H5P_create_id(pclass, true)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCREATE, FAIL, "unable to create property list"); } @@ -1007,14 +1007,14 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma /* Set flags */ if (fa->creation_flags & H5FD_ONION_FAPL_INFO_CREATE_FLAG_ENABLE_PAGE_ALIGNMENT) { file->header.flags |= H5FD_ONION_HEADER_FLAG_PAGE_ALIGNMENT; - file->align_history_on_pages = TRUE; + file->align_history_on_pages = true; } /* Truncate and create everything as necessary */ if (H5FD__onion_create_truncate_onion(file, filename, name_onion, file->recovery_file_name, flags, maxaddr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCREATE, NULL, "unable to create/truncate onionized files"); - file->is_open_rw = TRUE; + file->is_open_rw = true; } else { @@ -1053,7 +1053,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma if (H5FD_ONION_FAPL_INFO_CREATE_FLAG_ENABLE_PAGE_ALIGNMENT & file->fa.creation_flags) { hdr->flags |= H5FD_ONION_HEADER_FLAG_PAGE_ALIGNMENT; - file->align_history_on_pages = TRUE; + file->align_history_on_pages = true; } if (HADDR_UNDEF == (canon_eof = H5FD_get_eof(file->original_file, H5FD_MEM_DEFAULT))) { @@ -1106,7 +1106,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma } file->onion_eof = (haddr_t)saved_size; - if (TRUE == file->align_history_on_pages) + if (true == file->align_history_on_pages) file->onion_eof = (file->onion_eof + (hdr->page_size - 1)) & (~(hdr->page_size - 1)); rec->archival_index.list = NULL; @@ -1139,7 +1139,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma if (H5FD__onion_ingest_header(&file->header, file->onion_file, 0) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, NULL, "can't get history header from backing store"); file->align_history_on_pages = - (file->header.flags & H5FD_ONION_HEADER_FLAG_PAGE_ALIGNMENT) ? TRUE : FALSE; + (file->header.flags & H5FD_ONION_HEADER_FLAG_PAGE_ALIGNMENT) ? true : false; if (H5FD_ONION_HEADER_FLAG_WRITE_LOCK & file->header.flags) { /* Opening a file twice in write mode is an error */ @@ -1198,7 +1198,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma file->logical_eoa = 0; file->onion_eof = H5FD_get_eoa(file->onion_file, H5FD_MEM_DRAW); - if (TRUE == file->align_history_on_pages) + if (true == file->align_history_on_pages) file->onion_eof = (file->onion_eof + (file->header.page_size - 1)) & (~(file->header.page_size - 1)); ret_value = (H5FD_t *)file; @@ -1303,7 +1303,7 @@ H5FD__onion_open_rw(H5FD_onion_t *file, unsigned int flags, haddr_t maxaddr, boo file->curr_rev_record.parent_revision_num = file->curr_rev_record.revision_num; if (!new_open) file->curr_rev_record.revision_num += 1; - file->is_open_rw = TRUE; + file->is_open_rw = true; done: if (FAIL == ret_value) { @@ -1384,7 +1384,7 @@ H5FD__onion_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h page_readsize = (size_t)page_size - page_gap_head - page_gap_tail; - if (TRUE == file->is_open_rw && file->fa.revision_num != 0 && + if (true == file->is_open_rw && file->fa.revision_num != 0 && H5FD__onion_revision_index_find(file->rev_index, page_i, &entry_out)) { /* Page exists in 'live' revision index */ if (H5FD_read(file->onion_file, H5FD_MEM_DRAW, entry_out->phys_addr + page_gap_head, @@ -1477,7 +1477,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, assert(file->rev_index != NULL); assert((uint64_t)(offset + len) <= file->logical_eoa); - if (FALSE == file->is_open_rw) + if (false == file->is_open_rw) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Write not allowed if file not opened in write mode"); if (0 == len) diff --git a/src/H5FDonion_index.c b/src/H5FDonion_index.c index fae87ca..4e7f8a3 100644 --- a/src/H5FDonion_index.c +++ b/src/H5FDonion_index.c @@ -176,28 +176,28 @@ done: * + Sorted by increasing logical address (no duplicates) * + Logical addresses are multiples of page size. * - * Return: TRUE/FALSE + * Return: true/false *----------------------------------------------------------------------------- */ -hbool_t +bool H5FD__onion_archival_index_is_valid(const H5FD_onion_archival_index_t *aix) { - hbool_t ret_value = TRUE; + bool ret_value = true; FUNC_ENTER_PACKAGE_NOERR assert(aix); if (H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR != aix->version) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (NULL == aix->list) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Ensure list is sorted on logical_page field */ if (aix->n_entries > 1) for (uint64_t i = 1; i < aix->n_entries - 1; i++) if (aix->list[i + 1].logical_page <= aix->list[i].logical_page) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDonion_index.h b/src/H5FDonion_index.h index 0a9dd88..7dbd30a 100644 --- a/src/H5FDonion_index.h +++ b/src/H5FDonion_index.h @@ -125,9 +125,9 @@ extern "C" { H5_DLL herr_t H5FD__onion_ingest_revision_record(H5FD_onion_revision_record_t *r_out, H5FD_t *raw_file, const H5FD_onion_history_t *history, uint64_t revision_num); -H5_DLL hbool_t H5FD__onion_archival_index_is_valid(const H5FD_onion_archival_index_t *); -H5_DLL int H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *, uint64_t, - const H5FD_onion_index_entry_t **); +H5_DLL bool H5FD__onion_archival_index_is_valid(const H5FD_onion_archival_index_t *); +H5_DLL int H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *, uint64_t, + const H5FD_onion_index_entry_t **); H5_DLL H5FD_onion_revision_index_t *H5FD__onion_revision_index_init(uint32_t page_size); H5_DLL herr_t H5FD__onion_revision_index_destroy(H5FD_onion_revision_index_t *); diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index b1d929c..0d0a7b7 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -48,7 +48,7 @@ H5_DLL herr_t H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsiz /* Testing functions */ #ifdef H5FD_TESTING -H5_DLL hbool_t H5FD__supports_swmr_test(const char *vfd_name); +H5_DLL bool H5FD__supports_swmr_test(const char *vfd_name); #endif /* H5FD_TESTING */ #endif /* H5FDpkg_H */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 6b8e2da..5330077 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -117,18 +117,18 @@ H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name /*out*/, uint8_t *b H5_DLL herr_t H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf); H5_DLL void *H5FD_fapl_get(H5FD_t *file); H5_DLL herr_t H5FD_free_driver_info(hid_t driver_id, const void *driver_info); -H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref); -H5_DLL hid_t H5FD_register_driver_by_name(const char *name, hbool_t app_ref); -H5_DLL hid_t H5FD_register_driver_by_value(H5FD_class_value_t value, hbool_t app_ref); +H5_DLL hid_t H5FD_register(const void *cls, size_t size, bool app_ref); +H5_DLL hid_t H5FD_register_driver_by_name(const char *name, bool app_ref); +H5_DLL hid_t H5FD_register_driver_by_value(H5FD_class_value_t value, bool app_ref); H5_DLL htri_t H5FD_is_driver_registered_by_name(const char *driver_name, hid_t *registered_id); H5_DLL htri_t H5FD_is_driver_registered_by_value(H5FD_class_value_t driver_value, hid_t *registered_id); -H5_DLL hid_t H5FD_get_driver_id_by_name(const char *name, hbool_t is_api); -H5_DLL hid_t H5FD_get_driver_id_by_value(H5FD_class_value_t value, hbool_t is_api); +H5_DLL hid_t H5FD_get_driver_id_by_name(const char *name, bool is_api); +H5_DLL hid_t H5FD_get_driver_id_by_value(H5FD_class_value_t value, bool is_api); H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags /*out*/); -H5_DLL herr_t H5FD_check_plugin_load(const H5FD_class_t *cls, const union H5PL_key_t *key, hbool_t *success); +H5_DLL herr_t H5FD_check_plugin_load(const H5FD_class_t *cls, const union H5PL_key_t *key, bool *success); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t addr, hsize_t size); @@ -174,9 +174,9 @@ H5_DLL herr_t H5FD_read_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t c H5_DLL herr_t H5FD_write_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], const void *bufs[]); -H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing); -H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing); -H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw); +H5_DLL herr_t H5FD_flush(H5FD_t *file, bool closing); +H5_DLL herr_t H5FD_truncate(H5FD_t *file, bool closing); +H5_DLL herr_t H5FD_lock(H5FD_t *file, bool rw); H5_DLL herr_t H5FD_unlock(H5FD_t *file); H5_DLL herr_t H5FD_delete(const char *name, hid_t fapl_id); H5_DLL herr_t H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output); @@ -184,14 +184,14 @@ H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum); H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle); H5_DLL herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr); H5_DLL haddr_t H5FD_get_base_addr(const H5FD_t *file); -H5_DLL herr_t H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged); +H5_DLL herr_t H5FD_set_paged_aggr(H5FD_t *file, bool paged); -H5_DLL herr_t H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t count, H5FD_mem_t types[], +H5_DLL herr_t H5FD_sort_vector_io_req(bool *vector_was_sorted, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], H5FD_mem_t **s_types_ptr, haddr_t **s_addrs_ptr, size_t **s_sizes_ptr, H5_flexible_const_ptr_t **s_bufs_ptr); -H5_DLL herr_t H5FD_sort_selection_io_req(hbool_t *selection_was_sorted, size_t count, hid_t mem_space_ids[], +H5_DLL herr_t H5FD_sort_selection_io_req(bool *selection_was_sorted, size_t count, hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], H5_flexible_const_ptr_t bufs[], hid_t **s_mem_space_ids, hid_t **s_file_space_ids, haddr_t **s_offsets_ptr, @@ -207,14 +207,14 @@ H5_DLL herr_t H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off /*out* H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); #endif /* NOT_YET */ -H5_DLL herr_t H5FD_set_mpio_atomicity(H5FD_t *file, hbool_t flag); -H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); +H5_DLL herr_t H5FD_set_mpio_atomicity(H5FD_t *file, bool flag); +H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, bool *flag); /* Driver specific methods */ H5_DLL int H5FD_mpi_get_rank(H5FD_t *file); H5_DLL int H5FD_mpi_get_size(H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(H5FD_t *file); -H5_DLL herr_t H5FD_mpi_get_file_sync_required(H5FD_t *file, hbool_t *file_sync_required); +H5_DLL herr_t H5FD_mpi_get_file_sync_required(H5FD_t *file, bool *file_sync_required); #endif /* H5_HAVE_PARALLEL */ #endif /* H5FDprivate_H */ diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 19de079..08a6971 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -225,7 +225,7 @@ static herr_t H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha void *buf); static herr_t H5FD__ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); static herr_t H5FD__ros3_validate_config(const H5FD_ros3_fapl_t *fa); @@ -306,7 +306,7 @@ H5FD_ros3_init(void) #endif if (H5I_VFL != H5I_get_type(H5FD_ROS3_g)) { - H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), FALSE); + H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), false); if (H5I_INVALID_HID == H5FD_ROS3_g) { HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register ros3"); } @@ -423,7 +423,7 @@ H5FD__ros3_validate_config(const H5FD_ros3_fapl_t *fa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version"); /* if set to authenticate, region and id cannot be empty strings */ - if (fa->authenticate == TRUE) + if (fa->authenticate == true) if ((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0')) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information"); @@ -957,7 +957,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* open file; procedure depends on whether or not the fapl instructs to * authenticate requests or not. */ - if (fa.authenticate == TRUE) { + if (fa.authenticate == true) { /* compute signing key (part of AWS/S3 REST API) * can be re-used by user/key for 7 days after creation. * find way to re-use/share @@ -1757,8 +1757,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; diff --git a/src/H5FDros3.h b/src/H5FDros3.h index 0f2f315..ecd2678 100644 --- a/src/H5FDros3.h +++ b/src/H5FDros3.h @@ -51,10 +51,10 @@ * * `authenticate` (hbool_t) * - * Flag TRUE or FALSE whether or not requests are to be authenticated + * Flag true or false whether or not requests are to be authenticated * with the AWS4 algorithm. - * If TRUE, `aws_region`, `secret_id`, and `secret_key` must be populated. - * If FALSE, those three components are unused. + * If true, `aws_region`, `secret_id`, and `secret_key` must be populated. + * If false, those three components are unused. * * `aws_region` (char[]) * @@ -114,7 +114,7 @@ * to #H5FD_CURR_ROS3_FAPL_T_VERSION. * * \var hbool_t H5FD_ros3_fapl_t::authenticate - * A boolean which specifies if security credentials should be used for + * A Boolean which specifies if security credentials should be used for * accessing a S3 bucket. * * \var char H5FD_ros3_fapl_t::aws_region[H5FD_ROS3_MAX_REGION_LEN + 1] diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 8a433d5..83a33a9 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -208,7 +208,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) char *nvcat = NULL; hrb_node_t *node_ptr = NULL; hrb_node_t *new_node = NULL; - hbool_t is_looking = TRUE; + bool is_looking = true; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -320,7 +320,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) */ if (HDstrcmp(lowername, node_ptr->lowername) == 0) { - is_looking = FALSE; + is_looking = false; if (value == NULL) { #if S3COMMS_DEBUG @@ -398,7 +398,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) } else if (HDstrcmp(lowername, node_ptr->lowername) < 0) { - is_looking = FALSE; + is_looking = false; if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); @@ -427,7 +427,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) while (is_looking) { if (node_ptr->next == NULL) { - is_looking = FALSE; + is_looking = false; if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); @@ -450,7 +450,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) } else if (HDstrcmp(lowername, node_ptr->next->lowername) < 0) { - is_looking = FALSE; + is_looking = false; if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); @@ -474,7 +474,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) } else if (HDstrcmp(lowername, node_ptr->next->lowername) == 0) { - is_looking = FALSE; + is_looking = false; if (value == NULL) { /***************** @@ -1757,7 +1757,7 @@ done: *---------------------------------------------------------------------------- */ herr_t -H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, hbool_t lowercase) +H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, bool lowercase) { size_t i = 0; herr_t ret_value = SUCCEED; @@ -1775,7 +1775,7 @@ H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, for (i = 0; i < msg_len; i++) { int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */ - (lowercase == TRUE) ? "%02x" : "%02X", msg[i]); + (lowercase == true) ? "%02x" : "%02X", msg[i]); if (chars_written != 2) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]); } @@ -2433,7 +2433,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`."); #if S3COMMS_DEBUG - H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE); + H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, false); fprintf(stdout, " CHAR: \'%s\'\n", s); fprintf(stdout, " CHAR-HEX: \"%s\"\n", hex); #endif @@ -2480,7 +2480,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr #if S3COMMS_DEBUG fprintf(stdout, " STACK:\n {\n"); for (i = 0; i < stack_size; i++) { - H5FD_s3comms_bytes_to_hex((char *)hex, (&stack[i]), 1, FALSE); + H5FD_s3comms_bytes_to_hex((char *)hex, (&stack[i]), 1, false); hex[2] = 0; fprintf(stdout, " %s,\n", hex); } @@ -2818,7 +2818,7 @@ done: *---------------------------------------------------------------------------- */ herr_t -H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_slash, size_t *n_written) +H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, bool encode_slash, size_t *n_written) { char c = 0; size_t dest_off = 0; @@ -2845,7 +2845,7 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s */ for (s_off = 0; s_off < s_len; s_off++) { c = s[s_off]; - if (isalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' || (c == '/' && encode_slash == FALSE)) + if (isalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' || (c == '/' && encode_slash == false)) dest[dest_off++] = c; else { hex_off = 0; diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h index 47857f6..1912212 100644 --- a/src/H5FDs3comms.h +++ b/src/H5FDs3comms.h @@ -523,8 +523,7 @@ H5_DLL struct tm *gmnow(void); H5_DLL herr_t H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int cr_size, char *signed_headers_dest, int sh_size, hrb_t *http_request); -H5_DLL herr_t H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, - hbool_t lowercase); +H5_DLL herr_t H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, bool lowercase); H5_DLL herr_t H5FD_s3comms_free_purl(parsed_url_t *purl); @@ -548,7 +547,7 @@ H5_DLL herr_t H5FD_s3comms_tostringtosign(char *dest, const char *req_str, const H5_DLL herr_t H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written); -H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_slash, +H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, bool encode_slash, size_t *n_written); #ifdef __cplusplus diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index a964a69..6f4bb42 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -55,7 +55,7 @@ typedef struct H5FD_sec2_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -93,7 +93,7 @@ typedef struct H5FD_sec2_t { * Whether to eliminate the family driver info and convert this file to * a single file. */ - hbool_t fam_to_single; + bool fam_to_single; } H5FD_sec2_t; /* @@ -131,8 +131,8 @@ static herr_t H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha void *buf); static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__sec2_lock(H5FD_t *_file, bool rw); static herr_t H5FD__sec2_unlock(H5FD_t *_file); static herr_t H5FD__sec2_delete(const char *filename, hid_t fapl_id); static herr_t H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, @@ -206,14 +206,14 @@ H5FD_sec2_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) - ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + ignore_disabled_file_locks_s = true; /* Override: Ignore disabled locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) - ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + ignore_disabled_file_locks_s = false; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ if (H5I_VFL != H5I_get_type(H5FD_SEC2_g)) - H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), FALSE); + H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), false); /* Set return value */ ret_value = H5FD_SEC2_g; @@ -849,7 +849,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -908,15 +908,15 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5FD__sec2_lock(H5FD_t *_file, hbool_t rw) +H5FD__sec2_lock(H5FD_t *_file, bool rw) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 364a449..6e658bc 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -134,7 +134,7 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr haddr_t eoa; /* Address of end-of-allocated space */ hsize_t extra; /* Extra space to allocate, to align request */ unsigned long flags = 0; /* Driver feature flags */ - hbool_t use_alloc_size; /* Just pass alloc size to the driver */ + bool use_alloc_size; /* Just pass alloc size to the driver */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_PACKAGE @@ -374,8 +374,8 @@ done: * marking an entry dirty without a H5F_t*, this routine should * be changed to take a H5F_super_t* directly. * - * Return: Success: TRUE(1) - Block was extended - * FALSE(0) - Block could not be extended + * Return: Success: true(1) - Block was extended + * false(0) - Block could not be extended * Failure: FAIL * *------------------------------------------------------------------------- @@ -384,7 +384,7 @@ htri_t H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_t extra_requested) { haddr_t eoa; /* End of allocated space in file */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -413,7 +413,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_ HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA info as dirty"); /* Indicate success */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ done: diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index cf893f3..93d8d3b 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -34,11 +34,11 @@ static hid_t H5FD_SPLITTER_g = 0; /* Driver-specific file access properties */ typedef struct H5FD_splitter_fapl_t { - hid_t rw_fapl_id; /* fapl for the R/W channel */ - hid_t wo_fapl_id; /* fapl for the W/O channel */ - char wo_path[H5FD_SPLITTER_PATH_MAX + 1]; /* file name for the W/O channel */ - char log_file_path[H5FD_SPLITTER_PATH_MAX + 1]; /* file to record errors reported by the W/O channel */ - hbool_t ignore_wo_errs; /* TRUE to ignore errors on the W/O channel */ + hid_t rw_fapl_id; /* fapl for the R/W channel */ + hid_t wo_fapl_id; /* fapl for the W/O channel */ + char wo_path[H5FD_SPLITTER_PATH_MAX + 1]; /* file name for the W/O channel */ + char log_file_path[H5FD_SPLITTER_PATH_MAX + 1]; /* file to record errors reported by the W/O channel */ + bool ignore_wo_errs; /* true to ignore errors on the W/O channel */ } H5FD_splitter_fapl_t; /* The information of this splitter */ @@ -80,7 +80,7 @@ typedef struct H5FD_splitter_t { #define H5FD_SPLITTER_WO_ERROR(file, funcname, errmajor, errminor, ret, mesg) \ { \ H5FD__splitter_log_error((file), (funcname), (mesg)); \ - if (FALSE == (file)->fa.ignore_wo_errs) \ + if (false == (file)->fa.ignore_wo_errs) \ HGOTO_ERROR((errmajor), (errminor), (ret), (mesg)); \ } @@ -129,9 +129,9 @@ static herr_t H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id void *buf); static herr_t H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__splitter_lock(H5FD_t *_file, bool rw); static herr_t H5FD__splitter_unlock(H5FD_t *_file); static herr_t H5FD__splitter_delete(const char *filename, hid_t fapl_id); static herr_t H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, @@ -255,14 +255,14 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) assert(id_out_ptr != NULL); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id); if (NULL == plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list"); - *id_out_ptr = H5P_copy_plist(plist_ptr, FALSE); + *id_out_ptr = H5P_copy_plist(plist_ptr, false); if (H5I_INVALID_HID == *id_out_ptr) HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list"); @@ -340,7 +340,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/) H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (config == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config pointer is null"); @@ -399,7 +399,7 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli { H5P_genplist_t *def_plist; H5P_genplist_t *plist; - hbool_t free_config = FALSE; + bool free_config = false; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -418,7 +418,7 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli vfd_config->rw_fapl_id = H5P_DEFAULT; vfd_config->wo_fapl_id = H5P_DEFAULT; - free_config = TRUE; + free_config = true; } /* Make sure that the W/O channel supports write-only capability. @@ -460,7 +460,7 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli /* Set non-default channel FAPL IDs in splitter configuration info */ if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); fapl_out->rw_fapl_id = vfd_config->rw_fapl_id; } @@ -470,15 +470,15 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli * driver might have been replaced with the Splitter VFD, which * would cause recursion badness. */ - if ((fapl_out->rw_fapl_id = H5P_copy_plist(def_plist, FALSE)) < 0) + if ((fapl_out->rw_fapl_id = H5P_copy_plist(def_plist, false)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy property list"); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_out->rw_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, TRUE) < 0) + if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, true) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set default driver on R/W channel FAPL"); } if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); fapl_out->wo_fapl_id = vfd_config->wo_fapl_id; } @@ -488,11 +488,11 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli * driver might have been replaced with the Splitter VFD, which * would cause recursion badness. */ - if ((fapl_out->wo_fapl_id = H5P_copy_plist(def_plist, FALSE)) < 0) + if ((fapl_out->wo_fapl_id = H5P_copy_plist(def_plist, false)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy property list"); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_out->wo_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, TRUE) < 0) + if (H5P_set_driver_by_value(plist, H5_VFD_SEC2, NULL, true) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set default driver on R/W channel FAPL"); } @@ -568,7 +568,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1046,7 +1046,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -1232,7 +1232,7 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) +H5FD__splitter_lock(H5FD_t *_file, bool rw) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index e583157..11975bf 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -83,7 +83,7 @@ typedef struct H5FD_stdio_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ unsigned write_access; /* Flag to indicate the file was opened with write access */ - hbool_t ignore_disabled_file_locks; + bool ignore_disabled_file_locks; H5FD_stdio_file_op op; /* last operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -174,9 +174,9 @@ static herr_t H5FD_stdio_read(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr void *buf); static herr_t H5FD_stdio_write(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_stdio_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD_stdio_lock(H5FD_t *_file, bool rw); static herr_t H5FD_stdio_unlock(H5FD_t *_file); static herr_t H5FD_stdio_delete(const char *filename, hid_t fapl_id); @@ -412,7 +412,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* The environment variable was set, so use that preferentially */ file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; else { - hbool_t unused; + bool unused; /* Use the value in the property list */ if (H5Pget_file_locking(fapl_id, &unused, &file->ignore_disabled_file_locks) < 0) { @@ -946,7 +946,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t closing) +H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, bool closing) { H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func = "H5FD_stdio_flush"; /* Function Name for error reporting */ @@ -987,7 +987,7 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t closing) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/ closing) +H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, bool /*UNUSED*/ closing) { H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func = "H5FD_stdio_truncate"; /* Function Name for error reporting */ @@ -1075,7 +1075,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/ *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_lock(H5FD_t *_file, hbool_t rw) +H5FD_stdio_lock(H5FD_t *_file, bool rw) { #ifdef H5_HAVE_FLOCK H5FD_stdio_t *file = (H5FD_stdio_t *)_file; /* VFD file struct */ diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 570c747..8a7169a 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -36,7 +36,7 @@ static hid_t H5FD_IOC_g = H5I_INVALID_HID; /* Whether the driver initialized MPI on its own */ -static hbool_t H5FD_mpi_self_initialized = FALSE; +static bool H5FD_mpi_self_initialized = false; /* Pointer to value for MPI_TAG_UB */ int *H5FD_IOC_tag_ub_val_ptr = NULL; @@ -126,9 +126,9 @@ static herr_t H5FD__ioc_read_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count haddr_t addrs[], size_t sizes[], void *bufs[] /* out */); static herr_t H5FD__ioc_write_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */); -static herr_t H5FD__ioc_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__ioc_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__ioc_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__ioc_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__ioc_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__ioc_lock(H5FD_t *_file, bool rw); static herr_t H5FD__ioc_unlock(H5FD_t *_file); static herr_t H5FD__ioc_del(const char *name, hid_t fapl); /* @@ -219,7 +219,7 @@ H5FD_ioc_init(void) int key_val_retrieved = 0; int mpi_code; - if ((H5FD_IOC_g = H5FD_register(&H5FD_ioc_g, sizeof(H5FD_class_t), FALSE)) < 0) + if ((H5FD_IOC_g = H5FD_register(&H5FD_ioc_g, sizeof(H5FD_class_t), false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register IOC VFD"); /* Check if IOC VFD has been loaded dynamically */ @@ -247,7 +247,7 @@ H5FD_ioc_init(void) if (MPI_SUCCESS != (mpi_code = MPI_Init_thread(NULL, NULL, required, &provided))) H5_SUBFILING_MPI_GOTO_ERROR(H5I_INVALID_HID, "MPI_Init_thread failed", mpi_code); - H5FD_mpi_self_initialized = TRUE; + H5FD_mpi_self_initialized = true; if (provided != required) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, @@ -299,7 +299,7 @@ H5FD__ioc_term(void) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalize failed", mpi_code); } - H5FD_mpi_self_initialized = FALSE; + H5FD_mpi_self_initialized = false; } } @@ -373,7 +373,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) { const H5FD_ioc_config_t *config_ptr = NULL; H5P_genplist_t *plist_ptr = NULL; - hbool_t use_default_config = FALSE; + bool use_default_config = false; herr_t ret_value = SUCCEED; H5FD_IOC_LOG_CALL(__func__); @@ -386,11 +386,11 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_IOC != H5P_peek_driver(plist_ptr)) - use_default_config = TRUE; + use_default_config = true; else { config_ptr = H5P_peek_driver_info(plist_ptr); if (NULL == config_ptr) - use_default_config = TRUE; + use_default_config = true; } if (use_default_config) { @@ -1293,7 +1293,7 @@ H5FD__ioc_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_mem_t t dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1336,7 +1336,7 @@ H5FD__ioc_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_mem_t dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1355,7 +1355,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; @@ -1375,7 +1375,7 @@ H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, hboo *------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_ioc_t *file = (H5FD_ioc_t *)_file; herr_t ret_value = SUCCEED; @@ -1401,7 +1401,7 @@ H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ *-------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) +H5FD__ioc_lock(H5FD_t H5_ATTR_UNUSED *_file, bool H5_ATTR_UNUSED rw) { herr_t ret_value = SUCCEED; diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index d7a62d1..674b08d 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -265,7 +265,7 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements subfiling_context_t *sf_context = NULL; MPI_Request ack_request = MPI_REQUEST_NULL; io_req_t *sf_io_request = NULL; - hbool_t need_data_tag = FALSE; + bool need_data_tag = false; int64_t ioc_start; int64_t ioc_offset; int64_t ioc_subfile_idx; diff --git a/src/H5FDsubfiling/H5FDioc_priv.h b/src/H5FDsubfiling/H5FDioc_priv.h index cac2806..fbce1a0 100644 --- a/src/H5FDsubfiling/H5FDioc_priv.h +++ b/src/H5FDsubfiling/H5FDioc_priv.h @@ -87,7 +87,7 @@ do { assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ assert((entry_ptr)->next == NULL); \ assert((entry_ptr)->prev == NULL); \ - assert((entry_ptr)->in_progress == FALSE); \ + assert((entry_ptr)->in_progress == false); \ \ if ( ((q_ptr)->q_head) == NULL ) \ { \ @@ -101,7 +101,7 @@ do { ((q_ptr)->q_tail) = (entry_ptr); \ } \ ((q_ptr)->q_len)++; \ -} while ( FALSE ) /* H5FD_IOC__Q_APPEND() */ +} while ( false ) /* H5FD_IOC__Q_APPEND() */ #define H5FD_IOC__Q_REMOVE(q_ptr, entry_ptr) \ do { \ @@ -113,7 +113,7 @@ do { assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ assert((((q_ptr)->q_len == 1) && ((entry_ptr)->next == NULL) && ((entry_ptr)->prev == NULL)) || \ (((q_ptr)->q_len > 1) && (((entry_ptr)->next != NULL) || ((entry_ptr)->prev != NULL)))); \ - assert((entry_ptr)->in_progress == TRUE); \ + assert((entry_ptr)->in_progress == true); \ \ { \ if ( (((q_ptr)->q_head)) == (entry_ptr) ) \ @@ -140,7 +140,7 @@ do { (entry_ptr)->prev = NULL; \ ((q_ptr)->q_len)--; \ } \ -} while ( FALSE ) /* H5FD_IOC__Q_REMOVE() */ +} while ( false ) /* H5FD_IOC__Q_REMOVE() */ /* clang-format on */ @@ -160,8 +160,8 @@ do { * the IOC I/O Queue. This field points to the previous entry * in the queue, or NULL if there is no previous entry. * - * in_progress: Boolean flag that must be FALSE when the entry is inserted - * into the IOC I/O Queue, and set to TRUE when the entry is dispatched + * in_progress: Boolean flag that must be false when the entry is inserted + * into the IOC I/O Queue, and set to true when the entry is dispatched * to the worker thread pool for execution. * * When in_progress is FALS, the entry is said to be pending. @@ -184,7 +184,7 @@ do { * * Statistics: * - * The following fields are only defined if H5FD_IOC_COLLECT_STATS is TRUE. + * The following fields are only defined if H5FD_IOC_COLLECT_STATS is true. * They are intended to allow collection of basic statistics on the * behaviour of the IOC I/O Queue for purposes of debugging and performance * optimization. @@ -209,7 +209,7 @@ typedef struct ioc_io_queue_entry { uint32_t magic; struct ioc_io_queue_entry *next; struct ioc_io_queue_entry *prev; - hbool_t in_progress; + bool in_progress; uint32_t counter; sf_work_request_t wk_req; @@ -321,7 +321,7 @@ typedef struct ioc_io_queue_entry { * * Statistics: * - * The following fields are only defined if H5FD_IOC_COLLECT_STATS is TRUE. + * The following fields are only defined if H5FD_IOC_COLLECT_STATS is true. * They are intended to allow collection of basic statistics on the * behaviour of the IOC I/O Queue for purposes of debugging and performance * optimization. diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index cb3458e..98dd00b 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -85,7 +85,7 @@ static int ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm); static ioc_io_queue_entry_t *ioc_io_queue_alloc_entry(void); static void ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_ptr); -static void ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock); +static void ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, bool try_lock); static void ioc_io_queue_free_entry(ioc_io_queue_entry_t *q_entry_ptr); static void ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr); @@ -654,7 +654,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ { subfiling_context_t *sf_context = NULL; MPI_Status msg_status; - hbool_t send_nack = FALSE; + bool send_nack = false; int64_t file_context_id; int64_t data_size; int64_t file_offset; @@ -686,7 +686,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ subfile_idx = msg->header[2]; if (data_size < 0) { - send_nack = TRUE; + send_nack = true; H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "invalid data size for write"); } @@ -719,7 +719,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ /* Allocate space to receive data sent from the client */ if (NULL == (recv_buf = malloc((size_t)data_size))) { - send_nack = TRUE; + send_nack = true; H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate receive buffer for data"); } @@ -839,9 +839,9 @@ static int ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_Comm comm, uint32_t counter) { subfiling_context_t *sf_context = NULL; - hbool_t send_empty_buf = TRUE; - hbool_t send_nack = FALSE; - hbool_t need_data_tag = FALSE; + bool send_empty_buf = true; + bool send_nack = false; + bool need_data_tag = false; int64_t file_context_id; int64_t data_size; int64_t file_offset; @@ -886,8 +886,8 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C if (data_size < 0) { if (need_data_tag) { - send_nack = TRUE; - send_empty_buf = FALSE; + send_nack = true; + send_empty_buf = false; } H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "invalid data size for read"); } @@ -913,8 +913,8 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C /* Allocate space to send data read from file to client */ if (NULL == (send_buf = malloc((size_t)data_size))) { if (need_data_tag) { - send_nack = TRUE; - send_empty_buf = FALSE; + send_nack = true; + send_empty_buf = false; } H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate send buffer for data"); } @@ -934,7 +934,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C send_tag += IO_TAG_BASE; if (send_ack_to_client(send_tag, source, ioc_idx, READ_INDEP_ACK, comm) < 0) { - send_empty_buf = FALSE; + send_empty_buf = false; H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, -1, "couldn't send ACK to client"); } } @@ -951,7 +951,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C read_ret); } - send_empty_buf = FALSE; + send_empty_buf = false; /* Send read data to the client */ H5_CHECK_OVERFLOW(data_size, int64_t, int); @@ -1251,7 +1251,7 @@ ioc_io_queue_alloc_entry(void) q_entry_ptr->magic = H5FD_IOC__IO_Q_ENTRY_MAGIC; q_entry_ptr->next = NULL; q_entry_ptr->prev = NULL; - q_entry_ptr->in_progress = FALSE; + q_entry_ptr->in_progress = false; q_entry_ptr->counter = 0; /* will memcpy the wk_req field, so don't bother to initialize */ @@ -1414,9 +1414,9 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) * can become O(N**2) in the worst case. */ static void -ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) +ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, bool try_lock) { - hbool_t conflict_detected; + bool conflict_detected; int64_t entry_offset; int64_t entry_len; int64_t scan_offset; @@ -1462,7 +1462,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_offset = entry_ptr->wk_req.header[1]; entry_len = entry_ptr->wk_req.header[0]; - conflict_detected = FALSE; + conflict_detected = false; scan_ptr = entry_ptr->prev; @@ -1497,7 +1497,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) /* TODO: update this if statement when we add collective I/O */ if ((entry_ptr->wk_req.tag != READ_INDEP) || (scan_ptr->wk_req.tag != READ_INDEP)) { - conflict_detected = TRUE; + conflict_detected = true; } } @@ -1509,7 +1509,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) assert(scan_ptr == NULL); assert(!entry_ptr->in_progress); - entry_ptr->in_progress = TRUE; + entry_ptr->in_progress = true; assert(ioc_data->io_queue.num_pending > 0); diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 89afa01..8f738c7 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -36,7 +36,7 @@ static hid_t H5FD_SUBFILING_g = H5I_INVALID_HID; /* Whether the driver initialized MPI on its own */ -static hbool_t H5FD_mpi_self_initialized = FALSE; +static bool H5FD_mpi_self_initialized = false; /* The description of a file belonging to this driver. The 'eoa' and 'eof' * determine the amount of hdf5 address space in use and the high-water mark @@ -101,7 +101,7 @@ typedef struct H5FD_subfiling_t { uint64_t file_id; int64_t context_id; /* The value used to lookup a subfiling context for the file */ - hbool_t fail_to_encode; /* Used to check for failures from sb_get_size routine */ + bool fail_to_encode; /* Used to check for failures from sb_get_size routine */ char *file_dir; /* Directory where we find files */ char *file_path; /* The user defined filename */ @@ -172,9 +172,9 @@ static herr_t H5FD__subfiling_read_vector(H5FD_t *file, hid_t dxpl_id, uint32_t haddr_t addrs[], size_t sizes[], void *bufs[] /* out */); static herr_t H5FD__subfiling_write_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */); -static herr_t H5FD__subfiling_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__subfiling_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); #if 0 -static herr_t H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__subfiling_lock(H5FD_t *_file, bool rw); static herr_t H5FD__subfiling_unlock(H5FD_t *_file); #endif static herr_t H5FD__subfiling_del(const char *name, hid_t fapl); @@ -291,7 +291,7 @@ H5FD_subfiling_init(void) int provided = 0; int mpi_code; - if ((H5FD_SUBFILING_g = H5FD_register(&H5FD_subfiling_g, sizeof(H5FD_class_t), FALSE)) < 0) + if ((H5FD_SUBFILING_g = H5FD_register(&H5FD_subfiling_g, sizeof(H5FD_class_t), false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register subfiling VFD"); @@ -321,7 +321,7 @@ H5FD_subfiling_init(void) if (MPI_SUCCESS != (mpi_code = MPI_Init_thread(NULL, NULL, required, &provided))) H5_SUBFILING_MPI_GOTO_ERROR(H5I_INVALID_HID, "MPI_Init_thread failed", mpi_code); - H5FD_mpi_self_initialized = TRUE; + H5FD_mpi_self_initialized = true; if (provided != required) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, @@ -527,7 +527,7 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) { const H5FD_subfiling_config_t *config_ptr = NULL; H5P_genplist_t *plist = NULL; - hbool_t use_default_config = FALSE; + bool use_default_config = false; herr_t ret_value = SUCCEED; /*NO TRACE*/ @@ -539,11 +539,11 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_SUBFILING != H5P_peek_driver(plist)) - use_default_config = TRUE; + use_default_config = true; else { config_ptr = H5P_peek_driver_info(plist); if (NULL == config_ptr) - use_default_config = TRUE; + use_default_config = true; } if (use_default_config) { @@ -579,7 +579,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi config_out->magic = H5FD_SUBFILING_FAPL_MAGIC; config_out->version = H5FD_SUBFILING_CURR_FAPL_VERSION; config_out->ioc_fapl_id = H5I_INVALID_HID; - config_out->require_ioc = TRUE; + config_out->require_ioc = true; config_out->shared_cfg.ioc_selection = SELECT_IOC_ONE_PER_NODE; config_out->shared_cfg.stripe_size = H5FD_SUBFILING_DEFAULT_STRIPE_SIZE; @@ -588,7 +588,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi if ((h5_require_ioc = HDgetenv("H5_REQUIRE_IOC")) != NULL) { int value_check = atoi(h5_require_ioc); if (value_check == 0) - config_out->require_ioc = FALSE; + config_out->require_ioc = false; } /* Check if any MPI parameters were set on the FAPL */ @@ -720,7 +720,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) * errors later. */ if (NULL == (sf_context = H5_get_subfiling_object(file->context_id))) { - file->fail_to_encode = TRUE; + file->fail_to_encode = true; } else { if (sf_context->config_file_prefix) { @@ -744,7 +744,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) * a buffer. */ if (ret_value > H5FD_SUBFILING_MAX_DRV_INFO_SIZE) - file->fail_to_encode = TRUE; + file->fail_to_encode = true; H5_SUBFILING_FUNC_LEAVE; } /* end H5FD__subfiling_sb_size() */ @@ -873,7 +873,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char * /* Decode "require IOC" field */ INT32DECODE(p, tmp32); - file->fa.require_ioc = (hbool_t)tmp32; + file->fa.require_ioc = (bool)tmp32; /* Decode subfiling stripe size */ INT64DECODE(p, file->fa.shared_cfg.stripe_size); @@ -998,14 +998,14 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) assert(id_out_ptr != NULL); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id); if (NULL == plist_ptr) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list"); - *id_out_ptr = H5P_copy_plist(plist_ptr, FALSE); + *id_out_ptr = H5P_copy_plist(plist_ptr, false); if (H5I_INVALID_HID == *id_out_ptr) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list"); @@ -1101,7 +1101,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma H5FD_class_t *driver = NULL; /* VFD for file */ H5P_genplist_t *plist_ptr = NULL; H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ - hbool_t bcasted_eof = FALSE; + bool bcasted_eof = false; int64_t sf_eof = -1; int mpi_code; /* MPI return code */ H5FD_t *ret_value = NULL; @@ -1122,7 +1122,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma file_ptr->context_id = -1; file_ptr->fa.ioc_fapl_id = H5I_INVALID_HID; file_ptr->ext_comm = MPI_COMM_NULL; - file_ptr->fail_to_encode = FALSE; + file_ptr->fail_to_encode = false; /* Get the driver-specific file access properties */ if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -1250,7 +1250,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma H5_SUBFILING_MPI_GOTO_ERROR(NULL, "MPI_Bcast", mpi_code); } - bcasted_eof = TRUE; + bcasted_eof = true; if (sf_eof < 0) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "lead MPI process failed to get file EOF"); @@ -1319,7 +1319,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); } - file_ptr->fail_to_encode = FALSE; + file_ptr->fail_to_encode = false; done: free(file_ptr->file_path); @@ -1544,7 +1544,7 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i int64_t *source_data_offset = NULL; int64_t *sf_data_size = NULL; int64_t *sf_offset = NULL; - hbool_t rank0_bcast = FALSE; + bool rank0_bcast = false; int num_subfiles; herr_t ret_value = SUCCEED; @@ -2079,7 +2079,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2089,8 +2089,8 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m /* TODO: setup real support for vector I/O */ if (file_ptr->fa.require_ioc) { - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool extend_sizes = false; + bool extend_types = false; int k; size_t size; H5FD_mem_t type; @@ -2119,7 +2119,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m if (sizes[k] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[k - 1]; } else { @@ -2132,7 +2132,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m if (types[k] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[k - 1]; } else { @@ -2241,14 +2241,14 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } /* Call the subfiling IOC write*/ if (file_ptr->fa.require_ioc) { - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool extend_sizes = false; + bool extend_types = false; int k; size_t size; H5FD_mem_t type; @@ -2277,7 +2277,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ if (sizes[k] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[k - 1]; } else { @@ -2290,7 +2290,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ if (types[k] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[k - 1]; } else { @@ -2340,7 +2340,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -2408,8 +2408,8 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * @@ -2417,7 +2417,7 @@ done: */ #if 0 static herr_t -H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw) +H5FD__subfiling_lock(H5FD_t *_file, bool rw) { H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2829,8 +2829,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int64_t *_io_block_len; int64_t subfile_bytes = 0; int64_t iovec_depth; - hbool_t is_first = FALSE; - hbool_t is_last = FALSE; + bool is_first = false; + bool is_last = false; size_t output_offset; iovec_depth = curr_max_iovec_depth; @@ -2857,7 +2857,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int64_t num_full_stripes = iovec_depth; if (k == first_subfile) { - is_first = TRUE; + is_first = true; /* * Add partial segment length if not @@ -2870,7 +2870,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne } if (k == last_subfile) { - is_last = TRUE; + is_last = true; /* * Add partial segment length if not @@ -2885,7 +2885,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne /* Account for subfiles with uniform segments */ if (!is_first && !is_last) { - hbool_t thin_uniform_section = FALSE; + bool thin_uniform_section = false; if (last_subfile >= first_subfile) { /* diff --git a/src/H5FDsubfiling/H5FDsubfiling.h b/src/H5FDsubfiling/H5FDsubfiling.h index b1cf53a..5a520ce 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.h +++ b/src/H5FDsubfiling/H5FDsubfiling.h @@ -285,10 +285,10 @@ typedef struct H5FD_subfiling_params_t { * the #H5FD_IOC driver by calling H5Pset_fapl_ioc(), but future development * may allow other file drivers to be used. * - * \var hbool_t H5FD_subfiling_config_t::require_ioc + * \var bool H5FD_subfiling_config_t::require_ioc * A boolean flag which indicates whether the #H5FD_SUBFILING driver should * use the #H5FD_IOC driver for its I/O operations. This field should currently - * always be set to TRUE. + * always be set to true. * * \var H5FD_subfiling_params_t H5FD_subfiling_config_t::shared_cfg * A structure which contains the subfiling parameters that are shared between @@ -300,7 +300,7 @@ typedef struct H5FD_subfiling_config_t { uint32_t magic; /* Must be set to H5FD_SUBFILING_FAPL_MAGIC */ uint32_t version; /* Must be set to H5FD_SUBFILING_CURR_FAPL_VERSION */ hid_t ioc_fapl_id; /* The FAPL setup with the stacked VFD to use for I/O concentrators */ - hbool_t require_ioc; /* Whether to use the IOC VFD (currently must always be TRUE) */ + bool require_ioc; /* Whether to use the IOC VFD (currently must always be true) */ H5FD_subfiling_params_t shared_cfg; /* Subfiling/IOC parameters (stripe size, stripe count, etc.) */ } H5FD_subfiling_config_t; //! diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 34aaa93..cca179d 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -73,7 +73,7 @@ static herr_t record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id static void clear_fid_map_entry(uint64_t file_id, int64_t sf_context_id); static herr_t ioc_open_files(int64_t file_context_id, int file_acc_flags); static herr_t create_config_file(subfiling_context_t *sf_context, const char *base_filename, - const char *config_dir, const char *subfile_dir, hbool_t truncate_if_exists); + const char *config_dir, const char *subfile_dir, bool truncate_if_exists); static herr_t open_config_file(const char *base_filename, const char *config_dir, uint64_t file_id, const char *mode, FILE **config_file_out); @@ -441,12 +441,12 @@ H5_free_subfiling_topology(sf_topology_t *topology) #ifndef NDEBUG { - hbool_t topology_cached = FALSE; + bool topology_cached = false; /* Make sure this application topology object is in the cache */ for (size_t i = 0; i < sf_topology_cache_num_entries; i++) if (topology == sf_topology_cache[i]) - topology_cached = TRUE; + topology_cached = true; assert(topology_cached); } #endif @@ -510,7 +510,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm { H5P_genplist_t *plist = NULL; uint64_t stub_file_id = UINT64_MAX; - hbool_t bcasted_inode = FALSE; + bool bcasted_inode = false; H5FD_t *stub_file = NULL; hid_t fapl_id = H5I_INVALID_HID; int mpi_rank = 0; @@ -539,7 +539,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm MPI_Comm stub_comm = MPI_COMM_SELF; MPI_Info stub_info = MPI_INFO_NULL; - if ((fapl_id = H5P_create_id(H5P_CLS_FILE_ACCESS_g, FALSE)) < 0) + if ((fapl_id = H5P_create_id(H5P_CLS_FILE_ACCESS_g, false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't create FAPL for stub file"); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -568,7 +568,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm stub_file_id = (uint64_t)st.st_ino; } - bcasted_inode = TRUE; + bcasted_inode = true; if (mpi_size > 1) { if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&stub_file_id, 1, MPI_UINT64_T, 0, file_comm))) @@ -1106,7 +1106,7 @@ init_app_topology(int64_t sf_context_id, H5FD_subfiling_params_t *subfiling_conf H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get subfiling topology object"); app_topology->app_layout = NULL; app_topology->app_comm = MPI_COMM_NULL; - app_topology->rank_is_ioc = FALSE; + app_topology->rank_is_ioc = false; app_topology->ioc_idx = -1; app_topology->n_io_concentrators = ioc_count; app_topology->io_concentrators = NULL; @@ -1594,7 +1594,7 @@ compare_layout_nodelocal(const void *layout1, const void *layout2) * can also select one or more additional IOCs. * * As a side effect, we fill the 'io_concentrators' vector - * and set the 'rank_is_ioc' flag to TRUE if our rank is + * and set the 'rank_is_ioc' flag to true if our rank is * identified as owning an I/O Concentrator (IOC). * *------------------------------------------------------------------------- @@ -1658,7 +1658,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ assert(!app_topology->rank_is_ioc); app_topology->ioc_idx = total_ioc_count; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } total_ioc_count++; @@ -1681,7 +1681,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ assert(!app_topology->rank_is_ioc); app_topology->ioc_idx = total_ioc_count; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } total_ioc_count++; @@ -1733,7 +1733,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ if (app_layout->world_rank == io_concentrators[num_iocs_assigned]) { app_topology->ioc_idx = num_iocs_assigned; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } } @@ -2273,14 +2273,14 @@ done: */ static herr_t create_config_file(subfiling_context_t *sf_context, const char *base_filename, const char *config_dir, - const char *subfile_dir, hbool_t truncate_if_exists) + const char *subfile_dir, bool truncate_if_exists) { - hbool_t config_file_exists = FALSE; - FILE *config_file = NULL; - char *config_filename = NULL; - char *line_buf = NULL; - int ret = 0; - herr_t ret_value = SUCCEED; + bool config_file_exists = false; + FILE *config_file = NULL; + char *config_filename = NULL; + char *line_buf = NULL; + int ret = 0; + herr_t ret_value = SUCCEED; assert(sf_context); assert(base_filename); @@ -2406,11 +2406,11 @@ static herr_t open_config_file(const char *base_filename, const char *config_dir, uint64_t file_id, const char *mode, FILE **config_file_out) { - hbool_t config_file_exists = FALSE; - FILE *config_file = NULL; - char *config_filename = NULL; - int ret = 0; - herr_t ret_value = SUCCEED; + bool config_file_exists = false; + FILE *config_file = NULL; + char *config_filename = NULL; + int ret = 0; + herr_t ret_value = SUCCEED; assert(base_filename); assert(config_dir); @@ -2568,8 +2568,8 @@ herr_t H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepath) { hsize_t path_len = HSIZE_UNDEF; - hbool_t bcasted_path_len = FALSE; - hbool_t bcasted_path = FALSE; + bool bcasted_path_len = false; + bool bcasted_path = false; char *resolved_path = NULL; char *file_basename = NULL; char *file_dirname = NULL; @@ -2632,7 +2632,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat } /* Broadcast the size of the resolved filepath string to other ranks */ - bcasted_path_len = TRUE; + bcasted_path_len = true; if (mpi_size > 1) { if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&path_len, 1, HSIZE_AS_MPI_TYPE, 0, comm))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code); @@ -2647,7 +2647,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat } /* Broadcast the resolved filepath to other ranks */ - bcasted_path = TRUE; + bcasted_path = true; if (mpi_size > 1) { H5_CHECK_OVERFLOW(path_len, hsize_t, int); if (MPI_SUCCESS != (mpi_code = MPI_Bcast(resolved_path, (int)path_len, MPI_CHAR, 0, comm))) diff --git a/src/H5FDtest.c b/src/H5FDtest.c index 87d24b6..4f2a5b2 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -73,24 +73,24 @@ * * This function is only intended for use in the test code. * - * Return: TRUE (1) if the VFD supports SWMR I/O or vfd_name is + * Return: true (1) if the VFD supports SWMR I/O or vfd_name is * NULL or the empty string (which implies the default VFD). * - * FALSE (0) if it does not + * false (0) if it does not * * This function cannot fail at this time so there is no * error return value. *------------------------------------------------------------------------- */ -hbool_t +bool H5FD__supports_swmr_test(const char *vfd_name) { - hbool_t ret_value = FALSE; + bool ret_value = false; FUNC_ENTER_NOAPI_NOINIT_NOERR if (!vfd_name || !HDstrcmp(vfd_name, "") || !HDstrcmp(vfd_name, "nomatch")) - ret_value = TRUE; + ret_value = true; else ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2"); diff --git a/src/H5FL.c b/src/H5FL.c index 5ed6430..5dd4ed3 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -273,7 +273,7 @@ H5FL__reg_init(H5FL_reg_head_t *head) H5FL_reg_gc_head.first = new_node; /* Indicate that the free list is initialized */ - head->init = TRUE; + head->init = true; /* Make certain that the space allocated is large enough to store a free list pointer (eventually) */ if (head->size < sizeof(H5FL_reg_node_t)) @@ -609,7 +609,7 @@ H5FL__reg_term(void) /* No allocations left open for list, get rid of it */ else { /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_reg_gc_head.first->list->init = FALSE; + H5FL_reg_gc_head.first->list->init = false; /* Free the node from the garbage collection list */ H5MM_xfree(H5FL_reg_gc_head.first); @@ -751,7 +751,7 @@ H5FL__blk_init(H5FL_blk_head_t *head) H5FL_blk_gc_head.first = new_node; /* Indicate that the PQ is initialized */ - head->init = TRUE; + head->init = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -782,9 +782,9 @@ H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size) /* check if there is a free list for blocks of this size */ /* and if there are any blocks available on the list */ if ((free_list = H5FL__blk_find_list(&(head->head), size)) != NULL && free_list->list != NULL) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_blk_free_block_avail() */ @@ -1281,7 +1281,7 @@ H5FL__blk_term(void) /* No allocations left open for list, get rid of it */ else { /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_blk_gc_head.first->pq->init = FALSE; + H5FL_blk_gc_head.first->pq->init = false; /* Free the node from the garbage collection list */ H5MM_free(H5FL_blk_gc_head.first); @@ -1337,7 +1337,7 @@ H5FL__arr_init(H5FL_arr_head_t *head) head->list_arr[u].size = head->base_size + (head->elem_size * u); /* Indicate that the free list is initialized */ - head->init = TRUE; + head->init = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1804,7 +1804,7 @@ H5FL__arr_term(void) H5MM_xfree(H5FL_arr_gc_head.first->list->list_arr); /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_arr_gc_head.first->list->init = FALSE; + H5FL_arr_gc_head.first->list->init = false; /* Free the node from the garbage collection list */ H5MM_free(H5FL_arr_gc_head.first); @@ -1983,7 +1983,7 @@ H5FL_fac_init(size_t size) #endif /* H5FL_TRACK */ /* Indicate that the free list is initialized */ - factory->init = TRUE; + factory->init = true; /* Set return value */ ret_value = factory; @@ -2353,7 +2353,7 @@ H5FL__fac_term_all(void) assert(H5FL_fac_gc_head.first->list->allocated == 0); /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_fac_gc_head.first->list->init = FALSE; + H5FL_fac_gc_head.first->list->init = false; /* Free the node from the garbage collection list */ H5FL_fac_gc_head.first = H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 45ca751..3b9a84a 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -92,7 +92,7 @@ typedef struct H5FL_reg_node_t { /* Data structure for free list of blocks */ typedef struct H5FL_reg_head_t { - hbool_t init; /* Whether the free list has been initialized */ + bool init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ unsigned onlist; /* Number of blocks on free list */ const char *name; /* Name of the type */ @@ -163,7 +163,7 @@ typedef struct H5FL_blk_node_t { /* Data structure for priority queue of native block free lists */ typedef struct H5FL_blk_head_t { - hbool_t init; /* Whether the free list has been initialized */ + bool init; /* Whether the free list has been initialized */ unsigned allocated; /* Total number of blocks allocated */ unsigned onlist; /* Total number of blocks on free list */ size_t list_mem; /* Total amount of memory in blocks on free list */ @@ -215,7 +215,7 @@ typedef struct H5FL_blk_head_t { #define H5FL_BLK_CALLOC(t, size) (uint8_t *)H5MM_calloc(size) #define H5FL_BLK_FREE(t, blk) (uint8_t *)H5MM_xfree(blk) #define H5FL_BLK_REALLOC(t, blk, new_size) (uint8_t *)H5MM_realloc(blk, new_size) -#define H5FL_BLK_AVAIL(t, size) (FALSE) +#define H5FL_BLK_AVAIL(t, size) (false) #endif /* H5_NO_BLK_FREE_LISTS */ /* Data structure to store each array in free list */ @@ -237,7 +237,7 @@ typedef struct H5FL_arr_node_t { /* Data structure for free list of array blocks */ typedef struct H5FL_arr_head_t { - hbool_t init; /* Whether the free list has been initialized */ + bool init; /* Whether the free list has been initialized */ unsigned allocated; /* Total number of blocks allocated */ size_t list_mem; /* Amount of memory in block on free list */ const char *name; /* Name of the type */ @@ -358,7 +358,7 @@ typedef struct H5FL_fac_node_t H5FL_fac_node_t; /* Data structure for free list block factory */ typedef struct H5FL_fac_head_t { - hbool_t init; /* Whether the free list has been initialized */ + bool init; /* Whether the free list has been initialized */ unsigned allocated; /* Number of blocks allocated */ unsigned onlist; /* Number of blocks on free list */ size_t size; /* Size of the blocks in the list */ diff --git a/src/H5FO.c b/src/H5FO.c index 8a8f4d5..66e5ba4 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -32,7 +32,7 @@ typedef struct H5FO_open_obj_t { haddr_t addr; /* Address of object header for object */ void *obj; /* Pointer to the object */ - hbool_t deleted; /* Flag to indicate that the object was deleted from the file */ + bool deleted; /* Flag to indicate that the object was deleted from the file */ } H5FO_open_obj_t; /* Information about counted objects in a file */ @@ -139,7 +139,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr) H5F_t *f; IN/OUT: File's opened object info set haddr_t addr; IN: Address of object to insert void *obj; IN: Pointer to object to insert - hbool_t delete_flag; IN: Whether to 'mark' this object for deletion + bool delete_flag; IN: Whether to 'mark' this object for deletion RETURNS Returns a non-negative on success, negative on failure @@ -151,7 +151,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag) +H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, bool delete_flag) { H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value = SUCCEED; /* Return value */ @@ -252,7 +252,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) +H5FO_mark(const H5F_t *f, haddr_t addr, bool deleted) { H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value = SUCCEED; /* Return value */ @@ -280,12 +280,12 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) PURPOSE Check if an object is marked to be deleted when it is closed USAGE - hbool_t H5FO_marked(f,addr) + bool H5FO_marked(f,addr) const H5F_t *f; IN: File opened object is in haddr_t addr; IN: Address of object to delete RETURNS - Returns a TRUE/FALSE on success + Returns a true/false on success DESCRIPTION Checks if the object is currently in the "opened objects" tree and whether its marks for deletion from the file when it is closed. @@ -294,11 +294,11 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -hbool_t +bool H5FO_marked(const H5F_t *f, haddr_t addr) { H5FO_open_obj_t *open_obj; /* Information about open object */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOERR diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index 1f44ec8..5f5fe9c 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -31,10 +31,10 @@ typedef H5SL_t H5FO_t; /* Currently, all open objects are stored in skip list */ /* Private routines */ H5_DLL herr_t H5FO_create(const H5F_t *f); H5_DLL void *H5FO_opened(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag); +H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, bool delete_flag); H5_DLL herr_t H5FO_delete(H5F_t *f, haddr_t addr); -H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted); -H5_DLL hbool_t H5FO_marked(const H5F_t *f, haddr_t addr); +H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, bool deleted); +H5_DLL bool H5FO_marked(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_dest(const H5F_t *f); H5_DLL herr_t H5FO_top_create(H5F_t *f); H5_DLL herr_t H5FO_top_incr(const H5F_t *f, haddr_t addr); diff --git a/src/H5FS.c b/src/H5FS.c index 40bee44..c21ecf2 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -264,31 +264,31 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) fprintf(stderr, "%s: fspace_status = %0x: ", __func__, fspace_status); if (fspace_status) { - hbool_t printed = FALSE; + bool printed = false; if (fspace_status & H5AC_ES__IN_CACHE) { fprintf(stderr, "H5AC_ES__IN_CACHE"); - printed = TRUE; + printed = true; } /* end if */ if (fspace_status & H5AC_ES__IS_DIRTY) { fprintf(stderr, "%sH5AC_ES__IS_DIRTY", (printed ? " | " : "")); - printed = TRUE; + printed = true; } /* end if */ if (fspace_status & H5AC_ES__IS_PROTECTED) { fprintf(stderr, "%sH5AC_ES__IS_PROTECTED", (printed ? " | " : "")); - printed = TRUE; + printed = true; } /* end if */ if (fspace_status & H5AC_ES__IS_PINNED) { fprintf(stderr, "%sH5AC_ES__IS_PINNED", (printed ? " | " : "")); - printed = TRUE; + printed = true; } /* end if */ if (fspace_status & H5AC_ES__IS_FLUSH_DEP_PARENT) { fprintf(stderr, "%sH5AC_ES__IS_FLUSH_DEP_PARENT", (printed ? " | " : "")); - printed = TRUE; + printed = true; } /* end if */ if (fspace_status & H5AC_ES__IS_FLUSH_DEP_CHILD) { fprintf(stderr, "%sH5AC_ES__IS_FLUSH_DEP_CHILD", (printed ? " | " : "")); - printed = TRUE; + printed = true; } /* end if */ } /* end if */ fprintf(stderr, "\n"); @@ -488,7 +488,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) fspace->alloc_sect_size)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for absorbing section info"); - else if (status == FALSE) { + else if (status == false) { /* Section info can't "go away", but it's free. Allow * header to record it */ @@ -867,7 +867,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space) +H5FS_free(H5F_t *f, H5FS_t *fspace, bool free_file_space) { haddr_t saved_addr; /* Previous address of item */ unsigned cache_flags; /* Flags for unprotecting cache entries */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 420582e..f5e9361 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -72,7 +72,7 @@ static herr_t H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *ke /* Metadata cache callbacks */ static herr_t H5FS__cache_hdr_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FS__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); @@ -82,7 +82,7 @@ static herr_t H5FS__cache_hdr_free_icr(void *thing); static herr_t H5FS__cache_sinfo_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FS__cache_sinfo_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len); static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); @@ -171,7 +171,7 @@ H5FS__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -182,7 +182,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -193,7 +193,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__cache_hdr_verify_chksum() */ @@ -213,7 +213,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE */ static void * H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ H5FS_hdr_cache_ud_t *udata = (H5FS_hdr_cache_ud_t *)_udata; /* User data for callback */ @@ -404,8 +404,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * * 1) The instance of H5FS_sinfo_t is not in the metadata cache. * - * This will be TRUE iff H5_addr_defined(fspace->sect_addr) - * is FALSE, and fspace->sinfo is not NULL. This is sometimes + * This will be true iff H5_addr_defined(fspace->sect_addr) + * is false, and fspace->sinfo is not NULL. This is sometimes * referred to as "floating" section info in the comments. * * If the section info structure contains free space data @@ -417,7 +417,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * * H5_addr_defined(fspace->addr) * - * will both be TRUE. If this condition does not hold, then + * will both be true. If this condition does not hold, then * either the free space info is not persistent * (!H5_addr_defined(fspace->addr)???) or the section info * contains no free space data that must be written to file @@ -435,7 +435,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * - * Observe that fspace->serial_sect_count > 0 must be TRUE in + * Observe that fspace->serial_sect_count > 0 must be true in * cases 2) and 3), as the section info should not be stored on * disk if it doesn't exist. Similarly, since the section info * will not be stored to disk unless the header is, @@ -874,7 +874,7 @@ H5FS__cache_sinfo_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -885,7 +885,7 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -896,7 +896,7 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__cache_sinfo_verify_chksum() */ @@ -916,7 +916,7 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU */ static void * H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_NDEBUG_UNUSED *dirty) + bool H5_ATTR_NDEBUG_UNUSED *dirty) { H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* User data for callback */ H5FS_t *fspace; /* free space manager */ diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 4ec7aaf..6e14deb 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -126,7 +126,7 @@ typedef struct H5FS_sinfo_t { H5FS_bin_t *bins; /* Array of lists of lists of free sections */ /* Computed/cached values */ - hbool_t dirty; /* Whether this info in memory is out of sync w/info in file */ + bool dirty; /* Whether this info in memory is out of sync w/info in file */ unsigned nbins; /* Number of bins */ size_t serial_size; /* Total size of all serializable sections */ size_t tot_size_count; /* Total number of differently sized sections */ @@ -171,10 +171,10 @@ struct H5FS_t { haddr_t addr; /* Address of free space header on disk */ size_t hdr_size; /* Size of free space header on disk */ H5FS_sinfo_t *sinfo; /* Section information */ - hbool_t swmr_write; /* Flag indicating the file is opened with SWMR-write access */ + bool swmr_write; /* Flag indicating the file is opened with SWMR-write access */ unsigned sinfo_lock_count; /* # of times the section info has been locked */ - hbool_t sinfo_protected; /* Whether the section info was protected when locked */ - hbool_t sinfo_modified; /* Whether the section info has been modified while locked */ + bool sinfo_protected; /* Whether the section info was protected when locked */ + bool sinfo_modified; /* Whether the section info has been modified while locked */ unsigned sinfo_accmode; /* Access mode for protecting the section info */ /* must be either H5C__NO_FLAGS_SET (i.e r/w) */ /* or H5AC__READ_ONLY_FLAG (i.e. r/o). */ diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index abd4b20..f917a25 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -194,7 +194,7 @@ H5_DLL herr_t H5FS_delete(H5F_t *f, haddr_t fs_addr); H5_DLL herr_t H5FS_close(H5F_t *f, H5FS_t *fspace); H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr); H5_DLL herr_t H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace); -H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space); +H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, bool free_file_space); /* Free space section routines */ H5_DLL herr_t H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node, unsigned flags, diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 7889f76..9bf2af0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -239,7 +239,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) /* If the section address is defined, load it from the file */ if (H5_addr_defined(fspace->sect_addr)) { /* Sanity check */ - assert(fspace->sinfo_protected == FALSE); + assert(fspace->sinfo_protected == false); assert(H5_addr_defined(fspace->addr)); #ifdef H5FS_SINFO_DEBUG @@ -254,7 +254,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections"); /* Remember that we protected the section info & the access mode */ - fspace->sinfo_protected = TRUE; + fspace->sinfo_protected = true; fspace->sinfo_accmode = accmode; } /* end if */ else { @@ -316,7 +316,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) +H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, bool modified) { herr_t ret_value = SUCCEED; /* Return value */ @@ -345,10 +345,10 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDIRTY, FAIL, "attempt to modify read-only section info"); /* If we modified the section info, mark it dirty */ - fspace->sinfo->dirty = TRUE; + fspace->sinfo->dirty = true; /* Remember that the section info was modified while locked */ - fspace->sinfo_modified = TRUE; + fspace->sinfo_modified = true; /* Assume that the modification will affect the statistics in the header * and mark that dirty also @@ -362,9 +362,8 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) /* Check if section info lock count dropped to zero */ if (fspace->sinfo_lock_count == 0) { - hbool_t release_sinfo_space = - FALSE; /* Flag to indicate section info space in file should be released */ - hbool_t closing_or_flushing = f->shared->closing; /* Is closing or flushing in progress */ + bool release_sinfo_space = false; /* Flag to indicate section info space in file should be released */ + bool closing_or_flushing = f->shared->closing; /* Is closing or flushing in progress */ /* Check whether cache-flush is in progress if closing is not. */ if (!closing_or_flushing && @@ -410,7 +409,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info"); /* Reset the protected flag on the section info */ - fspace->sinfo_protected = FALSE; + fspace->sinfo_protected = false; /* Check if header is taking ownership of section info */ if ((cache_flags & H5AC__TAKE_OWNERSHIP_FLAG)) { @@ -418,7 +417,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) fprintf(stderr, "%s: Taking ownership of section info\n", __func__); #endif /* H5FS_SINFO_DEBUG */ /* Set flag to release section info space in file */ - release_sinfo_space = TRUE; + release_sinfo_space = true; } /* end if */ else { #ifdef H5FS_SINFO_DEBUG @@ -438,12 +437,12 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) bigger than previous section */ if (closing_or_flushing) { if (fspace->sect_size > fspace->alloc_sect_size) - release_sinfo_space = TRUE; + release_sinfo_space = true; else fspace->sect_size = fspace->alloc_sect_size; } else - release_sinfo_space = TRUE; + release_sinfo_space = true; } else assert(fspace->alloc_sect_size == 0); @@ -459,7 +458,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) } /* end else */ /* Reset the "section info modified" flag */ - fspace->sinfo_modified = FALSE; + fspace->sinfo_modified = false; /* Check if header needs to release section info in the file */ if (release_sinfo_space) { @@ -876,8 +875,8 @@ done: herr_t H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) { - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - herr_t ret_value = SUCCEED; /* Return value */ + bool sinfo_valid = false; /* Whether the section info is valid */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -889,7 +888,7 @@ H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* Perform actual section removal */ if (H5FS__sect_remove_real(fspace, sect) < 0) @@ -897,7 +896,7 @@ H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) done: /* Release the section info */ - if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, TRUE) < 0) + if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, true) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info"); FUNC_LEAVE_NOAPI(ret_value) @@ -916,7 +915,7 @@ static herr_t H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_section_info_t *sect) { H5FS_node_t *fspace_node = NULL; /* Pointer to free space node of the correct size */ - hbool_t fspace_node_alloc = FALSE; /* Whether the free space node was allocated */ + bool fspace_node_alloc = false; /* Whether the free space node was allocated */ unsigned bin; /* Bin to put the free space section in */ herr_t ret_value = SUCCEED; /* Return value */ @@ -944,7 +943,7 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_ /* Allocate new free list size node */ if (NULL == (fspace_node = H5FL_MALLOC(H5FS_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for free space node"); - fspace_node_alloc = TRUE; + fspace_node_alloc = true; /* Initialize the free list size node */ fspace_node->sect_size = sect->size; @@ -955,7 +954,7 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_ /* Insert new free space size node into bin's list */ if (H5SL_insert(sinfo->bins[bin].bin_list, fspace_node, &fspace_node->sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space node into skip list"); - fspace_node_alloc = FALSE; /* (owned by the bin skip list now, don't need to free on error) */ + fspace_node_alloc = false; /* (owned by the bin skip list now, don't need to free on error) */ /* Increment number of section sizes */ sinfo->tot_size_count++; @@ -1096,8 +1095,8 @@ static herr_t H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) { H5FS_section_class_t *sect_cls; /* Section's class */ - hbool_t modified; /* Flag to indicate merge or shrink occurred */ - hbool_t remove_sect = FALSE; /* Whether a section should be removed before shrinking */ + bool modified; /* Flag to indicate merge or shrink occurred */ + bool remove_sect = false; /* Whether a section should be removed before shrinking */ htri_t status; /* Status value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1112,14 +1111,14 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Loop until no more merging */ if (fspace->sinfo->merge_list) { do { - H5SL_node_t *less_sect_node; /* Skip list node for section less than new section */ - H5SL_node_t *greater_sect_node = NULL; /* Skip list node for section greater than new section */ - H5FS_section_info_t *tmp_sect; /* Temporary free space section */ - H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ - hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */ + H5SL_node_t *less_sect_node; /* Skip list node for section less than new section */ + H5SL_node_t *greater_sect_node = NULL; /* Skip list node for section greater than new section */ + H5FS_section_info_t *tmp_sect; /* Temporary free space section */ + H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ + bool greater_sect_node_valid = false; /* Indicate if 'greater than' section node is valid */ /* Reset 'modification occurred' flag */ - modified = FALSE; + modified = false; /* Look for neighboring section before new section */ less_sect_node = H5SL_below(fspace->sinfo->merge_list, &(*sect)->addr); @@ -1128,7 +1127,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) if (less_sect_node) { /* Check for node greater than section */ greater_sect_node = H5SL_next(less_sect_node); - greater_sect_node_valid = TRUE; + greater_sect_node_valid = true; /* Get section for 'less than' skip list node */ tmp_sect = (H5FS_section_info_t *)H5SL_item(less_sect_node); @@ -1165,7 +1164,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ - modified = TRUE; + modified = true; } /* end if */ } /* end if */ } /* end if */ @@ -1212,7 +1211,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ - modified = TRUE; + modified = true; } /* end if */ } /* end if */ } /* end if */ @@ -1223,7 +1222,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Loop until no more shrinking */ do { /* Reset 'modification occurred' flag */ - modified = FALSE; + modified = false; /* Check for (possibly merged) section able to shrink the size of the container */ sect_cls = &fspace->sect_cls[(*sect)->type]; @@ -1237,7 +1236,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) if (H5FS__sect_remove_real(fspace, *sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures"); - remove_sect = FALSE; + remove_sect = false; } /* end if */ /* Shrink the container */ @@ -1259,13 +1258,13 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) assert(*sect); /* Indicate that this section needs to be removed if it causes a shrink */ - remove_sect = TRUE; + remove_sect = true; } /* end if */ } /* end if */ } /* end if */ /* Indicate successful merge occurred */ - modified = TRUE; + modified = true; } /* end if */ } /* end if */ } while (modified && *sect); @@ -1291,8 +1290,8 @@ herr_t H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data) { H5FS_section_class_t *cls; /* Section's class */ - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ + bool sinfo_valid = false; /* Whether the section info is valid */ + bool sinfo_modified = false; /* Whether the section info was modified */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1312,7 +1311,7 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* Call "add" section class callback, if there is one */ cls = &fspace->sect_cls[sect->type]; @@ -1345,7 +1344,7 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag /* Mark free space sections as changed */ /* (if adding sections while deserializing sections, don't set the flag) */ if (!(flags & (H5FS_ADD_DESERIALIZING | H5FS_PAGE_END_NO_ADD))) - sinfo_modified = TRUE; + sinfo_modified = true; done: /* Release the section info */ @@ -1375,9 +1374,9 @@ htri_t H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data) { - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ - htri_t ret_value = FALSE; /* Return value */ + bool sinfo_valid = false; /* Whether the section info is valid */ + bool sinfo_modified = false; /* Whether the section info was modified */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1405,7 +1404,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* @@ -1481,10 +1480,10 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize } /* end else */ /* Note that we modified the section info */ - sinfo_modified = TRUE; + sinfo_modified = true; /* Indicate success */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ } /* end if */ @@ -1502,8 +1501,8 @@ done: * * Purpose: Try to merge/shrink a block * - * Return: TRUE: merged/shrunk - * FALSE: not merged/not shrunk + * Return: true: merged/shrunk + * false: not merged/not shrunk * Failure: negative * *------------------------------------------------------------------------- @@ -1511,10 +1510,10 @@ done: htri_t H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data) { - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ + bool sinfo_valid = false; /* Whether the section info is valid */ + bool sinfo_modified = false; /* Whether the section info was modified */ hsize_t saved_fs_size; /* Copy of the free-space section size */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1528,7 +1527,7 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigne /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; saved_fs_size = sect->size; /* Attempt to merge/shrink section with existing sections */ @@ -1537,8 +1536,8 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigne /* Check if section is shrunk and/or merged away completely */ if (!sect) { - sinfo_modified = TRUE; - HGOTO_DONE(TRUE); + sinfo_modified = true; + HGOTO_DONE(true); } /* end if */ else { /* Check if section is merged */ @@ -1546,8 +1545,8 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigne if (H5FS__sect_link(fspace, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list"); - sinfo_modified = TRUE; - HGOTO_DONE(TRUE); + sinfo_modified = true; + HGOTO_DONE(true); } /* end if */ } /* end else */ @@ -1574,7 +1573,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node { H5FS_node_t *fspace_node; /* Free list size node */ unsigned bin; /* Bin to put the free space section in */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ H5SL_node_t *curr_size_node = NULL; const H5FS_section_class_t *cls; /* Class of section */ @@ -1623,7 +1622,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't remove section from non-size tracking data structures"); /* Indicate that we found a node for the request */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ else { /* alignment is set */ @@ -1689,7 +1688,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node assert(request <= (*node)->size); } /* end if */ /* Indicate that we found a node for the request */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ /* Get the next section node in the list */ @@ -1722,9 +1721,9 @@ done: htri_t H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) { - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ - htri_t ret_value = FALSE; /* Return value */ + bool sinfo_valid = false; /* Whether the section info is valid */ + bool sinfo_modified = false; /* Whether the section info was modified */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1739,7 +1738,7 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t ** /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* Look for node in bins */ if ((ret_value = H5FS__sect_find_node(fspace, request, node)) < 0) @@ -1748,7 +1747,7 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t ** /* Decrement # of sections on free list, if we found an object */ if (ret_value > 0) { /* Note that we've modified the section info */ - sinfo_modified = TRUE; + sinfo_modified = true; } /* end if */ } /* end if */ @@ -1841,7 +1840,7 @@ herr_t H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) { H5FS_iter_ud_t udata; /* User data for callbacks */ - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ + bool sinfo_valid = false; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1862,7 +1861,7 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* Iterate over all the bins */ for (bin = 0; bin < fspace->sinfo->nbins; bin++) { @@ -1877,7 +1876,7 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) done: /* Release the section info */ - if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, FALSE) < 0) + if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, false) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info"); FUNC_LEAVE_NOAPI(ret_value) @@ -1925,7 +1924,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint const H5FS_section_class_t *old_cls; /* Old class of section */ const H5FS_section_class_t *new_cls; /* New class of section */ unsigned old_class; /* Old class ID of section */ - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ + bool sinfo_valid = false; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1939,7 +1938,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; /* Get class info */ old_class = sect->type; @@ -1950,13 +1949,13 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint if ((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) { H5FS_node_t *fspace_node; /* Free list size node */ unsigned bin; /* Bin to put the free space section in */ - hbool_t to_ghost; /* Flag if the section is changing to a ghost section */ + bool to_ghost; /* Flag if the section is changing to a ghost section */ /* Determine if this section is becoming a ghost or is becoming serializable */ if (old_cls->flags & H5FS_CLS_GHOST_OBJ) - to_ghost = FALSE; + to_ghost = false; else - to_ghost = TRUE; + to_ghost = true; /* Sanity check */ assert(fspace->sinfo->bins); @@ -2013,13 +2012,13 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint /* Check if the section's class change will affect the mergeable list */ if ((old_cls->flags & H5FS_CLS_SEPAR_OBJ) != (new_cls->flags & H5FS_CLS_SEPAR_OBJ)) { - hbool_t to_mergable; /* Flag if the section is changing to a mergeable section */ + bool to_mergable; /* Flag if the section is changing to a mergeable section */ /* Determine if this section is becoming mergeable or is becoming separate */ if (old_cls->flags & H5FS_CLS_SEPAR_OBJ) - to_mergable = TRUE; + to_mergable = true; else - to_mergable = FALSE; + to_mergable = false; /* Add or remove section from merge list, as appropriate */ if (to_mergable) { @@ -2053,7 +2052,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint done: /* Release the section info */ - if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, TRUE) < 0) + if (sinfo_valid && H5FS__sinfo_unlock(f, fspace, true) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info"); FUNC_LEAVE_NOAPI(ret_value) @@ -2207,16 +2206,16 @@ H5FS__sect_assert(const H5FS_t *fspace) * Purpose: To shrink the last section on the merge list if the section * is at EOF. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ htri_t H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) { - hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ - hbool_t section_removed = FALSE; /* Whether a section was removed */ - htri_t ret_value = FALSE; /* Return value */ + bool sinfo_valid = false; /* Whether the section info is valid */ + bool section_removed = false; /* Whether a section was removed */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2225,7 +2224,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); - sinfo_valid = TRUE; + sinfo_valid = true; if (fspace->sinfo && fspace->sinfo->merge_list) { H5SL_node_t *last_node; /* Last node in merge list */ @@ -2250,7 +2249,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) if (H5FS__sect_remove_real(fspace, tmp_sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures"); - section_removed = TRUE; + section_removed = true; /* Shrink away section */ if ((*tmp_sect_cls->shrink)(&tmp_sect, op_data) < 0) diff --git a/src/H5Faccum.c b/src/H5Faccum.c index e621e98..758b015 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -333,7 +333,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adju HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed"); /* Reset accumulator dirty flag */ - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ } /* end if */ else { @@ -346,7 +346,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adju HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed"); /* Reset accumulator dirty flag */ - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ /* Adjust dirty region tracking info */ @@ -448,7 +448,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s accum->dirty_len = size + accum->dirty_off + accum->dirty_len; else { accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ accum->dirty_off = 0; } /* end if */ @@ -467,7 +467,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s else { accum->dirty_off = accum->size; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ /* Set the new size of the metadata accumulator */ @@ -505,7 +505,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s else { accum->dirty_off = dirty_off; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ /* Check if the new metadata overlaps the beginning of the current accumulator */ @@ -546,7 +546,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s else { accum->dirty_off = 0; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ /* Check if the new metadata overlaps the end of the current accumulator */ @@ -585,7 +585,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s else { accum->dirty_off = dirty_off; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ /* New metadata overlaps both ends of the current accumulator */ @@ -620,7 +620,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s /* Adjust the dirty region and mark accumulator dirty */ accum->dirty_off = 0; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ /* New piece of metadata doesn't adjoin or overlap the existing accumulator */ @@ -632,7 +632,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed"); /* Reset accumulator dirty flag */ - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ /* Cache the new piece of metadata */ @@ -683,7 +683,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s /* Adjust the dirty region and mark accumulator dirty */ accum->dirty_off = 0; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ /* No metadata in the accumulator, grab this piece and keep it */ @@ -717,14 +717,14 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s /* Adjust the dirty region and mark accumulator dirty */ accum->dirty_off = 0; accum->dirty_len = size; - accum->dirty = TRUE; + accum->dirty = true; } /* end else */ } /* end if */ else { /* Make certain that data in accumulator is visible before new write */ if ((H5F_SHARED_INTENT(f_sh) & H5F_ACC_SWMR_WRITE) > 0) /* Flush if dirty and reset accumulator */ - if (H5F__accum_reset(f_sh, TRUE) < 0) + if (H5F__accum_reset(f_sh, true) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator"); /* Write the data */ @@ -754,7 +754,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s /* Check if entire dirty region is overwritten */ if (H5_addr_le(dirty_end, addr + size)) { - accum->dirty = FALSE; + accum->dirty = false; accum->dirty_len = 0; } /* end if */ else { @@ -775,7 +775,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s } /* end if */ else { /* Access covers whole accumulator */ /* Reset accumulator, but don't flush */ - if (H5F__accum_reset(f_sh, FALSE) < 0) + if (H5F__accum_reset(f_sh, false) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator"); } /* end else */ } /* end if */ @@ -797,7 +797,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s /* Check if entire dirty region is overwritten */ if (H5_addr_ge(dirty_start, addr)) { - accum->dirty = FALSE; + accum->dirty = false; accum->dirty_len = 0; } /* end if */ else { @@ -870,7 +870,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr /* Reset the accumulator, but don't free buffer */ accum->loc = HADDR_UNDEF; accum->size = 0; - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ /* Block to free must end within the accumulator */ else { @@ -900,7 +900,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr } /* end if */ /* Block freed encompasses dirty region */ else - accum->dirty = FALSE; + accum->dirty = false; } /* end else */ } /* end if */ } /* end else */ @@ -947,7 +947,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr } /* end if */ /* Reset dirty flag */ - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ /* Block to free begins at beginning of or in middle of dirty region */ else { @@ -970,7 +970,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr /* Check for block to free beginning at same location as dirty region */ if (H5_addr_eq(addr, dirty_start)) { /* Reset dirty flag */ - accum->dirty = FALSE; + accum->dirty = false; } /* end if */ /* Block to free eliminates end of dirty region */ else { @@ -1021,7 +1021,7 @@ H5F__accum_flush(H5F_shared_t *f_sh) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed"); /* Reset the dirty flag */ - f_sh->accum.dirty = FALSE; + f_sh->accum.dirty = false; } /* end if */ done: @@ -1038,7 +1038,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush) +H5F__accum_reset(H5F_shared_t *f_sh, bool flush) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1061,7 +1061,7 @@ H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush) /* Reset the buffer sizes & location */ f_sh->accum.alloc_size = f_sh->accum.size = 0; f_sh->accum.loc = HADDR_UNDEF; - f_sh->accum.dirty = FALSE; + f_sh->accum.dirty = false; f_sh->accum.dirty_len = 0; } /* end if */ diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index e05de9f..c946fa4 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -143,7 +143,7 @@ herr_t H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) { unsigned cwfsno; /* Local index for iterating over collections */ - hbool_t found = FALSE; /* Flag to indicate a heap with enough space was found */ + bool found = false; /* Flag to indicate a heap with enough space was found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -172,7 +172,7 @@ H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) for (cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) if (H5HG_FREE_SIZE(f->shared->cwfs[cwfsno]) >= need) { *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); - found = TRUE; + found = true; break; } /* end if */ @@ -196,12 +196,12 @@ H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); if (was_extended < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap"); - else if (was_extended == TRUE) { + else if (was_extended == true) { if (H5HG_extend(f, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection"); *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); - found = TRUE; + found = true; break; } /* end if */ } /* end if */ @@ -235,7 +235,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, hbool_t add_heap) +H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, bool add_heap) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 257b7b2..a3ae1d8 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -138,7 +138,7 @@ done: * driver when attempting to open the file when in fact it * should use all known file drivers. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ htri_t H5Fis_hdf5(const char *name) { H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */ - hbool_t is_accessible = FALSE; /* Whether file is accessible */ + bool is_accessible = false; /* Whether file is accessible */ htri_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 194ecbe..82de9e6 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -132,7 +132,7 @@ H5F_t * H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_efc_ent_t *ent = NULL; /* Entry for target file in efc */ - hbool_t open_file = FALSE; /* Whether ent->file needs to be closed in case of error */ + bool open_file = false; /* Whether ent->file needs to be closed in case of error */ H5P_genplist_t *plist; /* Property list pointer for FAPL */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5F_t *ret_value = NULL; /* Return value */ @@ -263,7 +263,7 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h /* Open the file */ if (NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file"); - open_file = TRUE; + open_file = true; /* Make file post open call */ if (H5F__post_open(ent->file) < 0) diff --git a/src/H5Fint.c b/src/H5Fint.c index 8f80e97..607dbad 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -53,7 +53,7 @@ typedef struct H5F_olist_t { hid_t *obj_id_list; /* Pointer to the list of open IDs to return */ size_t *obj_id_count; /* Number of open IDs */ struct { - hbool_t local; /* Set flag for "local" file searches */ + bool local; /* Set flag for "local" file searches */ union { H5F_shared_t *shared; /* Pointer to shared file to look inside */ const H5F_t *file; /* Pointer to file to look inside */ @@ -74,24 +74,24 @@ typedef struct H5F_olist_t { static herr_t H5F__close_cb(H5VL_object_t *file_vol_obj, void **request); static herr_t H5F__set_vol_conn(H5F_t *file); static herr_t H5F__get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, - hbool_t app_ref, size_t *obj_id_count_ptr); + bool app_ref, size_t *obj_id_count_ptr); static int H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F__build_name(const char *prefix, const char *file_name, char **full_name /*out*/); static char *H5F__getenv_prefix_name(char **env_prefix /*in,out*/); static H5F_t *H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); -static herr_t H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking); -static herr_t H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure); +static herr_t H5F__check_if_using_file_locks(H5P_genplist_t *fapl, bool *use_file_locking); +static herr_t H5F__dest(H5F_t *f, bool flush, bool free_on_failure); static herr_t H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name); static herr_t H5F__flush_phase1(H5F_t *f); -static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); +static herr_t H5F__flush_phase2(H5F_t *f, bool closing); /*********************/ /* Package Variables */ /*********************/ /* Based on the value of the HDF5_USE_FILE_LOCKING environment variable. - * TRUE/FALSE have obvious meanings. FAIL means the environment variable was + * true/false have obvious meanings. FAIL means the environment variable was * not set, so the code should ignore it and use the fapl value instead. */ htri_t use_locks_env_g = FAIL; @@ -170,7 +170,7 @@ H5F_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_FILE) > 0) { - (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); + (void)H5I_clear_type(H5I_FILE, false, false); n++; /*H5I*/ } /* end if */ else { @@ -246,10 +246,10 @@ H5F__parse_file_lock_env_var(htri_t *use_locks) /* Check the file locking environment variable */ lock_env_var = HDgetenv(HDF5_USE_FILE_LOCKING); if (lock_env_var && (!HDstrcmp(lock_env_var, "FALSE") || !HDstrcmp(lock_env_var, "0"))) - *use_locks = FALSE; /* Override: Never use locks */ + *use_locks = false; /* Override: Never use locks */ else if (lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST_EFFORT") || !HDstrcmp(lock_env_var, "1"))) - *use_locks = TRUE; /* Override: Always use locks */ + *use_locks = true; /* Override: Always use locks */ else *use_locks = FAIL; /* Environment variable not set, or not set correctly */ @@ -299,7 +299,7 @@ H5F__set_vol_conn(H5F_t *file) /* Cache the connector ID & info for the container */ file->shared->vol_id = connector_prop.connector_id; file->shared->vol_info = new_connector_info; - if (H5I_inc_ref(file->shared->vol_id, FALSE) < 0) + if (H5I_inc_ref(file->shared->vol_id, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "incrementing VOL connector ID failed"); done: @@ -323,12 +323,12 @@ done: *------------------------------------------------------------------------- */ hid_t -H5F_get_access_plist(H5F_t *f, hbool_t app_ref) +H5F_get_access_plist(H5F_t *f, bool app_ref) { H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ - hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */ + bool driver_prop_copied = false; /* Whether the driver property has been set up */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ unsigned efc_size = 0; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -426,7 +426,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) driver_prop.driver_id = f->shared->lf->driver_id; driver_prop.driver_info = H5FD_fapl_get(f->shared->lf); driver_prop.driver_config_str = H5P_peek_driver_config_str(old_plist); - driver_prop_copied = TRUE; + driver_prop_copied = true; /* Set the driver property */ if (H5P_set(new_plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) @@ -464,7 +464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref, size_t *obj_id_count_ptr) +H5F_get_obj_count(const H5F_t *f, unsigned types, bool app_ref, size_t *obj_id_count_ptr) { herr_t ret_value = SUCCEED; @@ -490,7 +490,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, hbool_t app_ref, +H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, bool app_ref, size_t *obj_id_count_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -519,7 +519,7 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id_list, hbool_t app_ref, +H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id_list, bool app_ref, size_t *obj_id_count_ptr) { size_t obj_id_count = 0; /* Number of open IDs */ @@ -539,11 +539,11 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id /* Determine if we are searching for local or global objects */ if (types & H5F_OBJ_LOCAL) { - olist.file_info.local = TRUE; + olist.file_info.local = true; olist.file_info.ptr.file = f; } /* end if */ else { - olist.file_info.local = FALSE; + olist.file_info.local = false; olist.file_info.ptr.shared = f ? f->shared : NULL; } /* end else */ @@ -625,7 +625,7 @@ static int H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) { H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */ - hbool_t add_obj = FALSE; + bool add_obj = false; int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -641,7 +641,7 @@ H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) (!olist->file_info.local && (!olist->file_info.ptr.shared || (olist->file_info.ptr.shared && ((H5F_t *)obj_ptr)->shared == olist->file_info.ptr.shared)))) { - add_obj = TRUE; + add_obj = true; } /* end if */ } /* end if */ else { /* Either count opened object IDs or put the IDs on the list */ @@ -661,7 +661,7 @@ H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) break; case H5I_DATATYPE: - if (H5T_is_named((H5T_t *)obj_ptr) == TRUE) + if (H5T_is_named((H5T_t *)obj_ptr) == true) oloc = H5T_oloc((H5T_t *)obj_ptr); else oloc = NULL; @@ -690,15 +690,15 @@ H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) } /* end switch */ if ((olist->file_info.local && ((!olist->file_info.ptr.file && olist->obj_type == H5I_DATATYPE && - H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) || + H5T_is_immutable((H5T_t *)obj_ptr) == false) || (!olist->file_info.ptr.file && olist->obj_type != H5I_DATATYPE) || (oloc && oloc->file == olist->file_info.ptr.file))) || (!olist->file_info.local && ((!olist->file_info.ptr.shared && olist->obj_type == H5I_DATATYPE && - H5T_is_immutable((H5T_t *)obj_ptr) == FALSE) || + H5T_is_immutable((H5T_t *)obj_ptr) == false) || (!olist->file_info.ptr.shared && olist->obj_type != H5I_DATATYPE) || (oloc && oloc->file && oloc->file->shared == olist->file_info.ptr.shared)))) { - add_obj = TRUE; + add_obj = true; } /* end if */ } /* end else */ @@ -1026,7 +1026,7 @@ done: * * Purpose: Check the file signature to detect an HDF5 file. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL *------------------------------------------------------------------------- */ htri_t @@ -1053,7 +1053,7 @@ H5F__is_hdf5(const char *name, hid_t fapl_id) * to read through it will fail so we have to try this first. */ if ((shared = H5F__sfile_search(file)) != NULL) - ret_value = TRUE; + ret_value = true; else { /* The file is an HDF5 file if the HDF5 file signature can be found */ if (H5FD_locate_signature(file, &sig_addr) < 0) @@ -1064,7 +1064,7 @@ H5F__is_hdf5(const char *name, hid_t fapl_id) done: /* Close the file */ if (file) - if (H5FD_close(file) < 0 && TRUE == ret_value) + if (H5FD_close(file) < 0 && true == ret_value) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file"); FUNC_LEAVE_NOAPI(ret_value) @@ -1096,7 +1096,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F if (NULL == (f = H5FL_CALLOC(H5F_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate top file structure"); - f->id_exists = FALSE; + f->id_exists = false; if (shared) { assert(lf == NULL); @@ -1132,7 +1132,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F f->shared->pgend_meta_thres = H5F_FILE_SPACE_PGEND_META_THRES; /* initialize point of no return */ - f->shared->point_of_no_return = FALSE; + f->shared->point_of_no_return = false; /* Copy the file creation and file access property lists into the * new file handle. We do this early because some values might need @@ -1140,7 +1140,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not property list"); - f->shared->fcpl_id = H5P_copy_plist(plist, FALSE); + f->shared->fcpl_id = H5P_copy_plist(plist, false); /* Get the FCPL values to cache */ if (H5P_get(plist, H5F_CRT_ADDR_BYTE_NUM_NAME, &f->shared->sizeof_addr) < 0) @@ -1357,7 +1357,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) +H5F__dest(H5F_t *f, bool flush, bool free_on_failure) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1371,7 +1371,7 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) int actype; /* metadata cache type (enum value) */ /* Mark this file as closing */ - f->shared->closing = TRUE; + f->shared->closing = true; /* Flush at this point since the file will be closed (phase 1). * Only try to flush the file if it was opened with write access, and if @@ -1395,7 +1395,7 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) * the caller requested a flush. */ if ((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) - if (H5F__flush_phase2(f, TRUE) < 0) + if (H5F__flush_phase2(f, true) < 0) /* Push error, but keep going */ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 2)"); @@ -1476,7 +1476,7 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space"); /* Truncate the file to the current allocated size */ - if (H5FD_truncate(f->shared->lf, TRUE) < 0) + if (H5FD_truncate(f->shared->lf, true) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed"); @@ -1544,7 +1544,7 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) } /* end if */ /* Destroy other components of the file */ - if (H5F__accum_reset(f->shared, TRUE) < 0) + if (H5F__accum_reset(f->shared, true) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file"); if (H5FO_dest(f) < 0) @@ -1654,14 +1654,14 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool_t free_on_failure) *------------------------------------------------------------------------- */ static herr_t -H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking) +H5F__check_if_using_file_locks(H5P_genplist_t *fapl, bool *use_file_locking) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Make sure the out parameter has a value */ - *use_file_locking = TRUE; + *use_file_locking = true; /* Check the fapl property */ if (H5P_get(fapl, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0) @@ -1669,7 +1669,7 @@ H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking) /* Check the environment variable */ if (use_locks_env_g != FAIL) - *use_file_locking = (use_locks_env_g == TRUE) ? TRUE : FALSE; + *use_file_locking = (use_locks_env_g == true) ? true : false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1761,12 +1761,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) size_t page_buf_size; unsigned page_buf_min_meta_perc = 0; unsigned page_buf_min_raw_perc = 0; - hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ - hbool_t clear = FALSE; /*clear the status_flags */ - hbool_t evict_on_close; /* evict on close value from plist */ - hbool_t use_file_locking = TRUE; /* Using file locks? */ - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ + bool set_flag = false; /*set the status_flags in the superblock */ + bool clear = false; /*clear the status_flags */ + bool evict_on_close; /* evict on close value from plist */ + bool use_file_locking = true; /* Using file locks? */ + bool ci_load = false; /* whether MDC ci load requested */ + bool ci_write = false; /* whether MDC CI write requested */ H5F_t *ret_value = NULL; /*actual return value */ FUNC_ENTER_NOAPI(NULL) @@ -1904,7 +1904,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Place an advisory lock on the file */ if (use_file_locking) - if (H5FD_lock(lf, (hbool_t)((flags & H5F_ACC_RDWR) ? TRUE : FALSE)) < 0) { + if (H5FD_lock(lf, (bool)((flags & H5F_ACC_RDWR) ? true : false)) < 0) { /* Locking failed - Closing will remove the lock */ if (H5FD_close(lf) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "unable to close low-level file info"); @@ -1924,7 +1924,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Need to set status_flags in the superblock if the driver has a 'lock' method */ if (drvr->lock) - set_flag = TRUE; + set_flag = true; } /* end else */ /* Check to see if both SWMR and cache image are requested. Fail if so */ @@ -1994,12 +1994,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* (This must be after the space for the superblock is allocated in * the file, since the superblock must be at offset 0) */ - if (H5G_mkroot(file, TRUE) < 0) + if (H5G_mkroot(file, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group"); } /* end if */ else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if (H5F__super_read(file, a_plist, TRUE) < 0) + if (H5F__super_read(file, a_plist, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock"); /* Create the page buffer before initializing the superblock */ @@ -2008,7 +2008,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create page buffer"); /* Open the root group */ - if (H5G_mkroot(file, FALSE) < 0) + if (H5G_mkroot(file, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group"); } /* end if */ @@ -2121,7 +2121,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) done: if ((NULL == ret_value) && file) - if (H5F__dest(file, FALSE, TRUE) < 0) + if (H5F__dest(file, false, true) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file"); FUNC_LEAVE_NOAPI(ret_value) @@ -2202,7 +2202,7 @@ H5F__flush_phase1(H5F_t *f) *------------------------------------------------------------------------- */ static herr_t -H5F__flush_phase2(H5F_t *f, hbool_t closing) +H5F__flush_phase2(H5F_t *f, bool closing) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2228,7 +2228,7 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing) * entry to the mpio file driver truncate call below, and the first * barrier in the following call to flush the cache again. */ - H5CX_set_mpi_file_flushing(TRUE); + H5CX_set_mpi_file_flushing(true); } #endif /* H5_HAVE_PARALLEL */ @@ -2245,7 +2245,7 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing) #ifdef H5_HAVE_PARALLEL if (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) /* Reset the "flushing the file" flag */ - H5CX_set_mpi_file_flushing(FALSE); + H5CX_set_mpi_file_flushing(false); #endif /* H5_HAVE_PARALLEL */ /* Inform the metadata cache that we are done with the flush */ @@ -2296,7 +2296,7 @@ H5F__flush(H5F_t *f) HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data"); /* Second phase of flushing data */ - if (H5F__flush_phase2(f, FALSE) < 0) + if (H5F__flush_phase2(f, false) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data"); @@ -2355,7 +2355,7 @@ H5F__close(H5F_t *f) } /* Reset the file ID for this file */ - f->id_exists = FALSE; + f->id_exists = false; /* Attempt to close the file/mount hierarchy */ if (H5F_try_close(f, NULL) < 0) @@ -2403,7 +2403,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) +H5F_try_close(H5F_t *f, bool *was_closed /*out*/) { unsigned nopen_files = 0; /* Number of open files in file/mount hierarchy */ unsigned nopen_objs = 0; /* Number of open objects in file/mount hierarchy */ @@ -2422,12 +2422,12 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) * this value by passing in NULL. */ if (was_closed) - *was_closed = FALSE; + *was_closed = false; /* Check if this file is already in the process of closing */ if (f->closing) { if (was_closed) - *was_closed = TRUE; + *was_closed = true; HGOTO_DONE(SUCCEED); } @@ -2486,7 +2486,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) } /* end switch */ /* Mark this file as closing (prevents re-entering file shutdown code below) */ - f->closing = TRUE; + f->closing = true; /* If the file close degree is "strong", close all the open objects in this file */ if (f->shared->fc_degree == H5F_CLOSE_STRONG) { @@ -2502,7 +2502,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) /* Get the list of IDs of open dataset, group, & attribute objects */ while ((result = H5F_get_obj_ids( f, H5F_OBJ_LOCAL | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_ATTR, - (int)(sizeof(objs) / sizeof(objs[0])), objs, FALSE, &obj_count)) <= 0 && + (int)(sizeof(objs) / sizeof(objs[0])), objs, false, &obj_count)) <= 0 && obj_count != 0) { /* Try to close all the open objects in this file */ @@ -2519,7 +2519,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) * open named datatype ID will get closed twice) */ while ((result = H5F_get_obj_ids(f, H5F_OBJ_LOCAL | H5F_OBJ_DATATYPE, - (int)(sizeof(objs) / sizeof(objs[0])), objs, FALSE, + (int)(sizeof(objs) / sizeof(objs[0])), objs, false, &obj_count)) <= 0 && obj_count != 0) { @@ -2556,12 +2556,12 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) * shared H5F_shared_t struct. If the reference count for the H5F_shared_t * struct reaches zero then destroy it also. */ - if (H5F__dest(f, TRUE, FALSE) < 0) + if (H5F__dest(f, true, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file"); - /* Since we closed the file, this should be set to TRUE */ + /* Since we closed the file, this should be set to true */ if (was_closed) - *was_closed = TRUE; + *was_closed = true; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_try_close() */ @@ -2623,13 +2623,13 @@ H5F_get_id(H5F_t *file) if (H5I_find_id(file, H5I_FILE, &ret_value) < 0 || H5I_INVALID_HID == ret_value) { /* resurrect the ID - Register an ID with the native connector */ - if ((ret_value = H5VL_wrap_register(H5I_FILE, file, FALSE)) < 0) + if ((ret_value = H5VL_wrap_register(H5I_FILE, file, false)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group"); - file->id_exists = TRUE; + file->id_exists = true; } else { /* Increment reference count on existing ID */ - if (H5I_inc_ref(ret_value, FALSE) < 0) + if (H5I_inc_ref(ret_value, false) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTINC, H5I_INVALID_HID, "incrementing file ID failed"); } /* end else */ @@ -2727,7 +2727,7 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n int *fd; /* POSIX I/O file descriptor */ h5_stat_t st; /* Stat info from stat() call */ h5_stat_t fst; /* Stat info from fstat() call */ - hbool_t want_posix_fd; /* Flag for retrieving file descriptor from VFD */ + bool want_posix_fd; /* Flag for retrieving file descriptor from VFD */ /* Allocate realname buffer */ if (NULL == (realname = (char *)H5MM_calloc((size_t)PATH_MAX * sizeof(char)))) @@ -2741,7 +2741,7 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n */ /* Copy the FAPL object to modify */ - if ((new_fapl_id = H5P_copy_plist(fapl, FALSE)) < 0) + if ((new_fapl_id = H5P_copy_plist(fapl, false)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); if (NULL == (new_fapl = (H5P_genplist_t *)H5I_object(new_fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "can't get property list"); @@ -2750,7 +2750,7 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n * Set the private property for retrieving the backing store * POSIX file descriptor from the Core VFD */ - want_posix_fd = TRUE; + want_posix_fd = true; if (H5P_set(new_fapl, H5F_ACS_WANT_POSIX_FD_NAME, &want_posix_fd) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property for retrieving file descriptor"); @@ -2877,7 +2877,7 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp /*in,out*/, haddr_t addr) void H5F_addr_decode_len(size_t addr_len, const uint8_t **pp /*in,out*/, haddr_t *addr_p /*out*/) { - hbool_t all_zero = TRUE; /* True if address was all zeroes */ + bool all_zero = true; /* True if address was all zeroes */ unsigned u; /* Local index variable */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -2899,7 +2899,7 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp /*in,out*/, haddr_t *add /* Check for non-undefined address byte value */ if (c != 0xff) - all_zero = FALSE; + all_zero = false; if (u < sizeof(*addr_p)) { haddr_t tmp = c; /* Local copy of address, for casting */ @@ -2914,7 +2914,7 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp /*in,out*/, haddr_t *add assert(0 == **pp); /*overflow */ } /* end for */ - /* If 'all_zero' is still TRUE, the address was entirely composed of '0xff' + /* If 'all_zero' is still true, the address was entirely composed of '0xff' * bytes, which is the encoded form of 'HADDR_UNDEF', so set the destination * to that value */ if (all_zero) @@ -3051,7 +3051,7 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) *------------------------------------------------------------------------- */ herr_t -H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) +H5F_set_store_msg_crt_idx(H5F_t *f, bool flag) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -3446,7 +3446,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__set_paged_aggr(const H5F_t *f, hbool_t paged) +H5F__set_paged_aggr(const H5F_t *f, bool paged) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3626,8 +3626,8 @@ done: herr_t H5F__start_swmr_write(H5F_t *f) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ + bool ci_load = false; /* whether MDC ci load requested */ + bool ci_write = false; /* whether MDC CI write requested */ size_t grp_dset_count = 0; /* # of open objects: groups & datasets */ size_t nt_attr_count = 0; /* # of opened named datatypes + opened attributes */ hid_t *obj_ids = NULL; /* List of ids */ @@ -3636,7 +3636,7 @@ H5F__start_swmr_write(H5F_t *f) H5O_loc_t *obj_olocs = NULL; /* Object location */ H5G_name_t *obj_paths = NULL; /* Group hierarchy path */ size_t u; /* Local index variable */ - hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ + bool setup = false; /* Boolean flag to indicate whether SWMR setting is enabled */ H5VL_t *vol_connector = NULL; /* VOL connector for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3678,13 +3678,13 @@ H5F__start_swmr_write(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information"); /* Get the # of opened named datatypes and attributes */ - if (H5F_get_obj_count(f, H5F_OBJ_DATATYPE | H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) + if (H5F_get_obj_count(f, H5F_OBJ_DATATYPE | H5F_OBJ_ATTR, false, &nt_attr_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed"); if (nt_attr_count > 0) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file"); /* Get the # of opened datasets and groups */ - if (H5F_get_obj_count(f, H5F_OBJ_GROUP | H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) + if (H5F_get_obj_count(f, H5F_OBJ_GROUP | H5F_OBJ_DATASET, false, &grp_dset_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed"); if (grp_dset_count > 0) { @@ -3706,7 +3706,7 @@ H5F__start_swmr_write(H5F_t *f) assert(obj_apl_ids[0] == H5P_DEFAULT); /* Get the list of opened object ids (groups & datasets) */ - if (H5F_get_obj_ids(f, H5F_OBJ_GROUP | H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, + if (H5F_get_obj_ids(f, H5F_OBJ_GROUP | H5F_OBJ_DATASET, grp_dset_count, obj_ids, false, &grp_dset_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed"); @@ -3796,7 +3796,7 @@ H5F__start_swmr_write(H5F_t *f) } /* end if */ /* Flush and reset the accumulator */ - if (H5F__accum_reset(f->shared, TRUE) < 0) + if (H5F__accum_reset(f->shared, true) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator"); /* Turn on SWMR write in shared file open flags */ @@ -3817,7 +3817,7 @@ H5F__start_swmr_write(H5F_t *f) if (H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD"); - setup = TRUE; + setup = true; /* Place an advisory lock on the file */ if (H5F_USE_FILE_LOCKING(f)) { @@ -3827,7 +3827,7 @@ H5F__start_swmr_write(H5F_t *f) if (H5FD_unlock(f->shared->lf) < 0) { HGOTO_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock the file"); } - if (H5FD_lock(f->shared->lf, TRUE) < 0) { + if (H5FD_lock(f->shared->lf, true) < 0) { HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, FAIL, "unable to lock the file"); } } @@ -3846,7 +3846,7 @@ H5F__start_swmr_write(H5F_t *f) /* Refresh (reopen) the objects (groups & datasets) in the file */ for (u = 0; u < grp_dset_count; u++) - if (H5O_refresh_metadata_reopen(obj_ids[u], obj_apl_ids[u], &obj_glocs[u], vol_connector, TRUE) < 0) + if (H5O_refresh_metadata_reopen(obj_ids[u], obj_apl_ids[u], &obj_glocs[u], vol_connector, true) < 0) HGOTO_ERROR(H5E_ID, H5E_CLOSEERROR, FAIL, "can't refresh-close object"); done: @@ -3914,8 +3914,8 @@ done: herr_t H5F__format_convert(H5F_t *f) { - hbool_t mark_dirty = FALSE; /* Whether to mark the file's superblock dirty */ - herr_t ret_value = SUCCEED; /* Return value */ + bool mark_dirty = false; /* Whether to mark the file's superblock dirty */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3926,7 +3926,7 @@ H5F__format_convert(H5F_t *f) /* Check if the superblock should be downgraded */ if (f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST; - mark_dirty = TRUE; + mark_dirty = true; } /* Check for persistent freespace manager, which needs to be downgraded */ @@ -3952,7 +3952,7 @@ H5F__format_convert(H5F_t *f) f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF; /* Indicate that the superblock should be marked dirty */ - mark_dirty = TRUE; + mark_dirty = true; } /* end if */ /* Check if we should mark the superblock dirty */ @@ -3977,13 +3977,13 @@ done: *------------------------------------------------------------------------- */ hid_t -H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref) +H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, bool app_ref) { void *vol_obj_file = NULL; /* File object pointer */ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; /* Location parameters */ hid_t file_id = H5I_INVALID_HID; /* File ID for object */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -4009,7 +4009,7 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; if ((file_id = H5VL_wrap_register(H5I_FILE, vol_obj_file, app_ref)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); @@ -4040,7 +4040,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize) +H5F_set_min_dset_ohdr(H5F_t *f, bool minimize) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Fio.c b/src/H5Fio.c index 1b329b6..b2c5835 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -423,11 +423,11 @@ H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata"); /* Flush and reset the accumulator */ - if (H5F__accum_reset(f->shared, TRUE) < 0) + if (H5F__accum_reset(f->shared, true) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator"); /* Flush file buffers to disk. */ - if (H5FD_flush(f->shared->lf, FALSE) < 0) + if (H5FD_flush(f->shared->lf, false) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed"); done: diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 0fcf4b8..3e3be07 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -845,8 +845,8 @@ * * Managing file access for in-memory files * \code - * herr_t H5Pset_fapl_core (hid_t access_properties, size_t block_size, hbool_t backing_store) - * herr_t H5Pget_fapl_core (hid_t access_properties, size_t *block_size), hbool_t *backing_store) + * herr_t H5Pset_fapl_core (hid_t access_properties, size_t block_size, bool backing_store) + * herr_t H5Pget_fapl_core (hid_t access_properties, size_t *block_size), bool *backing_store) * \endcode * * #H5Pset_fapl_core sets the file access property list to use the Memory driver; any previously @@ -856,9 +856,9 @@ * * The backing_store Boolean flag is set when the in-memory file is created. * backing_store indicates whether to write the file contents to disk when the file is closed. If - * backing_store is set to 1 (TRUE), the file contents are flushed to a file with the same name as the + * backing_store is set to 1 (true), the file contents are flushed to a file with the same name as the * in-memory file when the file is closed or access to the file is terminated in memory. If - * backing_store is set to 0 (FALSE), the file is not saved. + * backing_store is set to 0 (false), the file is not saved. * * The application is allowed to open an existing file with the #H5FD_CORE driver. While using * #H5Fopen to open an existing file, if backing_store is set to 1 and the flag for #H5Fopen is set to @@ -981,9 +981,9 @@ * \code * herr_t H5Pset_fapl_multi (hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl, * const char * const *memb_name, const haddr_t *memb_addr, - * hbool_t relax) + * bool relax) * herr_t H5Pget_fapl_multi (hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl, - * const char **memb_name, const haddr_t *memb_addr, hbool_t *relax) + * const char **memb_name, const haddr_t *memb_addr, bool *relax) * \endcode * * #H5Pset_fapl_multi sets the file access properties to use the Multi driver; any previously defined diff --git a/src/H5Fmount.c b/src/H5Fmount.c index ef0aa7b..47345f2 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -108,7 +108,7 @@ H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UN assert(loc); assert(name && *name); assert(child); - assert(TRUE == H5P_isa_class(plist_id, H5P_FILE_MOUNT)); + assert(true == H5P_isa_class(plist_id, H5P_FILE_MOUNT)); /* Set up group location to fill in */ mp_loc.oloc = &mp_oloc; @@ -129,7 +129,7 @@ H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UN * and remove the mount as soon as we exit this function. Prevent the * user from doing this. */ - if (mp_loc.oloc->holding_file != FALSE) + if (mp_loc.oloc->holding_file != false) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount path cannot contain links to external files"); /* Open the mount point group */ @@ -259,7 +259,7 @@ H5F_unmount(const H5G_loc_t *loc, const char *name) H5G_name_t mp_path; /* Mount point group hier. path */ H5O_loc_t mp_oloc; /* Mount point object location */ H5G_loc_t mp_loc; /* entry used to open mount point*/ - hbool_t mp_loc_setup = FALSE; /* Whether mount point location is set up */ + bool mp_loc_setup = false; /* Whether mount point location is set up */ H5G_loc_t root_loc; /* Group location of root of file to unmount */ int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ @@ -281,7 +281,7 @@ H5F_unmount(const H5G_loc_t *loc, const char *name) */ if (H5G_loc_find(loc, name, &mp_loc /*out*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTFOUND, FAIL, "group not found"); - mp_loc_setup = TRUE; + mp_loc_setup = true; child = mp_loc.oloc->file; mnt_oloc = H5G_oloc(child->shared->root_grp); child_idx = -1; @@ -330,7 +330,7 @@ H5F_unmount(const H5G_loc_t *loc, const char *name) /* Found the correct index, set the info about the child */ child_idx = (int)md; H5G_loc_free(&mp_loc); - mp_loc_setup = FALSE; + mp_loc_setup = false; mp_loc.oloc = mnt_oloc; mp_loc.path = H5G_nameof(parent->shared->mtab.child[md].group); child = parent->shared->mtab.child[child_idx].file; @@ -387,24 +387,24 @@ done: * * Purpose: Check if a file is mounted within another file. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: (can't happen) * *------------------------------------------------------------------------- */ -hbool_t +bool H5F_is_mount(const H5F_t *file) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); if (file->parent != NULL) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_is_mount() */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 6786e07..4abc226 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -188,7 +188,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag) +H5F__set_mpi_atomicity(H5F_t *file, bool flag) { herr_t ret_value = SUCCEED; @@ -292,7 +292,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/) +H5Fget_mpi_atomicity(hid_t file_id, bool *flag /*out*/) { H5VL_object_t *vol_obj; /* File info */ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ @@ -401,15 +401,15 @@ done: * coordinates between the file-global flag and the flag set * for the current operation in the current API context. * - * Return: TRUE/FALSE (can't fail) + * Return: true/false (can't fail) * *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_coll_metadata_reads(const H5F_t *file) { H5P_coll_md_read_flag_t file_flag = H5P_USER_FALSE; - hbool_t ret_value = FALSE; + bool ret_value = false; FUNC_ENTER_NOAPI_NOERR @@ -419,11 +419,11 @@ H5F_get_coll_metadata_reads(const H5F_t *file) file_flag = H5F_COLL_MD_READ(file); /* If file flag is set to H5P_FORCE_FALSE, exit early - * with FALSE, since collective metadata reads have + * with false, since collective metadata reads have * been explicitly disabled somewhere in the library. */ if (H5P_FORCE_FALSE == file_flag) - ret_value = FALSE; + ret_value = false; else { /* If file flag is set to H5P_USER_TRUE, ignore * any settings in the API context. A file-global @@ -432,7 +432,7 @@ H5F_get_coll_metadata_reads(const H5F_t *file) * Property List for an individual operation. */ if (H5P_USER_TRUE == file_flag) - ret_value = TRUE; + ret_value = true; else { /* Get the collective metadata reads flag from * the current API context. @@ -484,10 +484,10 @@ H5F_get_coll_metadata_reads(const H5F_t *file) *------------------------------------------------------------------------- */ void -H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbool_t *context_flag) +H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, bool *context_flag) { H5P_coll_md_read_flag_t prev_file_flag = H5P_USER_FALSE; - hbool_t prev_context_flag = FALSE; + bool prev_context_flag = false; FUNC_ENTER_NOAPI_NOERR @@ -516,12 +516,12 @@ H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbo * Function: H5F_mpi_get_file_block_type * * Purpose: Creates an MPI derived datatype for communicating an - * H5F_block_t structure. If `commit` is specified as TRUE, + * H5F_block_t structure. If `commit` is specified as true, * the resulting datatype will be committed and ready for * use in communication. Otherwise, the type is only suitable * for building other derived types. * - * If TRUE is returned through `new_type_derived`, this lets + * If true is returned through `new_type_derived`, this lets * the caller know that the datatype has been derived and * should be freed with MPI_Type_free once it is no longer * needed. @@ -531,7 +531,7 @@ H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbo *------------------------------------------------------------------------- */ herr_t -H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new_type_derived) +H5F_mpi_get_file_block_type(bool commit, MPI_Datatype *new_type, bool *new_type_derived) { MPI_Datatype types[2]; MPI_Aint displacements[2]; @@ -545,7 +545,7 @@ H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new assert(new_type); assert(new_type_derived); - *new_type_derived = FALSE; + *new_type_derived = false; field_count = 2; assert(field_count == sizeof(types) / sizeof(MPI_Datatype)); @@ -559,7 +559,7 @@ H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) - *new_type_derived = TRUE; + *new_type_derived = true; if (commit && MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -569,7 +569,7 @@ done: if (*new_type_derived) { if (MPI_SUCCESS != (mpi_code = MPI_Type_free(new_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - *new_type_derived = FALSE; + *new_type_derived = false; } } diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index ead3872..bc5c90b 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -156,13 +156,13 @@ typedef struct H5F_efc_t H5F_efc_t; /* Structure for passing 'user data' to superblock cache callbacks */ typedef struct H5F_superblock_cache_ud_t { /* IN: */ - H5F_t *f; /* Pointer to file */ - hbool_t ignore_drvrinfo; /* Indicate if the driver info should be ignored */ + H5F_t *f; /* Pointer to file */ + bool ignore_drvrinfo; /* Indicate if the driver info should be ignored */ /* OUT: */ unsigned sym_leaf_k; /* Symbol table leaf node's 'K' value */ unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ haddr_t stored_eof; /* End-of-file in file */ - hbool_t drvrinfo_removed; /* Indicate if the driver info was removed */ + bool drvrinfo_removed; /* Indicate if the driver info was removed */ unsigned super_vers; /* Superblock version obtained in get_load_size callback. * It will be used later in verify_chksum callback */ @@ -191,7 +191,7 @@ typedef struct H5F_meta_accum_t { size_t alloc_size; /* Size of the accumulated metadata buffer allocated (in bytes) */ size_t dirty_off; /* Offset of the dirty region in the accumulator buffer */ size_t dirty_len; /* Length of the dirty region in the accumulator buffer */ - hbool_t dirty; /* Flag to indicate that the accumulated metadata is dirty */ + bool dirty; /* Flag to indicate that the accumulated metadata is dirty */ } H5F_meta_accum_t; /* A record of the mount table */ @@ -237,27 +237,27 @@ typedef struct H5F_super_t { * pointing to this struct. */ struct H5F_shared_t { - H5FD_t *lf; /* Lower level file handle for I/O */ - H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ - H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info - * cache entry. This field is only defined - * for older versions of the super block, - * and then only when a driver information - * block is present. At all other times - * it should be NULL. - */ - hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track - * whether the driver info superblock - * extension message has been created - * yet. This field should be TRUE iff the - * superblock extension exists and contains - * a driver info message. Under all other - * circumstances, it must be set to FALSE. - */ - unsigned nrefs; /* Ref count for times file is opened */ - unsigned flags; /* Access Permissions for file */ - H5F_mtab_t mtab; /* File mount table */ - H5F_efc_t *efc; /* External file cache */ + H5FD_t *lf; /* Lower level file handle for I/O */ + H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ + H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info + * cache entry. This field is only defined + * for older versions of the super block, + * and then only when a driver information + * block is present. At all other times + * it should be NULL. + */ + bool drvinfo_sb_msg_exists; /* Convenience field used to track + * whether the driver info superblock + * extension message has been created + * yet. This field should be true iff the + * superblock extension exists and contains + * a driver info message. Under all other + * circumstances, it must be set to false. + */ + unsigned nrefs; /* Ref count for times file is opened */ + unsigned flags; /* Access Permissions for file */ + H5F_mtab_t mtab; /* File mount table */ + H5F_efc_t *efc; /* External file cache */ /* Cached values from FCPL/superblock */ uint8_t sizeof_addr; /* Size of addresses in file */ @@ -279,13 +279,13 @@ struct H5F_shared_t { /* close option. This structure is */ /* fixed at creation time and should */ /* not change thereafter. */ - hbool_t use_mdc_logging; /* Set when metadata logging is desired */ - hbool_t start_mdc_log_on_access; /* set when mdc logging should */ + bool use_mdc_logging; /* Set when metadata logging is desired */ + bool start_mdc_log_on_access; /* set when mdc logging should */ /* begin on file access/create */ char *mdc_log_location; /* location of mdc log */ hid_t fcpl_id; /* File creation property list ID */ H5F_close_degree_t fc_degree; /* File close behavior degree */ - hbool_t evict_on_close; /* If the file's objects should be evicted from the metadata cache on close */ + bool evict_on_close; /* If the file's objects should be evicted from the metadata cache on close */ size_t rdcc_nslots; /* Size of raw data chunk cache (slots) */ size_t rdcc_nbytes; /* Size of raw data chunk cache (bytes) */ double rdcc_w0; /* Preempt read chunks first? [0.0..1.0]*/ @@ -295,14 +295,14 @@ struct H5F_shared_t { unsigned gc_ref; /* Garbage-collect references? */ H5F_libver_t low_bound; /* The 'low' bound of library format versions */ H5F_libver_t high_bound; /* The 'high' bound of library format versions */ - hbool_t store_msg_crt_idx; /* Store creation index for object header messages? */ + bool store_msg_crt_idx; /* Store creation index for object header messages? */ unsigned ncwfs; /* Num entries on cwfs list */ struct H5HG_heap_t **cwfs; /* Global heap cache */ struct H5G_t *root_grp; /* Open root group */ H5FO_t *open_objs; /* Open objects in file */ H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ - hbool_t use_file_locking; /* Whether or not to use file locking */ - hbool_t closing; /* File is in the process of being closed */ + bool use_file_locking; /* Whether or not to use file locking */ + bool closing; /* File is in the process of being closed */ /* Cached VOL connector ID & info */ hid_t vol_id; /* ID of VOL connector for the container */ @@ -312,19 +312,19 @@ struct H5F_shared_t { /* File space allocation information */ H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ hsize_t fs_threshold; /* Free space section threshold */ - hbool_t fs_persist; /* Free-space persist or not */ + bool fs_persist; /* Free-space persist or not */ unsigned fs_version; /* Free-space version: */ /* It is used to update fsinfo message in the superblock extension when closing down the free-space managers */ - hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ + bool use_tmp_space; /* Whether temp. file space allocation is allowed */ haddr_t tmp_addr; /* Next address to use for temp. space in the file */ - hbool_t point_of_no_return; /* Flag to indicate that we can't go back and delete a freespace header when - it's used up */ + bool point_of_no_return; /* Flag to indicate that we can't go back and delete a freespace header when + it's used up */ H5F_fs_state_t fs_state[H5F_MEM_PAGE_NTYPES]; /* State of free space manager for each type */ haddr_t fs_addr[H5F_MEM_PAGE_NTYPES]; /* Address of free space manager info for each type */ H5FS_t *fs_man[H5F_MEM_PAGE_NTYPES]; /* Free space manager for each file space type */ - hbool_t null_fsm_addr; /* Used by h5clear tool to tell the library */ + bool null_fsm_addr; /* Used by h5clear tool to tell the library */ /* to drop free-space to the floor */ haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */ /* for self referential FSMs */ @@ -352,13 +352,13 @@ struct H5F_shared_t { /* Object flush info */ H5F_object_flush_t object_flush; /* Information for object flush callback */ - hbool_t crt_dset_min_ohdr_flag; /* flag to minimize created dataset object header */ + bool crt_dset_min_ohdr_flag; /* flag to minimize created dataset object header */ char *extpath; /* Path for searching target external link file */ #ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ - hbool_t coll_md_write; /* Do all metadata writes collectively */ + bool coll_md_write; /* Do all metadata writes collectively */ #endif /* H5_HAVE_PARALLEL */ }; @@ -374,8 +374,8 @@ struct H5F_t { H5VL_object_t *vol_obj; /* VOL object */ unsigned nopen_objs; /* Number of open object headers */ H5FO_t *obj_count; /* # of time each object is opened through top file structure */ - hbool_t id_exists; /* Whether an ID for this struct exists */ - hbool_t closing; /* File is in the process of being closed */ + bool id_exists; /* Whether an ID for this struct exists */ + bool closing; /* File is in the process of being closed */ struct H5F_t *parent; /* Parent file that this file is mounted to */ unsigned nmounts; /* Number of children mounted to this file */ }; @@ -420,16 +420,16 @@ H5_DLL herr_t H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *no /* Superblock related routines */ H5_DLL herr_t H5F__super_init(H5F_t *f); -H5_DLL herr_t H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read); +H5_DLL herr_t H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, bool initial_read); H5_DLL herr_t H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size); H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); /* Superblock extension related routines */ H5_DLL herr_t H5F__super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); -H5_DLL herr_t H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, +H5_DLL herr_t H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, bool may_create, unsigned mesg_flags); H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id); -H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created); +H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, bool was_created); /* Metadata accumulator routines */ H5_DLL herr_t H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf); @@ -437,7 +437,7 @@ H5_DLL herr_t H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr const void *buf); H5_DLL herr_t H5F__accum_free(H5F_shared_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size); H5_DLL herr_t H5F__accum_flush(H5F_shared_t *f_sh); -H5_DLL herr_t H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush); +H5_DLL herr_t H5F__accum_reset(H5F_shared_t *f_sh, bool flush); /* Shared file list related routines */ H5_DLL herr_t H5F__sfile_add(H5F_shared_t *shared); @@ -446,8 +446,8 @@ H5_DLL herr_t H5F__sfile_remove(H5F_shared_t *shared); /* Parallel I/O (i.e. MPI) related routines */ #ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5F__get_mpi_atomicity(const H5F_t *file, hbool_t *flag); -H5_DLL herr_t H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag); +H5_DLL herr_t H5F__get_mpi_atomicity(const H5F_t *file, bool *flag); +H5_DLL herr_t H5F__set_mpi_atomicity(H5F_t *file, bool flag); #endif /* H5_HAVE_PARALLEL */ /* External file cache routines */ @@ -466,7 +466,7 @@ H5_DLL htri_t H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize /* Functions that get/retrieve values from VFD layer */ H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); +H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, bool paged); H5_DLL herr_t H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa); /* Functions that flush or evict */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index aa62800..5b232c5 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -323,7 +323,7 @@ typedef struct H5F_t H5F_t; #define H5F_FILE_SPACE_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR /* Default free space section threshold used by free-space managers */ -#define H5F_FREE_SPACE_PERSIST_DEF FALSE +#define H5F_FREE_SPACE_PERSIST_DEF false /* Default free space section threshold used by free-space managers */ #define H5F_FREE_SPACE_THRESHOLD_DEF 1 @@ -491,8 +491,8 @@ typedef enum H5F_prefix_open_t { /* Private functions */ H5_DLL herr_t H5F_init(void); H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); -H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/); -H5_DLL hid_t H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref); +H5_DLL herr_t H5F_try_close(H5F_t *f, bool *was_closed /*out*/); +H5_DLL hid_t H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, bool app_ref); /* Functions that retrieve values from the file struct */ H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f); @@ -503,27 +503,27 @@ H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); H5_DLL char *H5F_get_extpath(const H5F_t *f); H5_DLL H5F_shared_t *H5F_get_shared(const H5F_t *f); -H5_DLL hbool_t H5F_same_shared(const H5F_t *f1, const H5F_t *f2); +H5_DLL bool H5F_same_shared(const H5F_t *f1, const H5F_t *f2); H5_DLL unsigned H5F_get_nopen_objs(const H5F_t *f); H5_DLL unsigned H5F_incr_nopen_objs(H5F_t *f); H5_DLL unsigned H5F_decr_nopen_objs(H5F_t *f); -H5_DLL hbool_t H5F_file_id_exists(const H5F_t *f); +H5_DLL bool H5F_file_id_exists(const H5F_t *f); H5_DLL H5F_t *H5F_get_parent(const H5F_t *f); H5_DLL unsigned H5F_get_nmounts(const H5F_t *f); H5_DLL unsigned H5F_get_read_attempts(const H5F_t *f); -H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); +H5_DLL hid_t H5F_get_access_plist(H5F_t *f, bool app_ref); H5_DLL hid_t H5F_get_id(H5F_t *file); -H5_DLL herr_t H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL herr_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, - hbool_t app_ref, size_t *obj_id_count_ptr); +H5_DLL herr_t H5F_get_obj_count(const H5F_t *f, unsigned types, bool app_ref, size_t *obj_id_count_ptr); +H5_DLL herr_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, bool app_ref, + size_t *obj_id_count_ptr); H5_DLL hsize_t H5F_get_pgend_meta_thres(const H5F_t *f); -H5_DLL hbool_t H5F_get_point_of_no_return(const H5F_t *f); -H5_DLL hbool_t H5F_get_null_fsm_addr(const H5F_t *f); -H5_DLL hbool_t H5F_get_min_dset_ohdr(const H5F_t *f); -H5_DLL herr_t H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize); +H5_DLL bool H5F_get_point_of_no_return(const H5F_t *f); +H5_DLL bool H5F_get_null_fsm_addr(const H5F_t *f); +H5_DLL bool H5F_get_min_dset_ohdr(const H5F_t *f); +H5_DLL herr_t H5F_set_min_dset_ohdr(H5F_t *f, bool minimize); H5_DLL const H5VL_class_t *H5F_get_vol_cls(const H5F_t *f); H5_DLL H5VL_object_t *H5F_get_vol_obj(const H5F_t *f); -H5_DLL hbool_t H5F_get_file_locking(const H5F_t *f); +H5_DLL bool H5F_get_file_locking(const H5F_t *f); /* Functions than retrieve values set/cached from the superblock/FCPL */ H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); @@ -540,45 +540,45 @@ H5_DLL unsigned H5F_get_sohm_nindexes(const H5F_t *f); H5_DLL herr_t H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes); H5_DLL hid_t H5F_get_fcpl(const H5F_t *f); H5_DLL H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f); -H5_DLL hbool_t H5F_get_evict_on_close(const H5F_t *f); +H5_DLL bool H5F_get_evict_on_close(const H5F_t *f); H5_DLL size_t H5F_rdcc_nbytes(const H5F_t *f); H5_DLL size_t H5F_rdcc_nslots(const H5F_t *f); H5_DLL double H5F_rdcc_w0(const H5F_t *f); H5_DLL size_t H5F_sieve_buf_size(const H5F_t *f); H5_DLL unsigned H5F_gc_ref(const H5F_t *f); -H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f); -H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag); +H5_DLL bool H5F_store_msg_crt_idx(const H5F_t *f); +H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, bool flag); H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc); -H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); -H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); +H5_DLL bool H5F_use_tmp_space(const H5F_t *f); +H5_DLL bool H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); H5_DLL hsize_t H5F_get_alignment(const H5F_t *f); H5_DLL hsize_t H5F_get_threshold(const H5F_t *f); #ifdef H5_HAVE_PARALLEL H5_DLL H5P_coll_md_read_flag_t H5F_coll_md_read(const H5F_t *f); #endif /* H5_HAVE_PARALLEL */ -H5_DLL hbool_t H5F_use_mdc_logging(const H5F_t *f); -H5_DLL hbool_t H5F_start_mdc_log_on_access(const H5F_t *f); -H5_DLL char *H5F_mdc_log_location(const H5F_t *f); +H5_DLL bool H5F_use_mdc_logging(const H5F_t *f); +H5_DLL bool H5F_start_mdc_log_on_access(const H5F_t *f); +H5_DLL char *H5F_mdc_log_location(const H5F_t *f); /* Functions that retrieve values from VFD layer */ H5_DLL hid_t H5F_get_driver_id(const H5F_t *f); H5_DLL herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum); -H5_DLL hbool_t H5F_shared_has_feature(const H5F_shared_t *f, unsigned feature); -H5_DLL hbool_t H5F_has_feature(const H5F_t *f, unsigned feature); +H5_DLL bool H5F_shared_has_feature(const H5F_shared_t *f, unsigned feature); +H5_DLL bool H5F_has_feature(const H5F_t *f, unsigned feature); H5_DLL haddr_t H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type); H5_DLL haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type); H5_DLL herr_t H5F_shared_get_file_driver(const H5F_shared_t *f_sh, H5FD_t **file_handle); H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle); -H5_DLL hbool_t H5F_has_vector_select_io(const H5F_t *f, hbool_t is_write); +H5_DLL bool H5F_has_vector_select_io(const H5F_t *f, bool is_write); /* File mounting routines */ -H5_DLL herr_t H5F_mount(const struct H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); -H5_DLL herr_t H5F_unmount(const struct H5G_loc_t *loc, const char *name); -H5_DLL hbool_t H5F_is_mount(const H5F_t *file); -H5_DLL hbool_t H5F_has_mount(const H5F_t *file); -H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc /*in,out*/); -H5_DLL herr_t H5F_flush_mounts(H5F_t *f); +H5_DLL herr_t H5F_mount(const struct H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); +H5_DLL herr_t H5F_unmount(const struct H5G_loc_t *loc, const char *name); +H5_DLL bool H5F_is_mount(const H5F_t *file); +H5_DLL bool H5F_has_mount(const H5F_t *file); +H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc /*in,out*/); +H5_DLL herr_t H5F_flush_mounts(H5F_t *f); /* Functions that operate on blocks of bytes wrt super block */ H5_DLL herr_t H5F_shared_block_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, @@ -640,10 +640,10 @@ H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f); H5_DLL int H5F_shared_mpi_get_size(const H5F_shared_t *f_sh); H5_DLL int H5F_mpi_get_size(const H5F_t *f); H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm); -H5_DLL herr_t H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new_type_derived); -H5_DLL hbool_t H5F_get_coll_metadata_reads(const H5F_t *f); -H5_DLL void H5F_set_coll_metadata_reads(H5F_t *f, H5P_coll_md_read_flag_t *file_flag, hbool_t *context_flag); -H5_DLL herr_t H5F_shared_get_mpi_file_sync_required(const H5F_shared_t *f_sh, hbool_t *flag); +H5_DLL herr_t H5F_mpi_get_file_block_type(bool commit, MPI_Datatype *new_type, bool *new_type_derived); +H5_DLL bool H5F_get_coll_metadata_reads(const H5F_t *f); +H5_DLL void H5F_set_coll_metadata_reads(H5F_t *f, H5P_coll_md_read_flag_t *file_flag, bool *context_flag); +H5_DLL herr_t H5F_shared_get_mpi_file_sync_required(const H5F_shared_t *f_sh, bool *flag); #endif /* H5_HAVE_PARALLEL */ /* External file cache routines */ @@ -657,7 +657,7 @@ H5_DLL H5F_t *H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix /* Global heap CWFS routines */ H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr); -H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, hbool_t add_heap); +H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, bool add_heap); H5_DLL herr_t H5F_cwfs_remove_heap(H5F_shared_t *shared, struct H5HG_heap_t *heap); /* Debugging functions */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 585f9a0..f800b4c 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -1659,7 +1659,7 @@ H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t * \details H5Fget_dset_no_attrs_hint() retrieves the no dataset attributes * hint setting for the file specified by the file identifier \p * file_id. This setting is used to inform the library to create - * minimized dataset object headers when \c TRUE. + * minimized dataset object headers when \c true. * * The setting's value is returned in the boolean pointer minimized. * @@ -1680,18 +1680,18 @@ H5_DLL herr_t H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize); * * \details H5Fset_dset_no_attrs_hint() sets the no dataset attributes hint * setting for the file specified by the file identifier \p file_id. - * If the boolean flag \p minimize is set to \c TRUE, then the library + * If the boolean flag \p minimize is set to \c true, then the library * will create minimized dataset object headers in the file. * \Bold{All} files that refer to the same file-on-disk will be * affected by the most recent setting, regardless of the file * identifier/handle (e.g., as returned by H5Fopen()). By setting the - * \p minimize flag to \c TRUE, the library expects that no attributes + * \p minimize flag to \c true, the library expects that no attributes * will be added to the dataset - attributes can be added, but they * are appended with a continuation message, which can reduce * performance. * * \attention This setting interacts with H5Pset_dset_no_attrs_hint(): if - * either is set to \c TRUE, then the created dataset's object header + * either is set to \c true, then the created dataset's object header * will be minimized. * * \since 1.10.5 diff --git a/src/H5Fquery.c b/src/H5Fquery.c index b74884e..af120a4 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -236,10 +236,10 @@ H5F_get_shared(const H5F_t *f) * * Purpose: Determine if two files have the same shared file pointer * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_same_shared(const H5F_t *f1, const H5F_t *f2) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -277,10 +277,10 @@ H5F_get_nopen_objs(const H5F_t *f) * * Purpose: Determines if a file ID exists for this file struct * - * Return: TRUE/FALSE + * Return: true/false *------------------------------------------------------------------------- */ -hbool_t +bool H5F_file_id_exists(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -503,10 +503,10 @@ H5F_sym_leaf_k(const H5F_t *f) * * Purpose: Get the setting flag for minimized dataset object headers * - * Return: TRUE/FALSE as set in file + * Return: true/false as set in file *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_min_dset_ohdr(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -761,7 +761,7 @@ H5F_get_fc_degree(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_evict_on_close(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -782,7 +782,7 @@ H5F_get_evict_on_close(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_store_msg_crt_idx(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -799,11 +799,11 @@ H5F_store_msg_crt_idx(const H5F_t *f) * * Purpose: Check if a file has a particular feature enabled * - * Return: Success: Non-negative - TRUE or FALSE + * Return: Success: Non-negative - true or false * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -811,7 +811,7 @@ H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature) assert(f_sh); - FUNC_LEAVE_NOAPI((hbool_t)(f_sh->lf->feature_flags & feature)) + FUNC_LEAVE_NOAPI((bool)(f_sh->lf->feature_flags & feature)) } /* end H5F_shared_has_feature() */ /*------------------------------------------------------------------------- @@ -819,11 +819,11 @@ H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature) * * Purpose: Check if a file has a particular feature enabled * - * Return: Success: Non-negative - TRUE or FALSE + * Return: Success: Non-negative - true or false * Failure: Negative (should not happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_has_feature(const H5F_t *f, unsigned feature) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -832,7 +832,7 @@ H5F_has_feature(const H5F_t *f, unsigned feature) assert(f); assert(f->shared); - FUNC_LEAVE_NOAPI((hbool_t)(f->shared->lf->feature_flags & feature)) + FUNC_LEAVE_NOAPI((bool)(f->shared->lf->feature_flags & feature)) } /* end H5F_has_feature() */ /*------------------------------------------------------------------------- @@ -999,10 +999,10 @@ done: * (Mainly added to stop non-file routines from poking about in the * H5F_t data structure) * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1022,10 +1022,10 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) * (Mainly added to stop non-file routines from poking about in the * H5F_t data structure) * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_use_tmp_space(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1070,7 +1070,7 @@ H5F_coll_md_read(const H5F_t *f) *------------------------------------------------------------------------- */ herr_t -H5F_shared_get_mpi_file_sync_required(const H5F_shared_t *f_sh, hbool_t *flag /*out*/) +H5F_shared_get_mpi_file_sync_required(const H5F_shared_t *f_sh, bool *flag /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1096,10 +1096,10 @@ done: * (Mainly added to stop non-file routines from poking about in the * H5F_t data structure) * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_use_mdc_logging(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1119,10 +1119,10 @@ H5F_use_mdc_logging(const H5F_t *f) * (Mainly added to stop non-file routines from poking about in the * H5F_t data structure) * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_start_mdc_log_on_access(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1142,7 +1142,7 @@ H5F_start_mdc_log_on_access(const H5F_t *f) * (Mainly added to stop non-file routines from poking about in the * H5F_t data structure) * - * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * Return: true/false on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ char * @@ -1229,7 +1229,7 @@ H5F_get_pgend_meta_thres(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_point_of_no_return(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1250,7 +1250,7 @@ H5F_get_point_of_no_return(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_null_fsm_addr(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -1340,11 +1340,11 @@ done: * * Purpose: Get the file locking flag for the file * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -hbool_t +bool H5F_get_file_locking(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1360,14 +1360,14 @@ H5F_get_file_locking(const H5F_t *f) * * Purpose: Determine if vector or selection I/O is supported by this file * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -hbool_t -H5F_has_vector_select_io(const H5F_t *f, hbool_t is_write) +bool +H5F_has_vector_select_io(const H5F_t *f, bool is_write) { - hbool_t ret_value; /* Return value */ + bool ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 163d8d8..9c6afd3 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -167,8 +167,8 @@ done: * marking an entry dirty without a H5F_t*, this routine should * be changed to take a H5F_super_t* directly. * - * Return: Success: TRUE(1) - Block was extended - * FALSE(0) - Block could not be extended + * Return: Success: true(1) - Block was extended + * false(0) - Block could not be extended * Failure: FAIL * *------------------------------------------------------------------------- @@ -176,7 +176,7 @@ done: htri_t H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 3160eb3..36ba660 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -172,7 +172,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created) +H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, bool was_created) { H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -275,7 +275,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f) */ drvinfo.len = driver_size; drvinfo.buf = dbuf; - if (H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < + if (H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, false, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message"); @@ -302,7 +302,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) +H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, bool initial_read) { H5AC_ring_t orig_ring = H5AC_RING_INV; H5F_super_t *sblock = NULL; /* Superblock structure */ @@ -313,7 +313,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) haddr_t super_addr; /* Absolute address of superblock */ haddr_t eof; /* End of file address */ unsigned rw_flags; /* Read/write permissions for file */ - hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ + bool skip_eof_check = false; /* Whether to skip checking the EOF value */ #ifdef H5_HAVE_PARALLEL int mpi_size = 1; #endif /* H5_HAVE_PARALLEL */ @@ -427,7 +427,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) if (H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, udata.btree_k) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes"); udata.stored_eof = HADDR_UNDEF; - udata.drvrinfo_removed = FALSE; + udata.drvrinfo_removed = false; /* Set the ring type in the API context */ H5AC_set_ring(H5AC_RING_SB, &orig_ring); @@ -590,7 +590,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) if ((sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) && (sblock->status_flags & H5F_SUPER_WRITE_ACCESS) && sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) - skip_eof_check = TRUE; + skip_eof_check = true; } if (!skip_eof_check && initial_read) { if (HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) @@ -713,8 +713,8 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Reset driver info message */ H5O_msg_reset(H5O_DRVINFO_ID, &drvinfo); - assert(FALSE == f->shared->drvinfo_sb_msg_exists); - f->shared->drvinfo_sb_msg_exists = TRUE; + assert(false == f->shared->drvinfo_sb_msg_exists); + f->shared->drvinfo_sb_msg_exists = true; } /* end else */ } /* end if */ @@ -841,7 +841,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) * We remove the following check: * if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF || null_fsm_addr) && * (H5F_INTENT(f) & H5F_ACC_RDWR)) - * f->shared->first_alloc_dealloc = TRUE; + * f->shared->first_alloc_dealloc = true; * * Because: * --there is no more f->shared->eoa_pre_fsm_fsalloc and @@ -881,7 +881,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) #endif /* JRM */ if (f->shared->null_fsm_addr) { - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, false, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension"); @@ -896,7 +896,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) "error in removing message from superblock extension"); } - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, true, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension"); @@ -913,7 +913,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) if ((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header"); if (status) { - hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); + bool rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); H5O_mdci_t mdci_msg; /* if the metadata cache image superblock extension message exists, @@ -939,7 +939,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) } /* end if */ /* Close superblock extension */ - if (H5F__super_ext_close(f, &ext_loc, FALSE) < 0) + if (H5F__super_ext_close(f, &ext_loc, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension"); } /* end if */ @@ -982,7 +982,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) assert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ - if (H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if (H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, false, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension"); @@ -1009,7 +1009,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) f->shared->sblock = sblock; /* Set the page aggregation mode */ - if (H5F__set_paged_aggr(f, (hbool_t)H5F_PAGED_AGGR(f)) < 0) + if (H5F__set_paged_aggr(f, (bool)H5F_PAGED_AGGR(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set paged_aggr status for file driver"); done: @@ -1069,11 +1069,11 @@ done: herr_t H5F__super_init(H5F_t *f) { - H5F_super_t *sblock = NULL; /* Superblock cache structure */ - hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */ - H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ - hbool_t drvinfo_in_cache = - FALSE; /* Whether the driver info block has been inserted into the metadata cache */ + H5F_super_t *sblock = NULL; /* Superblock cache structure */ + bool sblock_in_cache = false; /* Whether the superblock has been inserted into the metadata cache */ + H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ + bool drvinfo_in_cache = + false; /* Whether the driver info block has been inserted into the metadata cache */ H5P_genplist_t *plist; /* File creation property list */ H5AC_ring_t orig_ring = H5AC_RING_INV; hsize_t userblock_size; /* Size of userblock, in bytes */ @@ -1082,10 +1082,10 @@ H5F__super_init(H5F_t *f) size_t driver_size; /* Size of driver info block (bytes) */ unsigned super_vers = HDF5_SUPERBLOCK_VERSION_DEF; /* Superblock version for file */ H5O_loc_t ext_loc; /* Superblock extension object location */ - hbool_t need_ext; /* Whether the superblock extension is needed */ - hbool_t ext_created = FALSE; /* Whether the extension has been created */ - hbool_t non_default_fs_settings = FALSE; /* Whether the file has non-default free-space settings */ - herr_t ret_value = SUCCEED; /* Return Value */ + bool need_ext; /* Whether the superblock extension is needed */ + bool ext_created = false; /* Whether the extension has been created */ + bool non_default_fs_settings = false; /* Whether the file has non-default free-space settings */ + herr_t ret_value = SUCCEED; /* Return Value */ FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) @@ -1116,7 +1116,7 @@ H5F__super_init(H5F_t *f) f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) - non_default_fs_settings = TRUE; + non_default_fs_settings = true; /* * When creating a file with write access, the library will: @@ -1189,7 +1189,7 @@ H5F__super_init(H5F_t *f) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set superblock version"); } /* end if */ - if (H5FD_set_paged_aggr(f->shared->lf, (hbool_t)H5F_PAGED_AGGR(f)) < 0) + if (H5FD_set_paged_aggr(f->shared->lf, (bool)H5F_PAGED_AGGR(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to set paged_aggr status for file driver"); /* @@ -1272,7 +1272,7 @@ H5F__super_init(H5F_t *f) if (H5AC_insert_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "can't add superblock to cache"); - sblock_in_cache = TRUE; + sblock_in_cache = true; /* Keep a copy of the superblock info */ f->shared->sblock = sblock; @@ -1291,12 +1291,12 @@ H5F__super_init(H5F_t *f) /* Files with SOHM indices always need the superblock extension */ if (f->shared->sohm_nindexes > 0) { assert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); - need_ext = TRUE; + need_ext = true; } /* end if */ /* Files with non-default free space settings always need the superblock extension */ else if (non_default_fs_settings) { assert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); - need_ext = TRUE; + need_ext = true; } /* end if */ /* If we're going to use a version of the superblock format which allows * for the superblock extension, check for non-default values to store @@ -1307,15 +1307,15 @@ H5F__super_init(H5F_t *f) if (sblock->btree_k[H5B_SNODE_ID] != HDF5_BTREE_SNODE_IK_DEF || sblock->btree_k[H5B_CHUNK_ID] != HDF5_BTREE_CHUNK_IK_DEF || sblock->sym_leaf_k != H5F_CRT_SYM_LEAF_DEF) - need_ext = TRUE; + need_ext = true; /* Check for driver info to store */ else if (driver_size > 0) - need_ext = TRUE; + need_ext = true; else - need_ext = FALSE; + need_ext = false; } /* end if */ else - need_ext = FALSE; + need_ext = false; /* Set the ring type in the API context */ H5AC_set_ring(H5AC_RING_SBE, NULL); @@ -1332,7 +1332,7 @@ H5F__super_init(H5F_t *f) */ if (H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create superblock extension"); - ext_created = TRUE; + ext_created = true; /* Create the Shared Object Header Message table and register it with * the metadata cache, if this file supports shared messages. @@ -1378,8 +1378,8 @@ H5F__super_init(H5F_t *f) if (H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update driver info header message"); - assert(FALSE == f->shared->drvinfo_sb_msg_exists); - f->shared->drvinfo_sb_msg_exists = TRUE; + assert(false == f->shared->drvinfo_sb_msg_exists); + f->shared->drvinfo_sb_msg_exists = true; } /* end if */ /* Check for non-default free-space info settings */ @@ -1394,7 +1394,7 @@ H5F__super_init(H5F_t *f) fsinfo.page_size = f->shared->fs_page_size; fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres; fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF; - fsinfo.mapped = FALSE; + fsinfo.mapped = false; /* Set the version for the fsinfo message */ if (H5O_fsinfo_set_version(H5F_LOW_BOUND(f), H5F_HIGH_BOUND(f), &fsinfo) < 0) @@ -1433,7 +1433,7 @@ H5F__super_init(H5F_t *f) H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINS, FAIL, "can't add driver info block to cache"); - drvinfo_in_cache = TRUE; + drvinfo_in_cache = true; f->shared->drvinfo = drvinfo; } /* end if */ else @@ -1678,11 +1678,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, unsigned mesg_flags) +H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, bool may_create, unsigned mesg_flags) { H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t ext_created = FALSE; /* Whether superblock extension was created */ - hbool_t ext_opened = FALSE; /* Whether superblock extension was opened */ + bool ext_created = false; /* Whether superblock extension was created */ + bool ext_opened = false; /* Whether superblock extension was opened */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1706,10 +1706,10 @@ H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, assert(may_create); if (H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension"); - ext_created = TRUE; + ext_created = true; } /* end else */ assert(H5_addr_defined(ext_loc.addr)); - ext_opened = TRUE; + ext_opened = true; /* Check if message with ID does not exist in the object header */ if ((status = H5O_msg_exists(&ext_loc, id)) < 0) @@ -1764,7 +1764,7 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id) { H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ - hbool_t ext_opened = FALSE; /* Whether the superblock extension was opened */ + bool ext_opened = false; /* Whether the superblock extension was opened */ int null_count = 0; /* # of null messages */ htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1780,7 +1780,7 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id) /* Open superblock extension object header */ if (H5F__super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in starting file's superblock extension"); - ext_opened = TRUE; + ext_opened = true; /* Check if message with ID exists in the object header */ if ((status = H5O_msg_exists(&ext_loc, id)) < 0) @@ -1790,7 +1790,7 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id) H5O_hdr_info_t hdr_info; /* Object header info for superblock extension */ /* Remove the message */ - if (H5O_msg_remove(&ext_loc, id, H5O_ALL, TRUE) < 0) + if (H5O_msg_remove(&ext_loc, id, H5O_ALL, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete free-space manager info message"); /* Get info for the superblock extension's object header */ @@ -1816,7 +1816,7 @@ done: H5AC_set_ring(orig_ring, NULL); /* Close superblock extension object header, if opened */ - if (ext_opened && H5F__super_ext_close(f, &ext_loc, FALSE) < 0) + if (ext_opened && H5F__super_ext_close(f, &ext_loc, false) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 0e4b02a..e62cc47 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -60,7 +60,7 @@ static herr_t H5F__cache_superblock_get_initial_load_size(void *udata, size_t *i static herr_t H5F__cache_superblock_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); static htri_t H5F__cache_superblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5F__cache_superblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5F__cache_superblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5F__cache_superblock_image_len(const void *thing, size_t *image_len); static herr_t H5F__cache_superblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5F__cache_superblock_free_icr(void *thing); @@ -68,16 +68,16 @@ static herr_t H5F__cache_superblock_free_icr(void *thing); static herr_t H5F__cache_drvrinfo_get_initial_load_size(void *udata, size_t *image_len); static herr_t H5F__cache_drvrinfo_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); -static void *H5F__cache_drvrinfo_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5F__cache_drvrinfo_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5F__cache_drvrinfo_image_len(const void *thing, size_t *image_len); static herr_t H5F__cache_drvrinfo_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5F__cache_drvrinfo_free_icr(void *thing); /* Local encode/decode routines */ static herr_t H5F__superblock_prefix_decode(H5F_super_t *sblock, const uint8_t **image_ref, size_t len, - const H5F_superblock_cache_ud_t *udata, hbool_t extend_eoa); + const H5F_superblock_cache_ud_t *udata, bool extend_eoa); static herr_t H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvinfo, char *drv_name, const uint8_t **image_ref, - size_t len, H5F_drvrinfo_cache_ud_t *udata, hbool_t extend_eoa); + size_t len, H5F_drvrinfo_cache_ud_t *udata, bool extend_eoa); /*********************/ /* Package Variables */ @@ -140,7 +140,7 @@ H5FL_EXTERN(H5F_super_t); */ static herr_t H5F__superblock_prefix_decode(H5F_super_t *sblock, const uint8_t **image_ref, size_t len, - const H5F_superblock_cache_ud_t *udata, hbool_t extend_eoa) + const H5F_superblock_cache_ud_t *udata, bool extend_eoa) { const uint8_t *image = (const uint8_t *)*image_ref; /* Pointer into raw data buffer */ const uint8_t *end = image + len - 1; /* Pointer to end of buffer */ @@ -225,7 +225,7 @@ done: */ static herr_t H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvrinfo, char *drv_name, const uint8_t **image_ref, size_t len, - H5F_drvrinfo_cache_ud_t *udata, hbool_t extend_eoa) + H5F_drvrinfo_cache_ud_t *udata, bool extend_eoa) { const uint8_t *image = (const uint8_t *)*image_ref; /* Pointer into raw data buffer */ const uint8_t *end = image + len - 1; /* Pointer to end of buffer */ @@ -340,7 +340,7 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len, assert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); /* Deserialize the file superblock's prefix */ - if (H5F__superblock_prefix_decode(&sblock, &image, image_len, udata, TRUE) < 0) + if (H5F__superblock_prefix_decode(&sblock, &image, image_len, udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "can't decode file superblock prefix"); /* Save the version to be used in verify_chksum callback */ @@ -360,7 +360,7 @@ done: * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative *------------------------------------------------------------------------- */ @@ -371,7 +371,7 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -385,7 +385,7 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; } FUNC_LEAVE_NOAPI(ret_value) @@ -401,7 +401,7 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata *------------------------------------------------------------------------- */ static void * -H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5F_super_t *sblock = NULL; /* File's superblock */ H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */ @@ -421,7 +421,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Deserialize the file superblock's prefix */ - if (H5F__superblock_prefix_decode(sblock, &image, len, udata, FALSE) < 0) + if (H5F__superblock_prefix_decode(sblock, &image, len, udata, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode file superblock prefix"); /* Check for older version of superblock format */ @@ -551,7 +551,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, if (udata->ignore_drvrinfo && H5_addr_defined(sblock->driver_addr)) { /* Eliminate the driver info */ sblock->driver_addr = HADDR_UNDEF; - udata->drvrinfo_removed = TRUE; + udata->drvrinfo_removed = true; } /* NOTE: Driver info block is decoded separately, later */ @@ -848,7 +848,7 @@ H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t image_len, vo assert(image_len == H5F_DRVINFOBLOCK_HDR_SIZE); /* Deserialize the file driver info's prefix */ - if (H5F__drvrinfo_prefix_decode(&drvrinfo, NULL, &image, image_len, udata, TRUE) < 0) + if (H5F__drvrinfo_prefix_decode(&drvrinfo, NULL, &image, image_len, udata, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "can't decode file driver info prefix"); /* Set the final size for the cache image */ @@ -868,7 +868,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */ @@ -888,7 +888,7 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hb HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "memory allocation failed for driver info message"); /* Deserialize the file driver info's prefix */ - if (H5F__drvrinfo_prefix_decode(drvinfo, drv_name, &image, len, udata, FALSE) < 0) + if (H5F__drvrinfo_prefix_decode(drvinfo, drv_name, &image, len, udata, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode file driver info prefix"); /* Sanity check */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 593c525..081fbda 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -82,9 +82,9 @@ herr_t H5F__get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count) { - H5F_t *file; /* File info */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File info */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -95,14 +95,14 @@ H5F__get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_coun /* Push API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Retrieve count for message type */ if (H5SM__get_mesg_count_test(file, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count"); done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -123,9 +123,9 @@ done: herr_t H5F__check_cached_stab_test(hid_t file_id) { - H5F_t *file; /* File info */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File info */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -136,14 +136,14 @@ H5F__check_cached_stab_test(hid_t file_id) /* Push API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Verify the cached stab info */ if (H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info"); done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5G.c b/src/H5G.c index 95fc4bf..384eeb2 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -160,19 +160,19 @@ H5G__create_api_common(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_GACC, TRUE, &gapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_GACC, true, &gapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Check link creation property list */ if (H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + else if (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a link creation property list"); /* Check group creation property list */ if (H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) + else if (true != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group creation property list"); /* Set the LCPL for the API context */ @@ -184,7 +184,7 @@ H5G__create_api_common(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group"); /* Get an ID for the group */ - if ((ret_value = H5VL_register(H5I_GROUP, grp, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_GROUP, grp, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get ID for group handle"); done: @@ -302,7 +302,7 @@ done: * * Example: To create missing groups "A" and "B01" along the given path "/A/B01/grp" * hid_t create_id = H5Pcreate(H5P_GROUP_CREATE); - * int status = H5Pset_create_intermediate_group(create_id, TRUE); + * int status = H5Pset_create_intermediate_group(create_id, true); * hid_t gid = H5Gcreate_anon(file_id, "/A/B01/grp", create_id, H5P_DEFAULT); * * Return: Success: The object ID of a new, empty group open for @@ -327,16 +327,16 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) /* Check group property list */ if (H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) + else if (true != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list"); if (H5P_DEFAULT == gapl_id) gapl_id = H5P_GROUP_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(gapl_id, H5P_GROUP_ACCESS)) + else if (true != H5P_isa_class(gapl_id, H5P_GROUP_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group access property list"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, true) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Set location struct fields */ @@ -353,7 +353,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group"); /* Get an ID for the group */ - if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get ID for group handle"); done: @@ -395,7 +395,7 @@ H5G__open_api_common(hid_t loc_id, const char *name, hid_t gapl_id, void **token HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_GACC, FALSE, &gapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_GACC, false, &gapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); if (NULL == (grp = H5VL_group_open(*vol_obj_ptr, &loc_params, name, gapl_id, H5P_DATASET_XFER_DEFAULT, @@ -403,7 +403,7 @@ H5G__open_api_common(hid_t loc_id, const char *name, hid_t gapl_id, void **token HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group"); /* Register an ID for the group */ - if ((ret_value = H5VL_register(H5I_GROUP, grp, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_GROUP, grp, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group"); done: @@ -670,7 +670,7 @@ H5G__get_info_by_name_api_common(hid_t loc_id, const char *name, H5G_info_t *gro /* Set up VOL callback & object access arguments */ vol_cb_args.op_type = H5VL_GROUP_GET_INFO; - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, vol_obj_ptr, &vol_cb_args.args.get_info.loc_params) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments"); vol_cb_args.args.get_info.ginfo = group_info; @@ -779,7 +779,7 @@ H5G__get_info_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t /* Set up VOL callback & object access arguments */ vol_cb_args.op_type = H5VL_GROUP_GET_INFO; - if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr, + if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, false, lapl_id, vol_obj_ptr, &vol_cb_args.args.get_info.loc_params) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments"); vol_cb_args.args.get_info.ginfo = group_info; diff --git a/src/H5Gcache.c b/src/H5Gcache.c index febd37a..f7ba49a 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -55,7 +55,7 @@ /* Metadata cache (H5AC) callbacks */ static herr_t H5G__cache_node_get_initial_load_size(void *udata, size_t *image_len); -static void *H5G__cache_node_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5G__cache_node_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5G__cache_node_image_len(const void *thing, size_t *image_len); static herr_t H5G__cache_node_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5G__cache_node_free_icr(void *thing); @@ -139,7 +139,7 @@ H5G__cache_node_get_initial_load_size(void *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static void * -H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5F_t *f = (H5F_t *)_udata; /* User data for callback */ H5G_node_t *sym = NULL; /* Symbol table node created */ diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 08a8fa2..13a4d8a 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -49,7 +49,7 @@ typedef struct { /* upward */ H5O_link_t *lnk; /* Link struct to fill in */ - hbool_t *found; /* Pointer to flag to indicate that the object was found */ + bool *found; /* Pointer to flag to indicate that the object was found */ } H5G_iter_lkp_t; /* Private macros */ @@ -294,7 +294,7 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const ch udata.name = name; /* Iterate over the link messages to delete the right one */ - if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) + if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, true) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message"); done: @@ -337,7 +337,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS udata.name = ltable.lnks[n].name; /* Iterate over the link messages to delete the right one */ - if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) + if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, true) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message"); done: @@ -420,7 +420,7 @@ H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_ud } /* end if */ /* Indicate that the correct link was found */ - *udata->found = TRUE; + *udata->found = true; /* Stop iteration now */ HGOTO_DONE(H5_ITER_STOP); @@ -435,12 +435,12 @@ done: * * Purpose: Look up an object relative to a group, using link messages. * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (true/false) on success/Negative on failure * *------------------------------------------------------------------------- */ herr_t -H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, hbool_t *found, H5O_link_t *lnk) +H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, bool *found, H5O_link_t *lnk) { H5G_iter_lkp_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Message operator */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 961560a..7b1d58e 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -45,7 +45,7 @@ #define H5G_FHEAP_MAN_MAX_DIRECT_SIZE (64 * 1024) #define H5G_FHEAP_MAN_MAX_INDEX 32 #define H5G_FHEAP_MAN_START_ROOT_ROWS 1 -#define H5G_FHEAP_CHECKSUM_DBLOCKS TRUE +#define H5G_FHEAP_CHECKSUM_DBLOCKS true #define H5G_FHEAP_MAX_MAN_SIZE (4 * 1024) /* v2 B-tree creation macros for 'name' field index */ @@ -109,10 +109,10 @@ typedef struct { typedef struct { /* downward */ H5G_bt2_ud_common_t common; /* Common info for B-tree user data (must be first) */ - hbool_t rem_from_fheap; /* Whether to remove the link from the fractal heap */ + bool rem_from_fheap; /* Whether to remove the link from the fractal heap */ haddr_t corder_bt2_addr; /* Address of v2 B-tree indexing creation order */ H5RS_str_t *grp_full_path_r; /* Full path of group where link is removed */ - hbool_t replace_names; /* Whether to replace the names of open objects */ + bool replace_names; /* Whether to replace the names of open objects */ } H5G_bt2_ud_rm_t; /* @@ -124,7 +124,7 @@ typedef struct { H5F_t *f; /* Pointer to file that fractal heap is in */ haddr_t corder_bt2_addr; /* Address of v2 B-tree indexing creation order */ H5RS_str_t *grp_full_path_r; /* Full path of group where link is removed */ - hbool_t replace_names; /* Whether to replace the names of open objects */ + bool replace_names; /* Whether to replace the names of open objects */ } H5G_fh_ud_rm_t; /* @@ -363,7 +363,7 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) assert(lnk); /* Find out the size of buffer needed for serialized link */ - if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0) + if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, false, lnk)) == 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size"); /* Wrap the local buffer for serialized link */ @@ -375,7 +375,7 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer"); /* Create serialized form of link */ - if (H5O_msg_encode(f, H5O_LINK_ID, FALSE, (unsigned char *)link_ptr, lnk) < 0) + if (H5O_msg_encode(f, H5O_LINK_ID, false, (unsigned char *)link_ptr, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode link"); /* Open the fractal heap */ @@ -472,7 +472,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, hbool_t *found, H5O_link_t *lnk) +H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, bool *found, H5O_link_t *lnk) { H5G_bt2_ud_common_t udata; /* User data for v2 B-tree link lookup */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1309,10 +1309,10 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_ udata.common.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); udata.common.found_op = NULL; udata.common.found_op_data = NULL; - udata.rem_from_fheap = TRUE; + udata.rem_from_fheap = true; udata.corder_bt2_addr = linfo->corder_bt2_addr; udata.grp_full_path_r = grp_full_path_r; - udata.replace_names = TRUE; + udata.replace_names = true; /* Remove the record from the name index v2 B-tree */ if (H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0) @@ -1574,7 +1574,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) +H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, bool adj_link) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1605,10 +1605,10 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) udata.common.name_hash = 0; udata.common.found_op = NULL; udata.common.found_op_data = NULL; - udata.rem_from_fheap = FALSE; /* handled in "bulk" below by deleting entire heap */ + udata.rem_from_fheap = false; /* handled in "bulk" below by deleting entire heap */ udata.corder_bt2_addr = linfo->corder_bt2_addr; udata.grp_full_path_r = NULL; - udata.replace_names = FALSE; + udata.replace_names = false; /* Delete the name index, adjusting the ref. count on links removed */ if (H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 79a5fce..8b9b5c8 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -55,7 +55,7 @@ /* User data for path traversal routine for getting object info */ typedef struct { H5G_stat_t *statbuf; /* Stat buffer about object */ - hbool_t follow_link; /* Whether we are following a link or not */ + bool follow_link; /* Whether we are following a link or not */ H5F_t *loc_file; /* Pointer to the file the location is in */ } H5G_trav_goi_t; @@ -178,7 +178,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list"); /* Make a copy of the default property list */ - if ((tmp_gcpl = H5P_copy_plist(gc_plist, FALSE)) < 0) + if ((tmp_gcpl = H5P_copy_plist(gc_plist, false)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list"); /* Get pointer to the copied property list */ @@ -216,7 +216,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group"); /* Get an ID for the group */ - if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group"); done: @@ -274,7 +274,7 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group"); /* Get an ID for the group */ - if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group"); done: @@ -1062,7 +1062,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5G_stat_t *statbuf /*out*/) +H5G__get_objinfo(const H5G_loc_t *loc, const char *name, bool follow_link, H5G_stat_t *statbuf /*out*/) { H5G_trav_goi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 02b4c8a..25927df 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -419,7 +419,7 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk targ_oloc.addr = lnk->u.hard.addr; /* Get the object header */ - if (NULL == (oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, FAIL, "unable to protect target object header"); /* Check if a symbol table message exists */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 8607c3b..3af9610 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -154,7 +154,7 @@ H5G_top_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_GROUP) > 0) { - (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); + (void)H5I_clear_type(H5I_GROUP, false, false); n++; } @@ -311,7 +311,7 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info) /* Add group to list of open objects in file */ if (H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't incr object ref. count"); - if (H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, TRUE) < 0) + if (H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, true) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects"); /* Set the count of times the object is opened */ @@ -359,7 +359,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name) H5G_loc_t grp_loc; /* Location used to open group */ H5G_name_t grp_path; /* Opened object group hier. path */ H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ + bool loc_found = false; /* Location at 'name' found */ H5O_type_t obj_type; /* Type of object at location */ H5G_t *ret_value = NULL; /* Return value */ @@ -377,7 +377,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name) /* Find the group object */ if (H5G_loc_find(loc, name, &grp_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found"); - loc_found = TRUE; + loc_found = true; /* Check that the object found is the correct type */ if (H5O_obj_type(&grp_oloc, &obj_type) < 0) @@ -445,7 +445,7 @@ H5G_open(const H5G_loc_t *loc) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "not found"); /* Add group to list of open objects in file */ - if (H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, FALSE) < 0) { + if (H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, false) < 0) { grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects"); } /* end if */ @@ -504,8 +504,8 @@ done: static herr_t H5G__open_oid(H5G_t *grp) { - hbool_t obj_opened = FALSE; - herr_t ret_value = SUCCEED; + bool obj_opened = false; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -519,7 +519,7 @@ H5G__open_oid(H5G_t *grp) /* Grab the object header */ if (H5O_open(&(grp->oloc)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - obj_opened = TRUE; + obj_opened = true; /* Check if this object has the right message(s) to be treated as a group */ if ((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID) <= 0) && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID) <= 0)) @@ -548,9 +548,9 @@ done: herr_t H5G_close(H5G_t *grp) { - hbool_t corked; /* Whether the group is corked or not */ - hbool_t file_closed = TRUE; /* H5O_close also closed the file? */ - herr_t ret_value = SUCCEED; /* Return value */ + bool corked; /* Whether the group is corked or not */ + bool file_closed = true; /* H5O_close also closed the file? */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -582,7 +582,7 @@ H5G_close(H5G_t *grp) if (!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { if (H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata"); - if (H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) + if (H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata"); } /* end if */ @@ -722,10 +722,10 @@ H5G_mount(H5G_t *grp) /* Check args */ assert(grp && grp->shared); - assert(grp->shared->mounted == FALSE); + assert(grp->shared->mounted == false); /* Set the 'mounted' flag */ - grp->shared->mounted = TRUE; + grp->shared->mounted = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5G_mount() */ @@ -739,7 +739,7 @@ H5G_mount(H5G_t *grp) * *------------------------------------------------------------------------- */ -hbool_t +bool H5G_mounted(H5G_t *grp) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -766,10 +766,10 @@ H5G_unmount(H5G_t *grp) /* Check args */ assert(grp && grp->shared); - assert(grp->shared->mounted == TRUE); + assert(grp->shared->mounted == true); /* Reset the 'mounted' flag */ - grp->shared->mounted = FALSE; + grp->shared->mounted = false; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5G_unmount() */ @@ -854,7 +854,7 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter */ if (NULL == (grp = H5G__open_name(loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - if ((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) + if ((gid = H5VL_wrap_register(H5I_GROUP, grp, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register group"); /* Set up user data for callback */ @@ -917,7 +917,7 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) H5G_loc_t obj_loc; /* Location of object */ H5G_name_t obj_path; /* Object's group hier. path */ H5O_loc_t obj_oloc; /* Object's object location */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ + bool obj_found = false; /* Object at 'name' found */ size_t old_path_len = udata->curr_path_len; /* Length of path before appending this link's name */ size_t link_name_len; /* Length of link's name */ size_t len_needed; /* Length of path string needed */ @@ -968,7 +968,7 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) /* (Correctly handles mounted files) */ if (H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found"); - obj_found = TRUE; + obj_found = true; /* Construct unique "position" for this object */ H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); @@ -1108,7 +1108,7 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_o HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); /* Register an ID for the starting group */ - if ((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) + if ((gid = H5VL_wrap_register(H5I_GROUP, grp, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register group"); /* Get the location of the starting group */ @@ -1223,7 +1223,7 @@ H5G_get_create_plist(const H5G_t *grp) /* Copy the default group creation property list */ if (NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_ID_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default group creation property list"); - if ((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) + if ((new_gcpl_id = H5P_copy_plist(gcpl_plist, true)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list"); if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list"); @@ -1299,7 +1299,7 @@ H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, H5G_info_t *grp_in H5G_loc_t grp_loc; /* Location used to open group */ H5G_name_t grp_path; /* Opened object group hier. path */ H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ + bool loc_found = false; /* Location at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1316,7 +1316,7 @@ H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, H5G_info_t *grp_in /* Find the group object */ if (H5G_loc_find(loc, name, &grp_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found"); - loc_found = TRUE; + loc_found = true; /* Retrieve the group's information */ if (H5G__obj_info(grp_loc.oloc, grp_info /*out*/) < 0) @@ -1346,7 +1346,7 @@ H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t id H5G_loc_t grp_loc; /* Location used to open group */ H5G_name_t grp_path; /* Opened object group hier. path */ H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ + bool loc_found = false; /* Location at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1363,7 +1363,7 @@ H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t id /* Find the object's location, according to the order in the index */ if (H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &grp_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found"); - loc_found = TRUE; + loc_found = true; /* Retrieve the group's information */ if (H5G__obj_info(grp_loc.oloc, grp_info /*out*/) < 0) diff --git a/src/H5Glink.c b/src/H5Glink.c index be34877..59cb9d9 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -188,8 +188,8 @@ H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2) herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { - hbool_t dup_soft = FALSE; /* xstrdup the symbolic link name or not */ - herr_t ret_value = SUCCEED; /* Return value */ + bool dup_soft = false; /* xstrdup the symbolic link name or not */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -202,7 +202,7 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, co /* Set (default) common info for link */ lnk->cset = H5F_DEFAULT_CSET; lnk->corder = 0; - lnk->corder_valid = FALSE; /* Creation order not valid for this link */ + lnk->corder_valid = false; /* Creation order not valid for this link */ if ((lnk->name = H5MM_xstrdup(name)) == NULL) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate link name"); @@ -217,7 +217,7 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, co if ((lnk->u.soft.name = H5MM_xstrdup(s)) == NULL) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate symbolic link name"); - dup_soft = TRUE; + dup_soft = true; /* Set link type */ lnk->type = H5L_TYPE_SOFT; @@ -353,7 +353,7 @@ H5G__link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj /* Set the object location, if it's a hard link set the address also */ obj_loc->oloc->file = grp_loc->oloc->file; - obj_loc->oloc->holding_file = FALSE; + obj_loc->oloc->holding_file = false; if (lnk->type == H5L_TYPE_HARD) obj_loc->oloc->addr = lnk->u.hard.addr; diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 24590d0..477c31f 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -441,9 +441,9 @@ H5G__loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ { H5G_loc_fbi_t *udata = (H5G_loc_fbi_t *)_udata; /* User data passed in */ H5O_link_t fnd_lnk; /* Link within group */ - hbool_t lnk_copied = FALSE; /* Whether the link was copied */ - hbool_t obj_loc_valid = FALSE; /* Flag to indicate that the object location is valid */ - hbool_t obj_exists = FALSE; /* Whether the object exists (unused) */ + bool lnk_copied = false; /* Whether the link was copied */ + bool obj_loc_valid = false; /* Flag to indicate that the object location is valid */ + bool obj_exists = false; /* Whether the object exists (unused) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -455,17 +455,17 @@ H5G__loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ /* Query link */ if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found"); - lnk_copied = TRUE; + lnk_copied = true; /* Build the initial object location for the link */ if (H5G__link_to_loc(obj_loc, &fnd_lnk, udata->loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot initialize object location"); - obj_loc_valid = TRUE; + obj_loc_valid = true; /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ /* (may modify the object location) */ - if (H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, TRUE, udata->loc, &obj_exists) < 0) + if (H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, true, udata->loc, &obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed"); done: @@ -548,12 +548,12 @@ H5G__loc_insert(H5G_loc_t *grp_loc, char *name, H5G_loc_t *obj_loc, H5O_type_t o lnk.type = H5L_TYPE_HARD; lnk.cset = H5F_DEFAULT_CSET; lnk.corder = 0; /* Will be reset if the group is tracking creation order */ - lnk.corder_valid = FALSE; /* Indicate that the creation order isn't valid (yet) */ + lnk.corder_valid = false; /* Indicate that the creation order isn't valid (yet) */ lnk.name = name; lnk.u.hard.addr = obj_loc->oloc->addr; /* Insert new group into current group's symbol table */ - if (H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info) < 0) + if (H5G_obj_insert(grp_loc->oloc, name, &lnk, true, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert object"); /* Set the name of the object location */ @@ -578,19 +578,19 @@ H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/) { - hbool_t *exists = (hbool_t *)_udata; /* User data passed in */ - herr_t ret_value = SUCCEED; /* Return value */ + bool *exists = (bool *)_udata; /* User data passed in */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Check if the name in this group resolved to a valid object */ if (obj_loc == NULL) if (lnk) - *exists = FALSE; + *exists = false; else HGOTO_ERROR(H5E_SYM, H5E_INTERNAL, FAIL, "no object or link info?"); else - *exists = TRUE; + *exists = true; /* Indicate that this callback didn't take ownership of the group * * location for the object */ @@ -605,13 +605,13 @@ done: * * Purpose: Check if an object actually exists at a location * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- */ herr_t -H5G_loc_exists(const H5G_loc_t *loc, const char *name, hbool_t *exists) +H5G_loc_exists(const H5G_loc_t *loc, const char *name, bool *exists) { herr_t ret_value = SUCCEED; /* Return value */ @@ -865,7 +865,7 @@ H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ /* Remove the previous comment message if any */ if (exists) - if (H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE) < 0) + if (H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, true) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete existing comment object header message"); diff --git a/src/H5Gname.c b/src/H5Gname.c index 2d7d855..8223509 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -186,7 +186,7 @@ done: * * Purpose: Determine if one path is a valid prefix of another path * - * Return: TRUE for valid prefix, FALSE for not a valid prefix, FAIL + * Return: true for valid prefix, false for not a valid prefix, FAIL * on error * * @@ -198,7 +198,7 @@ H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) const char *fullpath; /* Pointer to actual fullpath string */ const char *prefix; /* Pointer to actual prefix string */ size_t nchars1, nchars2; /* Number of characters in components */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -229,15 +229,15 @@ H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) assert(prefix); } /* end if */ else - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ else - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end while */ /* If we reached the end of the prefix path to check, it must be a valid prefix */ if (*prefix == '\0') - ret_value = TRUE; + ret_value = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -439,7 +439,7 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) *------------------------------------------------------------------------- */ herr_t -H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name_len, hbool_t *cached) +H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name_len, bool *cached) { herr_t ret_value = SUCCEED; /* Return value */ @@ -467,7 +467,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name /* Indicate that the name is cached, if requested */ /* (Currently only used for testing - QAK, 2010/07/26) */ if (cached) - *cached = TRUE; + *cached = true; } /* end if */ else if (!loc->path->obj_hidden) { /* Search for name of object */ @@ -477,7 +477,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name /* Indicate that the name is _not_ cached, if requested */ /* (Currently only used for testing - QAK, 2010/07/26) */ if (cached) - *cached = FALSE; + *cached = false; } /* end else */ done: @@ -643,8 +643,8 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) H5O_loc_t *oloc; /* Object location for object that the ID refers to */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ H5F_t *top_obj_file; /* Top file in object's mounted file hier. */ - hbool_t obj_in_child = FALSE; /* Flag to indicate that the object is in the child mount hier. */ - herr_t ret_value = SUCCEED; /* Return value */ + bool obj_in_child = false; /* Flag to indicate that the object is in the child mount hier. */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -703,14 +703,14 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) if (H5F_PARENT(oloc->file)) { /* Check if object is in child file (for mount & unmount operations) */ if (names->dst_file && H5F_SAME_SHARED(oloc->file, names->dst_file)) - obj_in_child = TRUE; + obj_in_child = true; /* Find the "top" file in the chain of mounted files */ top_obj_file = H5F_PARENT(oloc->file); while (H5F_PARENT(top_obj_file) != NULL) { /* Check if object is in child mount hier. (for mount & unmount operations) */ if (names->dst_file && H5F_SAME_SHARED(top_obj_file, names->dst_file)) - obj_in_child = TRUE; + obj_in_child = true; top_obj_file = H5F_PARENT(top_obj_file); } /* end while */ @@ -720,7 +720,7 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Check if object is in top of child mount hier. (for mount & unmount operations) */ if (names->dst_file && H5F_SAME_SHARED(top_obj_file, names->dst_file)) - obj_in_child = TRUE; + obj_in_child = true; /* Check if the object is in same file mount hier. */ if (!H5F_SAME_SHARED(top_obj_file, names->src_file)) @@ -903,9 +903,9 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS /* Check if the object we are manipulating has a path */ if (src_full_path_r) { - hbool_t search_group = FALSE; /* Flag to indicate that groups are to be searched */ - hbool_t search_dataset = FALSE; /* Flag to indicate that datasets are to be searched */ - hbool_t search_datatype = FALSE; /* Flag to indicate that datatypes are to be searched */ + bool search_group = false; /* Flag to indicate that groups are to be searched */ + bool search_dataset = false; /* Flag to indicate that datasets are to be searched */ + bool search_datatype = false; /* Flag to indicate that datatypes are to be searched */ /* Check for particular link to operate on */ if (lnk) { @@ -927,17 +927,17 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS switch (obj_type) { case H5O_TYPE_GROUP: /* Search and replace names through group IDs */ - search_group = TRUE; + search_group = true; break; case H5O_TYPE_DATASET: /* Search and replace names through dataset IDs */ - search_dataset = TRUE; + search_dataset = true; break; case H5O_TYPE_NAMED_DATATYPE: /* Search and replace names through datatype IDs */ - search_datatype = TRUE; + search_datatype = true; break; case H5O_TYPE_MAP: @@ -955,7 +955,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS case H5L_TYPE_SOFT: /* Symbolic links might resolve to any object, so we need to search all IDs */ - search_group = search_dataset = search_datatype = TRUE; + search_group = search_dataset = search_datatype = true; break; case H5L_TYPE_ERROR: @@ -975,7 +975,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS } /* end if */ else { /* We pass NULL as link pointer when we need to search all IDs */ - search_group = search_dataset = search_datatype = TRUE; + search_group = search_dataset = search_datatype = true; } /* Check if we need to operate on the objects affected */ @@ -995,17 +995,17 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS /* Search through group IDs */ if (search_group) - if (H5I_iterate(H5I_GROUP, H5G__name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5G__name_replace_cb, &names, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups"); /* Search through dataset IDs */ if (search_dataset) - if (H5I_iterate(H5I_DATASET, H5G__name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5G__name_replace_cb, &names, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets"); /* Search through datatype IDs */ if (search_datatype) - if (H5I_iterate(H5I_DATATYPE, H5G__name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_DATATYPE, H5G__name_replace_cb, &names, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes"); } /* end if */ } /* end if */ @@ -1032,7 +1032,7 @@ H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, H5G_loc_t obj_loc; /* Location of object */ H5G_name_t obj_path; /* Object's group hier. path */ H5O_loc_t obj_oloc; /* Object's object location */ - hbool_t obj_found = FALSE; /* Object at 'path' found */ + bool obj_found = false; /* Object at 'path' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -1066,7 +1066,7 @@ H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, /* Find the object */ if (H5G_loc_find(&grp_loc, path, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found"); - obj_found = TRUE; + obj_found = true; /* Check for object in same file (handles mounted files) */ /* (re-verify address, in case we traversed a file mount) */ @@ -1106,7 +1106,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size, si H5G_gnba_iter_t udata; /* User data for iteration */ size_t len; /* Length of path name */ H5G_loc_t root_loc; /* Root group's location */ - hbool_t found_obj = FALSE; /* If we found the object */ + bool found_obj = false; /* If we found the object */ herr_t status; /* Status from iteration */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1123,7 +1123,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size, si if (root_loc.oloc->addr == loc->addr && root_loc.oloc->file == loc->file) { if (NULL == (udata.path = H5MM_strdup(""))) HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "can't duplicate path string"); - found_obj = TRUE; + found_obj = true; } /* end if */ else { /* Set up user data for iterator */ @@ -1135,7 +1135,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size, si &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group traversal failed while looking for object name"); else if (status > 0) - found_obj = TRUE; + found_obj = true; } /* end else */ /* Check for finding the object */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index bff0ae6..97103a6 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -72,12 +72,12 @@ static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_ haddr_t *addr_p /*out*/); static int H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static herr_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, hbool_t *found, void *_udata); -static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, - void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, +static herr_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, bool *found, void *_udata); +static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, bool *lt_key_changed, void *_md_key, + void *_udata, void *_rt_key, bool *rt_key_changed, haddr_t *new_node_p /*out*/); -static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, - void *rt_key, hbool_t *rt_key_changed); +static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, bool *lt_key_changed, void *udata, + void *rt_key, bool *rt_key_changed); static herr_t H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); @@ -96,8 +96,8 @@ H5B_class_t H5B_SNODE[1] = {{ H5G__node_cmp3, /*cmp3 */ H5G__node_found, /*found */ H5G__node_insert, /*insert */ - TRUE, /*follow min branch? */ - TRUE, /*follow max branch? */ + true, /*follow min branch? */ + true, /*follow max branch? */ H5B_RIGHT, /*critical key */ H5G__node_remove, /*remove */ H5G__node_decode_key, /*decode */ @@ -246,7 +246,7 @@ H5G__node_free(H5G_node_t *sym) assert(sym); /* Verify that node is clean */ - assert(sym->cache_info.is_dirty == FALSE); + assert(sym->cache_info.is_dirty == false); if (sym->entry) sym->entry = H5FL_SEQ_FREE(H5G_entry_t, sym->entry); @@ -435,14 +435,14 @@ done: * entry field. Otherwise the entry is copied from the * UDATA entry field to the symbol table. * - * Return: Success: Non-negative (TRUE/FALSE) if found and data + * Return: Success: Non-negative (true/false) if found and data * returned through the UDATA pointer, if *FOUND is true. * Failure: Negative if not found. * *------------------------------------------------------------------------- */ static herr_t -H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, hbool_t *found, void *_udata) +H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, bool *found, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; H5G_node_t *sn = NULL; @@ -485,10 +485,10 @@ H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, hboo } /* end while */ if (cmp) - *found = FALSE; + *found = false; else { /* Set the 'found it' flag */ - *found = TRUE; + *found = true; /* Call user's callback operator */ if ((udata->op)(&sn->entry[idx], udata->op_data) < 0) @@ -531,8 +531,8 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H5_ATTR_UNUSED *lt_key_changed, - void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p) +H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, bool H5_ATTR_UNUSED *lt_key_changed, + void *_md_key, void *_udata, void *_rt_key, bool *rt_key_changed, haddr_t *new_node_p) { H5G_node_key_t *md_key = (H5G_node_key_t *)_md_key; H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; @@ -628,7 +628,7 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H insert_into = snrt; if (idx == (int)H5F_SYM_LEAF_K(f)) { rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; + *rt_key_changed = true; } /* end if */ } /* end else */ } /* end if */ @@ -639,7 +639,7 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H insert_into = sn; if (idx == (int)sn->nsyms) { rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; + *rt_key_changed = true; } /* end if */ } /* end else */ @@ -690,8 +690,8 @@ done: */ static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in,out*/, - hbool_t H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/, - void *_rt_key /*in,out*/, hbool_t *rt_key_changed /*out*/) + bool H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/, + void *_rt_key /*in,out*/, bool *rt_key_changed /*out*/) { H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; @@ -743,7 +743,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i link_name_len = HDstrlen(lnk.name) + 1; /* Set up rest of link structure */ - lnk.corder_valid = FALSE; + lnk.corder_valid = false; lnk.corder = 0; lnk.cset = H5T_CSET_ASCII; if (sn->entry[idx].type == H5G_CACHED_SLINK) { @@ -822,7 +822,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i sn->nsyms -= 1; sn_flags |= H5AC__DIRTIED_FLAG; rt_key->offset = sn->entry[sn->nsyms - 1].name_off; - *rt_key_changed = TRUE; + *rt_key_changed = true; ret_value = H5B_INS_NOOP; } else { @@ -1206,7 +1206,7 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const tmp_src_oloc.addr = src_ent->header; /* Copy the shared object from source to destination */ - if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, &obj_type, + if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, true, &obj_type, (void **)&cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy object"); @@ -1239,7 +1239,7 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const /* Set up common link data */ lnk.cset = H5F_DEFAULT_CSET; /* XXX: Allow user to set this */ lnk.corder = 0; /* Creation order is not tracked for old-style links */ - lnk.corder_valid = FALSE; /* Creation order is not valid */ + lnk.corder_valid = false; /* Creation order is not valid */ /* lnk.name = name; */ /* This will be set in callback */ /* Determine name of source object */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 6878e51..e701922 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -155,10 +155,10 @@ herr_t H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc /*out*/) { - size_t hdr_size; /* Size of object header to request */ - hbool_t use_at_least_v18; /* Flag indicating the new group format should be used */ - hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t hdr_size; /* Size of object header to request */ + bool use_at_least_v18; /* Flag indicating the new group format should be used */ + hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -178,9 +178,9 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf /* Check for using the latest version of the group format which is introduced in v18 */ /* (add more checks for creating "new format" groups when needed) */ if ((H5F_LOW_BOUND(f) >= H5F_LIBVER_V18) || linfo->track_corder || (pline && pline->nused)) - use_at_least_v18 = TRUE; + use_at_least_v18 = true; else - use_at_least_v18 = FALSE; + use_at_least_v18 = false; /* Make certain that the creation order is being tracked if an index is * going to be built on it. @@ -271,7 +271,7 @@ done: * Purpose: Retrieves the "link info" message for an object. Also * sets the number of links correctly, if it isn't set up yet. * - * Return: Success: TRUE/FALSE whether message was found & retrieved + * Return: Success: true/false whether message was found & retrieved * Failure: FAIL if error occurred * *------------------------------------------------------------------------- @@ -380,7 +380,7 @@ H5G__obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) /* Insert link into group */ H5_GCC_CLANG_DIAG_OFF("cast-qual") - if (H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, H5O_TYPE_UNKNOWN, NULL) < 0) + if (H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, false, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert link into group"); H5_GCC_CLANG_DIAG_ON("cast-qual") @@ -402,15 +402,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, hbool_t adj_link, +H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, bool adj_link, H5O_type_t obj_type, const void *crt_info) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for insertions or not */ - hbool_t use_new_dense = FALSE; /* Whether to use "dense" form of 'new format' group */ + bool use_old_format; /* Whether to use 'old format' (symbol table) for insertions or not */ + bool use_new_dense = false; /* Whether to use "dense" form of 'new format' group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) @@ -429,20 +429,20 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, size_t link_msg_size; /* Size of new link message in the file */ /* Using the new format for groups */ - use_old_format = FALSE; + use_old_format = false; /* Check for tracking creation order on this group's links */ if (linfo.track_corder) { /* Set the creation order for the new link & indicate that it's valid */ obj_lnk->corder = linfo.max_corder; - obj_lnk->corder_valid = TRUE; + obj_lnk->corder_valid = true; /* Increment the max. creation order used in the group */ linfo.max_corder++; } /* end if */ /* Get the link's message size */ - if ((link_msg_size = H5O_msg_raw_size(grp_oloc->file, H5O_LINK_ID, FALSE, obj_lnk)) == 0) + if ((link_msg_size = H5O_msg_raw_size(grp_oloc->file, H5O_LINK_ID, false, obj_lnk)) == 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size"); /* Get the group info */ @@ -454,9 +454,9 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, * header message, convert to using dense link storage instead of link messages) */ if (H5_addr_defined(linfo.fheap_addr)) - use_new_dense = TRUE; + use_new_dense = true; else if (linfo.nlinks < ginfo.max_compact && link_msg_size < H5O_MESG_MAX_SIZE) - use_new_dense = FALSE; + use_new_dense = false; else { htri_t pline_exists; /* Whether the pipeline message exists */ H5G_obj_oh_it_ud1_t udata; /* User data for iteration */ @@ -487,10 +487,10 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links"); /* Remove all the 'link' messages */ - if (H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE) < 0) + if (H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link messages"); - use_new_dense = TRUE; + use_new_dense = true; } /* end else */ } /* end if */ else { @@ -520,7 +520,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links"); /* Remove the symbol table message from the group */ - if (H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE) < 0) + if (H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete old format link storage"); /* Recursively call this routine to insert the new link, since the @@ -534,7 +534,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_DONE(SUCCEED); } /* end if */ else - use_old_format = TRUE; + use_old_format = true; } /* end if */ /* Insert into symbol table or "dense" storage */ @@ -820,7 +820,7 @@ H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) /* Check if there's no more links */ if (linfo->nlinks == 0) { /* Delete the dense storage */ - if (H5G__dense_delete(oloc->file, linfo, FALSE) < 0) + if (H5G__dense_delete(oloc->file, linfo, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage"); } /* end if */ /* Check for switching back to compact storage */ @@ -835,7 +835,7 @@ H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) if (linfo->nlinks < ginfo.min_dense) { struct H5O_t *oh = NULL; /* Pointer to group's object header */ H5G_link_table_t ltable; /* Table of links */ - hbool_t can_convert = TRUE; /* Whether converting to link messages is possible */ + bool can_convert = true; /* Whether converting to link messages is possible */ size_t u; /* Local index */ /* Build the table of links for this group */ @@ -853,7 +853,7 @@ H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) for (u = 0; u < linfo->nlinks; u++) if (H5O_msg_size_oh(oloc->file, oh, H5O_LINK_ID, &(ltable.lnks[u]), (size_t)0) >= H5O_MESG_MAX_SIZE) { - can_convert = FALSE; + can_convert = false; break; } /* end if */ @@ -872,7 +872,7 @@ H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) } /* end if */ /* Remove the dense storage */ - if (H5G__dense_delete(oloc->file, linfo, FALSE) < 0) + if (H5G__dense_delete(oloc->file, linfo, false) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage"); } /* end if */ @@ -910,7 +910,7 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ + bool use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) @@ -924,7 +924,7 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message"); if (linfo_exists) { /* Using the new format for groups */ - use_old_format = FALSE; + use_old_format = false; /* Check for dense or compact storage */ if (H5_addr_defined(linfo.fheap_addr)) { @@ -939,7 +939,7 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n } /* end if */ else { /* Using the old format for groups */ - use_old_format = TRUE; + use_old_format = true; /* Remove object from the symbol table */ if (H5G__stab_remove(oloc, grp_full_path_r, name) < 0) @@ -971,7 +971,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5 { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ + bool use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -991,7 +991,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5 } /* end if */ /* Using the new format for groups */ - use_old_format = FALSE; + use_old_format = false; /* Check for dense or compact storage */ if (H5_addr_defined(linfo.fheap_addr)) { @@ -1011,7 +1011,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5 HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query"); /* Using the old format for groups */ - use_old_format = TRUE; + use_old_format = true; /* Remove object from the symbol table */ if (H5G__stab_remove_by_idx(grp_oloc, grp_full_path_r, order, n) < 0) @@ -1037,7 +1037,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk) +H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ diff --git a/src/H5Goh.c b/src/H5Goh.c index 6083617..b72406f 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -140,8 +140,8 @@ H5O__group_free_copy_file_udata(void *_udata) * Purpose: Determines if an object has the requisite messages for being * a group. * - * Return: Success: TRUE if the required group messages are - * present; FALSE otherwise. + * Return: Success: true if the required group messages are + * present; false otherwise. * * Failure: FAIL if the existence of certain messages * cannot be determined. diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index fdc05ec..77a8e4c 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -118,8 +118,8 @@ typedef struct H5G_node_t { * Shared information for all open group objects */ struct H5G_shared_t { - int fo_count; /* open file object count */ - hbool_t mounted; /* Group is mount point */ + int fo_count; /* open file object count */ + bool mounted; /* Group is mount point */ }; /* @@ -331,7 +331,7 @@ H5_DLL herr_t H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, * Group hierarchy traversal routines */ H5_DLL herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned target, - hbool_t last_comp, H5G_loc_t *obj_loc, hbool_t *obj_exists); + bool last_comp, H5G_loc_t *obj_loc, bool *obj_exists); /* * Utility functions @@ -359,7 +359,7 @@ H5_DLL herr_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t o H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name); H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk); +H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_link_t *lnk); H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); #ifndef H5_STRICT_FORMAT_CHECKS @@ -412,8 +412,7 @@ H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_ H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL herr_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, - H5O_link_t *lnk); +H5_DLL herr_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_link_t *lnk); H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); @@ -422,7 +421,7 @@ H5_DLL herr_t H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_inde H5_iter_order_t order, H5G_link_table_t *ltable); H5_DLL herr_t H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline); H5_DLL herr_t H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk); -H5_DLL herr_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, hbool_t *found, +H5_DLL herr_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, bool *found, H5O_link_t *lnk); H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); @@ -436,7 +435,7 @@ H5_DLL herr_t H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t * const char *name); H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link); +H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, bool adj_link); /* Functions that understand group objects */ H5_DLL herr_t H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc /*out*/); @@ -447,9 +446,9 @@ H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo); H5_DLL herr_t H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); H5_DLL herr_t H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info); -H5_DLL herr_t H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk); +H5_DLL herr_t H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_link_t *lnk); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL herr_t H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, +H5_DLL herr_t H5G__get_objinfo(const H5G_loc_t *loc, const char *name, bool follow_link, H5G_stat_t *statbuf /*out*/); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index d6b9335..8f8da1a 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -46,8 +46,8 @@ /* ========= Group Creation properties ============ */ /* Defaults for link info values */ -#define H5G_CRT_LINFO_TRACK_CORDER FALSE -#define H5G_CRT_LINFO_INDEX_CORDER FALSE +#define H5G_CRT_LINFO_TRACK_CORDER false +#define H5G_CRT_LINFO_INDEX_CORDER false #define H5G_CRT_LINFO_NLINKS 0 #define H5G_CRT_LINFO_MAX_CORDER 0 #define H5G_CRT_LINFO_LINK_FHEAP_ADDR HADDR_UNDEF @@ -70,10 +70,10 @@ /* Defaults for group info values */ #define H5G_CRT_GINFO_LHEAP_SIZE_HINT 0 -#define H5G_CRT_GINFO_STORE_LINK_PHASE_CHANGE FALSE +#define H5G_CRT_GINFO_STORE_LINK_PHASE_CHANGE false #define H5G_CRT_GINFO_MAX_COMPACT 8 #define H5G_CRT_GINFO_MIN_DENSE 6 -#define H5G_CRT_GINFO_STORE_EST_ENTRY_INFO FALSE +#define H5G_CRT_GINFO_STORE_EST_ENTRY_INFO false #define H5G_CRT_GINFO_EST_NUM_ENTRIES 4 #define H5G_CRT_GINFO_EST_NAME_LEN 8 @@ -194,7 +194,7 @@ H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc); H5_DLL herr_t H5G_close(H5G_t *grp); H5_DLL herr_t H5G_get_shared_count(H5G_t *grp); H5_DLL herr_t H5G_mount(H5G_t *grp); -H5_DLL hbool_t H5G_mounted(H5G_t *grp); +H5_DLL bool H5G_mounted(H5G_t *grp); H5_DLL herr_t H5G_unmount(H5G_t *grp); #ifndef H5_NO_DEPRECATED_SYMBOLS H5_DLL H5G_obj_t H5G_map_obj_type(H5O_type_t obj_type); @@ -225,7 +225,7 @@ H5_DLL herr_t H5G_link_to_info(const struct H5O_loc_t *link_loc, const struct H5 * Functions that understand group objects */ H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, struct H5O_link_t *obj_lnk, - hbool_t adj_link, H5O_type_t obj_type, const void *crt_info); + bool adj_link, H5O_type_t obj_type, const void *crt_info); H5_DLL herr_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t name_size, size_t *name_len); @@ -258,7 +258,7 @@ H5_DLL herr_t H5G_name_reset(H5G_name_t *name); H5_DLL herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_name_free(H5G_name_t *name); H5_DLL herr_t H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name_len, - hbool_t *cached); + bool *cached); H5_DLL herr_t H5G_get_name_by_addr(H5F_t *f, const struct H5O_loc_t *loc, char *name, size_t size, size_t *name_len); H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); @@ -272,7 +272,7 @@ H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc /*out*/); H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc /*out*/); -H5_DLL herr_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, hbool_t *exists); +H5_DLL herr_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, bool *exists); H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info2_t *oinfo /*out*/, unsigned fields); H5_DLL herr_t H5G_loc_native_info(const H5G_loc_t *loc, const char *name, H5O_native_info_t *oinfo /*out*/, @@ -286,7 +286,7 @@ H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc); /* * These functions operate on the root group */ -H5_DLL herr_t H5G_mkroot(H5F_t *f, hbool_t create_root); +H5_DLL herr_t H5G_mkroot(H5F_t *f, bool create_root); H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); H5_DLL herr_t H5G_root_free(H5G_t *grp); H5_DLL H5G_t *H5G_rootof(H5F_t *f); diff --git a/src/H5Groot.c b/src/H5Groot.c index 7f5b956..0686fa9 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -122,13 +122,13 @@ H5G_rootof(H5F_t *f) *------------------------------------------------------------------------- */ herr_t -H5G_mkroot(H5F_t *f, hbool_t create_root) +H5G_mkroot(H5F_t *f, bool create_root) { H5G_loc_t root_loc; /* Root location information */ H5G_obj_create_t gcrt_info; /* Root group object creation info */ htri_t stab_exists = -1; /* Whether the symbol table exists */ - hbool_t sblock_dirty = FALSE; /* Whether superblock was dirtied */ - hbool_t path_init = FALSE; /* Whether path was initialized */ + bool sblock_dirty = false; /* Whether superblock was dirtied */ + bool path_init = false; /* Whether path was initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -182,7 +182,7 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) "unable to decrement refcount on root group's object header"); /* Mark superblock dirty, so root group info is flushed */ - sblock_dirty = TRUE; + sblock_dirty = true; /* Create the root group symbol table entry */ assert(!f->shared->sblock->root_ent); @@ -245,7 +245,7 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) * present, so we don't need to check the superblock version. We do this if * we have write access, the root entry has been allocated (i.e. * super_vers < 2) and the stab info is not already cached. */ - if ((H5F_INTENT(f) & H5F_ACC_RDWR) && stab_exists != FALSE && f->shared->sblock->root_ent && + if ((H5F_INTENT(f) & H5F_ACC_RDWR) && stab_exists != false && f->shared->sblock->root_ent && f->shared->sblock->root_ent->type != H5G_CACHED_STAB) { H5O_stab_t stab; /* Symbol table */ @@ -266,13 +266,13 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) f->shared->sblock->root_ent->cache.stab.heap_addr = stab.heap_addr; /* Mark superblock dirty, so root group info is flushed */ - sblock_dirty = TRUE; + sblock_dirty = true; } /* end if */ } /* end if */ /* Create the path names for the root group's entry */ H5G__name_init(root_loc.path, "/"); - path_init = TRUE; + path_init = true; f->shared->root_grp->shared->fo_count = 1; /* The only other open object should be the superblock extension, if it @@ -373,7 +373,7 @@ H5G_root_loc(H5F_t *f, H5G_loc_t *loc) /* (but only for non-mounted files) */ if (!H5F_is_mount(f)) { loc->oloc->file = f; - loc->oloc->holding_file = FALSE; + loc->oloc->holding_file = false; } /* end if */ done: diff --git a/src/H5Gstab.c b/src/H5Gstab.c index e7f6c02..4770724 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -74,7 +74,7 @@ typedef struct H5G_bt_it_lbi_t { /* upward */ H5O_link_t *lnk; /*link to be returned */ - hbool_t found; /*whether we found the link */ + bool found; /*whether we found the link */ } H5G_bt_it_lbi_t; /********************/ @@ -365,7 +365,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5O_stab_t stab; /* Symbol table message */ H5G_bt_rm_t udata; /* Data to pass through B-tree */ H5O_link_t obj_lnk; /* Object's link within group */ - hbool_t lnk_copied = FALSE; /* Whether the link was copied */ + bool lnk_copied = false; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -375,7 +375,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, /* Look up name of link to remove, by index */ if (H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get link information"); - lnk_copied = TRUE; + lnk_copied = true; /* Read in symbol table message */ if (NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) @@ -677,7 +677,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gnbi_t udata; /* Iteration information */ - hbool_t udata_valid = FALSE; /* Whether iteration information is valid */ + bool udata_valid = false; /* Whether iteration information is valid */ herr_t ret_value = SUCCEED; /* Return value */ /* Portably clear udata struct (before FUNC_ENTER) */ @@ -714,7 +714,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t udata.common.op = H5G__stab_get_name_by_idx_cb; udata.heap = heap; udata.name = NULL; - udata_valid = TRUE; + udata_valid = true; /* Iterate over the group members */ if (H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) @@ -780,12 +780,12 @@ done: * * Purpose: Look up an object relative to a group, using symbol table * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (true/false) on success/Negative on failure * *------------------------------------------------------------------------- */ herr_t -H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk) +H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, bool *found, H5O_link_t *lnk) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */ @@ -863,7 +863,7 @@ H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Convert the entry to a link */ if (H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link"); - udata->found = TRUE; + udata->found = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -918,7 +918,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ udata.common.op = H5G__stab_lookup_by_idx_cb; udata.heap = heap; udata.lnk = lnk; - udata.found = FALSE; + udata.found = false; /* Iterate over the group members */ if (H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) @@ -961,7 +961,7 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) { H5O_stab_t stab; /* Current symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ - hbool_t changed = FALSE; /* Whether stab has been modified */ + bool changed = false; /* Whether stab has been modified */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) @@ -980,7 +980,7 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) /* The alternate symbol table's b-tree address is valid. Adjust the * symbol table message in the group. */ stab.btree_addr = alt_stab->btree_addr; - changed = TRUE; + changed = true; } /* end else */ } /* end if */ @@ -995,7 +995,7 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) /* The alternate symbol table's heap address is valid. Adjust the * symbol table message in the group. */ stab.heap_addr = alt_stab->heap_addr; - changed = TRUE; + changed = true; } /* end else */ } /* end if */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index a68ffae..fc55c98 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -70,7 +70,7 @@ htri_t H5G__is_empty_test(gid) hid_t gid; IN: group to check RETURNS - TRUE/FALSE on success, FAIL on failure + true/false on success, FAIL on failure DESCRIPTION Checks to see if the group has no link messages and no symbol table message and no "dense" link storage @@ -83,11 +83,11 @@ htri_t H5G__is_empty_test(hid_t gid) { - H5G_t *grp = NULL; /* Pointer to group */ - htri_t msg_exists = FALSE; /* Indicate that a header message is present */ - htri_t linfo_exists = FALSE; /* Indicate that the 'link info' message is present */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - htri_t ret_value = TRUE; /* Return value */ + H5G_t *grp = NULL; /* Pointer to group */ + htri_t msg_exists = false; /* Indicate that a header message is present */ + htri_t linfo_exists = false; /* Indicate that the 'link info' message is present */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -98,7 +98,7 @@ H5G__is_empty_test(hid_t gid) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* "New format" checks */ @@ -112,7 +112,7 @@ H5G__is_empty_test(hid_t gid) if (msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found"); - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* Check for a link info message */ @@ -133,15 +133,15 @@ H5G__is_empty_test(hid_t gid) /* Check for 'dense' link storage file addresses being defined */ if (H5_addr_defined(linfo.fheap_addr)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (H5_addr_defined(linfo.name_bt2_addr)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (H5_addr_defined(linfo.corder_bt2_addr)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check for link count */ if (linfo.nlinks > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* "Old format" checks */ @@ -171,11 +171,11 @@ H5G__is_empty_test(hid_t gid) /* Check for link count */ if (nlinks > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -191,7 +191,7 @@ done: hid_t gid; IN: group to check unsigned *nmsgs; OUT: # of link messages in header RETURNS - TRUE/FALSE on success, FAIL on failure + true/false on success, FAIL on failure DESCRIPTION Checks to see if the group has link messages and how many. GLOBAL VARIABLES @@ -203,10 +203,10 @@ done: htri_t H5G__has_links_test(hid_t gid, unsigned *nmsgs) { - H5G_t *grp = NULL; /* Pointer to group */ - htri_t msg_exists = 0; /* Indicate that a header message is present */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - htri_t ret_value = TRUE; /* Return value */ + H5G_t *grp = NULL; /* Pointer to group */ + htri_t msg_exists = 0; /* Indicate that a header message is present */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -217,13 +217,13 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Check if the group has any link messages */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header"); if (msg_exists == 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if the group has a symbol table message */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) @@ -242,7 +242,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -257,7 +257,7 @@ done: htri_t H5G__has_stab_test(gid) hid_t gid; IN: group to check RETURNS - TRUE/FALSE on success, FAIL on failure + true/false on success, FAIL on failure DESCRIPTION Checks to see if the group has a symbol table message. GLOBAL VARIABLES @@ -269,10 +269,10 @@ done: htri_t H5G__has_stab_test(hid_t gid) { - H5G_t *grp = NULL; /* Pointer to group */ - htri_t msg_exists = 0; /* Indicate that a header message is present */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - htri_t ret_value = TRUE; /* Return value */ + H5G_t *grp = NULL; /* Pointer to group */ + htri_t msg_exists = 0; /* Indicate that a header message is present */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -283,13 +283,13 @@ H5G__has_stab_test(hid_t gid) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Check if the group has a symbol table message */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header"); if (msg_exists == 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if the group has any link messages */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) @@ -298,7 +298,7 @@ H5G__has_stab_test(hid_t gid) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found"); done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -313,7 +313,7 @@ done: htri_t H5G__is_new_dense_test(gid) hid_t gid; IN: group to check RETURNS - TRUE/FALSE on success, FAIL on failure + true/false on success, FAIL on failure DESCRIPTION Checks to see if the group is in the "new" format for groups (link messages/ fractal heap+v2 B-tree) and if it is in "dense" storage form (ie. it has @@ -327,10 +327,10 @@ done: htri_t H5G__is_new_dense_test(hid_t gid) { - H5G_t *grp = NULL; /* Pointer to group */ - htri_t msg_exists = 0; /* Indicate that a header message is present */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - htri_t ret_value = TRUE; /* Return value */ + H5G_t *grp = NULL; /* Pointer to group */ + htri_t msg_exists = 0; /* Indicate that a header message is present */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -341,19 +341,19 @@ H5G__is_new_dense_test(hid_t gid) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Check if the group has a symbol table message */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header"); if (msg_exists > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if the group has any link messages */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header"); if (msg_exists > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if the group has link info message */ if ((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0) @@ -367,13 +367,13 @@ H5G__is_new_dense_test(hid_t gid) /* Check for 'dense' link storage file addresses being defined */ if (!H5_addr_defined(linfo.fheap_addr)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (!H5_addr_defined(linfo.name_bt2_addr)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -407,7 +407,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -419,7 +419,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Set metadata tag in API context */ H5_BEGIN_TAG(grp->oloc.addr) @@ -466,7 +466,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index"); if (bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -496,7 +496,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -508,7 +508,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Make certain the group has a symbol table message */ if (NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) @@ -519,7 +519,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size"); done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -552,7 +552,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign { void *obj_ptr; /* Pointer to object for ID */ const H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -568,7 +568,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Get the symbol table entry */ switch (H5I_get_type(obj_id)) { @@ -631,7 +631,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign } /* end else */ done: - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -726,7 +726,7 @@ H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, h * the cached stab (if present). If one exists, both must exist. */ /* Initialize constant fields in target oloc */ targ_oloc.file = f; - targ_oloc.holding_file = FALSE; + targ_oloc.holding_file = false; /* Iterate over entries */ for (i = 0; i < sn->nsyms; i++) { @@ -734,7 +734,7 @@ H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, h targ_oloc.addr = sn->entry[i].header; /* Load target object header */ - if (NULL == (targ_oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (targ_oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to protect target object header"); /* Check if a symbol table message exists */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 41e990c..5c86aa6 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -51,11 +51,11 @@ /* User data for path traversal routine */ typedef struct { /* down */ - hbool_t chk_exists; /* Flag to indicate we are checking if object exists */ + bool chk_exists; /* Flag to indicate we are checking if object exists */ /* up */ H5G_loc_t *obj_loc; /* Object location */ - hbool_t exists; /* Indicate if object exists */ + bool exists; /* Indicate if object exists */ } H5G_trav_slink_t; /********************/ @@ -69,9 +69,9 @@ static herr_t H5G__traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, const H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/); static herr_t H5G__traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc /*in,out*/, - unsigned target, hbool_t *obj_exists); + unsigned target, bool *obj_exists); static herr_t H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc /*in,out*/, unsigned target, hbool_t *obj_exists); + H5G_loc_t *obj_loc /*in,out*/, unsigned target, bool *obj_exists); static herr_t H5G__traverse_real(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traverse_t op, void *op_data); @@ -110,7 +110,7 @@ H5G__traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNU /* Check for dangling soft link */ if (obj_loc == NULL) { if (udata->chk_exists) - udata->exists = FALSE; + udata->exists = false; else HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "component not found"); } /* end if */ @@ -119,7 +119,7 @@ H5G__traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNU H5O_loc_copy_deep(udata->obj_loc->oloc, obj_loc->oloc); /* Indicate that the object exists */ - udata->exists = TRUE; + udata->exists = true; } /* end else */ done: @@ -142,7 +142,7 @@ done: */ static herr_t H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G_loc_t *obj_loc /*in,out*/, - unsigned target, hbool_t *obj_exists) + unsigned target, bool *obj_exists) { const H5L_class_t *link_class; /* User-defined link class */ hid_t cb_return = -1; /* The ID the user-defined callback returned */ @@ -177,7 +177,7 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G /* Create a group ID to pass to the user-defined callback */ if (NULL == (grp = H5G_open(&grp_loc_copy))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - if ((cur_grp = H5VL_wrap_register(H5I_GROUP, grp, FALSE)) < 0) + if ((cur_grp = H5VL_wrap_register(H5I_GROUP, grp, false)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group"); /* User-defined callback function */ @@ -202,7 +202,7 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G H5E_clear_stack(NULL); /* Indicate that the object doesn't exist */ - *obj_exists = FALSE; + *obj_exists = false; /* Get out now */ HGOTO_DONE(SUCCEED); @@ -261,15 +261,15 @@ done: */ static herr_t H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc /*in,out*/, - unsigned target, hbool_t *obj_exists) + unsigned target, bool *obj_exists) { H5G_trav_slink_t udata; /* User data to pass to link traversal callback */ H5G_name_t tmp_obj_path; /* Temporary copy of object's path */ - hbool_t tmp_obj_path_set = FALSE; /* Flag to indicate that tmp object path is initialized */ + bool tmp_obj_path_set = false; /* Flag to indicate that tmp object path is initialized */ H5O_loc_t tmp_grp_oloc; /* Temporary copy of group entry */ H5G_name_t tmp_grp_path; /* Temporary copy of group's path */ H5G_loc_t tmp_grp_loc; /* Temporary copy of group's location */ - hbool_t tmp_grp_loc_set = FALSE; /* Flag to indicate that tmp group location is initialized */ + bool tmp_grp_loc_set = false; /* Flag to indicate that tmp group location is initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -292,16 +292,16 @@ H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t * * link traversal on the object's & group's paths - QAK) */ H5G_loc_copy(&tmp_grp_loc, grp_loc, H5_COPY_DEEP); - tmp_grp_loc_set = TRUE; + tmp_grp_loc_set = true; /* Hold the object's group hier. path to restore later */ /* (Part of "tracking the names properly") */ H5G_name_copy(&tmp_obj_path, obj_loc->path, H5_COPY_SHALLOW); - tmp_obj_path_set = TRUE; + tmp_obj_path_set = true; /* Set up user data for traversal callback */ - udata.chk_exists = (target & H5G_TARGET_EXISTS) ? TRUE : FALSE; - udata.exists = FALSE; + udata.chk_exists = (target & H5G_TARGET_EXISTS) ? true : false; + udata.exists = false; udata.obj_loc = obj_loc; /* Traverse the link */ @@ -335,8 +335,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned target, hbool_t last_comp, - H5G_loc_t *obj_loc, hbool_t *obj_exists) +H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned target, bool last_comp, + H5G_loc_t *obj_loc, bool *obj_exists) { size_t nlinks; /* # of soft / UD links left to traverse */ herr_t ret_value = SUCCEED; /* Return value */ @@ -447,14 +447,14 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G H5G_loc_t obj_loc; /* Location of object */ size_t nchars; /* component name length */ H5O_link_t lnk; /* Link information for object */ - hbool_t link_valid = FALSE; /* Flag to indicate that the link information is valid */ - hbool_t obj_loc_valid = FALSE; /* Flag to indicate that the object location is valid */ + bool link_valid = false; /* Flag to indicate that the link information is valid */ + bool obj_loc_valid = false; /* Flag to indicate that the object location is valid */ H5G_own_loc_t own_loc = H5G_OWN_NONE; /* Enum to indicate whether callback took ownership of locations*/ - hbool_t group_copy = FALSE; /* Flag to indicate that the group entry is copied */ + bool group_copy = false; /* Flag to indicate that the group entry is copied */ char comp_buf[1024]; /* Temporary buffer for path components */ char *comp; /* Pointer to buffer for path components */ H5WB_t *wb = NULL; /* Wrapped buffer for temporary buffer */ - hbool_t last_comp = FALSE; /* Flag to indicate that a component is the last component in the name */ + bool last_comp = false; /* Flag to indicate that a component is the last component in the name */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -500,7 +500,7 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G /* Deep copy of the starting location to group location */ if (H5G_loc_copy(&grp_loc, &loc, H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to copy location"); - group_copy = TRUE; + group_copy = true; /* Clear object location */ if (H5G_loc_reset(&obj_loc) < 0) @@ -517,8 +517,8 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G /* Traverse the path */ while ((name = H5G__component(name, &nchars)) && *name) { const char *s; /* Temporary string pointer */ - hbool_t lookup_status; /* Status from object lookup */ - hbool_t obj_exists; /* Whether the object exists */ + bool lookup_status; /* Status from object lookup */ + bool obj_exists; /* Whether the object exists */ /* * Copy the component name into a null-terminated buffer so @@ -537,34 +537,34 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G /* Check if this is the last component of the name */ if (!((s = H5G__component(name + nchars, NULL)) && *s)) - last_comp = TRUE; + last_comp = true; /* If there's valid information in the link, reset it */ if (link_valid) { H5O_msg_reset(H5O_LINK_ID, &lnk); - link_valid = FALSE; + link_valid = false; } /* end if */ /* Get information for object in current group */ - lookup_status = FALSE; + lookup_status = false; if (H5G__obj_lookup(grp_loc.oloc, comp, &lookup_status, &lnk /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't look up component"); - obj_exists = FALSE; + obj_exists = false; /* If the lookup was OK, build object location and traverse special links, etc. */ if (lookup_status) { /* Sanity check link and indicate it's valid */ assert(lnk.type >= H5L_TYPE_HARD); assert(!HDstrcmp(comp, lnk.name)); - link_valid = TRUE; + link_valid = true; /* Build object location from the link */ if (H5G__link_to_loc(&grp_loc, &lnk, &obj_loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot initialize object location"); - obj_loc_valid = TRUE; + obj_loc_valid = true; /* Assume object exists */ - obj_exists = TRUE; + obj_exists = true; /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ @@ -719,7 +719,7 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G H5G_loc_free(&grp_loc); H5G_loc_copy(&grp_loc, &obj_loc, H5_COPY_SHALLOW); H5G_loc_reset(&obj_loc); - obj_loc_valid = FALSE; + obj_loc_valid = false; /* Advance to next component in string */ name += nchars; diff --git a/src/H5HF.c b/src/H5HF.c index 9faa6ad..3484d45a 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -559,7 +559,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void *obj) +H5HF_write(H5HF_t *fh, void *_id, bool H5_ATTR_UNUSED *id_changed, const void *obj) { uint8_t *id = (uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -747,7 +747,7 @@ done: herr_t H5HF_close(H5HF_t *fh) { - hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */ + bool pending_delete = false; /* Whether the heap is pending deletion */ haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -795,7 +795,7 @@ H5HF_close(H5HF_t *fh) /* Set local info, so heap deletion can occur after decrementing the * header's ref count */ - pending_delete = TRUE; + pending_delete = true; heap_addr = fh->hdr->heap_addr; } /* end if */ } /* end if */ @@ -856,7 +856,7 @@ H5HF_delete(H5F_t *f, haddr_t fh_addr) /* Check for files using shared heap header */ if (hdr->file_rc) - hdr->pending_delete = TRUE; + hdr->pending_delete = true; else { /* Delete heap now, starting with header (unprotects header) */ if (H5HF__hdr_delete(hdr) < 0) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index c34a374..9f2fa0a 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -68,7 +68,7 @@ static herr_t H5HF__cache_hdr_get_initial_load_size(void *udata, size_t *image_l static herr_t H5HF__cache_hdr_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); static htri_t H5HF__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); @@ -77,7 +77,7 @@ static herr_t H5HF__cache_hdr_free_icr(void *thing); static herr_t H5HF__cache_iblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_iblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); @@ -87,7 +87,7 @@ static herr_t H5HF__cache_iblock_free_icr(void *thing); static herr_t H5HF__cache_dblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_dblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); @@ -98,17 +98,17 @@ static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) /* Debugging Function Prototypes */ #ifndef NDEBUG -static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_clean, - hbool_t *clean); +static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, bool *fd_clean, + bool *clean); static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, - hbool_t *fd_clean, hbool_t *clean); + bool *fd_clean, bool *clean); static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, - H5HF_indirect_t *iblock, hbool_t *fd_clean, - hbool_t *clean, hbool_t *has_dblocks); + H5HF_indirect_t *iblock, bool *fd_clean, bool *clean, + bool *has_dblocks); static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, - H5HF_indirect_t *iblock, hbool_t *fd_clean, - hbool_t *clean, hbool_t *has_iblocks); + H5HF_indirect_t *iblock, bool *fd_clean, + bool *clean, bool *has_iblocks); #endif /* NDEBUG */ /*********************/ @@ -400,7 +400,7 @@ done: * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -411,7 +411,7 @@ H5HF__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -422,7 +422,7 @@ H5HF__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF__cache_hdr_verify_chksum() */ @@ -441,7 +441,7 @@ H5HF__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr = NULL; /* Fractal heap info */ H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* User data for callback */ @@ -628,8 +628,8 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, #ifndef NDEBUG { - hbool_t descendants_clean = TRUE; - hbool_t fd_children_clean = TRUE; + bool descendants_clean = true; + bool fd_children_clean = true; /* Verify that flush dependencies are working correctly. Do this * by verifying that either: @@ -764,7 +764,7 @@ H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN UINT32ENCODE(image, hdr->pline_root_direct_filter_mask); /* Encode I/O filter information */ - if (H5O_msg_encode(hdr->f, H5O_PLINE_ID, FALSE, image, &(hdr->pline)) < 0) + if (H5O_msg_encode(hdr->f, H5O_PLINE_ID, false, image, &(hdr->pline)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "can't encode I/O pipeline filters"); image += hdr->filter_len; } /* end if */ @@ -855,7 +855,7 @@ H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored checksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -866,7 +866,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -877,7 +877,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF__cache_iblock_verify_chksum() */ @@ -901,7 +901,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN */ static void * H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ @@ -1145,8 +1145,8 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 #ifndef NDEBUG { - hbool_t descendants_clean = TRUE; - hbool_t fd_children_clean = TRUE; + bool descendants_clean = true; + bool fd_children_clean = true; unsigned iblock_status = 0; /* verify that flush dependencies are working correctly. Do this @@ -1521,7 +1521,7 @@ H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -1538,7 +1538,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) uint32_t computed_chksum; /* Computed metadata checksum value */ size_t chk_size; /* The size for validating checksum */ uint8_t *chk_p; /* Pointer to the area for validating checksum */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -1552,7 +1552,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) /* Get out if data block is not checksummed */ if (!(hdr->checksum_dblocks)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); if (hdr->filter_len > 0) { size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ @@ -1581,7 +1581,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed"); /* Update info about direct block */ - udata->decompressed = TRUE; + udata->decompressed = true; len = nbytes; } else { @@ -1613,7 +1613,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) /* Verify checksum */ if (stored_chksum != computed_chksum) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Save the decompressed data to be used later in deserialize callback */ if (hdr->filter_len > 0) { @@ -1655,7 +1655,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ @@ -1963,8 +1963,8 @@ static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { - hbool_t at_tmp_addr; /* Flag to indicate direct block is */ - /* at temporary address */ + bool at_tmp_addr; /* Flag to indicate direct block is */ + /* at temporary address */ haddr_t dblock_addr; H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ @@ -2108,7 +2108,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check for root direct block */ if (dblock->parent == NULL) { - hbool_t hdr_changed = FALSE; /* Whether the header info changed */ + bool hdr_changed = false; /* Whether the header info changed */ /* Sanity check */ assert(H5_addr_eq(hdr->man_dtable.table_addr, addr)); @@ -2117,7 +2117,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check if the filter mask changed */ if (hdr->pline_root_direct_filter_mask != filter_mask) { hdr->pline_root_direct_filter_mask = filter_mask; - hdr_changed = TRUE; + hdr_changed = true; } /* end if */ /* verify that the cache's last record of the compressed @@ -2153,16 +2153,16 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le hdr->pline_root_direct_size = write_size; /* Note that heap header was modified */ - hdr_changed = TRUE; + hdr_changed = true; } /* end if */ /* Check if heap header was modified */ if (hdr_changed) if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty"); - } /* end if */ - else { /* the direct block's parent is an indirect block */ - hbool_t par_changed = FALSE; /* Whether the parent's infochanged */ + } /* end if */ + else { /* the direct block's parent is an indirect block */ + bool par_changed = false; /* Whether the parent's infochanged */ /* Sanity check */ assert(par_iblock); @@ -2171,7 +2171,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check if the filter mask changed */ if (par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { par_iblock->filt_ents[par_entry].filter_mask = filter_mask; - par_changed = TRUE; + par_changed = true; } /* end if */ /* verify that the cache's last record of the compressed @@ -2208,7 +2208,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le par_iblock->filt_ents[par_entry].size = write_size; /* Note that parent was modified */ - par_changed = TRUE; + par_changed = true; } /* end if */ /* Check if parent was modified */ @@ -2493,7 +2493,7 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) * Purpose: Sanity checking routine that verifies that all indirect * and direct blocks that are descendants of the supplied * instance of H5HF_hdr_t are clean. Set *clean to - * TRUE if this is the case, and to FALSE otherwise. + * true if this is the case, and to false otherwise. * * Update -- 8/24/15 * @@ -2549,9 +2549,9 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean) +H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, bool *fd_clean, bool *clean) { - hbool_t fd_exists = FALSE; /* whether flush dependency exists. */ + bool fd_exists = false; /* whether flush dependency exists. */ haddr_t hdr_addr; /* Address of header */ unsigned hdr_status = 0; /* Header cache entry status */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2606,7 +2606,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ H5HF_indirect_t *root_iblock = hdr->root_iblock; haddr_t root_iblock_addr; unsigned root_iblock_status = 0; - hbool_t root_iblock_in_cache; + bool root_iblock_in_cache; /* make note of the on disk address of the root iblock */ if (root_iblock == NULL) @@ -2627,13 +2627,13 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ assert(root_iblock_in_cache || (root_iblock == NULL)); if (!root_iblock_in_cache) { /* we are done */ - *clean = TRUE; - *fd_clean = TRUE; + *clean = true; + *fd_clean = true; } /* end if */ else if ((root_iblock_status & H5AC_ES__IS_DIRTY) && (((root_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))) { - *clean = FALSE; + *clean = false; /* verify that a flush dependency exists between the header and * the root inode. @@ -2642,10 +2642,10 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency"); assert(fd_exists); - *fd_clean = FALSE; + *fd_clean = false; } /* end else-if */ else { /* must examine children */ - hbool_t unprotect_root_iblock = FALSE; + bool unprotect_root_iblock = false; /* At this point, the root iblock may be pinned, protected, * both, or neither, and we may or may not have a pointer @@ -2683,7 +2683,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ H5_END_TAG - unprotect_root_iblock = TRUE; + unprotect_root_iblock = true; } /* end if */ else { /* the root iblock is protected, and we have no @@ -2758,7 +2758,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ H5_END_TAG - unprotect_root_iblock = TRUE; + unprotect_root_iblock = true; assert(iblock == root_iblock); } /* end if */ } /* end else */ @@ -2785,8 +2785,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ else if ((hdr->man_dtable.curr_root_rows == 0) && (HADDR_UNDEF != hdr->man_dtable.table_addr)) { haddr_t root_dblock_addr; unsigned root_dblock_status = 0; - hbool_t in_cache; - hbool_t type_ok; + bool in_cache; + bool type_ok; /* this is scenario 2 -- we have a root dblock */ root_dblock_addr = hdr->man_dtable.table_addr; @@ -2824,16 +2824,16 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ *fd_clean = *clean; } /* end if */ else { /* root dblock not in cache */ - *fd_clean = TRUE; - *clean = TRUE; + *fd_clean = true; + *clean = true; } /* end else */ } /* end else-if */ else { /* this is scenario 3 -- the fractal heap is empty, and we * have nothing to do. */ - *fd_clean = TRUE; - *clean = TRUE; + *fd_clean = true; + *clean = true; } /* end else */ done: @@ -2847,7 +2847,7 @@ done: * Purpose: Sanity checking routine that verifies that all indirect * and direct blocks that are descendants of the supplied * instance of H5HF_indirect_t are clean. Set *clean - * to TRUE if this is the case, and to FALSE otherwise. + * to true if this is the case, and to false otherwise. * * In passing, the function also does a cursory check to * spot any obvious errors in the flush dependency setup. @@ -2909,11 +2909,11 @@ done: #ifndef NDEBUG static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean) + unsigned *iblock_status, bool *fd_clean, bool *clean) { - hbool_t has_dblocks = FALSE; - hbool_t has_iblocks = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool has_dblocks = false; + bool has_iblocks = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2925,7 +2925,7 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5 assert(iblock_status); assert(fd_clean); assert(*fd_clean); - assert(clean); /* note that *clean need not be TRUE */ + assert(clean); /* note that *clean need not be true */ if ((*fd_clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_dblocks) < 0) @@ -3022,7 +3022,7 @@ done: #ifndef NDEBUG static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks) + bool *fd_clean, bool *clean, bool *has_dblocks) { unsigned num_direct_rows; unsigned max_dblock_index; @@ -3054,14 +3054,14 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_ dblock_addr = iblock->ents[i].addr; if (H5_addr_defined(dblock_addr)) { - hbool_t in_cache; - hbool_t type_ok; + bool in_cache; + bool type_ok; if (H5AC_verify_entry_type(f, dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type"); if (in_cache) { /* dblock is in cache */ - hbool_t fd_exists; + bool fd_exists; unsigned dblock_status = 0; if (!type_ok) @@ -3072,18 +3072,18 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_ assert(dblock_status & H5AC_ES__IN_CACHE); - *has_dblocks = TRUE; + *has_dblocks = true; if ((dblock_status & H5AC_ES__IS_DIRTY) && (((dblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))) { - *clean = FALSE; + *clean = false; if (H5AC_flush_dependency_exists(f, fd_parent_addr, dblock_addr, &fd_exists) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency"); if (fd_exists) - *fd_clean = FALSE; + *fd_clean = false; } /* end if */ /* If a child dblock is in cache, it must have a flush @@ -3182,7 +3182,7 @@ done: #ifndef NDEBUG static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks) + bool *fd_clean, bool *clean, bool *has_iblocks) { unsigned first_iblock_index; unsigned last_iblock_index; @@ -3220,24 +3220,24 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status"); if (child_iblock_status & H5AC_ES__IN_CACHE) { - hbool_t fd_exists; + bool fd_exists; - *has_iblocks = TRUE; + *has_iblocks = true; if ((child_iblock_status & H5AC_ES__IS_DIRTY) && (((child_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))) { - *clean = FALSE; + *clean = false; if (H5AC_flush_dependency_exists(f, fd_parent_addr, child_iblock_addr, &fd_exists) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency"); if (fd_exists) - *fd_clean = FALSE; + *fd_clean = false; } /* end if */ - /* if the child iblock is in cache and *fd_clean is TRUE, + /* if the child iblock is in cache and *fd_clean is true, * we must continue to explore down the fractal heap tree * structure to verify that all descendant blocks that are * flush dependency children of the entry at parent_addr are @@ -3291,7 +3291,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 */ if (*fd_clean) { H5HF_indirect_t *child_iblock = NULL; - hbool_t unprotect_child_iblock = FALSE; + bool unprotect_child_iblock = false; if (0 == (child_iblock_status & H5AC_ES__IS_PINNED)) { /* child iblock is not pinned */ @@ -3323,7 +3323,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 H5_END_TAG - unprotect_child_iblock = TRUE; + unprotect_child_iblock = true; } /* end if */ else { /* child iblock is protected -- use */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 0a86fc0..32afc1f 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -218,7 +218,7 @@ H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fw *------------------------------------------------------------------------- */ void -H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, int fwidth) +H5HF_hdr_print(const H5HF_hdr_t *hdr, bool dump_internal, FILE *stream, int indent, int fwidth) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -333,7 +333,7 @@ H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header"); /* Print the information about the heap's header */ - H5HF_hdr_print(hdr, FALSE, stream, indent, fwidth); + H5HF_hdr_print(hdr, false, stream, indent, fwidth); done: if (hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) @@ -482,7 +482,7 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); /* Initialize the free space information for the heap */ - if (H5HF__space_start(hdr, FALSE) < 0) + if (H5HF__space_start(hdr, false) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space"); /* If there is a free space manager for the heap, check for sections that overlap this block */ @@ -549,7 +549,7 @@ done: *------------------------------------------------------------------------- */ void -H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, int fwidth) +H5HF_iblock_print(const H5HF_indirect_t *iblock, bool dump_internal, FILE *stream, int indent, int fwidth) { const H5HF_hdr_t *hdr; /* Pointer to heap's header */ char temp_str[64]; /* Temporary string, for formatting */ @@ -642,7 +642,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st fprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3), "Parent indirect block address:", (void *)iblock->parent); if (iblock->parent) - H5HF_iblock_print(iblock->parent, TRUE, stream, indent + 6, fwidth); + H5HF_iblock_print(iblock->parent, true, stream, indent + 6, fwidth); } /* end if */ FUNC_LEAVE_NOAPI_VOID @@ -663,7 +663,7 @@ H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ - hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ + bool did_protect = false; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -686,12 +686,12 @@ H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* * Load the heap indirect block */ - if (NULL == (iblock = H5HF__man_iblock_protect(hdr, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, + if (NULL == (iblock = H5HF__man_iblock_protect(hdr, addr, nrows, NULL, 0, false, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block"); /* Print the information about the heap's indirect block */ - H5HF_iblock_print(iblock, FALSE, stream, indent, fwidth); + H5HF_iblock_print(iblock, false, stream, indent, fwidth); done: if (iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) @@ -778,7 +778,7 @@ H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, int fwidth HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header"); /* Initialize the free space information for the heap */ - if (H5HF__space_start(hdr, FALSE) < 0) + if (H5HF__space_start(hdr, false) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space"); /* If there is a free space manager for the heap, iterate over them */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 6b37f98..62f6d8a 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -208,7 +208,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_addr, hbool_t *parent_removed) +H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_addr, bool *parent_removed) { hsize_t dblock_size; /* Size of direct block on disk */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting indirect block */ @@ -245,7 +245,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_ /* Reset the parent_removed flag */ if (parent_removed) - *parent_removed = FALSE; + *parent_removed = false; /* Check for root direct block */ if (hdr->man_dtable.curr_root_rows == 0) { @@ -281,7 +281,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_ * indirect block will be removed when this direct block is detached */ if (parent_removed && 1 == dblock->parent->nchildren) - *parent_removed = TRUE; + *parent_removed = true; if (H5HF__man_iblock_detach(dblock->parent, dblock->par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block"); @@ -466,7 +466,7 @@ H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_siz } /* end else */ /* Reset compression context info */ - udata.decompressed = FALSE; + udata.decompressed = false; udata.dblk = NULL; /* Protect the direct block */ @@ -492,11 +492,11 @@ done: */ herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_iblock, unsigned *ret_entry, - hbool_t *ret_did_protect, unsigned flags) + bool *ret_did_protect, unsigned flags) { haddr_t iblock_addr; /* Indirect block's address */ H5HF_indirect_t *iblock; /* Pointer to indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ unsigned row, col; /* Row & column for object's block */ unsigned entry; /* Entry of block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -523,13 +523,13 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ /* Lock root indirect block */ if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, - FALSE, flags, &did_protect))) + false, flags, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); /* Check for indirect block row */ while (row >= hdr->man_dtable.max_direct_rows) { H5HF_indirect_t *new_iblock; /* Pointer to new indirect block */ - hbool_t new_did_protect; /* Whether we protected the indirect block or not */ + bool new_did_protect; /* Whether we protected the indirect block or not */ unsigned nrows; /* Number of rows in new indirect block */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ @@ -553,7 +553,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ } /* end if */ /* Lock child indirect block */ - if (NULL == (new_iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, iblock, entry, FALSE, + if (NULL == (new_iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, iblock, entry, false, flags, &new_did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index d74d3a3..da9d014 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -375,7 +375,7 @@ H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "I/O filters can't operate on this heap"); /* Mark the filters as checked */ - hdr->checked_filters = TRUE; + hdr->checked_filters = true; /* Make the "set local" filter callbacks for this dataset */ if (H5Z_set_local_direct(&(cparam->pline)) < 0) @@ -390,7 +390,7 @@ H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set version of I/O filter pipeline"); /* Compute the I/O filters' encoded size */ - if (0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline)))) + if (0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, false, &(hdr->pline)))) HGOTO_ERROR(H5E_HEAP, H5E_CANTGETSIZE, HADDR_UNDEF, "can't get I/O filter pipeline size"); /* Compute size of header on disk */ @@ -404,7 +404,7 @@ H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) hdr->heap_size = H5HF_HEADER_SIZE(hdr); /* Mark filters as checked, for performance reasons */ - hdr->checked_filters = TRUE; + hdr->checked_filters = true; } /* end else */ /* Set the length of IDs in the heap */ @@ -903,7 +903,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ else { H5HF_indirect_t *iblock; /* Pointer to indirect block */ - hbool_t walked_up, walked_down; /* Condition variables for finding direct block location */ + bool walked_up, walked_down; /* Condition variables for finding direct block location */ unsigned next_row; /* Iterator's next block row */ unsigned next_entry; /* Iterator's next block entry */ unsigned min_dblock_row; /* Minimum row for direct block size request */ @@ -946,7 +946,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) do { /* Reset conditions for leaving loop */ - walked_up = walked_down = FALSE; + walked_up = walked_down = false; /* Check for walking off end of indirect block */ /* (walk up iterator) */ @@ -973,7 +973,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) "unable to retrieve current block iterator location"); /* Indicate that we walked up */ - walked_up = TRUE; + walked_up = true; } /* end while */ /* Check for walking into child indirect block */ @@ -1010,7 +1010,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ else { H5HF_indirect_t *new_iblock; /* Pointer to new indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ haddr_t new_iblock_addr; /* New indirect block's address */ /* Allocate new indirect block */ @@ -1021,7 +1021,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) /* Lock new indirect block */ if (NULL == (new_iblock = H5HF__man_iblock_protect(hdr, new_iblock_addr, child_nrows, - iblock, next_entry, FALSE, + iblock, next_entry, false, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); @@ -1056,7 +1056,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) "unable to retrieve current block iterator location"); /* Indicate that we walked down */ - walked_down = TRUE; + walked_down = true; } /* end if */ } while (walked_down || walked_up); } /* end else */ @@ -1114,8 +1114,8 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) { H5HF_indirect_t *iblock; /* Indirect block where iterator is located */ unsigned curr_entry; /* Current entry for iterator */ - hbool_t walked_down; /* Loop flag */ - hbool_t walked_up; /* Loop flag */ + bool walked_down; /* Loop flag */ + bool walked_up; /* Loop flag */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1145,8 +1145,8 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) int tmp_entry; /* Temp. entry for iterator (use signed value to detect errors) */ /* Reset loop flags */ - walked_down = FALSE; - walked_up = FALSE; + walked_down = false; + walked_up = false; /* Walk backwards through entries, until we find one that has a child */ /* (Skip direct block that will be deleted, if we find it) */ @@ -1172,7 +1172,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) curr_entry--; /* Note that we walked up */ - walked_up = TRUE; + walked_up = true; } /* end if */ else { /* Reset iterator offset */ @@ -1207,7 +1207,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) } /* end if */ else { H5HF_indirect_t *child_iblock; /* Pointer to child indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ unsigned child_nrows; /* # of rows in child block */ /* Compute # of rows in next child indirect block to use */ @@ -1216,7 +1216,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Lock child indirect block */ if (NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, - child_nrows, iblock, curr_entry, FALSE, + child_nrows, iblock, curr_entry, false, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); @@ -1240,7 +1240,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) "unable to release fractal heap indirect block"); /* Note that we walked down */ - walked_down = TRUE; + walked_down = true; } /* end else */ } /* end else */ } while (walked_down || walked_up); diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index ddf5684..b177858 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -60,7 +60,7 @@ static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ static hsize_t H5HF__huge_new_id(H5HF_hdr_t *hdr); -static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op, +static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, bool is_read, H5HF_operator_t op, void *op_data); /*********************/ @@ -182,26 +182,26 @@ H5HF__huge_init(H5HF_hdr_t *hdr) if (hdr->filter_len > 0) { if ((hdr->id_len - 1) >= (unsigned)(hdr->sizeof_addr + hdr->sizeof_size + 4 + hdr->sizeof_size)) { /* Indicate that v2 B-tree doesn't have to be used to locate object */ - hdr->huge_ids_direct = TRUE; + hdr->huge_ids_direct = true; /* Set the size of 'huge' object IDs */ hdr->huge_id_size = (uint8_t)(hdr->sizeof_addr + hdr->sizeof_size + hdr->sizeof_size); } /* end if */ else /* Indicate that v2 B-tree must be used to access object */ - hdr->huge_ids_direct = FALSE; + hdr->huge_ids_direct = false; } /* end if */ else { if ((hdr->sizeof_addr + hdr->sizeof_size) <= (hdr->id_len - 1)) { /* Indicate that v2 B-tree doesn't have to be used to locate object */ - hdr->huge_ids_direct = TRUE; + hdr->huge_ids_direct = true; /* Set the size of 'huge' object IDs */ hdr->huge_id_size = (uint8_t)(hdr->sizeof_addr + hdr->sizeof_size); } /* end if */ else /* Indicate that v2 B-tree must be used to locate object */ - hdr->huge_ids_direct = FALSE; + hdr->huge_ids_direct = false; } /* end else */ if (!hdr->huge_ids_direct) { /* Set the size and maximum value of 'huge' object ID */ @@ -253,7 +253,7 @@ H5HF__huge_new_id(H5HF_hdr_t *hdr) /* Check for wrapping 'huge' object IDs around */ if (hdr->huge_next_id == hdr->huge_max_id) - hdr->huge_ids_wrapped = TRUE; + hdr->huge_ids_wrapped = true; } /* end else */ /* Set return value */ @@ -492,7 +492,7 @@ H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) } /* end else */ } /* end if */ else { - hbool_t found = FALSE; /* Whether entry was found */ + bool found = false; /* Whether entry was found */ /* Check if v2 B-tree is open yet */ if (NULL == hdr->huge_bt2) { @@ -575,7 +575,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) H5F_addr_decode(hdr->f, &id, &obj_addr); } /* end if */ else { - hbool_t found = FALSE; /* Whether entry was found */ + bool found = false; /* Whether entry was found */ /* Sanity check */ assert(H5_addr_defined(hdr->huge_bt2_addr)); @@ -640,7 +640,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data) +H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, bool is_read, H5HF_operator_t op, void *op_data) { void *read_buf = NULL; /* Pointer to buffer for reading */ haddr_t obj_addr; /* Object's address in the file */ @@ -671,7 +671,7 @@ H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_ope UINT32DECODE(id, filter_mask); } /* end if */ else { - hbool_t found = FALSE; /* Whether entry was found */ + bool found = false; /* Whether entry was found */ /* Sanity check */ assert(H5_addr_defined(hdr->huge_bt2_addr)); @@ -823,7 +823,7 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) else { H5HF_huge_bt2_indir_rec_t found_rec; /* Record found from tracking object */ H5HF_huge_bt2_indir_rec_t search_rec; /* Record for searching for object */ - hbool_t found = FALSE; /* Whether entry was found */ + bool found = false; /* Whether entry was found */ /* Sanity check */ assert(H5_addr_defined(hdr->huge_bt2_addr)); @@ -883,7 +883,7 @@ H5HF__huge_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) assert(obj); /* Call the internal 'op' routine */ - if (H5HF__huge_op_real(hdr, id, TRUE, NULL, obj) < 0) + if (H5HF__huge_op_real(hdr, id, true, NULL, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object"); done: @@ -914,7 +914,7 @@ H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_d assert(op); /* Call the internal 'op' routine routine */ - if (H5HF__huge_op_real(hdr, id, FALSE, op, op_data) < 0) + if (H5HF__huge_op_real(hdr, id, false, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object"); done: @@ -1072,7 +1072,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr) /* Reset the information about 'huge' objects in the file */ hdr->huge_bt2_addr = HADDR_UNDEF; hdr->huge_next_id = 0; - hdr->huge_ids_wrapped = FALSE; + hdr->huge_ids_wrapped = false; /* Mark heap header as modified */ if (H5HF__hdr_dirty(hdr) < 0) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index db9901f..6c273a8 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -319,8 +319,8 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) H5HF_indirect_t *iblock; /* Pointer to indirect block */ haddr_t iblock_addr; /* Indirect block's address */ hsize_t acc_dblock_free; /* Accumulated free space in direct blocks */ - hbool_t have_direct_block; /* Flag to indicate a direct block already exists */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool have_direct_block; /* Flag to indicate a direct block already exists */ + bool did_protect; /* Whether we protected the indirect block or not */ unsigned nrows; /* Number of rows for root indirect block */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -352,7 +352,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) /* Move current direct block (used as root) into new indirect block */ /* Lock new indirect block */ - if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, NULL, 0, FALSE, + if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, NULL, 0, false, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); @@ -474,7 +474,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned min_nrows = 0; /* Min. # of direct rows */ unsigned old_nrows; /* Old # of rows */ unsigned new_nrows; /* New # of rows */ - hbool_t skip_direct_rows = FALSE; /* Whether we are skipping direct rows */ + bool skip_direct_rows = false; /* Whether we are skipping direct rows */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -498,7 +498,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) assert(min_dblock_size > hdr->man_dtable.cparam.start_block_size); /* Set flag */ - skip_direct_rows = TRUE; + skip_direct_rows = true; /* Make certain we allocate at least the required row for the block requested */ min_nrows = 1 + H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); @@ -869,7 +869,7 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ H5HF_free_section_t *old_sec_node = *sec_node; /* Pointer to old indirect section node */ unsigned dblock_entry; /* Entry for direct block */ - hbool_t iblock_held = FALSE; /* Flag to indicate that indirect block is held */ + bool iblock_held = false; /* Flag to indicate that indirect block is held */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -885,7 +885,7 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) * section under it. */ if (old_sec_node->sect_info.state == H5FS_SECT_SERIALIZED || (H5FS_SECT_SERIALIZED == old_sec_node->u.row.under->sect_info.state) || - (TRUE == old_sec_node->u.row.under->u.indirect.u.iblock->removed_from_cache)) + (true == old_sec_node->u.row.under->u.indirect.u.iblock->removed_from_cache)) /* Revive row and / or indirect section */ if (H5HF__sect_row_revive(hdr, old_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section"); @@ -897,7 +897,7 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) /* Hold indirect block in memory, until direct block can point to it */ if (H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block"); - iblock_held = TRUE; + iblock_held = true; /* Reduce (& possibly re-add) 'row' section */ if (H5HF__sect_row_reduce(hdr, old_sec_node, &dblock_entry) < 0) @@ -962,7 +962,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p iblock->rc = 0; iblock->nrows = nrows; iblock->max_rows = max_rows; - iblock->removed_from_cache = FALSE; + iblock->removed_from_cache = false; /* Compute size of buffer needed for indirect block */ iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); @@ -1073,12 +1073,12 @@ done: */ H5HF_indirect_t * H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, - H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, - unsigned flags, hbool_t *did_protect) + H5HF_indirect_t *par_iblock, unsigned par_entry, bool must_protect, unsigned flags, + bool *did_protect) { H5HF_parent_t par_info; /* Parent info for loading block */ H5HF_indirect_t *iblock = NULL; /* Indirect block from cache */ - hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ + bool should_protect = false; /* Whether we should protect the indirect block or not */ H5HF_indirect_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1111,7 +1111,7 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n if (par_iblock->child_iblocks[indir_idx]) iblock = par_iblock->child_iblocks[indir_idx]; else - should_protect = TRUE; + should_protect = true; } /* end if */ else { /* Check for root indirect block */ @@ -1128,11 +1128,11 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n /* Sanity check */ assert(NULL == hdr->root_iblock); - should_protect = TRUE; + should_protect = true; } /* end else */ } /* end if */ else - should_protect = TRUE; + should_protect = true; } /* end else */ } /* end if */ @@ -1174,11 +1174,11 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n } /* end if */ /* Indicate that the indirect block was protected */ - *did_protect = TRUE; + *did_protect = true; } /* end if */ else /* Indicate that the indirect block was _not_ protected */ - *did_protect = FALSE; + *did_protect = false; /* Set the return value */ ret_value = iblock; @@ -1197,7 +1197,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect) +H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, bool did_protect) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1412,7 +1412,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* Check for last child being removed from indirect block */ if (iblock->nchildren == 0) { - hbool_t did_protect = FALSE; /* Whether the indirect block was protected */ + bool did_protect = false; /* Whether the indirect block was protected */ /* If this indirect block's refcount is >1, then it's being deleted * from the fractal heap (since its nchildren == 0), but is still @@ -1426,10 +1426,10 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) */ /* Lock indirect block for deletion */ if (NULL == (del_iblock = H5HF__man_iblock_protect(hdr, iblock->addr, iblock->nrows, - iblock->parent, iblock->par_entry, TRUE, + iblock->parent, iblock->par_entry, true, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); - assert(did_protect == TRUE); + assert(did_protect == true); /* Check for deleting root indirect block (and no root direct block) */ if (iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) @@ -1465,7 +1465,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* Delete indirect block from cache, if appropriate */ if (del_iblock) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotect */ - hbool_t took_ownership = FALSE; /* Flag to indicate that block ownership has transitioned */ + bool took_ownership = false; /* Flag to indicate that block ownership has transitioned */ /* If the refcount is still >0, unpin the block and take ownership * from the cache, otherwise let the cache destroy it. @@ -1473,7 +1473,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) if (del_iblock->rc > 0) { cache_flags |= (H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG); cache_flags |= H5AC__UNPIN_ENTRY_FLAG; - took_ownership = TRUE; + took_ownership = true; } /* end if */ else { /* Entry should be removed from the cache */ @@ -1487,7 +1487,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) } /* end else */ /* Unprotect the indirect block, with appropriate flags */ - if (H5HF__man_iblock_unprotect(del_iblock, cache_flags, TRUE) < 0) + if (H5HF__man_iblock_unprotect(del_iblock, cache_flags, true) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block"); /* if took ownership, free file space & mark block as removed from cache */ @@ -1501,7 +1501,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) del_iblock->addr = HADDR_UNDEF; /* Mark block as removed from the cache */ - del_iblock->removed_from_cache = TRUE; + del_iblock->removed_from_cache = true; } /* end if */ } /* end if */ @@ -1556,7 +1556,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr unsigned row, col; /* Current row & column in indirect block */ unsigned entry; /* Current entry in row */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1570,10 +1570,10 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr /* Lock indirect block */ if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, par_iblock, par_entry, - TRUE, H5AC__NO_FLAGS_SET, &did_protect))) + true, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); assert(iblock->nchildren > 0); - assert(did_protect == TRUE); + assert(did_protect == true); /* Iterate over rows in this indirect block */ entry = 0; @@ -1663,7 +1663,7 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned n H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1677,7 +1677,7 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned n assert(heap_size); /* Protect the indirect block */ - if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, par_iblock, par_entry, FALSE, + if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, par_iblock, par_entry, false, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block"); diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 9d87cc6..8a347e7 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -112,7 +112,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o hsize_t curr_offset; /* Current offset, as adjusted */ unsigned row; /* Current row we are on */ unsigned col; /* Column in row */ - hbool_t root_block = TRUE; /* Flag to indicate the current block is the root indirect block */ + bool root_block = true; /* Flag to indicate the current block is the root indirect block */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -145,7 +145,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o */ do { - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ /* Walk down the rows in the doubling table until we've found the correct row for the next block */ for (row = 0; row < hdr->man_dtable.max_root_rows; row++) @@ -177,7 +177,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o biter->curr->up = NULL; /* Next time through the loop will not be with the root indirect block */ - root_block = FALSE; + root_block = false; } /* end if */ else { hsize_t child_size; /* Size of new indirect block to create */ @@ -197,7 +197,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o /* Load indirect block for this context location */ if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, iblock_parent, - iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + iblock_par_entry, false, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); /* Make indirect block the context for the current location */ @@ -241,7 +241,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o } while (1); /* Breaks out in middle */ /* Set flag to indicate block iterator finished initializing */ - biter->ready = TRUE; + biter->ready = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -321,7 +321,7 @@ H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indir biter->curr = new_loc; /* Set flag to indicate block iterator finished initializing */ - biter->ready = TRUE; + biter->ready = true; done: if (ret_value < 0 && new_loc) @@ -381,7 +381,7 @@ H5HF__man_iter_reset(H5HF_block_iter_t *biter) } /* end if */ /* Reset block iterator flags */ - biter->ready = FALSE; + biter->ready = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -555,7 +555,7 @@ H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsi * *------------------------------------------------------------------------- */ -hbool_t +bool H5HF__man_iter_ready(H5HF_block_iter_t *biter) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5HFman.c b/src/H5HFman.c index d5075c0..b15960a 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -48,7 +48,7 @@ if (H5Z_can_apply_direct(&((HDR)->pline)) < 0) \ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "I/O filters can't operate on this heap"); \ \ - (HDR)->checked_filters = TRUE; \ + (HDR)->checked_filters = true; \ } /* end if */ \ } @@ -345,7 +345,7 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * } /* end if */ else { H5HF_indirect_t *iblock; /* Pointer to indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ unsigned entry; /* Entry of block */ /* Look up indirect block containing direct block */ @@ -526,7 +526,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ - hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ + bool did_protect = false; /* Whether we protected the indirect block or not */ hsize_t obj_off; /* Object's offset in heap */ size_t obj_len; /* Object's length in heap */ size_t dblock_size; /* Direct block size */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index e036cf0..ceef78f 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -66,7 +66,7 @@ */ #define H5HF_HEADER_SIZE(h) \ (/* General metadata fields */ \ - H5HF_METADATA_PREFIX_SIZE(TRUE) \ + H5HF_METADATA_PREFIX_SIZE(true) \ \ /* Fractal Heap Header specific fields */ \ \ @@ -118,7 +118,7 @@ /* Size of managed indirect block */ #define H5HF_MAN_INDIRECT_SIZE(h, r) \ (/* General metadata fields */ \ - H5HF_METADATA_PREFIX_SIZE(TRUE) \ + H5HF_METADATA_PREFIX_SIZE(true) \ \ /* Fractal heap managed, absolutely mapped indirect block specific fields */ \ + (unsigned)(h)->sizeof_addr /* File address of heap owning the block */ \ @@ -234,7 +234,7 @@ typedef struct H5HF_block_loc_t { /* Fractal heap block iterator info */ typedef struct H5HF_block_iter_t { - hbool_t ready; /* Set if iterator is finished initializing */ + bool ready; /* Set if iterator is finished initializing */ H5HF_block_loc_t *curr; /* Pointer to the current level information for iterator */ } H5HF_block_iter_t; @@ -253,7 +253,7 @@ typedef struct H5HF_free_section_t { unsigned num_entries; /* Number of entries covered */ /* Fields that aren't stored */ - hbool_t checked_out; /* Flag to indicate that a row section is temporarily out of the free space + bool checked_out; /* Flag to indicate that a row section is temporarily out of the free space manager */ } row; struct { @@ -299,10 +299,10 @@ struct H5HF_hdr_t { unsigned filter_len; /* Size of I/O filter information (in bytes) */ /* Flags for heap settings (stored in status byte in header) */ - hbool_t debug_objs; /* Is the heap storing objects in 'debug' format */ - hbool_t write_once; /* Is heap being written in "write once" mode? */ - hbool_t huge_ids_wrapped; /* Have "huge" object IDs wrapped around? */ - hbool_t checksum_dblocks; /* Should the direct blocks in the heap be checksummed? */ + bool debug_objs; /* Is the heap storing objects in 'debug' format */ + bool write_once; /* Is heap being written in "write once" mode? */ + bool huge_ids_wrapped; /* Have "huge" object IDs wrapped around? */ + bool checksum_dblocks; /* Should the direct blocks in the heap be checksummed? */ /* Doubling table information (partially stored in header) */ /* (Partially set by user, partially derived/updated internally) */ @@ -339,7 +339,7 @@ struct H5HF_hdr_t { unsigned mode; /* Access mode for heap */ H5F_t *f; /* Pointer to file for heap */ size_t file_rc; /* Reference count of files using heap header */ - hbool_t pending_delete; /* Heap is pending deletion */ + bool pending_delete; /* Heap is pending deletion */ uint8_t sizeof_size; /* Size of file sizes */ uint8_t sizeof_addr; /* Size of file addresses */ struct H5HF_indirect_t *root_iblock; /* Pointer to root indirect block */ @@ -349,14 +349,14 @@ struct H5HF_hdr_t { H5B2_t *huge_bt2; /* v2 B-tree handle for huge objects */ hsize_t huge_max_id; /* Max. 'huge' heap ID before rolling 'huge' heap IDs over */ uint8_t huge_id_size; /* Size of 'huge' heap IDs (in bytes) */ - hbool_t huge_ids_direct; /* Flag to indicate that 'huge' object's offset & length are stored directly in - heap ID */ - size_t tiny_max_len; /* Max. size of tiny objects for this heap */ - hbool_t tiny_len_extended; /* Flag to indicate that 'tiny' object's length is stored in extended form - (i.e. w/extra byte) */ - uint8_t heap_off_size; /* Size of heap offsets (in bytes) */ - uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */ - hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */ + bool huge_ids_direct; /* Flag to indicate that 'huge' object's offset & length are stored directly in + heap ID */ + size_t tiny_max_len; /* Max. size of tiny objects for this heap */ + bool tiny_len_extended; /* Flag to indicate that 'tiny' object's length is stored in extended form + (i.e. w/extra byte) */ + uint8_t heap_off_size; /* Size of heap offsets (in bytes) */ + uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */ + bool checked_filters; /* true if pipeline passes can_apply checks */ }; /* Common indirect block doubling table entry */ @@ -395,7 +395,7 @@ struct H5HF_indirect_t { unsigned nchildren; /* Number of child blocks */ unsigned max_child; /* Max. offset used in child entries */ struct H5HF_indirect_t **child_iblocks; /* Array of pointers to pinned child indirect blocks */ - hbool_t removed_from_cache; /* Flag that indicates the block has */ + bool removed_from_cache; /* Flag that indicates the block has */ /* been removed from the metadata cache, but */ /* is still 'live' due to a refcount (rc) > 0 */ /* (usually from free space sections) */ @@ -649,8 +649,8 @@ H5_DLL herr_t H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo unsigned nrows, unsigned max_rows, haddr_t *addr_p); H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, - hbool_t must_protect, unsigned flags, hbool_t *did_protect); -H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect); + bool must_protect, unsigned flags, bool *did_protect); +H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, bool did_protect); H5_DLL herr_t H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); H5_DLL herr_t H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); @@ -668,12 +668,12 @@ H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, H5HF_free_sec H5_DLL herr_t H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p, H5HF_free_section_t **ret_sec_node); H5_DLL herr_t H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_addr, - hbool_t *parent_removed); + bool *parent_removed); H5_DLL H5HF_direct_t *H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned flags); H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **par_iblock, - unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); + unsigned *par_entry, bool *par_did_protect, unsigned flags); H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); H5_DLL herr_t H5HF__man_dblock_dest(H5HF_direct_t *dblock); @@ -716,21 +716,21 @@ H5_DLL herr_t H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t H5_DLL herr_t H5HF__tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Block iteration routines */ -H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset); -H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, - unsigned start_entry); -H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); -H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); -H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, - H5HF_indirect_t **block); -H5_DLL hbool_t H5HF__man_iter_ready(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset); +H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, + unsigned start_entry); +H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); +H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); +H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, + H5HF_indirect_t **block); +H5_DLL bool H5HF__man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ -H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); +H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, bool may_create); H5_DLL herr_t H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags); H5_DLL htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node); H5_DLL herr_t H5HF__space_revert_root(const H5HF_hdr_t *hdr); @@ -771,8 +771,8 @@ H5_DLL hsize_t H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row); H5_DLL hsize_t H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row); H5_DLL herr_t H5HF_get_id_off_test(const H5HF_t *fh, const void *id, hsize_t *obj_off); H5_DLL herr_t H5HF_get_id_type_test(const void *id, unsigned char *obj_type); -H5_DLL herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended); -H5_DLL herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, hbool_t *ids_direct); +H5_DLL herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, bool *len_extended); +H5_DLL herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, bool *ids_direct); #endif /* H5HF_TESTING */ #endif /* H5HFpkg_H */ diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index f047b45..ca7948a 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -55,7 +55,7 @@ typedef struct H5HF_dtable_cparam_t { /* Fractal heap creation parameters */ typedef struct H5HF_create_t { H5HF_dtable_cparam_t managed; /* Mapped object doubling-table creation parameters */ - hbool_t checksum_dblocks; /* Whether the direct blocks should be checksummed */ + bool checksum_dblocks; /* Whether the direct blocks should be checksummed */ uint32_t max_man_size; /* Max. size of object to manage in doubling table */ /* (i.e. min. size of object to store standalone) */ uint16_t id_len; /* Length of IDs to use for heap objects */ @@ -108,7 +108,7 @@ H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /* H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p /*out*/); H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p /*out*/); H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj /*out*/); -H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed, const void *obj); +H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, bool *id_changed, const void *obj); H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, void *op_data); H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id); H5_DLL herr_t H5HF_close(H5HF_t *fh); @@ -125,13 +125,12 @@ H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, #endif /* H5HF_DEBUGGING */ /* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, - int fwidth); +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, bool dump_internal, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); -H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, - int fwidth); +H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, bool dump_internal, FILE *stream, int indent, + int fwidth); H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 0dd9f3f..8b27999 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -66,7 +66,7 @@ static H5HF_free_section_t *H5FS__sect_node_new(unsigned sect_type, haddr_t sect static herr_t H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ -static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect); +static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, bool refresh, H5HF_free_section_t *sect); static herr_t H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); /* 'single' section callbacks */ @@ -82,7 +82,7 @@ static herr_t H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *udata) static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect); /* 'row' section routines */ -static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, +static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, bool is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect); static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); @@ -111,7 +111,7 @@ static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream static H5HF_free_section_t *H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries); -static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t first_child, +static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, bool first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); @@ -122,10 +122,10 @@ static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock); static herr_t H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, - hbool_t *alloc_from_start); -static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); -static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static hbool_t H5HF__sect_indirect_is_first(H5HF_free_section_t *sect); + bool *alloc_from_start); +static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); +static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +static bool H5HF__sect_indirect_is_first(H5HF_free_section_t *sect); static H5HF_indirect_t *H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect); static hsize_t H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect); static H5HF_free_section_t *H5HF__sect_indirect_top(H5HF_free_section_t *sect); @@ -477,11 +477,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect) +H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, bool refresh, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ unsigned sec_entry; /* Entry within section indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -557,7 +557,7 @@ H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) } /* end if */ else { /* Look up indirect block information for section */ - if (H5HF__sect_single_locate_parent(hdr, FALSE, sect) < 0) + if (H5HF__sect_single_locate_parent(hdr, false, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get section's parent info"); } /* end else */ @@ -694,7 +694,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) dblock_overhead = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr); if ((dblock_size - dblock_overhead) == sect->sect_info.size && hdr->man_dtable.curr_root_rows > 0) { H5HF_direct_t *dblock; /* Pointer to direct block for section */ - hbool_t parent_removed; /* Whether the direct block parent was removed from the file */ + bool parent_removed; /* Whether the direct block parent was removed from the file */ if (NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) @@ -812,7 +812,7 @@ done: * * Note: Second section must be "after" first section * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * * Failure: negative * @@ -824,7 +824,7 @@ H5HF__sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5FS_sectio { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -840,7 +840,7 @@ H5HF__sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5FS_sectio * are actually within the same direct block) */ if (H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -907,7 +907,7 @@ done: * been done) as much as it's cleaning up _after_ the heap * shrink. * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * * Failure: negative * @@ -919,7 +919,7 @@ H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -939,14 +939,14 @@ H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) dblock_size = hdr->man_dtable.cparam.start_block_size; dblock_overhead = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr); if ((dblock_size - dblock_overhead) == sect->sect_info.size) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ else { /* We shouldn't have a situation where the 'next block' iterator * is moved before a direct block that still has objects within it. */ assert(hdr->man_iter_off > sect->sect_info.addr); - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end else */ done: @@ -1147,7 +1147,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, +H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, bool is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ @@ -1172,7 +1172,7 @@ H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, uns sect->u.row.row = row; sect->u.row.col = col; sect->u.row.num_entries = nentries; - sect->u.row.checked_out = FALSE; + sect->u.row.checked_out = false; /* Set return value */ ret_value = sect; @@ -1210,7 +1210,7 @@ H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_dire sect->u.row.row = dblock->par_entry / hdr->man_dtable.cparam.width; sect->u.row.col = dblock->par_entry % hdr->man_dtable.cparam.width; sect->u.row.num_entries = 1; - sect->u.row.checked_out = FALSE; + sect->u.row.checked_out = false; /* Create indirect section that underlies the row section */ if (NULL == (sect->u.row.under = H5HF__sect_indirect_for_row(hdr, dblock->parent, sect))) @@ -1251,7 +1251,7 @@ H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) * section is still marked as "live", switch it to the "serialized" state. */ if ((H5FS_SECT_LIVE == sect->u.row.under->sect_info.state) && - (TRUE == sect->u.row.under->u.indirect.u.iblock->removed_from_cache)) + (true == sect->u.row.under->u.indirect.u.iblock->removed_from_cache)) if (H5HF__sect_row_parent_removed(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "can't update section info"); @@ -1279,8 +1279,8 @@ done: herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p) { - hbool_t alloc_from_start; /* Whether to allocate from the end of the row */ - herr_t ret_value = SUCCEED; /* Return value */ + bool alloc_from_start; /* Whether to allocate from the end of the row */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1295,11 +1295,11 @@ H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entr assert(entry_p); /* Mark the row as checked out from the free space manager */ - assert(sect->u.row.checked_out == FALSE); - sect->u.row.checked_out = TRUE; + assert(sect->u.row.checked_out == false); + sect->u.row.checked_out = true; /* Forward row section to indirect routines, to handle reducing underlying indirect section */ - alloc_from_start = FALSE; + alloc_from_start = false; if (H5HF__sect_indirect_reduce_row(hdr, sect, &alloc_from_start) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce underlying section"); @@ -1326,7 +1326,7 @@ H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entr sect->u.row.num_entries--; /* Check the row back in */ - sect->u.row.checked_out = FALSE; + sect->u.row.checked_out = false; /* Add 'row' section back to free space list */ if (H5HF__space_add(hdr, sect, 0) < 0) @@ -1605,7 +1605,7 @@ done: * * Note: Second section must be "after" first section * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * * Failure: negative * @@ -1618,7 +1618,7 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_i const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ H5HF_free_section_t *top_indir_sect1, *top_indir_sect2; /* Top indirect section for each row */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -1645,7 +1645,7 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_i /* Check if second section adjoins first section */ if (H5_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1710,7 +1710,7 @@ done: * been done) as much as it's cleaning up _after_ the heap * shrink. * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * * Failure: negative * @@ -1722,7 +1722,7 @@ H5HF__sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -1732,7 +1732,7 @@ H5HF__sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED /* Check if section is past end of "next block" iterator */ if (sect->sect_info.addr >= hdr->man_iter_off) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1873,7 +1873,7 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t /* Sanity checking on the row */ assert(sect->u.row.under); assert(sect->u.row.num_entries); - assert(sect->u.row.checked_out == FALSE); + assert(sect->u.row.checked_out == false); indir_sect = sect->u.row.under; indir_idx = sect->u.row.row - indir_sect->u.indirect.row; assert(indir_sect->u.indirect.dir_rows[indir_idx] == sect); @@ -2188,7 +2188,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t first_child, +H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, bool first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col) { @@ -2322,7 +2322,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ curr_entry += row_entries; /* Reset the 'first child' parameters */ - first_child = FALSE; + first_child = false; first_row_sect = NULL; } /* end if */ else { @@ -2338,7 +2338,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ /* Add an indirect section for each indirect block in the row */ for (v = 0; v < row_entries; v++) { - hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ + bool did_protect = false; /* Whether we protected the indirect block or not */ /* Try to get the child section's indirect block, if it's available */ if (sect->sect_info.state == H5FS_SECT_LIVE) { @@ -2354,7 +2354,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ if (H5_addr_defined(child_iblock_addr)) { if (NULL == (child_iblock = H5HF__man_iblock_protect( hdr, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, - curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + curr_entry, false, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block"); } /* end if */ @@ -2396,7 +2396,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ curr_indir_entry++; /* Reset the 'first child' parameters */ - first_child = FALSE; + first_child = false; first_row_sect = NULL; } /* end for */ } /* end else */ @@ -2482,7 +2482,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section"); /* Initialize rows for new indirect section */ - if (H5HF__sect_indirect_init_rows(hdr, sect, TRUE, &first_row_sect, H5FS_ADD_SKIP_VALID, start_row, + if (H5HF__sect_indirect_init_rows(hdr, sect, true, &first_row_sect, H5FS_ADD_SKIP_VALID, start_row, start_col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section"); assert(first_row_sect); @@ -2561,7 +2561,7 @@ static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + bool did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2653,7 +2653,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t *alloc_from_start) +H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, bool *alloc_from_start) { H5HF_free_section_t *sect; /* Indirect section underlying row section */ unsigned row_start_entry; /* Entry for first block covered in row section */ @@ -2696,17 +2696,17 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* Check if we should allocate from end of indirect section */ if (row_end_entry == end_entry && start_row != end_row) { - *alloc_from_start = FALSE; + *alloc_from_start = false; row_entry = row_end_entry; } /* end if */ else { - *alloc_from_start = TRUE; + *alloc_from_start = true; row_entry = row_start_entry; } /* end else */ /* Check if we have a parent section to be detached from */ if (sect->u.indirect.parent) { - hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ + bool is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ is_first = H5HF__sect_indirect_is_first(sect); @@ -2951,7 +2951,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned if (sect->u.indirect.num_entries > 1) { /* Check if we have a parent section to be detached from */ if (sect->u.indirect.parent) { - hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ + bool is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ is_first = H5HF__sect_indirect_is_first(sect); @@ -3147,14 +3147,14 @@ done: * * Purpose: Check if indirect section is first in all parents * - * Return: Non-negative (TRUE/FALSE) on success/ + * Return: Non-negative (true/false) on success/ * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -3167,7 +3167,7 @@ H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) ret_value = H5HF__sect_indirect_is_first(sect->u.indirect.parent); } /* end if */ else - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF__sect_indirect_is_first() */ @@ -3265,7 +3265,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H unsigned end_entry1; /* End entry for section #1 */ unsigned end_row1; /* Ending row for section #1 */ unsigned start_row2; /* Starting row for section #2 */ - hbool_t merged_rows; /* Flag to indicate that rows was merged together */ + bool merged_rows; /* Flag to indicate that rows was merged together */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3348,7 +3348,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H new_dir_nrows1 = (sect1->u.indirect.dir_nrows + sect2->u.indirect.dir_nrows) - 1; /* Indicate that the rows were merged */ - merged_rows = TRUE; + merged_rows = true; } /* end if */ else { @@ -3358,7 +3358,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H new_dir_nrows1 = sect1->u.indirect.dir_nrows + sect2->u.indirect.dir_nrows; /* Indicate that the rows were _not_ merged */ - merged_rows = FALSE; + merged_rows = false; } /* end else */ /* Check if we need to move additional rows */ @@ -3390,7 +3390,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H } /* end if */ else /* Indicate that the rows were _not_ merged */ - merged_rows = FALSE; + merged_rows = false; /* Check for indirect sections in second section */ if (sect2->u.indirect.indir_nents > 0) { @@ -3731,7 +3731,7 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sec end_col = end_entry % hdr->man_dtable.cparam.width; /* Initialize rows for new indirect section */ - if (H5HF__sect_indirect_init_rows(hdr, new_sect, TRUE, NULL, H5FS_ADD_DESERIALIZING, + if (H5HF__sect_indirect_init_rows(hdr, new_sect, true, NULL, H5FS_ADD_DESERIALIZING, new_sect->u.indirect.row, new_sect->u.indirect.col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize indirect section"); diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 2913062..8c9f0c0 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -79,7 +79,7 @@ *------------------------------------------------------------------------- */ herr_t -H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create) +H5HF__space_start(H5HF_hdr_t *hdr, bool may_create) { const H5FS_section_class_t *classes[] = {/* Free space section classes implemented for fractal heap */ H5HF_FSPACE_SECT_CLS_SINGLE, H5HF_FSPACE_SECT_CLS_FIRST_ROW, @@ -152,7 +152,7 @@ H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags) /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) - if (H5HF__space_start(hdr, TRUE) < 0) + if (H5HF__space_start(hdr, true) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space"); /* Construct user data */ @@ -179,7 +179,7 @@ done: htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node) { - htri_t node_found = FALSE; /* Whether an existing free list node was found */ + htri_t node_found = false; /* Whether an existing free list node was found */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -193,7 +193,7 @@ H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node) /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) - if (H5HF__space_start(hdr, FALSE) < 0) + if (H5HF__space_start(hdr, false) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space"); /* Search for free space in the heap */ @@ -394,7 +394,7 @@ H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size) /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) - if (H5HF__space_start(hdr, FALSE) < 0) + if (H5HF__space_start(hdr, false) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space"); /* Get free space metadata size */ diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 8605163..b60853a 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -441,7 +441,7 @@ H5HF_get_id_type_test(const void *_id, unsigned char *obj_type) *------------------------------------------------------------------------- */ herr_t -H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended) +H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, bool *len_extended) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -469,7 +469,7 @@ H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended *------------------------------------------------------------------------- */ herr_t -H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, hbool_t *ids_direct) +H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, bool *ids_direct) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index e303b33..0f5f1a5 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -97,15 +97,15 @@ H5HF__tiny_init(H5HF_hdr_t *hdr) */ if ((hdr->id_len - 1) <= H5HF_TINY_LEN_SHORT) { hdr->tiny_max_len = hdr->id_len - 1; - hdr->tiny_len_extended = FALSE; + hdr->tiny_len_extended = false; } /* end if */ else if ((hdr->id_len - 1) == (H5HF_TINY_LEN_SHORT + 1)) { hdr->tiny_max_len = H5HF_TINY_LEN_SHORT; - hdr->tiny_len_extended = FALSE; + hdr->tiny_len_extended = false; } /* end if */ else { hdr->tiny_max_len = hdr->id_len - 2; - hdr->tiny_len_extended = TRUE; + hdr->tiny_len_extended = true; } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5HG.c b/src/H5HG.c index 5e573fa..26bc597 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -574,7 +574,7 @@ H5HG_read(H5F_t *f, H5HG_t *hobj, void *object /*out*/, size_t *buf_size) * with the H5AC_protect(), but it won't hurt to do it twice. */ if (heap->obj[0].begin) { - if (H5F_cwfs_advance_heap(f, heap, FALSE) < 0) + if (H5F_cwfs_advance_heap(f, heap, false) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, NULL, "can't adjust file's CWFS"); } /* end if */ @@ -771,7 +771,7 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj) * H5AC_protect() might have done that too, but that's okay. If the * heap isn't on the CWFS list then add it to the end. */ - if (H5F_cwfs_advance_heap(f, heap, TRUE) < 0) + if (H5F_cwfs_advance_heap(f, heap, true) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, FAIL, "can't adjust file's CWFS"); } /* end else */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index ecce815..125d451 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -55,7 +55,7 @@ static herr_t H5HG__cache_heap_get_initial_load_size(void *udata, size_t *image_len); static herr_t H5HG__cache_heap_get_final_load_size(const void *_image, size_t image_len, void *udata, size_t *actual_len); -static void *H5HG__cache_heap_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HG__cache_heap_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len); static herr_t H5HG__cache_heap_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HG__cache_heap_free_icr(void *thing); @@ -214,7 +214,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5F_t *f = (H5F_t *)_udata; /* File pointer */ H5HG_heap_t *heap = NULL; /* New global heap */ @@ -369,7 +369,7 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, hbool /* Post-parse checks */ if (p != heap->chunk + heap->size) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "partially decoded global heap"); - if (FALSE == H5HG_ISALIGNED(heap->obj[0].size)) + if (false == H5HG_ISALIGNED(heap->obj[0].size)) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "decoded global heap is not aligned"); /* Set the next index value to use when creating a new object */ diff --git a/src/H5HL.c b/src/H5HL.c index ffec3ad..bdf46d6 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -121,7 +121,7 @@ H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p /*out*/) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate file memory"); /* Initialize info */ - heap->single_cache_obj = TRUE; + heap->single_cache_obj = true; heap->dblk_addr = heap->prfx_addr + (hsize_t)heap->prfx_size; heap->dblk_size = size_hint; if (size_hint) @@ -522,7 +522,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of H5HL_free_t *fl = NULL, *last_fl = NULL; size_t need_size; size_t offset = 0; - hbool_t found; + bool found; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -552,7 +552,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of /* Look for a free slot large enough for this object and which would * leave zero or at least H5G_SIZEOF_FREE bytes left over. */ - for (fl = heap->freelist, found = FALSE; fl; fl = fl->next) { + for (fl = heap->freelist, found = false; fl; fl = fl->next) { if (fl->size > need_size && fl->size - need_size >= H5HL_SIZEOF_FREE(f)) { /* A big enough free block was found */ offset = fl->offset; @@ -560,14 +560,14 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of fl->size -= need_size; assert(fl->offset == H5HL_ALIGN(fl->offset)); assert(fl->size == H5HL_ALIGN(fl->size)); - found = TRUE; + found = true; break; } else if (fl->size == need_size) { /* Free block of exact size found */ offset = fl->offset; fl = H5HL__remove_free(heap, fl); - found = TRUE; + found = true; break; } else if (!last_fl || last_fl->offset < fl->offset) { @@ -581,7 +581,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of * can extend that free chunk. Otherwise we'll have to make another * free chunk. If the heap must expand, we double its size. */ - if (found == FALSE) { + if (found == false) { size_t need_more; /* How much more space we need */ size_t new_dblk_size; /* Final size of space allocated for heap data block */ size_t old_dblk_size; /* Previous size of space allocated for heap data block */ @@ -615,7 +615,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap"); /* Check if we extended the heap data block in file */ - if (was_extended == TRUE) { + if (was_extended == true) { /* Check for prefix & data block contiguous */ if (heap->single_cache_obj) { /* Resize prefix+data block */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 377bc0f..b38ff7c 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -67,14 +67,14 @@ static herr_t H5HL__cache_prefix_get_initial_load_size(void *udata, size_t *image_len); static herr_t H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len, void *udata, size_t *actual_len); -static void *H5HL__cache_prefix_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HL__cache_prefix_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HL__cache_prefix_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_prefix_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HL__cache_prefix_free_icr(void *thing); /* Local heap data block */ static herr_t H5HL__cache_datablock_get_initial_load_size(void *udata, size_t *image_len); -static void *H5HL__cache_datablock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5HL__cache_datablock_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5HL__cache_datablock_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_datablock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing); @@ -394,7 +394,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5HL_t *heap = NULL; /* Local heap */ H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ @@ -432,7 +432,7 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, hbo /* Check if heap data block is contiguous with header */ if (H5_addr_eq((heap->prfx_addr + heap->prfx_size), heap->dblk_addr)) { /* Note that the heap should be a single object in the cache */ - heap->single_cache_obj = TRUE; + heap->single_cache_obj = true; /* Allocate space for the heap data image */ if (NULL == (heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, heap->dblk_size))) @@ -456,7 +456,7 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, hbo /* Note that the heap should _NOT_ be a single * object in the cache */ - heap->single_cache_obj = FALSE; + heap->single_cache_obj = false; } /* Set return value */ @@ -683,7 +683,7 @@ H5HL__cache_datablock_get_initial_load_size(void *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static void * -H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) +H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, bool H5_ATTR_UNUSED *dirty) { H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ H5HL_t *heap = (H5HL_t *)_udata; /* User data for callback */ diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 5701365..dfcca97 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -231,7 +231,7 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size) dblk = NULL; /* Reset 'single cache object' flag */ - heap->single_cache_obj = FALSE; + heap->single_cache_obj = false; } else { /* Resize the heap data block in the cache */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 47c2060..9d23049 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -83,7 +83,7 @@ struct H5HL_t { size_t prots; /* # of times the heap has been protected */ size_t sizeof_size; /* Size of file sizes */ size_t sizeof_addr; /* Size of file addresses */ - hbool_t single_cache_obj; /* Indicate if the heap is a single object in the cache */ + bool single_cache_obj; /* Indicate if the heap is a single object in the cache */ H5HL_free_t *freelist; /* the free list */ /* Prefix-specific fields */ diff --git a/src/H5I.c b/src/H5I.c index f0d1be6..97e679c 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -107,21 +107,21 @@ H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved, H5I H5I_next_type_g++; } else { - hbool_t done; /* Indicate that search was successful */ - int i; + bool done; /* Indicate that search was successful */ + int i; /* Look for a free type to give out */ - done = FALSE; - for (i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES && done == FALSE; i++) { + done = false; + for (i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES && done == false; i++) { if (NULL == H5I_type_info_array_g[i]) { /* Found a free type ID */ new_type = (H5I_type_t)i; - done = TRUE; + done = true; } } /* Verify that we found a type to give out */ - if (done == FALSE) + if (done == false) HGOTO_ERROR(H5E_ID, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded"); } @@ -157,14 +157,14 @@ done: * Purpose: Query function to inform the user if a given type is * currently registered with the library. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ htri_t H5Itype_exists(H5I_type_t type) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "It", type); @@ -176,7 +176,7 @@ H5Itype_exists(H5I_type_t type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); if (NULL == H5I_type_info_array_g[type]) - ret_value = FALSE; + ret_value = false; done: FUNC_LEAVE_API(ret_value) @@ -249,7 +249,7 @@ H5Iclear_type(H5I_type_t type, hbool_t force) if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "cannot call public function on library type"); - ret_value = H5I_clear_type(type, force, TRUE); + ret_value = H5I_clear_type(type, force, true); done: FUNC_LEAVE_API(ret_value) @@ -307,7 +307,7 @@ H5Iregister(H5I_type_t type, const void *object) HGOTO_ERROR(H5E_ID, H5E_BADGROUP, H5I_INVALID_HID, "cannot call public function on library type"); /* Register the object */ - if ((ret_value = H5I__register(type, object, TRUE, NULL, NULL)) < 0) + if ((ret_value = H5I__register(type, object, true, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object"); done: @@ -340,7 +340,7 @@ H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_ HGOTO_ERROR(H5E_ID, H5E_BADVALUE, H5I_INVALID_HID, "NULL pointer for realize_cb not allowed"); /* Register the future object */ - if ((ret_value = H5I__register(type, object, TRUE, realize_cb, discard_cb)) < 0) + if ((ret_value = H5I__register(type, object, true, realize_cb, discard_cb)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object"); done: @@ -499,7 +499,7 @@ H5Iinc_ref(hid_t id) HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID"); /* Do actual increment operation */ - if ((ret_value = H5I_inc_ref(id, TRUE)) < 0) + if ((ret_value = H5I_inc_ref(id, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTINC, (-1), "can't increment ID ref count"); done: @@ -529,7 +529,7 @@ H5Iget_ref(hid_t id) HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID"); /* Do actual retrieve operation */ - if ((ret_value = H5I_get_ref(id, TRUE)) < 0) + if ((ret_value = H5I_get_ref(id, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't get ID ref count"); done: @@ -647,7 +647,7 @@ done: * Purpose: Check if the given id is valid. An id is valid if it is in * use and has an application reference count of at least 1. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -655,16 +655,16 @@ htri_t H5Iis_valid(hid_t id) { H5I_id_info_t *info = NULL; /* Pointer to the ID info */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", id); /* Find the ID */ if (NULL == (info = H5I__find_id(id))) - ret_value = FALSE; + ret_value = false; else if (!info->app_count) /* Check if the found id is an internal id */ - ret_value = FALSE; + ret_value = false; done: FUNC_LEAVE_API(ret_value) @@ -745,7 +745,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ - (void)H5I_iterate(type, H5I__search_cb, &udata, TRUE); + (void)H5I_iterate(type, H5I__search_cb, &udata, true); /* Set return value */ ret_value = udata.ret_obj; @@ -826,7 +826,7 @@ H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data) /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ - if ((ret_value = H5I_iterate(type, H5I__iterate_pub_cb, &int_udata, TRUE)) < 0) + if ((ret_value = H5I_iterate(type, H5I__iterate_pub_cb, &int_udata, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "can't iterate over ids"); done: @@ -867,7 +867,7 @@ H5Iget_file_id(hid_t obj_id) HGOTO_ERROR(H5E_ID, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier"); /* Get the file ID */ - if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0) + if ((ret_value = H5F_get_file_id(vol_obj, type, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID"); } else diff --git a/src/H5Iint.c b/src/H5Iint.c index 462dc71..63557c5 100644 --- a/src/H5Iint.c +++ b/src/H5Iint.c @@ -53,15 +53,15 @@ typedef struct { typedef struct { H5I_search_func_t user_func; /* 'User' function to invoke */ void *user_udata; /* User data to pass to 'user' function */ - hbool_t app_ref; /* Whether this is an appl. ref. call */ + bool app_ref; /* Whether this is an appl. ref. call */ H5I_type_t obj_type; /* Type of object we are iterating over */ } H5I_iterate_ud_t; /* User data for H5I__clear_type_cb */ typedef struct { H5I_type_info_t *type_info; /* Pointer to the type's info to be cleared */ - hbool_t force; /* Whether to always remove the ID */ - hbool_t app_ref; /* Whether this is an appl. ref. call */ + bool force; /* Whether to always remove the ID */ + bool app_ref; /* Whether this is an appl. ref. call */ } H5I_clear_type_ud_t; /********************/ @@ -92,7 +92,7 @@ int H5I_next_type_g = (int)H5I_NTYPES; H5FL_DEFINE_STATIC(H5I_id_info_t); /* Whether deletes are actually marks (for mark-and-sweep) */ -static hbool_t H5I_marking_s = FALSE; +static bool H5I_marking_s = false; /*****************************/ /* Library Private Variables */ @@ -287,7 +287,7 @@ H5I__unwrap(void *object, H5I_type_t type) *------------------------------------------------------------------------- */ herr_t -H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) +H5I_clear_type(H5I_type_t type, bool force, bool app_ref) { H5I_clear_type_ud_t udata; /* udata struct for callback */ H5I_id_info_t *item = NULL; @@ -314,7 +314,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) */ /* Set marking flag */ - H5I_marking_s = TRUE; + H5I_marking_s = true; /* Mark nodes for deletion */ HASH_ITER(hh, udata.type_info->hash_table, item, tmp) @@ -325,7 +325,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) } /* Unset marking flag */ - H5I_marking_s = FALSE; + H5I_marking_s = false; /* Perform sweep */ HASH_ITER(hh, udata.type_info->hash_table, item, tmp) @@ -355,7 +355,7 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) { H5I_id_info_t *info = (H5I_id_info_t *)_info; /* Current ID info being worked with */ H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */ - hbool_t mark = FALSE; + bool mark = false; FUNC_ENTER_PACKAGE_NOERR @@ -384,12 +384,12 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) #endif /* H5I_DEBUG */ /* Indicate node should be removed from list */ - mark = TRUE; + mark = true; } } else { /* Indicate node should be removed from list */ - mark = TRUE; + mark = true; } } else { @@ -407,12 +407,12 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) #endif /* H5I_DEBUG */ /* Indicate node should be removed from list */ - mark = TRUE; + mark = true; } } else { /* Indicate node should be removed from list */ - mark = TRUE; + mark = true; } } H5_GCC_CLANG_DIAG_ON("cast-qual") @@ -420,7 +420,7 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) /* Remove ID if requested */ if (mark) { /* Mark ID for deletion */ - info->marked = TRUE; + info->marked = true; /* Decrement the number of IDs in the type */ udata->type_info->id_count--; @@ -461,7 +461,7 @@ H5I__destroy_type(H5I_type_t type) /* Close/clear/destroy all IDs for this type */ H5E_BEGIN_TRY { - H5I_clear_type(type, TRUE, FALSE); + H5I_clear_type(type, true, false); } H5E_END_TRY /* don't care about errors */ @@ -500,7 +500,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, H5I_future_realize_func_t realize_cb, +H5I__register(H5I_type_t type, const void *object, bool app_ref, H5I_future_realize_func_t realize_cb, H5I_future_discard_func_t discard_cb) { H5I_type_info_t *type_info = NULL; /* Pointer to the type */ @@ -528,7 +528,7 @@ H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, H5I_future_r info->is_future = (NULL != realize_cb); info->realize_cb = realize_cb; info->discard_cb = discard_cb; - info->marked = FALSE; + info->marked = false; /* Insert into the type */ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info); @@ -559,7 +559,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) +H5I_register(H5I_type_t type, const void *object, bool app_ref) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -596,7 +596,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, hid_t existing_id) +H5I_register_using_existing_id(H5I_type_t type, void *object, bool app_ref, hid_t existing_id) { H5I_type_info_t *type_info = NULL; /* Pointer to the type */ H5I_id_info_t *info = NULL; /* Pointer to the new ID information */ @@ -637,10 +637,10 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h /* This API call is only used by the native VOL connector, which is * not asynchronous. */ - info->is_future = FALSE; + info->is_future = false; info->realize_cb = NULL; info->discard_cb = NULL; - info->marked = FALSE; + info->marked = false; /* Insert into the type */ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info); @@ -792,7 +792,7 @@ H5I_get_type(hid_t id) * the ID was of the correct class since there's no * H5I_OBJECT ID class. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: FAIL * *------------------------------------------------------------------------- @@ -809,11 +809,11 @@ H5I_is_file_object(hid_t id) if (type < 1 || type >= H5I_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID type out of range"); - /* Return TRUE if the ID is a file object (dataset, group, map, or committed - * datatype), FALSE otherwise. + /* Return true if the ID is a file object (dataset, group, map, or committed + * datatype), false otherwise. */ if (H5I_DATASET == type || H5I_GROUP == type || H5I_MAP == type) - ret_value = TRUE; + ret_value = true; else if (H5I_DATATYPE == type) { H5T_t *dt = NULL; @@ -824,7 +824,7 @@ H5I_is_file_object(hid_t id) ret_value = H5T_is_named(dt); } else - ret_value = FALSE; + ret_value = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -889,7 +889,7 @@ H5I__remove_common(H5I_type_info_t *type_info, hid_t id) if (!H5I_marking_s) HASH_DELETE(hh, type_info->hash_table, info); else - info->marked = TRUE; + info->marked = true; } else HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, NULL, "can't remove ID node from hash table"); @@ -1273,7 +1273,7 @@ done: *------------------------------------------------------------------------- */ int -H5I_inc_ref(hid_t id, hbool_t app_ref) +H5I_inc_ref(hid_t id, bool app_ref) { H5I_id_info_t *info = NULL; /* Pointer to the ID info */ int ret_value = 0; /* Return value */ @@ -1310,7 +1310,7 @@ done: *------------------------------------------------------------------------- */ int -H5I_get_ref(hid_t id, hbool_t app_ref) +H5I_get_ref(hid_t id, bool app_ref) { H5I_id_info_t *info = NULL; /* Pointer to the ID */ int ret_value = 0; /* Return value */ @@ -1503,7 +1503,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) * Function: H5I_iterate * * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). + * non-zero application reference count if app_ref is true). * Stop if FUNC returns a non zero value (i.e. anything * other than H5_ITER_CONT). * @@ -1525,7 +1525,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref) +H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, bool app_ref) { H5I_type_info_t *type_info = NULL; /* Pointer to the type */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1635,7 +1635,7 @@ H5I__find_id(hid_t id) future_object = NULL; /* Change the ID from 'future' to 'actual' */ - id_info->is_future = FALSE; + id_info->is_future = false; id_info->realize_cb = NULL; id_info->discard_cb = NULL; } diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 1009ecb..6207962 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -62,12 +62,12 @@ typedef struct H5I_id_info_t { const void *object; /* Pointer associated with the ID */ /* Future ID info */ - hbool_t is_future; /* Whether this ID represents a future object */ + bool is_future; /* Whether this ID represents a future object */ H5I_future_realize_func_t realize_cb; /* 'realize' callback for future object */ H5I_future_discard_func_t discard_cb; /* 'discard' callback for future object */ /* Hash table ID fields */ - hbool_t marked; /* Marked for deletion */ + bool marked; /* Marked for deletion */ UT_hash_handle hh; /* Hash table handle (must be LAST) */ } H5I_id_info_t; @@ -101,7 +101,7 @@ H5_DLLVAR int H5I_next_type_g; /* Package Private Prototypes */ /******************************/ -H5_DLL hid_t H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, +H5_DLL hid_t H5I__register(H5I_type_t type, const void *object, bool app_ref, H5I_future_realize_func_t realize_cb, H5I_future_discard_func_t discard_cb); H5_DLL int H5I__destroy_type(H5I_type_t type); H5_DLL void *H5I__remove_verify(hid_t id, H5I_type_t type); @@ -111,7 +111,7 @@ H5_DLL H5I_id_info_t *H5I__find_id(hid_t id); /* Testing functions */ #ifdef H5I_TESTING -H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached); +H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, bool *cached); #endif /* H5I_TESTING */ #endif /*H5Ipkg_H*/ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index e59f928..75a5787 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -63,11 +63,11 @@ typedef struct H5I_class_t { /***************************************/ H5_DLL herr_t H5I_register_type(const H5I_class_t *cls); H5_DLL int64_t H5I_nmembers(H5I_type_t type); -H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref); +H5_DLL herr_t H5I_clear_type(H5I_type_t type, bool force, bool app_ref); H5_DLL H5I_type_t H5I_get_type(hid_t id); -H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref); -H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); -H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref); +H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, bool app_ref); +H5_DLL int H5I_get_ref(hid_t id, bool app_ref); +H5_DLL int H5I_inc_ref(hid_t id, bool app_ref); H5_DLL int H5I_dec_ref(hid_t id); H5_DLL int H5I_dec_app_ref(hid_t id); H5_DLL int H5I_dec_app_ref_async(hid_t id, void **token); @@ -94,9 +94,8 @@ H5_DLL void *H5I_subst(hid_t id, const void *new_object); H5_DLL htri_t H5I_is_file_object(hid_t id); /* ID registration functions */ -H5_DLL hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref); -H5_DLL herr_t H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, - hid_t existing_id); +H5_DLL hid_t H5I_register(H5I_type_t type, const void *object, bool app_ref); +H5_DLL herr_t H5I_register_using_existing_id(H5I_type_t type, void *object, bool app_ref, hid_t existing_id); /* Debugging functions */ H5_DLL herr_t H5I_dump_ids_for_type(H5I_type_t type); diff --git a/src/H5Itest.c b/src/H5Itest.c index 68204a8..a6d2c1e 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -61,12 +61,12 @@ *------------------------------------------------------------------------- */ ssize_t -H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) +H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, bool *cached) { H5VL_object_t *vol_obj; /* Object of id */ H5G_loc_t loc; /* Object location */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool api_ctx_pushed = false; /* Whether API context pushed */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ size_t name_len = 0; /* Length of name */ ssize_t ret_value = -1; /* Return value */ @@ -75,7 +75,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, (-1), "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Get the object pointer */ if (NULL == (vol_obj = H5VL_vol_object(id))) @@ -84,7 +84,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTSET, (-1), "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Get object location */ if (H5G_loc(id, &loc) < 0) @@ -102,7 +102,7 @@ done: if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) HDONE_ERROR(H5E_ID, H5E_CANTRESET, (-1), "can't reset VOL wrapper info"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5L.c b/src/H5L.c index c746ec6..dd8baf3 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -54,7 +54,7 @@ static herr_t H5L__delete_api_common(hid_t loc_id, const char *name, hid_t lapl_ static herr_t H5L__delete_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr); -static herr_t H5L__exists_api_common(hid_t loc_id, const char *name, hbool_t *exists, hid_t lapl_id, +static herr_t H5L__exists_api_common(hid_t loc_id, const char *name, bool *exists, hid_t lapl_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr); static herr_t H5L__iterate_api_common(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate2_t op, void *op_data, void **token_ptr, @@ -107,7 +107,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified"); if (!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified"); - if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) + if (lcpl_id != H5P_DEFAULT && (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list"); /* Check the link create property list */ @@ -118,7 +118,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); @@ -209,7 +209,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified"); if (!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified"); - if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) + if (lcpl_id != H5P_DEFAULT && (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list"); /* Check the link create property list */ @@ -220,7 +220,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); @@ -308,7 +308,7 @@ H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const ch HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "link_target parameter cannot be NULL"); if (!*link_target) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "link_target parameter cannot be an empty string"); - if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) + if (lcpl_id != H5P_DEFAULT && (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list"); /* link_name is verified in H5VL_setup_name_args() */ @@ -320,11 +320,11 @@ H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const ch H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up object access arguments */ - if (H5VL_setup_name_args(link_loc_id, link_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(link_loc_id, link_name, true, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Set up VOL callback arguments */ @@ -451,7 +451,7 @@ H5L__create_hard_api_common(hid_t cur_loc_id, const char *cur_name, hid_t link_l HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new_name parameter cannot be NULL"); if (!*link_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new_name parameter cannot be an empty string"); - if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) + if (lcpl_id != H5P_DEFAULT && (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list"); /* Check the link create property list */ @@ -462,7 +462,7 @@ H5L__create_hard_api_common(hid_t cur_loc_id, const char *cur_name, hid_t link_l H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up new location struct */ @@ -657,7 +657,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_i H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get normalized copy of the link target */ @@ -754,7 +754,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, con H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); loc_params.type = H5VL_OBJECT_BY_NAME; @@ -807,7 +807,7 @@ H5L__delete_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **tok /* name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, true, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Set up VOL callback arguments */ @@ -925,7 +925,7 @@ H5L__delete_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t i HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Set up object access arguments */ - if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, TRUE, lapl_id, vol_obj_ptr, &loc_params) < + if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, true, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments"); @@ -1049,7 +1049,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -1111,7 +1111,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -1150,7 +1150,7 @@ done: * *--------------------------------------------------------------------------*/ static herr_t -H5L__exists_api_common(hid_t loc_id, const char *name, hbool_t *exists, hid_t lapl_id, void **token_ptr, +H5L__exists_api_common(hid_t loc_id, const char *name, bool *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 */ @@ -1168,7 +1168,7 @@ H5L__exists_api_common(hid_t loc_id, const char *name, hbool_t *exists, hid_t la HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer for link existence"); /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Set up VOL callback arguments */ @@ -1188,21 +1188,21 @@ done: * * Purpose: Checks if a link of a given name exists in a group * - * Return: Success: TRUE/FALSE/FAIL + * Return: Success: true/false/FAIL * *------------------------------------------------------------------------- */ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { - hbool_t exists; /* Flag to indicate if link exists */ - htri_t ret_value = FAIL; /* Return value */ + bool exists; /* Flag to indicate if link exists */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); /* Synchronously check if a link exists */ - exists = FALSE; + exists = false; if (H5L__exists_api_common(loc_id, name, &exists, lapl_id, NULL, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to synchronously check link existence"); @@ -1218,7 +1218,7 @@ done: * * Purpose: Asynchronous version of H5Lexists * - * Return: Success: TRUE/FALSE/FAIL + * Return: Success: true/false/FAIL * *--------------------------------------------------------------------------*/ herr_t @@ -1279,7 +1279,7 @@ H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t l HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -1336,7 +1336,7 @@ H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -1460,8 +1460,8 @@ done: * Purpose: Tests whether a user-defined link class has been registered * or not. * - * Return: TRUE if the link class has been registered - * FALSE if it is unregistered + * Return: true if the link class has been registered + * false if it is unregistered * FAIL on error (if the class is not a valid UD class ID) * *------------------------------------------------------------------------- @@ -1469,8 +1469,8 @@ done: htri_t H5Lis_registered(H5L_type_t id) { - hbool_t is_registered = FALSE; - htri_t ret_value = FALSE; /* Return value */ + bool is_registered = false; + htri_t ret_value = false; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Ll", id); @@ -1483,7 +1483,7 @@ H5Lis_registered(H5L_type_t id) if (H5L_is_registered(id, &is_registered) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADTYPE, FAIL, "could not determine registration status of UD link type"); - ret_value = is_registered ? TRUE : FALSE; + ret_value = is_registered ? true : false; done: FUNC_LEAVE_API(ret_value) @@ -1526,7 +1526,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5 HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, (-1), "can't set access property list info"); /* Set up location struct */ @@ -1599,7 +1599,7 @@ H5L__iterate_api_common(hid_t group_id, H5_index_t idx_type, H5_iter_order_t ord /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = FALSE; + vol_cb_args.args.iterate.recursive = false; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = idx_p; @@ -1745,7 +1745,7 @@ H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ @@ -1760,7 +1760,7 @@ H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = FALSE; + vol_cb_args.args.iterate.recursive = false; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = idx_p; @@ -1834,7 +1834,7 @@ H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = TRUE; + vol_cb_args.args.iterate.recursive = true; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = NULL; @@ -1900,7 +1900,7 @@ H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* get the location object */ @@ -1915,7 +1915,7 @@ H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = TRUE; + vol_cb_args.args.iterate.recursive = true; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = NULL; diff --git a/src/H5Ldeprec.c b/src/H5Ldeprec.c index 1399eec..40734e1 100644 --- a/src/H5Ldeprec.c +++ b/src/H5Ldeprec.c @@ -145,7 +145,7 @@ H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t H5VL_loc_params_t loc_params; H5I_type_t id_type; /* Type of ID */ H5L_shim_data_t shim_data; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -183,7 +183,7 @@ H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = FALSE; + vol_cb_args.args.iterate.recursive = false; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = idx_p; @@ -227,7 +227,7 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; H5L_shim_data_t shim_data; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -246,7 +246,7 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ @@ -272,7 +272,7 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = FALSE; + vol_cb_args.args.iterate.recursive = false; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = idx_p; @@ -307,7 +307,7 @@ H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t l H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; H5L_info2_t linfo2; /* New-style link info */ - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -318,7 +318,7 @@ H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t l HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -392,7 +392,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; H5L_info2_t linfo2; /* New-style link info */ - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -407,7 +407,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up location struct */ @@ -498,7 +498,7 @@ H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat H5VL_loc_params_t loc_params; H5I_type_t id_type; /* Type of ID */ H5L_shim_data_t shim_data; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -536,7 +536,7 @@ H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = TRUE; + vol_cb_args.args.iterate.recursive = true; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = NULL; @@ -587,7 +587,7 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; H5L_shim_data_t shim_data; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -606,7 +606,7 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info"); /* get the location object */ @@ -632,7 +632,7 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_LINK_ITER; - vol_cb_args.args.iterate.recursive = TRUE; + vol_cb_args.args.iterate.recursive = true; vol_cb_args.args.iterate.idx_type = idx_type; vol_cb_args.args.iterate.order = order; vol_cb_args.args.iterate.idx_p = NULL; diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index d7edbad..a5f49e4 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -156,7 +156,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons if (intent == H5F_ACC_DEFAULT) intent = H5F_INTENT(loc.oloc->file); - if ((fapl_id == H5P_DEFAULT) && ((fapl_id = H5F_get_access_plist(loc.oloc->file, FALSE)) < 0)) + if ((fapl_id == H5P_DEFAULT) && ((fapl_id = H5F_get_access_plist(loc.oloc->file, false)) < 0)) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "can't get parent's file access property list"); /* Get callback_info */ @@ -228,7 +228,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object"); /* Get an ID for the external link's object */ - if ((ext_obj_id = H5VL_wrap_register(opened_type, ext_obj, TRUE)) < 0) + if ((ext_obj_id = H5VL_wrap_register(opened_type, ext_obj, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register external link object"); /* Set return value */ diff --git a/src/H5Lint.c b/src/H5Lint.c index 554dd14..e0040e4 100644 --- a/src/H5Lint.c +++ b/src/H5Lint.c @@ -105,7 +105,7 @@ typedef struct { H5T_cset_t cset; /* Char set for new name */ const H5G_loc_t *dst_loc; /* Destination location for moving object */ unsigned dst_target_flags; /* Target flags for destination object */ - hbool_t copy; /* TRUE if this is a copy operation */ + bool copy; /* true if this is a copy operation */ size_t orig_nlinks; /* The original value for the # of soft / UD links that can be traversed */ } H5L_trav_mv_t; @@ -113,7 +113,7 @@ typedef struct { typedef struct { H5F_t *file; /* Pointer to the file */ H5O_link_t *lnk; /* Pointer to link information to insert */ - hbool_t copy; /* TRUE if this is a copy operation */ + bool copy; /* true if this is a copy operation */ } H5L_trav_mv2_t; /* User data for path traversal routine for checking if a link exists */ @@ -122,7 +122,7 @@ typedef struct { char *sep; /* Pointer to next separator in the string */ /* Up */ - hbool_t *exists; /* Whether the link exists or not */ + bool *exists; /* Whether the link exists or not */ } H5L_trav_le_t; /* User data for path traversal routine for getting link value */ @@ -397,7 +397,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_is_registered(H5L_type_t id, hbool_t *is_registered) +H5L_is_registered(H5L_type_t id, bool *is_registered) { size_t i; /* Local index variable */ @@ -407,10 +407,10 @@ H5L_is_registered(H5L_type_t id, hbool_t *is_registered) assert(is_registered); /* Is the link class already registered? */ - *is_registered = FALSE; + *is_registered = false; for (i = 0; i < H5L_table_used_g; i++) if (H5L_table_g[i].id == id) { - *is_registered = TRUE; + *is_registered = true; break; } @@ -509,12 +509,12 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/) { H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */ - H5G_t *grp = NULL; /* H5G_t for this group, opened to pass to user callback */ - hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ - H5G_loc_t temp_loc; /* For UD callback */ - hbool_t temp_loc_init = FALSE; /* Temporary location for UD callback (temp_loc) has been initialized */ - hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */ - herr_t ret_value = SUCCEED; /* Return value */ + H5G_t *grp = NULL; /* H5G_t for this group, opened to pass to user callback */ + hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ + H5G_loc_t temp_loc; /* For UD callback */ + bool temp_loc_init = false; /* Temporary location for UD callback (temp_loc) has been initialized */ + bool obj_created = false; /* Whether an object was created (through a hard link) */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -543,7 +543,7 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT udata->path = new_loc.path; /* Indicate that an object was created */ - obj_created = TRUE; + obj_created = true; } /* end if */ else { /* Check that both objects are in same file */ @@ -555,7 +555,7 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT /* Set 'standard' aspects of link */ udata->lnk->corder = 0; /* Will be re-written during group insertion, if the group is tracking creation order */ - udata->lnk->corder_valid = FALSE; /* Creation order not valid (yet) */ + udata->lnk->corder_valid = false; /* Creation order not valid (yet) */ /* Check for non-default link creation properties */ if (udata->lc_plist) { @@ -572,7 +572,7 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT H5_GCC_CLANG_DIAG_ON("cast-qual") /* Insert link into group */ - if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, + if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, true, udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN, udata->ocrt_info ? udata->ocrt_info->crt_info : NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object"); @@ -603,12 +603,12 @@ H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_AT temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; - temp_loc_init = TRUE; + temp_loc_init = true; /* Set up location for user-defined callback */ if (NULL == (grp = H5G_open(&temp_loc))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) + if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, true)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group"); /* Make callback */ @@ -755,7 +755,7 @@ H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link H5G_loc_t obj_loc; /* Location of object to link to */ H5G_name_t path; /* obj_loc's path*/ H5O_loc_t oloc; /* obj_loc's oloc */ - hbool_t loc_valid = FALSE; + bool loc_valid = false; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -779,7 +779,7 @@ H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link H5G_loc_reset(&obj_loc); if (H5G_loc_find(cur_loc, norm_cur_name, &obj_loc) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "source object not found"); - loc_valid = TRUE; + loc_valid = true; /* Construct link information for eventual insertion */ lnk.u.hard.addr = obj_loc.oloc->addr; @@ -1045,7 +1045,7 @@ H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_A { H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ H5O_link_t fnd_lnk; /* Link within group */ - hbool_t lnk_copied = FALSE; /* Whether the link was copied */ + bool lnk_copied = false; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1057,7 +1057,7 @@ H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_A /* Query link */ if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found"); - lnk_copied = TRUE; + lnk_copied = true; /* Retrieve the value for the link */ if (H5L__get_val_real(&fnd_lnk, udata->buf, udata->size) < 0) @@ -1290,7 +1290,7 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5G_t *grp = NULL; /* H5G_t for this group, opened to pass to user callback */ hid_t grp_id = FAIL; /* ID for this group (passed to user callback */ H5G_loc_t temp_loc; /* For UD callback */ - hbool_t temp_loc_init = FALSE; + bool temp_loc_init = false; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1312,7 +1312,7 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_GCC_CLANG_DIAG_ON("cast-qual") /* Insert the link into the group */ - if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, NULL) < 0) + if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, true, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object"); /* If the link was a user-defined link, call its move callback if it has one */ @@ -1336,12 +1336,12 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; - temp_loc_init = TRUE; + temp_loc_init = true; /* Set up location for user-defined callback */ if (NULL == (grp = H5G_open(&temp_loc))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) + if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, true)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID"); if (udata->copy) { @@ -1399,7 +1399,7 @@ H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */ H5L_trav_mv2_t udata_out; /* User data for H5L__move_dest_cb traversal */ char *orig_name = NULL; /* The name of the link in this group */ - hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */ + bool link_copied = false; /* Has udata_out.lnk been allocated? */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1420,7 +1420,7 @@ H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, * destination, so we should free it here. */ udata_out.lnk->name = (char *)H5MM_xfree(udata_out.lnk->name); - link_copied = TRUE; + link_copied = true; udata_out.lnk->cset = udata->cset; udata_out.file = grp_loc->oloc->file; @@ -1502,7 +1502,7 @@ done: * location, while DST_LOC and DST_NAME together define its * final location. * - * If copy_flag is FALSE, the original link is removed + * If copy_flag is false, the original link is removed * (effectively moving the link). * * Return: Non-negative on success/Negative on failure @@ -1511,7 +1511,7 @@ done: */ herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name, - hbool_t copy_flag, hid_t lcpl_id) + bool copy_flag, hid_t lcpl_id) { unsigned dst_target_flags = H5G_TARGET_NORMAL; H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */ @@ -1589,7 +1589,7 @@ H5L__exists_final_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATT FUNC_ENTER_PACKAGE_NOERR /* Check if the name in this group resolved to a valid link */ - *udata->exists = (hbool_t)(lnk != NULL); + *udata->exists = (bool)(lnk != NULL); /* Indicate that this callback didn't take ownership of the group * * location for the object */ @@ -1641,10 +1641,10 @@ H5L__exists_inter_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATT HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists"); } /* end if */ else - *udata->exists = TRUE; + *udata->exists = true; } /* end if */ else - *udata->exists = FALSE; + *udata->exists = false; /* Indicate that this callback didn't take ownership of the group * * location for the object */ @@ -1660,14 +1660,14 @@ done: * Purpose: Returns whether a link exists in a group * * Note: Same as H5L__exists, except that missing links are reported - * as 'FALSE' instead of causing failures + * as 'false' instead of causing failures * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (true/false) on success/Negative on failure * *------------------------------------------------------------------------- */ herr_t -H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists) +H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, bool *exists) { H5L_trav_le_t udata; /* User data for traversal */ H5G_traverse_t cb_func; /* Callback function for traversal */ @@ -1689,7 +1689,7 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists) /* A path of "/" will always exist in a file */ if ('\0' == *name_trav) - *exists = TRUE; + *exists = true; else { /* Set up user data & correct callback */ udata.exists = exists; @@ -1729,7 +1729,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists) +H5L__exists(const H5G_loc_t *loc, const char *name, bool *exists) { H5L_trav_le_t udata; /* User data for traversal */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1743,7 +1743,7 @@ H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists) /* A path of "/" will always exist in a file */ if (0 == HDstrcmp(name, "/")) - *exists = TRUE; + *exists = true; else { /* Traverse the group hierarchy to locate the object to get info about */ udata.exists = exists; @@ -1833,7 +1833,7 @@ H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ { H5L_trav_gibi_t *udata = (H5L_trav_gibi_t *)_udata; /* User data passed in */ H5O_link_t fnd_lnk; /* Link within group */ - hbool_t lnk_copied = FALSE; /* Whether the link was copied */ + bool lnk_copied = false; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1845,7 +1845,7 @@ H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ /* Query link */ if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found"); - lnk_copied = TRUE; + lnk_copied = true; /* Get information from the link */ if (H5G_link_to_info(obj_loc->oloc, &fnd_lnk, udata->linfo) < 0) @@ -1998,8 +1998,8 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t { H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */ const H5O_link_t *src_lnk = _src_lnk; /* Source link */ - hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ - hbool_t expanded_link_open = FALSE; /* Whether the target location has been opened */ + bool dst_lnk_init = false; /* Whether the destination link is initialized */ + bool expanded_link_open = false; /* Whether the target location has been opened */ H5G_loc_t tmp_src_loc; /* Group location holding target object */ H5G_name_t tmp_src_path; /* Path for target object */ H5O_loc_t tmp_src_oloc; /* Object location for target object */ @@ -2018,7 +2018,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t (H5L_TYPE_EXTERNAL == src_lnk->type && cpy_info->expand_ext_link)) { H5G_loc_t lnk_grp_loc; /* Group location holding link */ H5G_name_t lnk_grp_path; /* Path for link */ - hbool_t tar_exists = FALSE; /* Whether the target object exists */ + bool tar_exists = false; /* Whether the target object exists */ /* Set up group location for link */ H5G_name_reset(&lnk_grp_path); @@ -2047,7 +2047,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t /* Find the target object */ if (H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to find target object"); - expanded_link_open = TRUE; + expanded_link_open = true; /* Convert symbolic link to hard link */ if (tmp_src_lnk.type == H5L_TYPE_SOFT) @@ -2063,7 +2063,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t /* Copy src link information to dst link information */ if (NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk)) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message"); - dst_lnk_init = TRUE; + dst_lnk_init = true; /* Check if object in source group is a hard link & copy it */ if (H5L_TYPE_HARD == src_lnk->type) { @@ -2084,7 +2084,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t /* Copy the shared object from source to destination */ /* Don't care about obj_type or udata because those are only important * for old style groups */ - if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, NULL, NULL) < 0) + if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, true, NULL, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object"); /* Copy new destination object's information for eventual insertion */ diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 53737d1..0b04fdc 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -49,7 +49,7 @@ H5_DLL herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *cur_loc hid_t lcpl_id); H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id); -H5_DLL herr_t H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists); +H5_DLL herr_t H5L__exists(const H5G_loc_t *loc, const char *name, bool *exists); H5_DLL herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/); H5_DLL herr_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, @@ -59,7 +59,7 @@ H5_DLL herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*o H5_DLL herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf /*out*/, size_t size); H5_DLL herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, - const char *dst_name, hbool_t copy_flag, hid_t lcpl_id); + const char *dst_name, bool copy_flag, hid_t lcpl_id); H5_DLL herr_t H5L__delete(const H5G_loc_t *loc, const char *name); H5_DLL herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index cfdfb22..150a079 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -70,7 +70,7 @@ H5_DLL herr_t H5L_init(void); H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id); H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id); -H5_DLL herr_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists); +H5_DLL herr_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, bool *exists); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linkbuf /*out*/); H5_DLL herr_t H5L_register_external(void); H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, @@ -79,7 +79,7 @@ H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx /* User-defined link functions */ H5_DLL herr_t H5L_register(const H5L_class_t *cls); H5_DLL herr_t H5L_unregister(H5L_type_t id); -H5_DLL herr_t H5L_is_registered(H5L_type_t id, hbool_t *is_registered); +H5_DLL herr_t H5L_is_registered(H5L_type_t id, bool *is_registered); H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id); #endif /* H5Lprivate_H */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index bb5850c..03b47c5 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -713,8 +713,8 @@ H5_DLL herr_t H5Lexists_async(hid_t loc_id, const char *name, hbool_t *exists, h * \p corder specifies the link's creation order position, while * \p corder_valid indicates whether the value in corder is valid. * - * If \p corder_valid is \c TRUE, the value in \p corder is known to - * be valid; if \p corder_valid is \c FALSE, the value in \p corder is + * If \p corder_valid is \c true, the value in \p corder is known to + * be valid; if \p corder_valid is \c false, the value in \p corder is * presumed to be invalid; \p corder starts at zero (0) and is * incremented by one (1) as new links are created. But * higher-numbered entries are not adjusted when a lower-numbered link @@ -1510,8 +1510,8 @@ typedef herr_t (*H5L_iterate1_t)(hid_t group, const char *name, const H5L_info1_ * \c corder specifies the link's creation order position while * \c corder_valid indicates whether the value in \c corder is valid. * - * If \c corder_valid is \c TRUE, the value in \c corder is known to - * be valid; if \c corder_valid is \c FALSE, the value in \c corder is + * If \c corder_valid is \c true, the value in \c corder is known to + * be valid; if \c corder_valid is \c false, the value in \c corder is * presumed to be invalid; * * \c corder starts at zero (0) and is incremented by one (1) as new diff --git a/src/H5M.c b/src/H5M.c index cb8f771..e2fd202 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -116,7 +116,7 @@ H5M_top_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_MAP) > 0) { - (void)H5I_clear_type(H5I_MAP, FALSE, FALSE); + (void)H5I_clear_type(H5I_MAP, false, false); n++; } @@ -224,17 +224,17 @@ H5M__create_api_common(hid_t loc_id, const char *name, hid_t key_type_id, hid_t /* Get link creation property list */ if (H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + else if (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "lcpl_id is not a link creation property list"); /* Get map creation property list */ if (H5P_DEFAULT == mcpl_id) mcpl_id = H5P_MAP_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(mcpl_id, H5P_MAP_CREATE)) + else if (true != H5P_isa_class(mcpl_id, H5P_MAP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "mcpl_id is not a map create property list ID"); /* Set up VOL callback arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, TRUE, &mapl_id, vol_obj_ptr, &map_args.create.loc_params) < + if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, true, &mapl_id, vol_obj_ptr, &map_args.create.loc_params) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); map_args.create.name = name; @@ -253,7 +253,7 @@ H5M__create_api_common(hid_t loc_id, const char *name, hid_t key_type_id, hid_t map = map_args.create.map; /* Get an ID for the map */ - if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register map handle"); done: @@ -393,11 +393,11 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id /* Check arguments */ if (H5P_DEFAULT == mcpl_id) mcpl_id = H5P_MAP_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(mcpl_id, H5P_MAP_CREATE)) + else if (true != H5P_isa_class(mcpl_id, H5P_MAP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not map create property list ID"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&mapl_id, H5P_CLS_MACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&mapl_id, H5P_CLS_MACC, loc_id, true) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* get the location object */ @@ -425,7 +425,7 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id map = map_args.create.map; /* Get an ID for the map */ - if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register map"); done: @@ -474,7 +474,7 @@ H5M__open_api_common(hid_t loc_id, const char *name, hid_t mapl_id, void **token HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up VOL callback arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, FALSE, &mapl_id, vol_obj_ptr, &map_args.open.loc_params) < + if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, false, &mapl_id, vol_obj_ptr, &map_args.open.loc_params) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); map_args.open.name = name; @@ -489,7 +489,7 @@ H5M__open_api_common(hid_t loc_id, const char *name, hid_t mapl_id, void **token map = map_args.open.map; /* Register an ID for the map */ - if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register map ID"); done: @@ -890,7 +890,7 @@ H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id) /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -949,7 +949,7 @@ H5M__put_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -1084,7 +1084,7 @@ H5M__get_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -1222,7 +1222,7 @@ H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -1231,7 +1231,7 @@ H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, /* Set up VOL callback arguments */ map_args.exists.key_mem_type_id = key_mem_type_id; map_args.exists.key = key; - map_args.exists.exists = FALSE; + map_args.exists.exists = false; vol_cb_args.op_type = H5VL_MAP_EXISTS; vol_cb_args.args = &map_args; @@ -1302,7 +1302,7 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -1391,7 +1391,7 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -1459,7 +1459,7 @@ H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id) /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ diff --git a/src/H5MF.c b/src/H5MF.c index b527d6b..c8df9e4 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -47,9 +47,9 @@ #define H5MF_CHECK_FSM(FSM, CF) \ do { \ - assert(*CF == FALSE); \ + assert(*CF == false); \ if (!H5_addr_defined(FSM->addr) || !H5_addr_defined(FSM->sect_addr)) \ - *CF = TRUE; \ + *CF = true; \ } while (0) /* For non-paged aggregation: map allocation request type to tracked free-space type */ @@ -92,12 +92,12 @@ static herr_t H5MF__close_pagefs(H5F_t *f); static herr_t H5MF__close_shrink_eoa(H5F_t *f); /* General routines */ -static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); -static hbool_t H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type); -static hbool_t H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace); -static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, - H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, - hbool_t *continue_alloc_fsm); +static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); +static bool H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type); +static bool H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace); +static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, + H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, + bool *continue_alloc_fsm); /* Free-space type manager routines */ static herr_t H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type); @@ -135,7 +135,7 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) { H5MF_aggr_merge_t mapping_type; /* Type of free list mapping */ H5FD_mem_t type; /* Memory type for iteration */ - hbool_t all_same; /* Whether all the types map to the same value */ + bool all_same; /* Whether all the types map to the same value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -147,11 +147,11 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) /* Iterate over all the free space types to determine if sections of that type * can merge with the metadata or small 'raw' data aggregator */ - all_same = TRUE; + all_same = true; for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) /* Check for any different type mappings */ if (f_sh->fs_type_map[type] != f_sh->fs_type_map[H5FD_MEM_DEFAULT]) { - all_same = FALSE; + all_same = false; break; } /* end if */ @@ -167,18 +167,18 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) if (f_sh->fs_type_map[H5FD_MEM_DRAW] == f_sh->fs_type_map[H5FD_MEM_SUPER]) mapping_type = H5MF_AGGR_MERGE_SEPARATE; else { - hbool_t all_metadata_same; /* Whether all metadata go in same free list */ + bool all_metadata_same; /* Whether all metadata go in same free list */ /* One or more allocation type don't map to the same free list type */ /* Check if all the metadata allocation types map to the same type */ - all_metadata_same = TRUE; + all_metadata_same = true; for (type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; type++) /* Skip checking raw data free list mapping */ /* (global heap is treated as raw data) */ if (type != H5FD_MEM_DRAW && type != H5FD_MEM_GHEAP) { /* Check for any different type mappings */ if (f_sh->fs_type_map[type] != f_sh->fs_type_map[H5FD_MEM_SUPER]) { - all_metadata_same = FALSE; + all_metadata_same = false; break; } /* end if */ } /* end if */ @@ -616,8 +616,8 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio /* Construct user data for callbacks */ udata.f = f; udata.alloc_type = alloc_type; - udata.allow_sect_absorb = TRUE; - udata.allow_eoa_shrink_only = FALSE; + udata.allow_sect_absorb = true; + udata.allow_eoa_shrink_only = false; /* Set the ring type in the API context */ if (H5MF__fsm_is_self_referential(f->shared, fspace)) @@ -649,8 +649,8 @@ done: * Purpose: To find a section from the specified free-space manager to fulfill the request. * If found, re-add the left-over space back to the manager. * - * Return: TRUE if a section is found to fulfill the request - * FALSE if not + * Return: true if a section is found to fulfill the request + * false if not * *------------------------------------------------------------------------- */ @@ -1177,14 +1177,14 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) /* Construct user data for callbacks */ udata.f = f; udata.alloc_type = alloc_type; - udata.allow_sect_absorb = TRUE; - udata.allow_eoa_shrink_only = FALSE; + udata.allow_sect_absorb = true; + udata.allow_eoa_shrink_only = false; /* Try to merge the section that is smaller than threshold */ if ((merged = H5FS_sect_try_merge(f, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't merge section to file free space"); - else if (merged == TRUE) /* successfully merged */ + else if (merged == true) /* successfully merged */ /* Indicate that the node was used */ node = NULL; } /* end else */ @@ -1221,8 +1221,8 @@ done: * --try to extend into a free-space section if adjoined * --try to extend into the page end threshold if a metadata block * - * Return: Success: TRUE(1) - Block was extended - * FALSE(0) - Block could not be extended + * Return: Success: true(1) - Block was extended + * false(0) - Block could not be extended * Failure: FAIL * *------------------------------------------------------------------------- @@ -1235,9 +1235,9 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi haddr_t end; /* End of block to extend */ H5FD_mem_t map_type; /* Mapped type */ H5F_mem_page_t fs_type; /* free space type */ - htri_t allow_extend = TRUE; /* Possible to extend the block */ + htri_t allow_extend = true; /* Possible to extend the block */ hsize_t frag_size = 0; /* Size of mis-aligned fragment */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG @@ -1266,7 +1266,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi if (size < f->shared->fs_page_size) { /* To extend a small block: cannot cross page boundary */ if ((addr / f->shared->fs_page_size) != (((end + extra_requested) - 1) / f->shared->fs_page_size)) - allow_extend = FALSE; + allow_extend = false; } /* end if */ else { haddr_t eoa; /* EOA for the file */ @@ -1301,7 +1301,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi /* If extending at EOA succeeds: */ /* for paged aggregation, put the fragment into the large-sized free-space manager */ - if (ret_value == TRUE && H5F_PAGED_AGGR(f) && frag_size) { + if (ret_value == true && H5F_PAGED_AGGR(f) && frag_size) { H5MF_free_section_t *node = NULL; /* Free space section pointer */ /* Should be large-sized block */ @@ -1324,7 +1324,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi } /* end if */ /* For non-paged aggregation: try to extend into the aggregators */ - if (ret_value == FALSE && (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR || + if (ret_value == false && (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR || f->shared->fs_strategy == H5F_FSPACE_STRATEGY_AGGR)) { H5F_blk_aggr_t *aggr; /* Aggregator to use */ @@ -1339,7 +1339,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi } /* end if */ /* If no extension so far, try to extend into a free-space section */ - if (ret_value == FALSE && + if (ret_value == false && ((f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) || (H5F_PAGED_AGGR(f)))) { H5MF_sect_ud_t udata; /* User data */ @@ -1365,11 +1365,11 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi } /* end if */ /* For paged aggregation and a metadata block: try to extend into page end threshold */ - if (ret_value == FALSE && H5F_PAGED_AGGR(f) && map_type != H5FD_MEM_DRAW) { + if (ret_value == false && H5F_PAGED_AGGR(f) && map_type != H5FD_MEM_DRAW) { H5MF_EOA_MISALIGN(f, end, f->shared->fs_page_size, frag_size); if (frag_size <= H5F_PGEND_META_THRES(f) && extra_requested <= frag_size) - ret_value = TRUE; + ret_value = true; #ifdef H5MF_ALLOC_DEBUG_MORE fprintf(stderr, "%s: Try to extend into the page end threshold = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ @@ -1411,7 +1411,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */ H5F_mem_page_t fs_type; /* Free space type */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG @@ -1447,8 +1447,8 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) /* Construct user data for callbacks */ udata.f = f; udata.alloc_type = alloc_type; - udata.allow_sect_absorb = FALSE; /* Force section to be absorbed into aggregator */ - udata.allow_eoa_shrink_only = FALSE; + udata.allow_sect_absorb = false; /* Force section to be absorbed into aggregator */ + udata.allow_eoa_shrink_only = false; /* Check if the block can shrink the container */ if (sect_cls->can_shrink) { @@ -1761,7 +1761,7 @@ H5MF__close_aggrfs(H5F_t *f) fsinfo.version = f->shared->fs_version; /* Write the free space manager message -- message must already exist */ - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, false, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension"); @@ -1924,7 +1924,7 @@ H5MF__close_pagefs(H5F_t *f) fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_fsm_fsalloc; /* Write the free space manager message -- message must already exist */ - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, false, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension"); @@ -1972,14 +1972,14 @@ H5MF__close_pagefs(H5F_t *f) * open. * * If there is a cache image in the file at file open, - * f->shared->first_alloc_dealloc will always be FALSE unless + * f->shared->first_alloc_dealloc will always be false unless * the file is opened R/O, as otherwise, the image will have been * read and discarded by this point. * * If a cache image was created on file close, the actual EOA * should be in f->shared->eoa_post_mdci_fsalloc. Note that in * this case, it is conceivable that f->shared->first_alloc_dealloc - * will still be TRUE, as the cache image is allocated directly from + * will still be true, as the cache image is allocated directly from * the file driver layer. However, as this possibility seems remote, * it is ignored in the following assert. */ @@ -1997,7 +1997,7 @@ H5MF__close_pagefs(H5F_t *f) /* Write file space info message to superblock extension object header */ /* Create the superblock extension object header in advance if needed */ - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, false, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension"); } /* end else */ @@ -2035,7 +2035,7 @@ H5MF__close_shrink_eoa(H5F_t *f) H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5F_mem_t type; H5F_mem_page_t ptype; /* Memory type for iteration */ - hbool_t eoa_shrank; /* Whether an EOA shrink occurs */ + bool eoa_shrank; /* Whether an EOA shrink occurs */ htri_t status; /* Status value */ H5MF_sect_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2048,8 +2048,8 @@ H5MF__close_shrink_eoa(H5F_t *f) /* Construct user data for callbacks */ udata.f = f; - udata.allow_sect_absorb = FALSE; - udata.allow_eoa_shrink_only = TRUE; + udata.allow_sect_absorb = false; + udata.allow_eoa_shrink_only = true; /* Set the ring type in the API context */ H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); @@ -2057,7 +2057,7 @@ H5MF__close_shrink_eoa(H5F_t *f) /* Iterate until no more EOA shrinking occurs */ do { - eoa_shrank = FALSE; + eoa_shrank = false; if (H5F_PAGED_AGGR(f)) { /* Check the last section of each free-space manager */ @@ -2081,7 +2081,7 @@ H5MF__close_shrink_eoa(H5F_t *f) if ((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[ptype], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa"); else if (status > 0) - eoa_shrank = TRUE; + eoa_shrank = true; } /* end if */ } /* end for */ } /* end if */ @@ -2105,7 +2105,7 @@ H5MF__close_shrink_eoa(H5F_t *f) if ((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[type], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa"); else if (status > 0) - eoa_shrank = TRUE; + eoa_shrank = true; } /* end if */ } /* end for */ @@ -2113,7 +2113,7 @@ H5MF__close_shrink_eoa(H5F_t *f) if ((status = H5MF__aggrs_try_shrink_eoa(f)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa"); else if (status > 0) - eoa_shrank = TRUE; + eoa_shrank = true; } /* end else */ } while (eoa_shrank); @@ -2195,14 +2195,14 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) /* Iterate over all the free space types that have managers and get each free list's space */ for (type = start_type; type < end_type; type++) { - fs_started[type] = FALSE; + fs_started[type] = false; /* Check if the free space for the file has been initialized */ if (!f->shared->fs_man[type] && H5_addr_defined(f->shared->fs_addr[type])) { if (H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space"); assert(f->shared->fs_man[type]); - fs_started[type] = TRUE; + fs_started[type] = true; } /* end if */ /* Test to see if we need to switch rings -- do so if required */ @@ -2335,8 +2335,8 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t /* Iterate over memory types, retrieving the number of sections of each type */ for (ty = start_type; ty < end_type; ty++) { - hbool_t fs_started = FALSE; /* The free-space manager is opened or not */ - size_t nums = 0; /* The number of free-space sections */ + bool fs_started = false; /* The free-space manager is opened or not */ + size_t nums = 0; /* The number of free-space sections */ /* Test to see if we need to switch rings -- do so if required */ if (H5MF__fsm_type_is_self_referential(f->shared, ty)) @@ -2353,7 +2353,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t if (H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager"); assert(f->shared->fs_man[ty]); - fs_started = TRUE; + fs_started = true; } /* end if */ /* Check if there's free space sections of this type */ @@ -2549,7 +2549,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) +H5MF_settle_raw_data_fsm(H5F_t *f, bool *fsm_settled) { int pass_count; hsize_t alloc_size; @@ -2578,8 +2578,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * the private property in f->shared->null_fsm_addr is not enabled. */ if (f->shared->fs_persist && !H5F_NULL_FSM_ADDR(f)) { - hbool_t fsm_opened[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ - hbool_t fsm_visited[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ + bool fsm_opened[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ + bool fsm_visited[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ /* should only be called if file is opened R/W */ assert(H5F_INTENT(f) & H5F_ACC_RDWR); @@ -2668,10 +2668,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - assert(FALSE); + assert(false); if (!fsm_visited[fsm_type]) { - fsm_visited[fsm_type] = TRUE; + fsm_visited[fsm_type] = true; /* If there is no active FSM for this type, but such a FSM has * space allocated in file, open it so that we can free its file @@ -2680,12 +2680,12 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (NULL == f->shared->fs_man[fsm_type]) { if (H5_addr_defined(f->shared->fs_addr[fsm_type])) { /* Sanity check */ - assert(fsm_opened[fsm_type] == FALSE); + assert(fsm_opened[fsm_type] == false); if (H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager"); - fsm_opened[fsm_type] = TRUE; + fsm_opened[fsm_type] = true; } /* end if */ } /* end if */ @@ -2711,7 +2711,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * reallocate later if the free space manager contains * any free space. */ - if (H5FS_free(f, f->shared->fs_man[fsm_type], TRUE) < 0) + if (H5FS_free(f, f->shared->fs_man[fsm_type], true) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers"); f->shared->fs_addr[fsm_type] = HADDR_UNDEF; @@ -2770,7 +2770,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres; fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF; - if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if (H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, true, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension"); } @@ -2796,7 +2796,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* Reinitialize fsm_visited */ for (fsm_type = H5F_MEM_PAGE_SUPER; fsm_type < H5F_MEM_PAGE_NTYPES; fsm_type++) - fsm_visited[fsm_type] = FALSE; + fsm_visited[fsm_type] = false; for (pass_count = 0; pass_count <= 1; pass_count++) { if (pass_count == 0) @@ -2818,7 +2818,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - assert(FALSE); + assert(false); /* Test to see if we need to switch rings -- do so if required */ if (H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) @@ -2836,7 +2836,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * more than once. */ if (!fsm_visited[fsm_type]) { - fsm_visited[fsm_type] = TRUE; + fsm_visited[fsm_type] = true; if (f->shared->fs_man[fsm_type]) { /* Only allocate file space if the target free space manager @@ -2901,7 +2901,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5MF__close_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space manager"); - fsm_opened[fsm_type] = FALSE; + fsm_opened[fsm_type] = false; } /* end if */ } /* end if */ } /* end for */ @@ -2912,7 +2912,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) assert(!fsm_opened[fsm_type]); /* Indicate that the FSM was settled successfully */ - *fsm_settled = TRUE; + *fsm_settled = true; } /* end if */ done: @@ -3017,7 +3017,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) +H5MF_settle_meta_data_fsm(H5F_t *f, bool *fsm_settled) { H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ @@ -3029,7 +3029,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5FS_t *lg_sinfo_fspace = NULL; /* ptr to lg FSM sinfo alloc FSM */ haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */ /* for self referential FSMs */ - hbool_t continue_alloc_fsm = FALSE; /* Continue allocating addr and sect_addr for FSMs */ + bool continue_alloc_fsm = false; /* Continue allocating addr and sect_addr for FSMs */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3185,7 +3185,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) * they are all settled, */ do { - continue_alloc_fsm = FALSE; + continue_alloc_fsm = false; if (sm_hdr_fspace) if (H5FS_vfd_alloc_hdr_and_section_info_if_needed( f, sm_hdr_fspace, &(f->shared->fs_addr[sm_fshdr_fs_type])) < 0) @@ -3241,7 +3241,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) f->shared->eoa_fsm_fsalloc = eoa_fsm_fsalloc; /* Indicate that the FSM was settled successfully */ - *fsm_settled = TRUE; + *fsm_settled = true; } /* end if */ done: @@ -3257,7 +3257,7 @@ done: * * Purpose: To determine whether any of the input FSMs has allocated * its "addr" and "sect_addr". - * Return TRUE or FALSE in *continue_alloc_fsm. + * Return true or false in *continue_alloc_fsm. * * Return: SUCCEED/FAIL * @@ -3265,7 +3265,7 @@ done: */ static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, - H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm) + H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, bool *continue_alloc_fsm) { FUNC_ENTER_PACKAGE_NOERR @@ -3300,21 +3300,21 @@ H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_s /*------------------------------------------------------------------------- * Function: H5MF__fsm_type_is_self_referential() * - * Purpose: Return TRUE if the indicated free space manager allocates - * file space for free space managers. Return FALSE otherwise. + * Purpose: Return true if the indicated free space manager allocates + * file space for free space managers. Return false otherwise. * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) { H5F_mem_page_t sm_fshdr_fsm; H5F_mem_page_t sm_fssinfo_fsm; H5F_mem_page_t lg_fshdr_fsm; H5F_mem_page_t lg_fssinfo_fsm; - hbool_t result = FALSE; + bool result = false; FUNC_ENTER_PACKAGE_NOERR @@ -3337,11 +3337,11 @@ H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) /* In principle, fsm_type should always be less than * H5F_MEM_PAGE_LARGE_SUPER whenever paged aggregation * is not enabled. However, since there is code that does - * not observe this principle, force the result to FALSE if + * not observe this principle, force the result to false if * fsm_type is greater than or equal to H5F_MEM_PAGE_LARGE_SUPER. */ if (fsm_type >= H5F_MEM_PAGE_LARGE_SUPER) - result = FALSE; + result = false; else result = (fsm_type == sm_fshdr_fsm) || (fsm_type == sm_fssinfo_fsm); } /* end else */ @@ -3352,19 +3352,19 @@ H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) /*------------------------------------------------------------------------- * Function: H5MF__fsm_is_self_referential() * - * Purpose: Return TRUE if the indicated free space manager allocates - * file space for free space managers. Return FALSE otherwise. + * Purpose: Return true if the indicated free space manager allocates + * file space for free space managers. Return false otherwise. * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace) { H5F_mem_page_t sm_fshdr_fsm; H5F_mem_page_t sm_fssinfo_fsm; - hbool_t result = FALSE; + bool result = false; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 5464b8a..80d25f2 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -212,7 +212,7 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F /* Check if the space requested is larger than the space left in the block */ if ((size + aggr_frag_size) > aggr->size) { - htri_t extended = FALSE; /* Whether the file was extended */ + htri_t extended = false; /* Whether the file was extended */ /* Check if the block asked for is too large for 'normal' aggregator block */ if (size >= aggr->alloc_size) { @@ -401,8 +401,8 @@ done: * 2) When the aggregator is not at end of file: * Extended the block into the aggregator if it has enough space to satisfy the request * - * Return: Success: TRUE(1) - Block was extended - * FALSE(0) - Block could not be extended + * Return: Success: true(1) - Block was extended + * false(0) - Block could not be extended * Failure: FAIL * *------------------------------------------------------------------------- @@ -410,7 +410,7 @@ done: htri_t H5MF__aggr_try_extend(H5F_t * f, H5F_blk_aggr_t * aggr, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -441,7 +441,7 @@ done: aggr->addr += extra_requested; /* Indicate success */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ /* * If extra_requested is above percentage threshold: @@ -454,7 +454,7 @@ done: if ((ret_value = H5F__try_extend(f, type, (aggr->addr + aggr->size), extra)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file"); - else if (ret_value == TRUE) { + else if (ret_value == true) { /* Shift the aggregator block by the extra requested */ /* (allocates the space for the extra_requested) */ aggr->addr += extra_requested; @@ -480,7 +480,7 @@ done: aggr->addr += extra_requested; /* Indicate success */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end else */ } /* end if */ @@ -496,8 +496,8 @@ done: * Purpose: Check if a section adjoins an aggregator block and one can * absorb the other. * - * Return: Success: TRUE(1) - Section or aggregator can be absorbed - * FALSE(0) - Section and aggregator can not be absorbed + * Return: Success: true(1) - Section or aggregator can be absorbed + * false(0) - Section and aggregator can not be absorbed * Failure: FAIL * *------------------------------------------------------------------------- @@ -505,7 +505,7 @@ done: htri_t H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -536,7 +536,7 @@ done: *shrink = H5MF_SHRINK_AGGR_ABSORB_SECT; /* Indicate success */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ @@ -556,7 +556,7 @@ done: *------------------------------------------------------------------------- */ herr_t H5MF__aggr_absorb(const H5F_t H5_ATTR_UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect, - hbool_t allow_sect_absorb) + bool allow_sect_absorb) { FUNC_ENTER_PACKAGE_NOERR @@ -799,7 +799,7 @@ done: * * Purpose: Check if the remaining space in the aggregator is at EOA * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -807,7 +807,7 @@ done: static htri_t H5MF__aggr_can_shrink_eoa(H5F_t * f, H5FD_mem_t type, H5F_blk_aggr_t * aggr) { haddr_t eoa = HADDR_UNDEF; /* EOA for the file */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index a9be085..32d04d3 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -96,7 +96,7 @@ typedef struct H5MF_free_section_t { unsigned num_entries; /* Number of entries covered */ /* Fields that aren't stored */ - hbool_t checked_out; /* Flag to indicate that a row section is temporarily out of the free space + bool checked_out; /* Flag to indicate that a row section is temporarily out of the free space manager */ } row; struct { @@ -142,8 +142,8 @@ typedef struct H5MF_sect_ud_t { /* Down */ H5F_t *f; /* Pointer to file to operate on */ H5FD_mem_t alloc_type; /* Type of memory being allocated */ - hbool_t allow_sect_absorb; /* Whether sections are allowed to absorb a block aggregator */ - hbool_t allow_eoa_shrink_only; /* Whether shrinking eoa is allowed only for the section */ + bool allow_sect_absorb; /* Whether sections are allowed to absorb a block aggregator */ + bool allow_eoa_shrink_only; /* Whether shrinking eoa is allowed only for the section */ /* Up */ H5MF_shrink_type_t shrink; /* Type of shrink operation to perform */ @@ -191,7 +191,7 @@ H5_DLL htri_t H5MF__aggrs_try_shrink_eoa(H5F_t *f); H5_DLL htri_t H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink); H5_DLL herr_t H5MF__aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect, - hbool_t allow_sect_absorb); + bool allow_sect_absorb); H5_DLL herr_t H5MF__aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, hsize_t *size); /* Debugging routines */ diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index da6ef6d..5342cc7 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -63,8 +63,8 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); H5_DLL herr_t H5MF_free_aggrs(H5F_t *f); /* Free space manager settling routines */ -H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); -H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled); +H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, bool *fsm_settled); +H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, bool *fsm_settled); /* This function has to be declared in H5MFprivate.h as it is needed * in our test code to allow us to manually start a self referential diff --git a/src/H5MFsection.c b/src/H5MFsection.c index ede7912..3b81960 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -340,7 +340,7 @@ done: * * Note: Second section must be "after" first section * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -412,7 +412,7 @@ done: * * Purpose: Can this section shrink the container? * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -450,12 +450,12 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Indicate shrinking can occur */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ else { /* Shrinking can't occur if the 'eoa_shrink_only' flag is set and we're not shrinking the EOA */ if (udata->allow_eoa_shrink_only) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if this section is allowed to merge with metadata aggregation block */ if (udata->f->shared->fs_aggr_merge[udata->alloc_type] & H5F_FS_MERGE_METADATA) { @@ -475,7 +475,7 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Indicate shrinking can occur */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ @@ -498,13 +498,13 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Indicate shrinking can occur */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ } /* end else */ /* Set return value */ - ret_value = FALSE; + ret_value = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -641,7 +641,7 @@ done: * Note: Second section must be "after" first section * The "merged" section cannot cross page boundary. * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -652,7 +652,7 @@ H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */ const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */ H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -668,7 +668,7 @@ H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section /* If they are on different pages, couldn't merge */ if ((sect1->sect_info.addr / udata->f->shared->fs_page_size) != (((sect2->sect_info.addr + sect2->sect_info.size - 1) / udata->f->shared->fs_page_size))) - ret_value = FALSE; + ret_value = false; #ifdef H5MF_ALLOC_DEBUG_MORE fprintf(stderr, "%s: Leaving: ret_value = %d\n", __func__, ret_value); @@ -747,7 +747,7 @@ done: * * Note: Second section must be "after" first section * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -758,7 +758,7 @@ H5MF__sect_large_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section { const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */ const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -821,7 +821,7 @@ done: * * Purpose: Can this section shrink the container? * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -833,7 +833,7 @@ H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata) H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */ haddr_t eoa; /* End of address space in the file */ haddr_t end; /* End of section to extend */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -860,7 +860,7 @@ H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata) #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Indicate shrinking can occur */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ done: diff --git a/src/H5O.c b/src/H5O.c index fc92a61..13447db 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -111,7 +111,7 @@ H5O__open_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **token /* name is checked in this H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Open the object */ @@ -120,7 +120,7 @@ H5O__open_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **token HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object"); /* Get an atom for the object */ - if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle"); done: @@ -235,7 +235,7 @@ H5O__open_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t idx /* Check args */ /* group_name, idx_type, order are checked in H5VL_setup_idx-args() */ /* Set up object access arguments */ - if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr, + if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); @@ -245,7 +245,7 @@ H5O__open_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t idx HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object"); /* Get an ID for the object */ - if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -383,7 +383,7 @@ H5Oopen_by_token(hid_t loc_id, H5O_token_t token) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object"); /* Register the object's ID */ - if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -426,13 +426,13 @@ H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, c /* Get correct property lists */ if (H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + else if (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list"); /* Get object copy property list */ if (H5P_DEFAULT == ocpypl_id) ocpypl_id = H5P_OBJECT_COPY_DEFAULT; - else if (TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) + else if (true != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list"); /* Set the LCPL for the API context */ @@ -840,7 +840,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid if (HDstrlen(new_name) > H5L_MAX_LINK_NAME_LEN) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "name too long"); #endif /* H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T */ - if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) + if (lcpl_id != H5P_DEFAULT && (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list"); /* Get the link creation property list */ @@ -851,7 +851,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set up new location struct */ @@ -1008,7 +1008,7 @@ done: * * Purpose: Determine if a linked-to object exists * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: FAIL * *------------------------------------------------------------------------- @@ -1019,7 +1019,7 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) H5VL_object_t *vol_obj; /* Object of loc_id */ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; /* Location parameters for object access */ - hbool_t obj_exists = FALSE; /* Whether object exists */ + bool obj_exists = false; /* Whether object exists */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1032,7 +1032,7 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ @@ -1139,7 +1139,7 @@ H5O__get_info_by_name_api_common(hid_t loc_id, const char *name, H5O_info2_t *oi /* "name" is checked in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Set up VOL callback arguments */ @@ -1260,7 +1260,7 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set location struct fields */ @@ -1372,7 +1372,7 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Fill out location struct */ @@ -1437,7 +1437,7 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Set location struct fields */ @@ -1551,7 +1551,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Fill in location struct fields */ @@ -1662,7 +1662,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, si HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "no name"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, (-1), "can't set access property list info"); /* Fill in location struct fields */ @@ -1832,7 +1832,7 @@ H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ @@ -1868,14 +1868,14 @@ done: * Purpose: This is the common function to validate an object * before closing it. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ static htri_t H5O__close_check_type(hid_t object_id) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -1905,7 +1905,7 @@ H5O__close_check_type(hid_t object_id) case H5I_EVENTSET: case H5I_NTYPES: default: - HGOTO_DONE(FALSE); + HGOTO_DONE(false); break; } /* end switch */ @@ -2053,7 +2053,7 @@ H5Odisable_mdc_flushes(hid_t object_id) H5TRACE1("e", "i", object_id); /* Make sure the ID is a file object */ - if (H5I_is_file_object(object_id) != TRUE) + if (H5I_is_file_object(object_id) != true) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID is not a file object"); /* Get the VOL object */ @@ -2123,7 +2123,7 @@ H5Oenable_mdc_flushes(hid_t object_id) H5TRACE1("e", "i", object_id); /* Make sure the ID is a file object */ - if (H5I_is_file_object(object_id) != TRUE) + if (H5I_is_file_object(object_id) != true) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID is not a file object"); /* Get the VOL object */ @@ -2176,8 +2176,8 @@ done: * Function: H5Oare_mdc_flushes_disabled * * Purpose: Retrieve the object's "cork" status in the parameter "are_disabled": - * TRUE if mdc flushes for the object is disabled - * FALSE if mdc flushes for the object is not disabled + * true if mdc flushes for the object is disabled + * false if mdc flushes for the object is not disabled * * Return error if the parameter "are_disabled" is not supplied * @@ -2187,7 +2187,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) +H5Oare_mdc_flushes_disabled(hid_t object_id, bool *are_disabled) { H5VL_object_t *vol_obj; /* Object of loc_id */ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ @@ -2196,14 +2196,14 @@ H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", object_id, are_disabled); + H5TRACE2("e", "i*!", object_id, are_disabled); /* Sanity check */ if (!are_disabled) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location from ID"); /* Make sure the ID is a file object */ - if (H5I_is_file_object(object_id) != TRUE) + if (H5I_is_file_object(object_id) != true) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID is not a file object"); /* Get the VOL object */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 23841a6..1050212 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -31,14 +31,14 @@ /* PRIVATE PROTOTYPES */ static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__ainfo_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__ainfo_copy(const void *_mesg, void *_dest); -static size_t H5O__ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__ainfo_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__ainfo_free(void *_mesg); static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static herr_t H5O__ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, +static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); @@ -121,8 +121,8 @@ H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS flags = *p++; if (flags & ~H5O_AINFO_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message"); - ainfo->track_corder = (flags & H5O_AINFO_TRACK_CORDER) ? TRUE : FALSE; - ainfo->index_corder = (flags & H5O_AINFO_INDEX_CORDER) ? TRUE : FALSE; + ainfo->track_corder = (flags & H5O_AINFO_TRACK_CORDER) ? true : false; + ainfo->index_corder = (flags & H5O_AINFO_INDEX_CORDER) ? true : false; /* Set the number of attributes on the object to an invalid value, so we query it later */ ainfo->nattrs = HSIZET_MAX; @@ -175,7 +175,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__ainfo_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; unsigned char flags; /* Flags for encoding attribute info */ @@ -262,7 +262,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ainfo_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; size_t ret_value = 0; /* Return value */ @@ -350,8 +350,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) +H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, bool *deleted, + const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_PACKAGE_NOERR @@ -363,7 +363,7 @@ H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUS * that this message should be deleted. */ if (cpy_info->copy_without_attr) - *deleted = TRUE; + *deleted = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__ainfo_pre_copy_file() */ @@ -380,7 +380,7 @@ H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUS */ static void * H5O__ainfo_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + bool H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 5e80685..d7ede47 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -51,9 +51,9 @@ /* Local Prototypes */ /********************/ -static herr_t H5O__add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, size_t idx, +static herr_t H5O__add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, bool *chk_dirtied, size_t idx, uint8_t *new_gap_loc, size_t new_gap_size); -static herr_t H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *new_gap_loc, +static herr_t H5O__eliminate_gap(H5O_t *oh, bool *chk_dirtied, H5O_mesg_t *mesg, uint8_t *new_gap_loc, size_t new_gap_size); static herr_t H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size); @@ -93,12 +93,12 @@ H5FL_EXTERN(H5O_cont_t); *------------------------------------------------------------------------- */ static herr_t -H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, size_t idx, +H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, bool *chk_dirtied, size_t idx, uint8_t *new_gap_loc, size_t new_gap_size) { - hbool_t merged_with_null; /* Whether the gap was merged with a null message */ - size_t u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + bool merged_with_null; /* Whether the gap was merged with a null message */ + size_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -124,7 +124,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ #endif /* NDEBUG */ /* Check for existing null message in chunk */ - merged_with_null = FALSE; + merged_with_null = false; for (u = 0; u < oh->nmesgs && !merged_with_null; u++) { /* Find a null message in the chunk with the new gap */ /* (a null message that's not the one we are eliminating) */ @@ -137,7 +137,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't eliminate gap in chunk"); /* Set flag to indicate that the gap was handled */ - merged_with_null = TRUE; + merged_with_null = true; } /* end if */ } /* end for */ @@ -182,7 +182,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ memset(null_msg->raw, 0, null_msg->raw_size); /* Mark message as dirty */ - null_msg->dirty = TRUE; + null_msg->dirty = true; /* Reset size of gap in chunk */ oh->chunk[chunkno].gap = 0; @@ -191,7 +191,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ oh->chunk[chunkno].gap = new_gap_size; /* Mark the chunk as modified */ - *chk_dirtied = TRUE; + *chk_dirtied = true; } /* end if */ done: @@ -215,10 +215,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *gap_loc, size_t gap_size) +H5O__eliminate_gap(H5O_t *oh, bool *chk_dirtied, H5O_mesg_t *mesg, uint8_t *gap_loc, size_t gap_size) { uint8_t *move_start, *move_end; /* Pointers to area of messages to move */ - hbool_t null_before_gap; /* Flag whether the null message is before the gap or not */ + bool null_before_gap; /* Flag whether the null message is before the gap or not */ FUNC_ENTER_PACKAGE_NOERR @@ -231,7 +231,7 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g assert(gap_size); /* Check if the null message is before or after the gap produced */ - null_before_gap = (hbool_t)(mesg->raw < gap_loc); + null_before_gap = (bool)(mesg->raw < gap_loc); /* Set up information about region of messages to move */ if (null_before_gap) { @@ -292,8 +292,8 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g oh->chunk[mesg->chunkno].gap = 0; /* Mark null message as dirty */ - mesg->dirty = TRUE; - *chk_dirtied = TRUE; + mesg->dirty = true; + *chk_dirtied = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5O__eliminate_gap() */ @@ -313,7 +313,7 @@ H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new size_t new_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ + bool chk_dirtied = false; /* Flags for unprotecting chunk */ H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ @@ -368,8 +368,8 @@ H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new null_msg->chunkno = alloc_msg->chunkno; /* Mark the message as dirty */ - null_msg->dirty = TRUE; - chk_dirtied = TRUE; + null_msg->dirty = true; + chk_dirtied = true; /* Check for gap in new null message's chunk */ if (oh->chunk[null_msg->chunkno].gap > 0) { @@ -393,8 +393,8 @@ H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new alloc_msg->native = new_native; /* Mark the new message as dirty */ - alloc_msg->dirty = TRUE; - chk_dirtied = TRUE; + alloc_msg->dirty = true; + chk_dirtied = true; done: /* Release chunk */ @@ -461,11 +461,11 @@ done: * included to ensure that there is enough space to extend * this chunk. * - * Return: TRUE: The chunk has been extended, and *msg_idx + * Return: true: The chunk has been extended, and *msg_idx * contains the message index for null message * which is large enough to hold size bytes. * - * FALSE: The chunk cannot be extended, and *msg_idx + * false: The chunk cannot be extended, and *msg_idx * is undefined. * * FAIL: Some internal error has been detected. @@ -476,19 +476,19 @@ static htri_t H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size_t *msg_idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied = false; /* Flag for unprotecting chunk */ size_t delta; /* Change in chunk's size */ size_t aligned_size = H5O_ALIGN_OH(oh, size); uint8_t *old_image; /* Old address of chunk's image in memory */ size_t old_size; /* Old size of chunk */ htri_t was_extended; /* If chunk can be extended */ size_t extend_msg = 0; /* Index of null message to extend */ - hbool_t extended_msg = FALSE; /* Whether an existing message was extended */ + bool extended_msg = false; /* Whether an existing message was extended */ uint8_t new_size_flags = 0; /* New chunk #0 size flags */ - hbool_t adjust_size_flags = FALSE; /* Whether to adjust the chunk #0 size flags */ + bool adjust_size_flags = false; /* Whether to adjust the chunk #0 size flags */ size_t extra_prfx_size = 0; /* Extra bytes added to object header prefix */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* return value */ + htri_t ret_value = true; /* return value */ FUNC_ENTER_PACKAGE @@ -512,7 +512,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size (oh->chunk[chunkno].gap + H5O_SIZEOF_CHKSUM_OH(oh))))) { extend_msg = u; - extended_msg = TRUE; + extended_msg = true; break; } /* end if */ } /* end for */ @@ -538,19 +538,19 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size if (orig_prfx_size < 8 && (chunk0_size + delta) > 4294967295) { extra_prfx_size = 8 - orig_prfx_size; new_size_flags = H5O_HDR_CHUNK0_8; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ /* Check for moving to a 4-byte size encoding */ else if (orig_prfx_size < 4 && (chunk0_size + delta) > 65535) { extra_prfx_size = 4 - orig_prfx_size; new_size_flags = H5O_HDR_CHUNK0_4; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ /* Check for moving to a 2-byte size encoding */ else if (orig_prfx_size < 2 && (chunk0_size + delta) > 255) { extra_prfx_size = 2 - orig_prfx_size; new_size_flags = H5O_HDR_CHUNK0_2; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ } /* end if */ @@ -563,8 +563,8 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); if (was_extended < 0) /* error */ HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't tell if we can extend chunk"); - else if (was_extended == FALSE) /* can't extend -- we are done */ - HGOTO_DONE(FALSE); + else if (was_extended == false) /* can't extend -- we are done */ + HGOTO_DONE(false); /* Adjust object header prefix flags */ if (adjust_size_flags) { @@ -602,8 +602,8 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size } /* end else */ /* Mark the extended message as dirty */ - oh->mesg[extend_msg].dirty = TRUE; - chk_dirtied = TRUE; + oh->mesg[extend_msg].dirty = true; + chk_dirtied = true; /* Allocate more memory space for chunk's image */ old_image = oh->chunk[chunkno].image; @@ -635,7 +635,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size if (chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) && (((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) { H5O_chunk_proxy_t *chk_proxy2 = NULL; /* Chunk that continuation message is in */ - hbool_t chk_dirtied2 = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied2 = false; /* Flag for unprotecting chunk */ unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ @@ -647,8 +647,8 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size ((H5O_cont_t *)(oh->mesg[u].native))->size = oh->chunk[chunkno].size; /* Flag continuation message as dirty */ - oh->mesg[u].dirty = TRUE; - chk_dirtied2 = TRUE; + oh->mesg[u].dirty = true; + chk_dirtied2 = true; /* Release chunk containing continuation message */ if (H5O__chunk_unprotect(f, chk_proxy2, chk_dirtied2) < 0) @@ -763,21 +763,21 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_ /* Check if message is large enough to hold continuation info */ if (total_size >= cont_size) { - hbool_t better = FALSE; /* Whether the current message is better than a previous one */ + bool better = false; /* Whether the current message is better than a previous one */ /* Check for first message that can be moved */ if (found_msg->msgno < 0) - better = TRUE; + better = true; else { /* Prioritize moving non-attributes above attributes */ /* (Even attributes with an otherwise better fit */ if (found_msg->id == H5O_ATTR_ID && curr_msg->type->id != H5O_ATTR_ID) - better = TRUE; + better = true; /* Either two attributes, or two non-attributes */ else { /* Take a smaller one */ if (total_size < found_msg->total_size) - better = TRUE; + better = true; /* If they are the same size, choose the earliest one * in the chunk array */ /* (Could also bias toward message earlier / later @@ -785,7 +785,7 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_ */ else if (total_size == found_msg->total_size) { if (msg_chunkno < found_msg->chunkno) - better = TRUE; + better = true; } /* end else-if */ } /* end else */ } /* end else */ @@ -967,7 +967,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ found_null = oh->nmesgs++; null_msg = &(oh->mesg[found_null]); null_msg->type = H5O_MSG_NULL; - null_msg->dirty = TRUE; + null_msg->dirty = true; null_msg->native = NULL; null_msg->raw = oh->chunk[chunkno - 1].image + ((chunkno == 1) ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)) - @@ -984,7 +984,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ oh->chunk[chunkno - 1].gap = 0; /* Release chunk, marking it dirty */ - if (H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) + if (H5O__chunk_unprotect(f, chk_proxy, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); } /* end if */ else { @@ -1051,10 +1051,10 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ } /* end if */ /* Mark the new null message as dirty */ - null_msg->dirty = TRUE; + null_msg->dirty = true; /* Release chunk, marking it dirty */ - if (H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) + if (H5O__chunk_unprotect(f, chk_proxy, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); } /* end if */ } /* end if */ @@ -1063,7 +1063,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ /* (account for chunk's magic # & checksum) */ idx = oh->nmesgs++; oh->mesg[idx].type = H5O_MSG_NULL; - oh->mesg[idx].dirty = TRUE; + oh->mesg[idx].dirty = true; oh->mesg[idx].native = NULL; oh->mesg[idx].raw = p + H5O_SIZEOF_MSGHDR_OH(oh); oh->mesg[idx].raw_size = size - (size_t)(H5O_SIZEOF_CHKHDR_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh)); @@ -1255,7 +1255,7 @@ H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, s assert(mesg_idx); /* Compute the size needed to store the message in the object header */ - raw_size = (type->raw_size)(f, FALSE, mesg); + raw_size = (type->raw_size)(f, false, mesg); if (0 == raw_size) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "can't compute object header message size"); if (raw_size >= H5O_MESG_MAX_SIZE) @@ -1282,7 +1282,7 @@ H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, s if ((tri_result = H5O__alloc_extend_chunk(f, oh, chunkno, raw_size, &idx)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't extend existing chunk"); - if (tri_result == TRUE) + if (tri_result == true) break; } /* end for */ @@ -1319,10 +1319,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) +H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, bool adj_link) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - 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 @@ -1356,8 +1356,8 @@ H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) mesg->flags = 0; /* Mark the message as modified */ - mesg->dirty = TRUE; - chk_dirtied = TRUE; + mesg->dirty = true; + chk_dirtied = true; /* Check if chunk has a gap currently */ if (oh->chunk[mesg->chunkno].gap) { @@ -1382,7 +1382,7 @@ done: * * Purpose: Check and move message(s) forward into a continuation message * - * Return: Success: non-negative (TRUE/FALSE) + * Return: Success: non-negative (true/false) * Failure: negative * *------------------------------------------------------------------------- @@ -1393,8 +1393,8 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that continuation message is in */ H5O_mesg_t *cont_msg; /* Pointer to the continuation message */ unsigned deleted_chunkno; /* Chunk # to delete */ - hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ - htri_t ret_value = TRUE; /* Return value */ + bool chk_dirtied = false; /* Flags for unprotecting chunk */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -1445,7 +1445,7 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) /* Convert continuation message into a null message. Do not delete * the target chunk yet, so we can still copy messages from it. */ - if (H5O__release_mesg(f, oh, cont_msg, FALSE) < 0) + if (H5O__release_mesg(f, oh, cont_msg, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message"); /* Protect chunk */ @@ -1467,7 +1467,7 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) H5MM_memcpy(move_start, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), move_size); curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); curr_msg->chunkno = cont_chunkno; - chk_dirtied = TRUE; + chk_dirtied = true; /* Adjust location to move messages to */ move_start += move_size; @@ -1487,8 +1487,8 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) /* Adjust size of null (was continuation) message */ cont_msg->raw_size = gap_size - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); cont_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); - cont_msg->dirty = TRUE; - chk_dirtied = TRUE; + cont_msg->dirty = true; + chk_dirtied = true; } /* end if */ else { /* Check if there is space that should be a gap */ @@ -1515,7 +1515,7 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) if (curr_msg->type->id == H5O_NULL_ID) { /* Release any information/memory for message */ H5O__msg_free_mesg(curr_msg); - chk_dirtied = TRUE; + chk_dirtied = true; /* Remove from message list */ if (v < (oh->nmesgs - 1)) @@ -1530,10 +1530,10 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) oh->nchunks--; } /* end if */ else - ret_value = FALSE; + ret_value = false; } /* end if */ else - ret_value = FALSE; + ret_value = false; done: /* Release chunk, if not already done */ @@ -1559,10 +1559,10 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) H5O_chunk_proxy_t *null_chk_proxy = NULL; /* Chunk that null message is in */ H5O_chunk_proxy_t *curr_chk_proxy = NULL; /* Chunk that message is in */ H5O_chunk_proxy_t *cont_targ_chk_proxy = NULL; /* Chunk that continuation message points to */ - hbool_t null_chk_dirtied = FALSE; /* Flags for unprotecting null chunk */ - hbool_t curr_chk_dirtied = FALSE; /* Flags for unprotecting curr chunk */ - hbool_t packed_msg; /* Flag to indicate that messages were packed */ - hbool_t did_packing = FALSE; /* Whether any messages were packed */ + bool null_chk_dirtied = false; /* Flags for unprotecting null chunk */ + bool curr_chk_dirtied = false; /* Flags for unprotecting curr chunk */ + bool packed_msg; /* Flag to indicate that messages were packed */ + bool did_packing = false; /* Whether any messages were packed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1579,7 +1579,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) unsigned u; /* Local index variable */ /* Reset packed messages flag */ - packed_msg = FALSE; + packed_msg = false; /* Scan through messages for messages that can be moved earlier in chunks */ for (u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { @@ -1622,10 +1622,10 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) /* Mark null message dirty */ /* (since we need to re-encode its message header) */ - curr_msg->dirty = TRUE; + curr_msg->dirty = true; /* Release chunk, marking it dirty */ - if (H5O__chunk_unprotect(f, null_chk_proxy, TRUE) < 0) + if (H5O__chunk_unprotect(f, null_chk_proxy, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); null_chk_proxy = NULL; @@ -1634,7 +1634,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) * was packed - if its not at the end its chunk, * we'll move it again on the next pass. */ - packed_msg = TRUE; + packed_msg = true; } /* end if */ /* Break out of loop */ @@ -1657,7 +1657,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "Error in moving messages into cont message"); else if (status > 0) { /* Message(s) got moved into "continuation" message */ - packed_msg = TRUE; + packed_msg = true; break; } /* end else-if */ } /* end if */ @@ -1736,7 +1736,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) } /* end if */ /* Unprotect continuation message target chunk */ - if (H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) + if (H5O__chunk_unprotect(f, cont_targ_chk_proxy, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); cont_targ_chk_proxy = NULL; @@ -1750,7 +1750,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) /* Point non-null message at null message's space */ curr_msg->chunkno = null_msg->chunkno; curr_msg->raw = null_msg->raw; - curr_chk_dirtied = TRUE; + curr_chk_dirtied = true; /* Change information for null message */ if (curr_msg->raw_size == null_msg->raw_size) { @@ -1760,15 +1760,15 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) null_msg->raw = old_raw; /* Mark null message dirty */ - null_msg->dirty = TRUE; - null_chk_dirtied = TRUE; + null_msg->dirty = true; + null_chk_dirtied = true; /* Release current chunk, marking it dirty */ if (H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); curr_chk_proxy = NULL; - curr_chk_dirtied = FALSE; + curr_chk_dirtied = false; /* Check for gap in null message's chunk */ if (oh->chunk[old_chunkno].gap > 0) { @@ -1787,7 +1787,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); null_chk_proxy = NULL; - null_chk_dirtied = FALSE; + null_chk_dirtied = false; } /* end if */ else { size_t new_null_msg; /* Message index for new null message */ @@ -1802,8 +1802,8 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) null_msg->raw_size = curr_msg->raw_size; /* Mark null message dirty */ - null_msg->dirty = TRUE; - null_chk_dirtied = TRUE; + null_msg->dirty = true; + null_chk_dirtied = true; /* Add the gap to the chunk */ if (H5O__add_gap(f, oh, null_msg->chunkno, &null_chk_dirtied, v, @@ -1819,8 +1819,8 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) null_msg->raw_size -= curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); /* Mark null message dirty */ - null_msg->dirty = TRUE; - null_chk_dirtied = TRUE; + null_msg->dirty = true; + null_chk_dirtied = true; /* Create new null message for previous location of non-null message */ if (oh->nmesgs >= oh->alloc_nmesgs) { @@ -1842,7 +1842,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); null_chk_proxy = NULL; - null_chk_dirtied = FALSE; + null_chk_dirtied = false; /* Initialize new null message to take over non-null message's location */ oh->mesg[new_null_msg].type = H5O_MSG_NULL; @@ -1852,8 +1852,8 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) oh->mesg[new_null_msg].chunkno = old_chunkno; /* Mark new null message dirty */ - oh->mesg[new_null_msg].dirty = TRUE; - curr_chk_dirtied = TRUE; + oh->mesg[new_null_msg].dirty = true; + curr_chk_dirtied = true; /* Check for gap in new null message's chunk */ if (oh->chunk[old_chunkno].gap > 0) { @@ -1872,11 +1872,11 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); curr_chk_proxy = NULL; - curr_chk_dirtied = FALSE; + curr_chk_dirtied = false; } /* end else */ /* Indicate that we packed messages */ - packed_msg = TRUE; + packed_msg = true; /* Break out of loop */ /* (If it's possible to move message to even earlier chunk @@ -1895,7 +1895,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) /* If we did any packing, remember that */ if (packed_msg) - did_packing = TRUE; + did_packing = true; } while (packed_msg); /* Set return value */ @@ -1907,7 +1907,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect null object header chunk"); if (curr_chk_proxy && H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect current object header chunk"); - if (cont_targ_chk_proxy && H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) + if (cont_targ_chk_proxy && H5O__chunk_unprotect(f, cont_targ_chk_proxy, false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect continuation message target object header chunk"); } /* end if */ @@ -1930,9 +1930,9 @@ done: static htri_t H5O__merge_null(H5F_t *f, H5O_t *oh) { - hbool_t merged_msg; /* Flag to indicate that messages were merged */ - hbool_t did_merging = FALSE; /* Whether any messages were merged */ - htri_t ret_value = FAIL; /* Return value */ + bool merged_msg; /* Flag to indicate that messages were merged */ + bool did_merging = false; /* Whether any messages were merged */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1948,7 +1948,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) unsigned u; /* Local index variable */ /* Reset merged messages flag */ - merged_msg = FALSE; + merged_msg = false; /* Scan messages for adjacent null messages & merge them */ for (u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { @@ -1974,7 +1974,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) adj_raw_size = (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg2->raw_size; /* Message has been merged */ - merged_msg = TRUE; + merged_msg = true; } /* end if */ /* Check for second message before first message */ else if ((curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) == @@ -1984,7 +1984,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) adj_raw_size = (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg2->raw_size; /* Message has been merged */ - merged_msg = TRUE; + merged_msg = true; } /* end if */ /* Second message has been merged, delete it */ @@ -2005,10 +2005,10 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) curr_msg->raw_size += adj_raw_size; /* Mark first message as dirty */ - curr_msg->dirty = TRUE; + curr_msg->dirty = true; /* Release new null message's chunk, marking it dirty */ - if (H5O__chunk_unprotect(f, curr_chk_proxy, TRUE) < 0) + if (H5O__chunk_unprotect(f, curr_chk_proxy, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); @@ -2048,7 +2048,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) /* If we did any merging, remember that */ if (merged_msg) - did_merging = TRUE; + did_merging = true; } while (merged_msg); /* Set return value */ @@ -2075,9 +2075,9 @@ done: static htri_t H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) { - hbool_t deleted_chunk; /* Whether to a chunk was deleted */ - hbool_t did_deleting = FALSE; /* Whether any chunks were deleted */ - htri_t ret_value = FAIL; /* Return value */ + bool deleted_chunk; /* Whether to a chunk was deleted */ + bool did_deleting = false; /* Whether any chunks were deleted */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -2091,7 +2091,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) unsigned u, v; /* Local index variables */ /* Reset 'chunk deleted' flag */ - deleted_chunk = FALSE; + deleted_chunk = false; /* Scan messages for null messages that fill an entire chunk */ for (u = 0, null_msg = &oh->mesg[0]; u < oh->nmesgs; u++, null_msg++) { @@ -2140,7 +2140,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) deleted_chunkno = null_msg->chunkno; /* Convert continuation message into a null message */ - if (H5O__release_mesg(f, oh, cont_msg, TRUE) < 0) + if (H5O__release_mesg(f, oh, cont_msg, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message"); /* @@ -2230,14 +2230,14 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) } /* end for */ /* Found chunk to delete */ - deleted_chunk = TRUE; + deleted_chunk = true; break; } /* end if */ } /* end for */ /* If we deleted any chunks, remember that */ if (deleted_chunk) - did_deleting = TRUE; + did_deleting = true; } while (deleted_chunk); /* Set return value */ @@ -2260,9 +2260,9 @@ done: herr_t H5O__condense_header(H5F_t *f, H5O_t *oh) { - hbool_t rescan_header; /* Whether to rescan header */ - htri_t result; /* Result from packing/merging/etc */ - herr_t ret_value = SUCCEED; /* return value */ + bool rescan_header; /* Whether to rescan header */ + htri_t result; /* Result from packing/merging/etc */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_PACKAGE @@ -2272,28 +2272,28 @@ H5O__condense_header(H5F_t *f, H5O_t *oh) /* Loop until no changed to the object header messages & chunks */ do { /* Reset 'rescan chunks' flag */ - rescan_header = FALSE; + rescan_header = false; /* Scan for messages that can be moved earlier in chunks */ result = H5O__move_msgs_forward(f, oh); if (result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't move header messages forward"); if (result > 0) - rescan_header = TRUE; + rescan_header = true; /* Scan for adjacent null messages & merge them */ result = H5O__merge_null(f, oh); if (result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack null header messages"); if (result > 0) - rescan_header = TRUE; + rescan_header = true; /* Scan for empty chunks to remove */ result = H5O__remove_empty_chunks(f, oh); if (result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk"); if (result > 0) - rescan_header = TRUE; + rescan_header = true; } while (rescan_header); #ifdef H5O_DEBUG H5O__assert(oh); @@ -2327,7 +2327,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) size_t sizeof_chksum = H5O_SIZEOF_CHKSUM_OH(oh); /* Size of chunk checksum */ size_t sizeof_msghdr = H5O_SIZEOF_MSGHDR_OH(oh); /* Size of message header */ uint8_t new_size_flags = 0; /* New chunk #0 size flags */ - hbool_t adjust_size_flags = FALSE; /* Whether to adjust the chunk #0 size flags */ + bool adjust_size_flags = false; /* Whether to adjust the chunk #0 size flags */ size_t less_prfx_size = 0; /* Bytes removed from object header prefix */ size_t u; /* Index */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2393,7 +2393,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) /* Initialize new null message to make the chunk large enough */ curr_msg = &oh->mesg[oh->nmesgs - 1]; curr_msg->type = H5O_MSG_NULL; - curr_msg->dirty = TRUE; + curr_msg->dirty = true; curr_msg->native = NULL; curr_msg->raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; curr_msg->raw_size = @@ -2413,19 +2413,19 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) if (orig_prfx_size > 1 && chunk0_newsize <= 255) { less_prfx_size = orig_prfx_size - 1; new_size_flags = H5O_HDR_CHUNK0_1; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ /* Check for moving to a 2-byte size encoding */ else if (orig_prfx_size > 2 && chunk0_newsize <= 65535) { less_prfx_size = orig_prfx_size - 2; new_size_flags = H5O_HDR_CHUNK0_2; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ /* Check for moving to a 4-byte size encoding */ else if (orig_prfx_size > 4 && chunk0_newsize <= 4294967295) { less_prfx_size = orig_prfx_size - 4; new_size_flags = H5O_HDR_CHUNK0_4; - adjust_size_flags = TRUE; + adjust_size_flags = true; } /* end if */ } /* end if */ @@ -2473,10 +2473,10 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) ((H5O_cont_t *)(curr_msg->native))->size = chunk->size; /* Flag continuation message as dirty */ - curr_msg->dirty = TRUE; + curr_msg->dirty = true; /* Release chunk, marking it dirty */ - if (H5O__chunk_unprotect(f, cont_chk_proxy, TRUE) < 0) + if (H5O__chunk_unprotect(f, cont_chk_proxy, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); } /* end if */ } /* end for */ @@ -2493,7 +2493,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) done: /* Release chunk, marking it dirty */ - if (chk_proxy && H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) + if (chk_proxy && H5O__chunk_unprotect(f, chk_proxy, true) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 901227e..04c3fab 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -28,10 +28,10 @@ static void *H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, uns static void *H5O__attr_copy(const void *_mesg, void *_dest); static size_t H5O__attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O__attr_free(void *mesg); -static herr_t H5O__attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata); + H5F_t *file_dst, bool *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); @@ -243,7 +243,7 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u extent = H5FL_FREE(H5S_extent_t, extent); /* Default to entire dataspace being selected */ - if (H5S_select_all(attr->shared->ds, FALSE) < 0) + if (H5S_select_all(attr->shared->ds, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); /* Determine pointer movement and check if it's valid */ @@ -380,7 +380,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) p += name_len; /* encode the attribute datatype */ - if ((H5O_MSG_DTYPE->encode)(f, FALSE, p, attr->shared->dt) < 0) + if ((H5O_MSG_DTYPE->encode)(f, false, p, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute datatype"); if (attr->shared->version < H5O_ATTR_VERSION_2) { @@ -391,7 +391,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) p += attr->shared->dt_size; /* encode the attribute dataspace */ - if ((H5O_MSG_SDSPACE->encode)(f, FALSE, p, &(attr->shared->ds->extent)) < 0) + if ((H5O_MSG_SDSPACE->encode)(f, false, p, &(attr->shared->ds->extent)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute dataspace"); if (attr->shared->version < H5O_ATTR_VERSION_2) { @@ -629,7 +629,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, hbool_t *deleted, +H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, bool *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { const H5A_t *attr_src = (const H5A_t *)native_src; /* Source attribute */ @@ -652,7 +652,7 @@ H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, * that this message should be deleted. */ if (cpy_info->copy_without_attr) - *deleted = TRUE; + *deleted = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -670,8 +670,7 @@ done: */ static void * H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void H5_ATTR_UNUSED *udata) + H5F_t *file_dst, bool *recompute_size, H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { void *ret_value = NULL; /* Return value */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 9e38488..3b9e995 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -68,7 +68,7 @@ typedef struct { H5A_t *attr; /* Attribute data to update object header with */ /* up */ - hbool_t found; /* Whether the attribute was found */ + bool found; /* Whether the attribute was found */ } H5O_iter_wrt_t; /* User data for iteration when renaming an attribute */ @@ -79,7 +79,7 @@ typedef struct { const char *new_name; /* New name of attribute */ /* up */ - hbool_t found; /* Whether the attribute was found */ + bool found; /* Whether the attribute was found */ } H5O_iter_ren_t; /* User data for iteration when removing an attribute */ @@ -89,7 +89,7 @@ typedef struct { const char *name; /* Name of attribute to open */ /* up */ - hbool_t found; /* Found attribute to delete */ + bool found; /* Found attribute to delete */ } H5O_iter_rm_t; /* User data for iteration when checking if an attribute exists */ @@ -98,7 +98,7 @@ typedef struct { const char *name; /* Name of attribute to open */ /* up */ - hbool_t *exists; /* Pointer to flag to indicate attribute exists */ + bool *exists; /* Pointer to flag to indicate attribute exists */ } H5O_iter_xst_t; /********************/ @@ -174,7 +174,7 @@ H5O__attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_U /* Convert message into a null message in the header */ /* (don't delete attribute's space in the file though) */ - if (H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) + if (H5O__release_mesg(udata->f, oh, mesg, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message"); /* Indicate that the object header was modified */ @@ -213,16 +213,16 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Check if this object already has attribute information */ if (oh->version > H5O_VERSION_1) { - hbool_t new_ainfo = FALSE; /* Flag to indicate that the attribute information is new */ - htri_t ainfo_exists; /* Whether the attribute info was retrieved */ + bool new_ainfo = false; /* Flag to indicate that the attribute information is new */ + htri_t ainfo_exists; /* Whether the attribute info was retrieved */ /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); if (!ainfo_exists) { /* Initialize attribute information */ - ainfo.track_corder = (hbool_t)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) ? TRUE : FALSE); - ainfo.index_corder = (hbool_t)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) ? TRUE : FALSE); + ainfo.track_corder = (bool)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) ? true : false); + ainfo.index_corder = (bool)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) ? true : false); ainfo.max_crt_idx = 0; ainfo.corder_bt2_addr = HADDR_UNDEF; ainfo.nattrs = 0; @@ -230,7 +230,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) ainfo.name_bt2_addr = HADDR_UNDEF; /* Set flag to add attribute information to object header */ - new_ainfo = TRUE; + new_ainfo = true; } /* end if */ else { /* Sanity check attribute info read in */ @@ -247,9 +247,9 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Check for attribute being shareable */ if ((shareable = H5SM_can_share(loc->file, NULL, NULL, H5O_ATTR_ID, attr)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't determine attribute sharing status"); - else if (shareable == FALSE) { + else if (shareable == false) { /* Compute the size needed to encode the attribute */ - raw_size = (H5O_MSG_ATTR->raw_size)(loc->file, FALSE, attr); + raw_size = (H5O_MSG_ATTR->raw_size)(loc->file, false, attr); } /* end if */ /* Check for condititions for switching to "dense" attribute storage are met */ @@ -366,7 +366,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared"); /* Update the modification time, if any */ - if (H5O_touch_oh(loc->file, oh, FALSE) < 0) + if (H5O_touch_oh(loc->file, oh, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -435,7 +435,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) H5O_ainfo_t ainfo; /* Attribute information for object */ H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ - htri_t found_open_attr = FALSE; /* Whether opened object is found */ + htri_t found_open_attr = false; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE_TAG(loc->addr) @@ -445,7 +445,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) assert(name); /* 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_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header"); /* Check for attribute info stored */ @@ -461,7 +461,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) */ if ((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute"); - else if (found_open_attr == TRUE) { + else if (found_open_attr == true) { if (NULL == (opened_attr = H5A__copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute"); } /* end else if */ @@ -560,7 +560,7 @@ H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t H5A_attr_iter_op_t attr_op; /* Attribute operator */ H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ - htri_t found_open_attr = FALSE; /* Whether opened object is found */ + htri_t found_open_attr = false; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -617,8 +617,8 @@ done: * Purpose: Find out whether an attribute has been opened by giving * the name. Return the pointer to the object if found. * - * Return: TRUE: found the already opened object - * FALSE: didn't find the opened object + * Return: true: found the already opened object + * false: didn't find the opened object * FAIL: function failed. * *------------------------------------------------------------------------- @@ -629,7 +629,7 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ hid_t *attr_id_list = NULL; /* List of IDs for opened attributes */ unsigned long loc_fnum; /* File serial # for object */ size_t num_open_attr; /* Number of opened attributes */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -638,7 +638,7 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number"); /* Count all opened attributes */ - if (H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE, &num_open_attr) < 0) + if (H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, false, &num_open_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't count opened attributes"); /* Find out whether the attribute has been opened */ @@ -651,7 +651,7 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "unable to allocate memory for attribute ID list"); /* Retrieve the IDs of all opened attributes */ - if (H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE, + if (H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, false, &check_num_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get IDs of opened attributes"); if (check_num_attr != num_open_attr) @@ -675,7 +675,7 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ */ if (!HDstrcmp(name_to_open, (*attr)->shared->name) && loc->addr == (*attr)->oloc.addr && loc_fnum == attr_fnum) { - ret_value = TRUE; + ret_value = true; break; } /* end if */ } /* end for */ @@ -773,7 +773,7 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied = false; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -805,8 +805,8 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS } /* end if */ /* Mark the message as modified */ - mesg->dirty = TRUE; - chk_dirtied = TRUE; + mesg->dirty = true; + chk_dirtied = true; /* Release chunk */ if (H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) @@ -824,7 +824,7 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS *oh_modified = H5O_MODIFY; /* Indicate that the attribute was found */ - udata->found = TRUE; + udata->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -885,7 +885,7 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) /* Set up user data for callback */ udata.f = loc->file; udata.attr = attr; - udata.found = FALSE; + udata.found = false; /* Iterate over attributes, to locate correct one to update */ op.op_type = H5O_MESG_OP_LIB; @@ -899,7 +899,7 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) } /* end else */ /* Update the modification time, if any */ - if (H5O_touch_oh(loc->file, oh, FALSE) < 0) + if (H5O_touch_oh(loc->file, oh, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -937,7 +937,7 @@ H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/, /* Check for existing attribute with new name */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->new_name) == 0) { /* Indicate that we found an existing attribute with the new name*/ - udata->found = TRUE; + udata->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -967,7 +967,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied = false; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -994,8 +994,8 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5_ITER_ERROR, "unable to update attribute version"); /* Mark the message as modified */ - mesg->dirty = TRUE; - chk_dirtied = TRUE; + mesg->dirty = true; + chk_dirtied = true; /* Release chunk */ if (H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) @@ -1012,7 +1012,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR } /* end if */ else { /* Sanity check */ - assert(H5O_msg_is_shared(H5O_ATTR_ID, (H5A_t *)mesg->native) == FALSE); + assert(H5O_msg_is_shared(H5O_ATTR_ID, (H5A_t *)mesg->native) == false); /* Check for attribute message changing size */ if (HDstrlen(udata->new_name) != HDstrlen(udata->old_name) || @@ -1036,7 +1036,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR /* (doesn't decrement the link count on shared components because * the "native" pointer has been reset) */ - if (H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) + if (H5O__release_mesg(udata->f, oh, mesg, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release previous attribute"); @@ -1050,7 +1050,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR "unable to relocate renamed attribute in header"); /* Sanity check */ - assert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); + assert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == false); /* Close the local copy of the attribute */ H5A__close(attr); @@ -1061,7 +1061,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR *oh_modified |= H5O_MODIFY; /* Indicate that we found an existing attribute with the old name */ - udata->found = TRUE; + udata->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -1124,7 +1124,7 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_nam udata.f = loc->file; udata.old_name = old_name; udata.new_name = new_name; - udata.found = FALSE; + udata.found = false; /* Iterate over attributes, to check if "new name" exists already */ op.op_type = H5O_MESG_OP_LIB; @@ -1148,7 +1148,7 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_nam } /* end else */ /* Update the modification time, if any */ - if (H5O_touch_oh(loc->file, oh, FALSE) < 0) + if (H5O_touch_oh(loc->file, oh, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -1185,7 +1185,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, H assert(attr_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_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Check for attribute info stored */ @@ -1308,8 +1308,8 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check for shifting from dense storage back to compact storage */ if (H5_addr_defined(ainfo->fheap_addr) && ainfo->nattrs < oh->min_dense) { - hbool_t can_convert = TRUE; /* Whether converting to attribute messages is possible */ - size_t u; /* Local index */ + bool can_convert = true; /* Whether converting to attribute messages is possible */ + size_t u; /* Local index */ /* Build the table of attributes for this object */ if (H5A__dense_build_table(loc->file, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) @@ -1322,14 +1322,14 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) for (u = 0; u < ainfo->nattrs; u++) if (H5O_msg_size_oh(loc->file, oh, H5O_ATTR_ID, (atable.attrs[u]), (size_t)0) >= H5O_MESG_MAX_SIZE) { - can_convert = FALSE; + can_convert = false; break; } /* end if */ /* If ok, insert attributes as object header messages */ if (can_convert) { H5A_t *exist_attr = NULL; - htri_t found_open_attr = FALSE; + htri_t found_open_attr = false; /* Iterate over attributes, to put them into header */ for (u = 0; u < ainfo->nattrs; u++) { @@ -1384,7 +1384,7 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) * message should be deleted itself. */ if (ainfo->nattrs == 0) { - if (H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0) + if (H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, true) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info"); } /* end if */ @@ -1423,14 +1423,14 @@ H5O__attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNU /* Check for correct attribute message to modify */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Convert message into a null message (i.e. delete it) */ - if (H5O__release_mesg(udata->f, oh, mesg, TRUE) < 0) + if (H5O__release_mesg(udata->f, oh, mesg, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message"); /* Indicate that the object header was modified */ *oh_modified = H5O_MODIFY_CONDENSE; /* Indicate that this message is the attribute to be deleted */ - udata->found = TRUE; + udata->found = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -1454,7 +1454,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ + htri_t ainfo_exists = false; /* Whether the attribute info exists in the file */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(loc->addr) @@ -1488,7 +1488,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) /* Set up user data for callback */ udata.f = loc->file; udata.name = name; - udata.found = FALSE; + udata.found = false; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; @@ -1507,7 +1507,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info"); /* Update the modification time, if any */ - if (H5O_touch_oh(loc->file, oh, FALSE) < 0) + if (H5O_touch_oh(loc->file, oh, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -1532,7 +1532,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ + htri_t ainfo_exists = false; /* Whether the attribute info exists in the file */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1574,7 +1574,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order /* Set up user data for callback, to remove the attribute by name */ udata.f = loc->file; udata.name = ((atable.attrs[n])->shared)->name; - udata.found = FALSE; + udata.found = false; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; @@ -1593,7 +1593,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info"); /* Update the modification time, if any */ - if (H5O_touch_oh(loc->file, oh, FALSE) < 0) + if (H5O_touch_oh(loc->file, oh, false) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: @@ -1628,7 +1628,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) /* Check for attributes stored densely */ if (oh->version > H5O_VERSION_1) { - htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ + htri_t ainfo_exists = false; /* Whether the attribute info exists in the file */ H5O_ainfo_t ainfo; /* Attribute information for object */ /* Attempt to get the attribute information from the object header */ @@ -1681,7 +1681,7 @@ H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/, unsig /* Check for correct attribute message */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Indicate that this message is the attribute sought */ - *udata->exists = TRUE; + *udata->exists = true; /* Stop iterating */ ret_value = H5_ITER_STOP; @@ -1700,7 +1700,7 @@ H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/, unsig *------------------------------------------------------------------------- */ herr_t -H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists) +H5O__attr_exists(const H5O_loc_t *loc, const char *name, bool *attr_exists) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -1714,7 +1714,7 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists) assert(attr_exists); /* 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_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Check for attribute info stored */ @@ -1779,7 +1779,7 @@ H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) /* Attributes are only stored in fractal heap & indexed w/v2 B-tree in later versions */ if (oh->version > H5O_VERSION_1) { H5O_ainfo_t ainfo; /* Attribute information for object */ - htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ + htri_t ainfo_exists = false; /* Whether the attribute info exists in the file */ /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 364629b..c9c2196 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -35,8 +35,8 @@ /* PRIVATE PROTOTYPES */ static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O__bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__bogus_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__bogus_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* This message derives from H5O message class */ @@ -142,7 +142,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, +H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_PACKAGE_NOERR @@ -173,7 +173,7 @@ H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared *------------------------------------------------------------------------- */ static size_t -H5O__bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__bogus_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 0bac54e..7f56b43 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -24,9 +24,9 @@ static void *H5O__btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__btreek_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__btreek_copy(const void *_mesg, void *_dest); -static size_t H5O__btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__btreek_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* This message derives from H5O message class */ @@ -120,8 +120,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, - const void *_mesg) +H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; @@ -190,7 +189,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 4a56cb2..31763f9 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -57,7 +57,7 @@ static herr_t H5O__cache_get_initial_load_size(void *udata, size_t *image_len); static herr_t H5O__cache_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); static htri_t H5O__cache_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5O__cache_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5O__cache_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5O__cache_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5O__cache_notify(H5AC_notify_action_t action, void *_thing); @@ -65,7 +65,7 @@ static herr_t H5O__cache_free_icr(void *thing); static herr_t H5O__cache_chk_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5O__cache_chk_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5O__cache_chk_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5O__cache_chk_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing); @@ -76,7 +76,7 @@ static herr_t H5O__prefix_deserialize(const uint8_t *image, size_t len, H5O_cach /* Chunk routines */ static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t *image, - size_t len, H5O_common_cache_ud_t *udata, hbool_t *dirty); + size_t len, H5O_common_cache_ud_t *udata, bool *dirty); static herr_t H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno); /* Misc. routines */ @@ -202,7 +202,7 @@ done: * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative *------------------------------------------------------------------------- */ @@ -211,7 +211,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) { const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -235,8 +235,8 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) /* Indicate that udata->oh is to be freed later in H5O__prefix_deserialize() */ - udata->free_oh = TRUE; - ret_value = FALSE; + udata->free_oh = true; + ret_value = false; } } else @@ -263,7 +263,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) *------------------------------------------------------------------------- */ static void * -H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty) +H5O__cache_deserialize(const void *image, size_t len, void *_udata, bool *dirty) { H5O_t *oh = NULL; /* Object header read in */ H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ @@ -312,7 +312,7 @@ H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dir HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk"); /* Note that we've loaded the object header from the file */ - udata->made_attempt = TRUE; + udata->made_attempt = true; /* Set return value */ ret_value = oh; @@ -320,7 +320,7 @@ H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dir done: /* Release the [possibly partially initialized] object header on errors */ if (!ret_value && oh) - if (H5O__free(oh, FALSE) < 0) + if (H5O__free(oh, false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data"); FUNC_LEAVE_NOAPI(ret_value) @@ -531,7 +531,7 @@ H5O__cache_notify(H5AC_notify_action_t action, void *_thing) /* Mark messages stored with the object header (i.e. messages in chunk 0) as clean */ for (u = 0; u < oh->nmesgs; u++) if (oh->mesg[u].chunkno == 0) - oh->mesg[u].dirty = FALSE; + oh->mesg[u].dirty = false; #ifndef NDEBUG /* Reset the number of messages dirtied by decoding */ oh->ndecode_dirtied = 0; @@ -581,7 +581,7 @@ H5O__cache_free_icr(void *_thing) assert(oh->cache_info.type == H5AC_OHDR); /* Destroy object header */ - if (H5O__free(oh, FALSE) < 0) + if (H5O__free(oh, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header"); done: @@ -621,7 +621,7 @@ H5O__cache_chk_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative *------------------------------------------------------------------------- */ @@ -630,7 +630,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) { const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE_NOERR @@ -645,7 +645,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; } FUNC_LEAVE_NOAPI(ret_value) @@ -663,7 +663,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) *------------------------------------------------------------------------- */ static void * -H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty) +H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, bool *dirty) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ @@ -858,7 +858,7 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) /* Mark messages in chunk as clean */ for (u = 0; u < chk_proxy->oh->nmesgs; u++) if (chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno) - chk_proxy->oh->mesg[u].dirty = FALSE; + chk_proxy->oh->mesg[u].dirty = false; } break; case H5AC_NOTIFY_ACTION_CHILD_DIRTIED: @@ -1152,9 +1152,9 @@ H5O__prefix_deserialize(const uint8_t *_image, size_t len, H5O_cache_ud_t *udata /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; - if (H5O__free(saved_oh, FALSE) < 0) + if (H5O__free(saved_oh, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header"); - udata->free_oh = FALSE; + udata->free_oh = false; } else /* Save the object header for later use in 'deserialize' callback */ @@ -1165,7 +1165,7 @@ H5O__prefix_deserialize(const uint8_t *_image, size_t len, H5O_cache_ud_t *udata done: /* Release the [possibly partially initialized] object header on errors */ if (ret_value < 0 && oh) - if (H5O__free(oh, FALSE) < 0) + if (H5O__free(oh, false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header data"); FUNC_LEAVE_NOAPI(ret_value) @@ -1181,7 +1181,7 @@ done: */ static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t *image, size_t len, - H5O_common_cache_ud_t *udata, hbool_t *dirty) + H5O_common_cache_ud_t *udata, bool *dirty) { const uint8_t *chunk_image = NULL; /* Pointer into buffer to decode */ const uint8_t *p_end = NULL; /* End of image buffer */ @@ -1189,8 +1189,8 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t unsigned merged_null_msgs = 0; /* Number of null messages merged together */ unsigned chunkno; /* Current chunk's index */ unsigned nullcnt; /* Count of null messages (for sanity checking gaps in chunks) */ - hbool_t mesgs_modified = - FALSE; /* Whether any messages were modified when the object header was deserialized */ + bool mesgs_modified = + false; /* Whether any messages were modified when the object header was deserialized */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -1336,7 +1336,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t /* Combine adjacent null messages */ mesgno = oh->nmesgs - 1; oh->mesg[mesgno].raw_size += (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + mesg_size; - oh->mesg[mesgno].dirty = TRUE; + oh->mesg[mesgno].dirty = true; merged_null_msgs++; } else { @@ -1355,7 +1355,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t oh->nmesgs++; /* Initialize information about message */ - mesg->dirty = FALSE; + mesg->dirty = false; mesg->flags = flags; mesg->crt_idx = crt_idx; mesg->native = NULL; @@ -1412,8 +1412,8 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t mesg->flags |= H5O_MSG_FLAG_WAS_UNKNOWN; /* Mark the message and chunk as dirty */ - mesg->dirty = TRUE; - mesgs_modified = TRUE; + mesg->dirty = true; + mesgs_modified = true; } } else { @@ -1464,7 +1464,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t mesg->native = refcount; /* Set object header values */ - oh->has_refcount_msg = TRUE; + oh->has_refcount_msg = true; if (!refcount) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't decode refcount"); oh->nlink = *refcount; @@ -1482,8 +1482,8 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t /* Mark the message & chunk as dirty if the message was changed by decoding */ if ((ioflags & H5O_DECODEIO_DIRTY) && (udata->file_intent & H5F_ACC_RDWR)) { - mesg->dirty = TRUE; - mesgs_modified = TRUE; + mesg->dirty = true; + mesgs_modified = true; } } @@ -1526,12 +1526,12 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t /* Mark the chunk dirty if we've modified messages */ if (mesgs_modified) - *dirty = TRUE; + *dirty = true; /* Mark the chunk dirty if we've merged null messages */ if (merged_null_msgs > 0) { udata->merged_null_msgs += merged_null_msgs; - *dirty = TRUE; + *dirty = true; } done: diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index c379384..7c71178 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -36,9 +36,9 @@ /* Callbacks for message class */ static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__mdci_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mdci_copy(const void *_mesg, void *_dest); -static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__mdci_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__mdci_free(void *mesg); static herr_t H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static herr_t H5O__mdci_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -135,7 +135,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__mdci_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_mdci_t *mesg = (const H5O_mdci_t *)_mesg; @@ -203,7 +203,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__mdci_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index f09e6eb..e131d67 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -122,7 +122,7 @@ done: /* Release resources */ if (cont_chk_proxy) - if (H5O__chunk_unprotect(f, cont_chk_proxy, FALSE) < 0) + if (H5O__chunk_unprotect(f, cont_chk_proxy, false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk"); FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -208,7 +208,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t dirtied) +H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, bool dirtied) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 3af61a2..ff08218 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -33,8 +33,8 @@ /* PRIVATE PROTOTYPES */ static void *H5O__cont_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O__cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__cont_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__cont_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__cont_free(void *mesg); static herr_t H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static herr_t H5O__cont_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -122,7 +122,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__cont_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_cont_t *cont = (const H5O_cont_t *)_mesg; @@ -156,7 +156,7 @@ H5O__cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co *------------------------------------------------------------------------- */ static size_t -H5O__cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__cont_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index ae60afb..e4b6dd5 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -125,9 +125,9 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const H5G_loc_t src_loc; /* Source object group location */ H5G_name_t src_path; /* Opened source object hier. path */ H5O_loc_t src_oloc; /* Opened source object object location */ - hbool_t dst_exists; /* Does destination name exist already? */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hbool_t obj_open = FALSE; /* Entry at 'name' found */ + bool dst_exists; /* Does destination name exist already? */ + bool loc_found = false; /* Location at 'name' found */ + bool obj_open = false; /* Entry at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -139,7 +139,7 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const assert(dst_name && *dst_name); /* Check if destination name already exists */ - dst_exists = FALSE; + dst_exists = false; if (H5L_exists_tolerant(dst_loc, dst_name, &dst_exists) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists"); if (dst_exists) @@ -153,12 +153,12 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const /* Find the source object to copy */ if (H5G_loc_find(loc, src_name, &src_loc /*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found"); - loc_found = TRUE; + loc_found = true; /* Open source object's object header */ if (H5O_open(&src_oloc) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object"); - obj_open = TRUE; + obj_open = true; /* Do the actual copying of the object */ if (H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) @@ -199,8 +199,8 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 H5O_t *oh_dst = NULL; /* Object header for destination object */ unsigned mesgno = 0; haddr_t addr_new = HADDR_UNDEF; - hbool_t *deleted = NULL; /* Array of flags indicating whether messages should be copied */ - hbool_t inserted = FALSE; /* Whether the destination object header has been inserted into the cache */ + bool *deleted = NULL; /* Array of flags indicating whether messages should be copied */ + bool inserted = false; /* Whether the destination object header has been inserted into the cache */ size_t null_msgs; /* Number of NULL messages found in each loop */ size_t orig_dst_msgs; /* Original # of messages in dest. object */ H5O_mesg_t *mesg_src; /* Message in source object header */ @@ -231,7 +231,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 cpy_info->shared_fo = H5FO_opened(oloc_src->file, oloc_src->addr); /* Get source object header */ - if (NULL == (oh_src = H5O_protect(oloc_src, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh_src = H5O_protect(oloc_src, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Retrieve user data for particular type of object to copy */ @@ -250,7 +250,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 H5F_GET_FILENO(oloc_src->file, fileno_src); H5F_GET_FILENO(oloc_dst->file, fileno_dst); if (fileno_src == fileno_dst) { - merge = TRUE; + merge = true; oloc_dst->addr = oloc_src->addr; } /* end if */ else @@ -270,7 +270,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 addr_map->src_obj_pos.fileno = fileno_src; addr_map->src_obj_pos.addr = oloc_src->addr; addr_map->dst_addr = oloc_dst->addr; - addr_map->is_locked = TRUE; /* We've locked the object currently */ + addr_map->is_locked = true; /* We've locked the object currently */ addr_map->inc_ref_count = 0; /* Start with no additional ref counts to add */ addr_map->obj_class = obj_class; addr_map->udata = cpy_udata; @@ -342,9 +342,9 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Allocate memory for "deleted" array. This array marks the message in * the source that shouldn't be copied to the destination. */ - if (NULL == (deleted = (hbool_t *)H5MM_malloc(sizeof(hbool_t) * oh_src->nmesgs))) + if (NULL == (deleted = (bool *)H5MM_malloc(sizeof(bool) * oh_src->nmesgs))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - memset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs); + memset(deleted, false, sizeof(bool) * oh_src->nmesgs); /* "pre copy" pass over messages, to gather information for actual message copy operation * (for messages which depend on information from other messages) @@ -365,7 +365,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 * messages because the destination OH will have only one chunk */ if (H5O_CONT_ID == mesg_src->type->id || H5O_NULL_ID == mesg_src->type->id) { - deleted[mesgno] = TRUE; + deleted[mesgno] = true; ++null_msgs; copy_type = H5O_MSG_NULL; } /* end if */ @@ -413,7 +413,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Skip any deleted or NULL messages in the source unless the * preserve_null flag is set */ - if (FALSE == cpy_info->preserve_null) { + if (false == cpy_info->preserve_null) { while (deleted[mesgno + null_msgs]) { ++null_msgs; assert(mesgno + null_msgs < oh_src->nmesgs); @@ -436,7 +436,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 if (cpy_info->preserve_null && deleted[mesgno]) { mesg_dst->type = H5O_MSG_NULL; mesg_dst->flags = 0; - mesg_dst->dirty = TRUE; + mesg_dst->dirty = true; } /* end if */ /* Check for message class to operate on */ @@ -448,7 +448,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* copy this message into destination file */ if (copy_type->copy_file) { - hbool_t recompute_size; /* Whether copy_file callback created a shared message */ + bool recompute_size; /* Whether copy_file callback created a shared message */ unsigned mesg_flags; /* Message flags */ /* Decode the message if necessary. */ @@ -460,7 +460,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 mesg_flags = (unsigned)mesg_dst->flags & ~H5O_MSG_FLAG_SHARED & ~H5O_MSG_FLAG_SHAREABLE; /* Copy the source message */ - recompute_size = FALSE; + recompute_size = false; if (NULL == (mesg_dst->native = H5O__msg_copy_file(copy_type, oloc_src->file, mesg_src->native, oloc_dst->file, &recompute_size, &mesg_flags, cpy_info, cpy_udata))) @@ -469,7 +469,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Check if the sharing state changed, and recompute the size if so */ if (!(mesg_flags & H5O_MSG_FLAG_SHARED) != !(mesg_dst->flags & H5O_MSG_FLAG_SHARED)) - recompute_size = TRUE; + recompute_size = true; /* Set destination message flags */ mesg_dst->flags = (uint8_t)mesg_flags; @@ -480,11 +480,11 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 */ if (recompute_size) mesg_dst->raw_size = H5O_ALIGN_OH( - oh_dst, H5O_msg_raw_size(oloc_dst->file, mesg_dst->type->id, FALSE, mesg_dst->native)); + oh_dst, H5O_msg_raw_size(oloc_dst->file, mesg_dst->type->id, false, mesg_dst->native)); /* Mark the message in the destination as dirty, so it'll get encoded when the object header is * flushed */ - mesg_dst->dirty = TRUE; + mesg_dst->dirty = true; } /* end if (mesg_src->type->copy_file) */ } /* end of mesgno loop */ @@ -594,7 +594,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Skip any deleted or NULL messages in the source unless the * preserve_null flag is set. */ - if (FALSE == cpy_info->preserve_null) { + if (false == cpy_info->preserve_null) { while (deleted[mesgno + null_msgs]) { ++null_msgs; assert(mesgno + null_msgs < oh_src->nmesgs); @@ -633,7 +633,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* (account for chunk's magic # & checksum) */ null_idx = oh_dst->nmesgs++; oh_dst->mesg[null_idx].type = H5O_MSG_NULL; - oh_dst->mesg[null_idx].dirty = TRUE; + oh_dst->mesg[null_idx].dirty = true; oh_dst->mesg[null_idx].native = NULL; oh_dst->mesg[null_idx].raw = current_pos + msghdr_size; oh_dst->mesg[null_idx].raw_size = dst_oh_null - msghdr_size; @@ -664,7 +664,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 H5F_GET_FILENO(oloc_src->file, addr_map->src_obj_pos.fileno); addr_map->src_obj_pos.addr = oloc_src->addr; addr_map->dst_addr = oloc_dst->addr; - addr_map->is_locked = TRUE; /* We've locked the object currently */ + addr_map->is_locked = true; /* We've locked the object currently */ addr_map->inc_ref_count = 0; /* Start with no additional ref counts to add */ addr_map->obj_class = obj_class; addr_map->udata = cpy_udata; @@ -683,7 +683,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 /* Skip any deleted or NULL messages in the source unless the * preserve_null flag is set */ - if (FALSE == cpy_info->preserve_null) { + if (false == cpy_info->preserve_null) { while (deleted[mesgno + null_msgs]) { ++null_msgs; assert(mesgno + null_msgs < oh_src->nmesgs); @@ -727,7 +727,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 } /* end for */ /* Indicate that the destination address will no longer be locked */ - addr_map->is_locked = FALSE; + addr_map->is_locked = false; /* Increment object header's reference count, if any descendents have created links to this object */ if (addr_map->inc_ref_count) { @@ -746,7 +746,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5 if (H5AC_insert_entry(oloc_dst->file, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header"); oh_dst = NULL; - inserted = TRUE; + inserted = true; /* Reset metadata tag */ H5_END_TAG @@ -770,7 +770,7 @@ done: /* Free destination object header on failure */ if (ret_value < 0) { if (oh_dst && !inserted) { - if (H5O__free(oh_dst, TRUE) < 0) + if (H5O__free(oh_dst, true) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data"); if (H5O_loc_reset(oloc_dst) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data"); @@ -797,11 +797,11 @@ done: */ herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5O_copy_t *cpy_info, - hbool_t inc_depth, H5O_type_t *obj_type, void **udata /*out*/) + bool inc_depth, H5O_type_t *obj_type, void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5_obj_t src_obj_pos; /* Position of source object */ - hbool_t inc_link; /* Whether to increment the link count for the object */ + bool inc_link; /* Whether to increment the link count for the object */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -838,7 +838,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5O_ cpy_info->curr_depth--; /* When an object is copied for the first time, increment it's link */ - inc_link = TRUE; + inc_link = true; /* indicate that a new object is created */ ret_value++; @@ -861,10 +861,10 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5O_ */ if (addr_map->is_locked) { addr_map->inc_ref_count++; - inc_link = FALSE; + inc_link = false; } /* end if */ else - inc_link = TRUE; + inc_link = true; } /* end else */ /* Increment destination object's link count, if allowed */ @@ -965,24 +965,24 @@ H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, hid_t /* Convert copy flags into copy struct */ if ((cpy_option & H5O_COPY_SHALLOW_HIERARCHY_FLAG) > 0) { - cpy_info.copy_shallow = TRUE; + cpy_info.copy_shallow = true; cpy_info.max_depth = 1; } /* end if */ else cpy_info.max_depth = -1; /* Current default is for full, recursive hier. copy */ cpy_info.curr_depth = 0; if ((cpy_option & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) - cpy_info.expand_soft_link = TRUE; + cpy_info.expand_soft_link = true; if ((cpy_option & H5O_COPY_EXPAND_EXT_LINK_FLAG) > 0) - cpy_info.expand_ext_link = TRUE; + cpy_info.expand_ext_link = true; if ((cpy_option & H5O_COPY_EXPAND_REFERENCE_FLAG) > 0) - cpy_info.expand_ref = TRUE; + cpy_info.expand_ref = true; if ((cpy_option & H5O_COPY_WITHOUT_ATTR_FLAG) > 0) - cpy_info.copy_without_attr = TRUE; + cpy_info.copy_without_attr = true; if ((cpy_option & H5O_COPY_PRESERVE_NULL_FLAG) > 0) - cpy_info.preserve_null = TRUE; + cpy_info.preserve_null = true; if ((cpy_option & H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) > 0) - cpy_info.merge_comm_dt = TRUE; + cpy_info.merge_comm_dt = true; /* Add dt_list to copy struct */ cpy_info.dst_dt_suggestion_list = dt_list; @@ -1027,7 +1027,7 @@ H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hid_ H5O_loc_t new_oloc; /* Copied object object location */ H5G_loc_t new_loc; /* Group location of object copied */ H5F_t *cached_dst_file; /* Cached destination file */ - hbool_t entry_inserted = FALSE; /* Flag to indicate that the new entry was inserted into a group */ + bool entry_inserted = false; /* Flag to indicate that the new entry was inserted into a group */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1060,7 +1060,7 @@ H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hid_ /* Insert the new object in the destination file's group */ if (H5L_link(dst_loc, dst_name, &new_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link"); - entry_inserted = TRUE; + entry_inserted = true; done: /* Free the ID to name buffers */ @@ -1128,7 +1128,7 @@ H5O__copy_comm_dt_cmp(const void *_key1, const void *_key2) HGOTO_DONE(1); } /* end if */ - ret_value = H5T_cmp(key1->dt, key2->dt, FALSE); + ret_value = H5T_cmp(key1->dt, key2->dt, false); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1154,7 +1154,7 @@ H5O__copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) H5T_t *dt = NULL; /* Datatype */ H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *addr = NULL; /* Destination address */ - hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ + bool obj_inserted = false; /* Object inserted into skip list */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1191,7 +1191,7 @@ H5O__copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) *addr = ((H5O_shared_t *)(key->dt))->u.loc.oh_addr; if (H5SL_insert(udata->dst_dt_list, addr, key) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list"); - obj_inserted = TRUE; + obj_inserted = true; } /* end if */ } /* end if */ @@ -1229,7 +1229,7 @@ H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *addr = NULL; /* Destination address */ - hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ + bool obj_inserted = false; /* Object inserted into skip list */ H5A_attr_iter_op_t attr_op; /* Attribute iteration operator */ const H5O_obj_class_t *obj_class = NULL; /* Type of object */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1270,7 +1270,7 @@ H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t *addr = obj_oloc->addr; if (H5SL_insert(udata->dst_dt_list, addr, key) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list"); - obj_inserted = TRUE; + obj_inserted = true; } /* end if */ } /* end if */ else if (obj_class->type == H5O_TYPE_DATASET) { @@ -1296,7 +1296,7 @@ H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t *addr = ((H5O_shared_t *)(key->dt))->u.loc.oh_addr; if (H5SL_insert(udata->dst_dt_list, addr, key) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list"); - obj_inserted = TRUE; + obj_inserted = true; } /* end if */ } /* end if */ } /* end else */ @@ -1347,7 +1347,7 @@ H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5G_loc_t obj_loc; /* Location of object */ H5O_loc_t obj_oloc; /* Object's object location */ H5G_name_t obj_path; /* Object's group hier. path */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ + bool obj_found = false; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -1369,7 +1369,7 @@ H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const /* Find the object */ if (H5G_loc_find(udata->dst_root_loc, name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found"); - obj_found = TRUE; + obj_found = true; /* Check object and add to skip list if appropriate */ if (H5O__copy_search_comm_dt_check(&obj_oloc, udata) < 0) @@ -1391,9 +1391,9 @@ done: * in the destination file, building the destination file * skiplist as necessary. * - * Return: TRUE if a match is found in the destination file + * Return: true if a match is found in the destination file * - oloc_dst will contain the address - * FALSE if a match is not found + * false if a match is not found * Negative on failure * *------------------------------------------------------------------------- @@ -1406,7 +1406,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i haddr_t *dst_addr; /* Destination datatype address */ H5G_loc_t dst_root_loc = {NULL, NULL}; /* Destination root group location */ H5O_copy_search_comm_dt_ud_t udata; /* Group iteration user data */ - herr_t ret_value = FALSE; /* Return value */ + herr_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -1490,7 +1490,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i if (cpy_info->dst_dt_suggestion_list && NULL != (dst_addr = (haddr_t *)H5SL_search(cpy_info->dst_dt_list, key))) { oloc_dst->addr = *dst_addr; - ret_value = TRUE; + ret_value = true; } /* end if */ else { H5O_mcdt_search_ret_t search_cb_ret = H5O_MCDT_SEARCH_CONT; @@ -1527,7 +1527,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i if (H5G_visit(&dst_root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O__copy_search_comm_dt_cb, &udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed"); - cpy_info->dst_dt_list_complete = TRUE; + cpy_info->dst_dt_list_complete = true; } /* end if */ else if (search_cb_ret != H5O_MCDT_SEARCH_STOP) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown return value for callback"); @@ -1539,7 +1539,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i if (cpy_info->dst_dt_list_complete) { if (NULL != (dst_addr = (haddr_t *)H5SL_search(cpy_info->dst_dt_list, key))) { oloc_dst->addr = *dst_addr; - ret_value = TRUE; + ret_value = true; } /* end if */ } /* end if */ diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 2479d71..e354a55 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -104,7 +104,7 @@ H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, H5G_loc_t *dst_ro assert(dst_oloc); /* Perform the copy, or look up existing copy */ - if ((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, FALSE, NULL, NULL)) < 0) + if ((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, false, NULL, NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object"); /* Check if a new valid object is copied to the destination */ @@ -295,7 +295,7 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt hid_t tid_dst = H5I_INVALID_HID; /* Datatype ID for memory datatype */ H5T_path_t *tpath_src_mem = NULL, *tpath_mem_dst = NULL; /* Datatype conversion paths */ size_t i; /* Local index variable */ - hbool_t reg_tid_src = (tid_src == H5I_INVALID_HID); + bool reg_tid_src = (tid_src == H5I_INVALID_HID); hid_t dst_loc_id = H5I_INVALID_HID; void *conv_buf = NULL; /* Buffer for converting data */ size_t conv_buf_size = 0; /* Buffer size */ @@ -309,13 +309,13 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt FUNC_ENTER_PACKAGE /* Create datatype ID for src datatype. */ - if ((tid_src == H5I_INVALID_HID) && (tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) + if ((tid_src == H5I_INVALID_HID) && (tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); /* create a memory copy of the reference datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { + if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); } /* end if */ @@ -327,7 +327,7 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { + if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); } /* end if */ @@ -379,7 +379,7 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt if (H5R__set_obj_token(ref, (const H5O_token_t *)&tmp_token, token_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to set object token"); /* Do not set app_ref since references are released once the copy is done */ - if (H5R__set_loc_id(ref, dst_loc_id, TRUE, FALSE) < 0) + if (H5R__set_loc_id(ref, dst_loc_id, true, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to set destination loc id"); } /* end if */ } /* end for */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index d6c7097..9bc949f 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -148,8 +148,8 @@ H5O__assert(const H5O_t *oh) if (H5O_NULL_ID == curr_msg->type->id) free_space += curr_tot_size; else if (H5O_CONT_ID == curr_msg->type->id) { - H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; - hbool_t H5_ATTR_NDEBUG_UNUSED found_chunk = FALSE; /* Found a chunk that matches */ + H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; + bool H5_ATTR_NDEBUG_UNUSED found_chunk = false; /* Found a chunk that matches */ assert(cont); @@ -162,7 +162,7 @@ H5O__assert(const H5O_t *oh) if (H5_addr_eq(cont->addr, oh->chunk[v].addr) && cont->size == oh->chunk[v].size) { assert(cont->chunkno == v); assert(!found_chunk); - found_chunk = TRUE; + found_chunk = true; } /* end if */ } /* end for */ assert(found_chunk); @@ -393,7 +393,7 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int "Dirty:", oh->mesg[i].dirty ? "TRUE" : "FALSE"); fprintf(stream, "%*s%-*s ", indent + 3, "", MAX(0, fwidth - 3), "Message flags:"); if (oh->mesg[i].flags) { - hbool_t flag_printed = FALSE; + bool flag_printed = false; /* Sanity check that all flags in format are covered below */ HDcompile_assert(H5O_MSG_FLAG_BITS == @@ -404,36 +404,36 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int if (oh->mesg[i].flags & H5O_MSG_FLAG_CONSTANT) { fprintf(stream, "%sC", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_SHARED) { fprintf(stream, "%sS", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_DONTSHARE) { fprintf(stream, "%sDS", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE) { fprintf(stream, "%sFIUW", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN) { fprintf(stream, "%sMIU", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_WAS_UNKNOWN) { assert(oh->mesg[i].flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN); fprintf(stream, "%sWU", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_SHAREABLE) { fprintf(stream, "%sSA", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS) { fprintf(stream, "%sFIUA", (flag_printed ? ", " : "<")); - flag_printed = TRUE; + flag_printed = true; } /* end if */ if (!flag_printed) fprintf(stream, "-"); @@ -511,9 +511,9 @@ H5O_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) /* Set up the object location */ loc.file = f; loc.addr = addr; - loc.holding_file = FALSE; + loc.holding_file = false; - 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 load object header"); /* debug */ diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index 71edd82..6e8b34e 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -341,7 +341,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) void *opened_obj = NULL; /* Opened object */ H5VL_loc_params_t loc_params; /* Location parameters */ H5O_token_t obj_token = {0}; /* Object token */ - hbool_t is_native_vol_obj; + bool is_native_vol_obj; hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -379,7 +379,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object"); /* Register the object's ID */ - if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -455,7 +455,7 @@ H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "oinfo parameter cannot be NULL"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Fill out location struct */ @@ -509,7 +509,7 @@ H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); loc_params.type = H5VL_OBJECT_BY_IDX; @@ -548,7 +548,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo /*out*/, unsigned fields) { H5VL_object_t *vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -601,7 +601,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, { H5VL_object_t *vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -618,7 +618,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Fill out location struct */ @@ -666,7 +666,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H { H5VL_object_t *vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -685,7 +685,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); loc_params.type = H5VL_OBJECT_BY_IDX; @@ -850,7 +850,7 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ @@ -925,7 +925,7 @@ H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1 H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; /* Location parameters for object access */ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */ - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1019,7 +1019,7 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ H5VL_loc_params_t loc_params; /* Location parameters for object access */ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */ - hbool_t is_native_vol_obj; + bool is_native_vol_obj; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1040,7 +1040,7 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 36a1ba5..4ff9873 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -23,9 +23,9 @@ static void *H5O__drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__drvinfo_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__drvinfo_copy(const void *_mesg, void *_dest); -static size_t H5O__drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__drvinfo_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__drvinfo_reset(void *_mesg); static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -135,7 +135,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, +H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; @@ -215,7 +215,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 48622e2..bad4684 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -34,11 +34,10 @@ static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); static herr_t H5O__dtype_set_share(void *_mesg, const H5O_shared_t *sh); static htri_t H5O__dtype_can_share(const void *_mesg); -static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *_udata); static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void *udata); + H5F_t *file_dst, bool *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -112,19 +111,19 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ * * Purpose: Decodes a datatype * - * Return: TRUE if we can upgrade the parent type's version even + * Return: true if we can upgrade the parent type's version even * with strict format checks - * FALSE if we cannot + * false if we cannot * NEGATIVE on failure *------------------------------------------------------------------------- */ static htri_t -H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt, hbool_t skip, +H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt, bool skip, const uint8_t *p_end) { unsigned flags; unsigned version; - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_PACKAGE @@ -460,7 +459,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t upgrade_to = temp_type->shared->version; /* Pass "can_upgrade" flag down to parent type */ - ret_value = TRUE; + ret_value = true; } /* Go create the array datatype now, for older versions of the datatype message */ @@ -498,7 +497,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the return value to indicate that we should freely * upgrade parent types */ - ret_value = TRUE; + ret_value = true; } } } @@ -510,8 +509,8 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the "force conversion" flag if VL datatype fields exist in this * type or any component types */ - if (temp_type->shared->force_conv == TRUE) - dt->shared->force_conv = TRUE; + if (temp_type->shared->force_conv == true) + dt->shared->force_conv = true; /* Member size */ dt->shared->u.compnd.memb[dt->shared->u.compnd.nmembs].size = temp_type->shared->size; @@ -583,16 +582,16 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t if (dt->shared->u.atomic.u.r.rtype == H5R_OBJECT2 || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { - dt->shared->u.atomic.u.r.opaque = TRUE; + dt->shared->u.atomic.u.r.opaque = true; dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); if (dt->shared->u.atomic.u.r.version != H5R_ENCODE_VERSION) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "reference version does not match"); } else - dt->shared->u.atomic.u.r.opaque = FALSE; + dt->shared->u.atomic.u.r.opaque = false; /* This type needs conversion */ - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; /* Mark location of this type as undefined for now. The caller * function should decide the location. */ @@ -702,7 +701,7 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t * vlen itself. */ H5O_DTYPE_CHECK_VERSION(dt, version, dt->shared->parent->shared->version, ioflags, "vlen", FAIL) - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; /* Mark location this type as undefined for now. The caller function should * decide the location. */ @@ -762,8 +761,8 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t /* Set the "force conversion" flag if a VL base datatype is used or * or if any components of the base datatype are VL types. */ - if (dt->shared->parent->shared->force_conv == TRUE) - dt->shared->force_conv = TRUE; + if (dt->shared->parent->shared->force_conv == true) + dt->shared->force_conv = true; break; case H5T_NO_CLASS: @@ -1312,7 +1311,7 @@ static void * H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags /*in,out*/, size_t p_size, const uint8_t *p) { - hbool_t skip; + bool skip; H5T_t *dt = NULL; const uint8_t *p_end = p + p_size - 1; void *ret_value = NULL; @@ -1331,7 +1330,7 @@ H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign * the library will have set p_size to SIZE_MAX and we can use that * as a signal to skip bounds checking. */ - skip = (p_size == SIZE_MAX ? TRUE : FALSE); + skip = (p_size == SIZE_MAX ? true : false); /* Perform actual decode of message */ if (H5O__dtype_decode_helper(ioflags, &p, dt, skip, p_end) < 0) @@ -1673,8 +1672,8 @@ done: * not. Immutable datatypes or datatypes that are already * shared cannot be shared (again). * - * Return: TRUE if datatype can be shared - * FALSE if datatype may not shared + * Return: true if datatype can be shared + * false if datatype may not shared * Negative on failure * *------------------------------------------------------------------------- @@ -1684,7 +1683,7 @@ H5O__dtype_can_share(const void *_mesg) { const H5T_t *mesg = (const H5T_t *)_mesg; htri_t tri_ret; - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE @@ -1692,13 +1691,13 @@ H5O__dtype_can_share(const void *_mesg) /* Don't share immutable datatypes */ if ((tri_ret = H5T_is_immutable(mesg)) > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if (tri_ret < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is immutable"); /* Don't share committed datatypes */ if ((tri_ret = H5T_is_named(mesg)) > 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if (tri_ret < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is shared"); @@ -1719,7 +1718,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, +H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5T_t *dt_src = (const H5T_t *)mesg_src; /* Source datatype */ @@ -1772,7 +1771,7 @@ done: */ static void * H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, void *native_src, - H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, + H5F_t *file_dst, bool H5_ATTR_UNUSED *recompute_size, H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5T_t *dst_mesg; /* Destination datatype */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 5e8c4df..e2238c0 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -22,11 +22,11 @@ /* PRIVATE PROTOTYPES */ static void *H5O__efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__efl_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__efl_copy(const void *_mesg, void *_dest); -static size_t H5O__efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__efl_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__efl_reset(void *_mesg); -static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, +static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__efl_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -118,7 +118,7 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_addr(f), p_end)) HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(mesg->heap_addr)); - if (H5_addr_defined(mesg->heap_addr) == FALSE) + if (H5_addr_defined(mesg->heap_addr) == false) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad local heap address when parsing efl msg"); /* Decode the file list */ @@ -197,7 +197,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__efl_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t u; /* Local index variable */ @@ -260,7 +260,7 @@ H5O__efl_copy(const void *_mesg, void *_dest) const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; H5O_efl_t *dest = (H5O_efl_t *)_dest; size_t u; /* Local index variable */ - hbool_t slot_allocated = FALSE; /* Flag to indicate that dynamic allocation has begun */ + bool slot_allocated = false; /* Flag to indicate that dynamic allocation has begun */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -279,7 +279,7 @@ H5O__efl_copy(const void *_mesg, void *_dest) if (dest->nalloc > 0) { if (NULL == (dest->slot = (H5O_efl_entry_t *)H5MM_calloc(dest->nalloc * sizeof(H5O_efl_entry_t)))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "can't allocate efl message slots"); - slot_allocated = TRUE; + slot_allocated = true; for (u = 0; u < mesg->nused; u++) { dest->slot[u] = mesg->slot[u]; if (NULL == (dest->slot[u].name = H5MM_xstrdup(mesg->slot[u].name))) @@ -320,7 +320,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__efl_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t ret_value = 0; @@ -425,7 +425,7 @@ done: */ static void * H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + bool H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata) { H5O_efl_t *efl_src = (H5O_efl_t *)mesg_src; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 45abc18..87975f4 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -38,7 +38,7 @@ static size_t H5O__fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O__fill_copy(const void *_mesg, void *_dest); static herr_t H5O__fill_reset(void *_mesg); static herr_t H5O__fill_free(void *_mesg); -static herr_t H5O__fill_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__fill_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -296,11 +296,11 @@ H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, H5MM_memcpy(fill->buf, p, (size_t)fill->size); /* Set the "defined" flag */ - fill->fill_defined = TRUE; + fill->fill_defined = true; } else /* Set the "defined" flag */ - fill->fill_defined = TRUE; + fill->fill_defined = true; } /* Set return value */ @@ -329,7 +329,7 @@ H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flag unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ - htri_t exists = FALSE; + htri_t exists = false; H5T_t *dt = NULL; const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ void *ret_value = NULL; /* Return value */ @@ -374,7 +374,7 @@ H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flag if (NULL == (fill->buf = H5MM_malloc((size_t)fill->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value"); H5MM_memcpy(fill->buf, p, (size_t)fill->size); - fill->fill_defined = TRUE; + fill->fill_defined = true; } else fill->size = -1; @@ -577,10 +577,10 @@ H5O__fill_copy(const void *_src, void *_dst) size_t bkg_size; /* Size of background buffer */ /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->type, H5T_COPY_TRANSIENT), FALSE); + dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->type, H5T_COPY_TRANSIENT), false); if (dst_id < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy/register datatype"); - src_id = H5I_register(H5I_DATATYPE, H5T_copy(src->type, H5T_COPY_ALL), FALSE); + src_id = H5I_register(H5I_DATATYPE, H5T_copy(src->type, H5T_COPY_ALL), false); if (src_id < 0) { H5I_dec_ref(dst_id); HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy/register datatype"); @@ -721,14 +721,14 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) assert(fill); if (fill->buf) { - if (fill->type && H5T_detect_class(fill->type, H5T_VLEN, FALSE) > 0) { + if (fill->type && H5T_detect_class(fill->type, H5T_VLEN, false) > 0) { H5T_t *fill_type; /* Copy of fill value datatype */ H5S_t *fill_space; /* Scalar dataspace for fill value element */ /* Copy the fill value datatype and get an ID for it */ if (NULL == (fill_type = H5T_copy(fill->type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy fill value datatype"); - if ((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, FALSE)) < 0) { + if ((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, false)) < 0) { (void)H5T_close_real(fill_type); HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register fill value datatype"); } /* end if */ @@ -787,7 +787,7 @@ H5O__fill_reset(void *_fill) /* Reset value fields */ fill->alloc_time = H5D_ALLOC_TIME_LATE; fill->fill_time = H5D_FILL_TIME_IFSET; - fill->fill_defined = FALSE; + fill->fill_defined = false; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__fill_reset() */ @@ -825,7 +825,7 @@ H5O__fill_free(void *fill) *------------------------------------------------------------------------- */ static herr_t -H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, +H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */ @@ -955,7 +955,7 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, int in *------------------------------------------------------------------------- */ herr_t -H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) +H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) { H5T_path_t *tpath; /* Type conversion info */ void *buf = NULL, *bkg = NULL; /* Conversion buffers */ @@ -969,14 +969,14 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) assert(fill_changed); /* No-op cases */ - if (!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, FALSE)) { + if (!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, false)) { /* Don't need datatype for fill value */ if (fill->type) (void)H5T_close_real(fill->type); fill->type = NULL; /* Note that the fill value info has changed */ - *fill_changed = TRUE; + *fill_changed = true; HGOTO_DONE(SUCCEED); } /* end if */ @@ -991,8 +991,8 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) if (!H5T_path_noop(tpath)) { size_t fill_type_size; - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill->type, H5T_COPY_ALL), FALSE)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dset_type, H5T_COPY_ALL), FALSE)) < 0) + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill->type, H5T_COPY_ALL), false)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dset_type, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy/register data type"); /* @@ -1024,7 +1024,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) H5_CHECKED_ASSIGN(fill->size, ssize_t, H5T_get_size(dset_type), size_t); /* Note that the fill value info has changed */ - *fill_changed = TRUE; + *fill_changed = true; } /* end if */ done: diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 6ff751f..1c561d0 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -150,7 +150,7 @@ H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag) assert(oloc); /* Get object header for object */ - if (NULL == (oh = H5O_protect(oloc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(oloc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object's object header"); /* Get object header's address (i.e. the tag value for this object) */ @@ -186,7 +186,7 @@ herr_t H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid) { H5VL_object_t *vol_obj = NULL; /* VOL object associated with the ID */ - hbool_t objs_incr = FALSE; /* Whether the object count in the file was incremented */ + bool objs_incr = false; /* Whether the object count in the file was incremented */ H5F_t *file = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -214,7 +214,7 @@ H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid) * if this object is the only thing holding the file open. */ H5F_incr_nopen_objs(oloc->file); - objs_incr = TRUE; + objs_incr = true; /* Save important datatype state */ if (H5I_get_type(oid) == H5I_DATATYPE) @@ -239,7 +239,7 @@ H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object"); /* Re-open the object, re-fetching its metadata */ - if (H5O_refresh_metadata_reopen(oid, H5P_DEFAULT, &obj_loc, connector, FALSE) < 0) + if (H5O_refresh_metadata_reopen(oid, H5P_DEFAULT, &obj_loc, connector, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object"); /* Restore the number of references on the VOL connector */ @@ -280,7 +280,7 @@ H5O__refresh_metadata_close(H5O_loc_t *oloc, H5G_loc_t *obj_loc, hid_t oid) { H5F_t *file; /* Local copy of the object's file pointer */ haddr_t tag = 0; /* Tag for object */ - hbool_t corked = FALSE; /* Whether object's metadata is corked */ + bool corked = false; /* Whether object's metadata is corked */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -319,7 +319,7 @@ H5O__refresh_metadata_close(H5O_loc_t *oloc, H5G_loc_t *obj_loc, hid_t oid) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata"); /* Evict the object's tagged metadata */ - if (H5AC_evict_tagged_metadata(file, tag, TRUE) < 0) + if (H5AC_evict_tagged_metadata(file, tag, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to evict metadata"); /* Re-cork object with tag */ @@ -344,7 +344,7 @@ done: */ herr_t H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *obj_loc, H5VL_t *vol_connector, - hbool_t start_swmr) + bool start_swmr) { void *object = NULL; /* Object for this operation */ H5I_type_t type; /* Type of object for the ID */ @@ -374,7 +374,7 @@ H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *obj_loc, H5VL_t case H5I_DATASET: /* Set dataset access property list in API context if appropriate */ - if (H5CX_set_apl(&apl_id, H5P_CLS_DACC, oid, TRUE) < 0) + if (H5CX_set_apl(&apl_id, H5P_CLS_DACC, oid, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info"); /* Re-open the dataset */ @@ -411,7 +411,7 @@ H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *obj_loc, H5VL_t } /* end switch */ /* Re-register ID for the object */ - if ((H5VL_register_using_existing_id(type, object, vol_connector, TRUE, oid)) < 0) + if ((H5VL_register_using_existing_id(type, object, vol_connector, true, oid)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to re-register object ID after refresh"); done: diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index d1e0798..70f34fe 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -30,9 +30,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__fsinfo_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__fsinfo_copy(const void *_mesg, void *_dest); -static size_t H5O__fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__fsinfo_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__fsinfo_free(void *mesg); static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -131,7 +131,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU switch (strategy) { case H5F_FILE_SPACE_ALL_PERSIST: fsinfo->strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; - fsinfo->persist = TRUE; + fsinfo->persist = true; fsinfo->threshold = threshold; if (HADDR_UNDEF == (fsinfo->eoa_pre_fsm_fsalloc = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to get file size"); @@ -163,7 +163,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU } fsinfo->version = H5O_FSINFO_VERSION_1; - fsinfo->mapped = TRUE; + fsinfo->mapped = true; } else { if (vers < H5O_FSINFO_VERSION_1) @@ -199,7 +199,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(fsinfo->fs_addr[ptype - 1])); } - fsinfo->mapped = FALSE; + fsinfo->mapped = false; } /* Set return value */ @@ -222,7 +222,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__fsinfo_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5F_mem_page_t ptype; /* Memory type for iteration */ @@ -300,7 +300,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__fsinfo_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index f8b1263..72d15af 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -29,9 +29,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__ginfo_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__ginfo_copy(const void *_mesg, void *_dest); -static size_t H5O__ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__ginfo_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__ginfo_free(void *_mesg); static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -111,8 +111,8 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign flags = *p++; if (flags & ~H5O_GINFO_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message"); - ginfo->store_link_phase_change = (flags & H5O_GINFO_STORE_PHASE_CHANGE) ? TRUE : FALSE; - ginfo->store_est_entry_info = (flags & H5O_GINFO_STORE_EST_ENTRY_INFO) ? TRUE : FALSE; + ginfo->store_link_phase_change = (flags & H5O_GINFO_STORE_PHASE_CHANGE) ? true : false; + ginfo->store_est_entry_info = (flags & H5O_GINFO_STORE_EST_ENTRY_INFO) ? true : false; /* Get the max. # of links to store compactly & the min. # of links to store densely */ if (ginfo->store_link_phase_change) { @@ -158,8 +158,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, - const void *_mesg) +H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; unsigned char flags = 0; /* Flags for encoding group info */ @@ -243,7 +242,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ginfo_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; size_t ret_value = 0; /* Return value */ diff --git a/src/H5Oint.c b/src/H5Oint.c index e4cb65b..89e7de9 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -212,7 +212,7 @@ H5O_init(void) *------------------------------------------------------------------------- */ static herr_t -H5O__set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) +H5O__set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, bool store_msg_crt_idx) { uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ @@ -269,7 +269,7 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc assert(f); assert(loc); - assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); + assert(true == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); /* create object header in freelist * header version is set internally @@ -284,7 +284,7 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't apply object header to file"); done: - if ((FAIL == ret_value) && (NULL != oh) && (H5O__free(oh, TRUE) < 0)) + if ((FAIL == ret_value) && (NULL != oh) && (H5O__free(oh, true) < 0)) HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "can't delete object header"); FUNC_LEAVE_NOAPI(ret_value) @@ -311,7 +311,7 @@ H5O_create_ohdr(H5F_t *f, hid_t ocpl_id) FUNC_ENTER_NOAPI(NULL) assert(f); - assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); + assert(true == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); /* Check for invalid access request */ if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) @@ -345,7 +345,7 @@ H5O_create_ohdr(H5F_t *f, hid_t ocpl_id) ret_value = oh; done: - if ((NULL == ret_value) && (NULL != oh) && (H5O__free(oh, TRUE) < 0)) + if ((NULL == ret_value) && (NULL != oh) && (H5O__free(oh, true) < 0)) HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, NULL, "can't delete object header"); FUNC_LEAVE_NOAPI(ret_value) @@ -376,7 +376,7 @@ H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t init assert(f); assert(loc_out); assert(oh); - assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); + assert(true == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); /* Allocate at least a reasonable size for the object header */ size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint)); @@ -491,7 +491,7 @@ H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t init /* Initialize the initial "null" message; covers the entire first chunk */ oh->mesg[0].type = H5O_MSG_NULL; - oh->mesg[0].dirty = TRUE; + oh->mesg[0].dirty = true; oh->mesg[0].native = NULL; oh->mesg[0].raw = oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh); @@ -556,7 +556,7 @@ H5O_open(H5O_loc_t *loc) /* Turn off the variable for holding file or increment open-lock counters */ if (loc->holding_file) - loc->holding_file = FALSE; + loc->holding_file = false; else H5F_INCR_NOPEN_OBJS(loc->file); @@ -579,7 +579,7 @@ H5O_open_name(const H5G_loc_t *loc, const char *name, H5I_type_t *opened_type) H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ + bool loc_found = false; /* Entry at 'name' found */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -596,7 +596,7 @@ H5O_open_name(const H5G_loc_t *loc, const char *name, H5I_type_t *opened_type) /* Find the object's location */ if (H5G_loc_find(loc, name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, NULL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Open the object */ if (NULL == (ret_value = H5O_open_by_loc(&obj_loc, opened_type))) @@ -627,7 +627,7 @@ H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5 H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ + bool loc_found = false; /* Entry at 'name' found */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -643,7 +643,7 @@ H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5 /* Find the object's location, according to the order in the index */ if (H5G_loc_find_by_idx(loc, name, idx_type, order, n, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, NULL, "group not found"); - loc_found = TRUE; + loc_found = true; /* Open the object */ if (NULL == (ret_value = H5O_open_by_loc(&obj_loc, opened_type))) @@ -740,7 +740,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) +H5O_close(H5O_loc_t *loc, bool *file_closed /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ @@ -758,14 +758,14 @@ H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) * this value by passing in NULL. */ if (file_closed) - *file_closed = FALSE; + *file_closed = false; /* Decrement open-lock counters */ H5F_DECR_NOPEN_OBJS(loc->file); #ifdef H5O_DEBUG if (H5DEBUG(O)) { - if (FALSE == H5F_ID_EXISTS(loc->file) && 1 == H5F_NREFS(loc->file)) + if (false == H5F_ID_EXISTS(loc->file) && 1 == H5F_NREFS(loc->file)) fprintf(H5DEBUG(O), "< %" PRIuHADDR " auto %lu remaining\n", loc->addr, (unsigned long)H5F_NOPEN_OBJS(loc->file)); else @@ -803,7 +803,7 @@ done: *------------------------------------------------------------------------- */ int -H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) +H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, bool *deleted) { haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ int ret_value = -1; /* Return value */ @@ -834,12 +834,12 @@ H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) /* Check if the object is still open by the user */ if (H5FO_opened(f, addr) != NULL) { /* Flag the object to be deleted when it's closed */ - if (H5FO_mark(f, addr, TRUE) < 0) + if (H5FO_mark(f, addr, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, (-1), "can't mark object for deletion"); } /* end if */ else { /* Mark the object header for deletion */ - *deleted = TRUE; + *deleted = true; } /* end else */ } /* end if */ } /* end if */ @@ -849,7 +849,7 @@ H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) /* Check if the object is currently open, but marked for deletion */ if (H5FO_marked(f, addr)) { /* Remove "delete me" flag on the object */ - if (H5FO_mark(f, addr, FALSE) < 0) + if (H5FO_mark(f, addr, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, (-1), "can't mark object for deletion"); } /* end if */ } /* end if */ @@ -868,9 +868,9 @@ H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) if (oh->has_refcount_msg) { /* Check for removing refcount message */ if (oh->nlink <= 1) { - if (H5O__msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE) < 0) + if (H5O__msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, (-1), "unable to delete refcount message"); - oh->has_refcount_msg = FALSE; + oh->has_refcount_msg = false; } /* end if */ /* Update refcount message with new link count */ else { @@ -889,7 +889,7 @@ H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) if (H5O__msg_append_real(f, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, (-1), "unable to create new refcount message"); - oh->has_refcount_msg = TRUE; + oh->has_refcount_msg = true; } /* end if */ } /* end else */ } /* end if */ @@ -917,9 +917,9 @@ done: int H5O_link(const H5O_loc_t *loc, int adjust) { - H5O_t *oh = NULL; - hbool_t deleted = FALSE; /* Whether the object was deleted */ - int ret_value = -1; /* Return value */ + H5O_t *oh = NULL; + bool deleted = false; /* Whether the object was deleted */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) @@ -959,7 +959,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) +H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, bool pin_all_chunks) { H5O_t *oh = NULL; /* Object header protected */ H5O_cache_ud_t udata; /* User data for protecting object header */ @@ -986,11 +986,11 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "no write intent on file"); /* Construct the user data for protect callback */ - udata.made_attempt = FALSE; + udata.made_attempt = false; udata.v1_pfx_nmesgs = 0; udata.chunk0_size = 0; udata.oh = NULL; - udata.free_oh = FALSE; + udata.free_oh = false; udata.common.f = loc->file; udata.common.file_intent = file_intent; udata.common.merged_null_msgs = 0; @@ -1010,11 +1010,11 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) /* Sanity check - we should only have continuation messages to process * when the object header is actually loaded from the file. */ - assert(udata.made_attempt == TRUE); + assert(udata.made_attempt == true); assert(cont_msg_info.msgs); /* Construct the user data for protecting chunks */ - chk_udata.decoding = TRUE; + chk_udata.decoding = true; chk_udata.oh = oh; chk_udata.chunkno = UINT_MAX; /* Set to invalid value, for better error detection */ chk_udata.common.f = loc->file; @@ -1107,7 +1107,7 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header chunk"); /* Unprotect chunk */ - if (H5O__chunk_unprotect(loc->file, chk_proxy, FALSE) < 0) + if (H5O__chunk_unprotect(loc->file, chk_proxy, false) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk"); /* Preserve chunk proxy pointer for later */ @@ -1115,7 +1115,7 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) } /* end for */ /* Set the flag for the unprotect */ - oh->chunks_pinned = TRUE; + oh->chunks_pinned = true; } /* end if */ /* Set return value */ @@ -1159,7 +1159,7 @@ H5O_pin(const H5O_loc_t *loc) assert(loc); /* Get header */ - if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header"); /* Increment the reference count on the object header */ @@ -1249,7 +1249,7 @@ H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags) } /* end for */ /* Reet the flag from the unprotect */ - oh->chunks_pinned = FALSE; + oh->chunks_pinned = false; } /* end if */ /* Unprotect the object header */ @@ -1272,10 +1272,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) +H5O_touch_oh(H5F_t *f, H5O_t *oh, bool force) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + bool chk_dirtied = false; /* Flag for unprotecting chunk */ time_t now; /* Current time */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1330,8 +1330,8 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) *((time_t *)(oh->mesg[idx].native)) = now; /* Mark the message as dirty */ - oh->mesg[idx].dirty = TRUE; - chk_dirtied = TRUE; + oh->mesg[idx].dirty = true; + chk_dirtied = true; } /* end if */ else { /* XXX: For now, update access time & change fields in the object header @@ -1366,7 +1366,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch(const H5O_loc_t *loc, hbool_t force) +H5O_touch(const H5O_loc_t *loc, bool force) { H5O_t *oh = NULL; /* Object header to modify */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ @@ -1378,7 +1378,7 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force) assert(loc); /* Get the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Create/Update the modification time message */ @@ -1452,8 +1452,8 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) oh->mesg[idx].flags = mesg_flags; /* Mark the message and object header as dirty */ - oh->mesg[idx].dirty = TRUE; - oh->cache_info.is_dirty = TRUE; + oh->mesg[idx].dirty = true; + oh->cache_info.is_dirty = true; } /* end if */ done: @@ -1479,7 +1479,7 @@ H5O_delete(H5F_t *f, haddr_t addr) H5O_t *oh = NULL; /* Object header information */ H5O_loc_t loc; /* Object location for object to delete */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ - hbool_t corked; + bool corked; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(addr, FAIL) @@ -1491,10 +1491,10 @@ H5O_delete(H5F_t *f, haddr_t addr) /* Set up the object location */ loc.file = f; loc.addr = addr; - loc.holding_file = FALSE; + loc.holding_file = false; /* Get the object header information */ - if (NULL == (oh = H5O_protect(&loc, H5AC__NO_FLAGS_SET, FALSE))) + if (NULL == (oh = H5O_protect(&loc, H5AC__NO_FLAGS_SET, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Delete object */ @@ -1577,7 +1577,7 @@ H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type) FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* 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 load object header"); /* Retrieve the type of the object */ @@ -1646,7 +1646,7 @@ H5O__obj_class(const H5O_loc_t *loc) FUNC_ENTER_PACKAGE_TAG(loc->addr) /* 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, NULL, "unable to load object header"); /* Test whether entry qualifies as a particular type of object */ @@ -1899,7 +1899,7 @@ H5O_loc_hold_file(H5O_loc_t *loc) /* If this location is not already holding its file open, do so. */ if (!loc->holding_file) { H5F_INCR_NOPEN_OBJS(loc->file); - loc->holding_file = TRUE; + loc->holding_file = true; } FUNC_LEAVE_NOAPI(SUCCEED) @@ -1930,7 +1930,7 @@ H5O_loc_free(H5O_loc_t *loc) /* If this location is holding its file open try to close the file. */ if (loc->holding_file) { H5F_DECR_NOPEN_OBJS(loc->file); - loc->holding_file = FALSE; + loc->holding_file = false; if (H5F_NOPEN_OBJS(loc->file) <= 0) { if (H5F_try_close(loc->file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file"); @@ -1967,7 +1967,7 @@ H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr) memset(hdr, 0, sizeof(*hdr)); /* 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_CANTLOAD, FAIL, "unable to load object header"); /* Get the information for the object header */ @@ -2082,7 +2082,7 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info2_t *oinfo, unsigned fields) assert(oinfo); /* 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 load object header"); /* Get class for object */ @@ -2188,7 +2188,7 @@ H5O_get_native_info(const H5O_loc_t *loc, H5O_native_info_t *oinfo, unsigned fie assert(oinfo); /* 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 load object header"); /* Get class for object */ @@ -2246,7 +2246,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, H5P_genplist_t *oc_plist) assert(oc_plist); /* 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 load object header"); /* Set property values, if they were used for the object */ @@ -2301,7 +2301,7 @@ H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks) assert(nlinks); /* 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 load object header"); /* Retrieve the # of link messages seen when the object header was loaded */ @@ -2450,7 +2450,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, unsigned *rc, H5O_type_t *otype) assert(loc); /* 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 load object header"); /* Set the object's reference count */ @@ -2505,7 +2505,7 @@ H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t *l H5G_loc_t obj_loc; /* Location of object */ H5G_name_t obj_path; /* Object's group hier. path */ H5O_loc_t obj_oloc; /* Object's object location */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ + bool obj_found = false; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -2528,7 +2528,7 @@ H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t *l /* (Correctly handles mounted files) */ if (H5G_loc_find(udata->start_loc, name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found"); - obj_found = TRUE; + obj_found = true; /* Construct unique "position" for this object */ H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); @@ -2615,7 +2615,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or H5G_loc_t obj_loc; /* Location used to open object */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ + bool loc_found = false; /* Entry at 'name' found */ H5O_info2_t oinfo; /* Object info struct */ void *obj = NULL; /* Object */ H5I_type_t opened_type; /* ID type of object */ @@ -2638,7 +2638,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or /* Find the object's location */ if (H5G_loc_find(loc, obj_name, &obj_loc /*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found"); - loc_found = TRUE; + loc_found = true; /* Get the object's info */ if (H5O_get_info(&obj_oloc, &oinfo, fields) < 0) @@ -2650,7 +2650,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object"); /* Get an ID for the visited object */ - if ((obj_id = H5VL_wrap_register(opened_type, obj, TRUE)) < 0) + if ((obj_id = H5VL_wrap_register(opened_type, obj, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register visited object"); /* Make callback for starting object */ @@ -2812,7 +2812,7 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc) assert(loc); /* Get 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"); /* Decrement the reference count on the object header */ @@ -2858,7 +2858,7 @@ H5O_get_proxy(const H5O_t *oh) *------------------------------------------------------------------------- */ herr_t -H5O__free(H5O_t *oh, hbool_t H5_ATTR_NDEBUG_UNUSED force) +H5O__free(H5O_t *oh, bool H5_ATTR_NDEBUG_UNUSED force) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index f725b5c..a61c14a 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -31,15 +31,15 @@ /* PRIVATE PROTOTYPES */ static void *H5O__layout_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__layout_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__layout_copy(const void *_mesg, void *_dest); -static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__layout_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__layout_reset(void *_mesg); static herr_t H5O__layout_free(void *_mesg); static herr_t H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static herr_t H5O__layout_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__layout_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, +static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__layout_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -543,7 +543,7 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU mesg->storage.u.virt.printf_gap = HSIZE_UNDEF; mesg->storage.u.virt.source_fapl = -1; mesg->storage.u.virt.source_dapl = -1; - mesg->storage.u.virt.init = FALSE; + mesg->storage.u.virt.init = false; /* Decode heap block if it exists */ if (mesg->storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF) { @@ -793,7 +793,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__layout_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *)_mesg; unsigned u; @@ -993,7 +993,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) case H5D_CHUNKED: /* Reset the pointer of the chunked storage index but not the address */ if (dest->storage.u.chunk.ops) - H5D_chunk_idx_reset(&dest->storage.u.chunk, FALSE); + H5D_chunk_idx_reset(&dest->storage.u.chunk, false); break; case H5D_VIRTUAL: @@ -1032,7 +1032,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__layout_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *)_mesg; size_t ret_value = 0; /* Return value */ @@ -1045,7 +1045,7 @@ H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const vo /* Compute serialized size */ /* (including possibly compact data) */ - ret_value = H5D__layout_meta_size(f, mesg, TRUE); + ret_value = H5D__layout_meta_size(f, mesg, true); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__layout_size() */ @@ -1180,9 +1180,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, - hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, - void H5_ATTR_UNUSED *udata) +H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, + const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1214,14 +1213,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void *_udata) +H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, bool H5_ATTR_UNUSED *recompute_size, + unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void *_udata) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *)mesg_src; H5O_layout_t *layout_dst = NULL; - hbool_t copied = FALSE; /* Whether the data was copied */ + bool copied = false; /* Whether the data was copied */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1243,7 +1241,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, if (H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage"); - copied = TRUE; + copied = true; } /* end if */ break; @@ -1263,7 +1261,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, if (H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage"); - copied = TRUE; + copied = true; } /* end if */ break; @@ -1276,7 +1274,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage"); - copied = TRUE; + copied = true; } /* end if */ break; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 507f39c..9d26483 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -33,13 +33,13 @@ /* PRIVATE PROTOTYPES */ static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__linfo_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__linfo_copy(const void *_mesg, void *_dest); -static size_t H5O__linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__linfo_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__linfo_free(void *_mesg); static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static void *H5O__linfo_copy_file(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); +static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, bool *recompute_size, + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); @@ -128,8 +128,8 @@ H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS index_flags = *p++; if (index_flags & ~H5O_LINFO_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message"); - linfo->track_corder = (index_flags & H5O_LINFO_TRACK_CORDER) ? TRUE : FALSE; - linfo->index_corder = (index_flags & H5O_LINFO_INDEX_CORDER) ? TRUE : FALSE; + linfo->track_corder = (index_flags & H5O_LINFO_TRACK_CORDER) ? true : false; + linfo->index_corder = (index_flags & H5O_LINFO_INDEX_CORDER) ? true : false; /* Set the number of links in the group to an invalid value, so we query it later */ linfo->nlinks = HSIZET_MAX; @@ -183,7 +183,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__linfo_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; unsigned char index_flags; /* Flags for encoding link index info */ @@ -270,7 +270,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__linfo_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; size_t ret_value = 0; /* Return value */ @@ -334,7 +334,7 @@ H5O__linfo_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) /* If the group is using "dense" link storage, delete it */ if (H5_addr_defined(linfo->fheap_addr)) - if (H5G__dense_delete(f, linfo, TRUE) < 0) + if (H5G__dense_delete(f, linfo, true) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense link storage"); done: @@ -354,7 +354,7 @@ done: */ static void * H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + bool H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void *_udata) { H5O_linfo_t *linfo_src = (H5O_linfo_t *)native_src; @@ -422,7 +422,7 @@ H5O__linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) { H5O_linfo_postcopy_ud_t *udata = (H5O_linfo_postcopy_ud_t *)_udata; /* 'User data' passed in */ H5O_link_t dst_lnk; /* Destination link to insert */ - hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ + bool dst_lnk_init = false; /* Whether the destination link is initialized */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE @@ -434,7 +434,7 @@ H5O__linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) /* Copy the link (and the object it points to) */ if (H5L__link_copy_file(udata->dst_oloc->file, src_lnk, udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy link"); - dst_lnk_init = TRUE; + dst_lnk_init = true; /* Set metadata tag in API context */ H5_BEGIN_TAG(H5AC__COPIED_TAG) diff --git a/src/H5Olink.c b/src/H5Olink.c index 88611ec..9e65f7d 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -35,14 +35,14 @@ /* PRIVATE PROTOTYPES */ static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__link_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__link_copy(const void *_mesg, void *_dest); -static size_t H5O__link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__link_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__link_reset(void *_mesg); static herr_t H5O__link_free(void *_mesg); -static herr_t H5O__link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__link_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, +static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); @@ -150,11 +150,11 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE if (H5_IS_BUFFER_OVERFLOW(p, 8, p_end)) HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); INT64DECODE(p, lnk->corder); - lnk->corder_valid = TRUE; + lnk->corder_valid = true; } else { lnk->corder = 0; - lnk->corder_valid = FALSE; + lnk->corder_valid = false; } /* Check for non-default name character set */ @@ -289,7 +289,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__link_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; uint64_t len; /* Length of a string in the message */ @@ -473,7 +473,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__link_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; uint64_t name_len; /* Length of name */ @@ -663,8 +663,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) +H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, bool *deleted, + const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_PACKAGE_NOERR @@ -678,7 +678,7 @@ H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE * on it. */ if (cpy_info->max_depth >= 0 && cpy_info->curr_depth >= cpy_info->max_depth) - *deleted = TRUE; + *deleted = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__link_pre_copy_file() */ @@ -696,7 +696,7 @@ H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE */ static void * H5O__link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, + bool H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_link_t *link_src = (H5O_link_t *)native_src; 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 */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 1474c66..6a45dcd 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -24,14 +24,14 @@ static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O__mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__mtime_new_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__mtime_new_size(const H5F_t *f, bool disable_shared, const void *_mesg); static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__mtime_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mtime_copy(const void *_mesg, void *_dest); -static size_t H5O__mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__mtime_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__mtime_free(void *_mesg); static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -221,7 +221,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, +H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *)_mesg; @@ -257,8 +257,7 @@ H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh *------------------------------------------------------------------------- */ static herr_t -H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, - const void *_mesg) +H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *)_mesg; struct tm *tm; @@ -329,7 +328,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_PACKAGE_NOERR @@ -356,7 +355,7 @@ H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disabl *------------------------------------------------------------------------- */ static size_t -H5O__mtime_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mtime_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Oname.c b/src/H5Oname.c index 727b603..2184287 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -29,9 +29,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__name_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__name_copy(const void *_mesg, void *_dest); -static size_t H5O__name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__name_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__name_reset(void *_mesg); static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -110,8 +110,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, - const void *_mesg) +H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; @@ -186,7 +185,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; size_t ret_value = 0; /* Return value */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index ee7104e..feca86f 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -173,7 +173,7 @@ \ /* Mark the message dirty if it was changed by decoding */ \ if ((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \ - (MSG)->dirty = TRUE; \ + (MSG)->dirty = true; \ /* Increment the count of messages dirtied by decoding, but */ \ /* only ifndef NDEBUG */ \ INCR_NDECODE_DIRTIED(OH) \ @@ -211,18 +211,18 @@ struct H5O_msg_class_t { size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ void *(*decode)(H5F_t *, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *); - herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *); - void *(*copy)(const void *, void *); /*copy native value */ - size_t (*raw_size)(const H5F_t *, hbool_t, const void *); /*sizeof encoded message */ - herr_t (*reset)(void *); /*free nested data structs */ - herr_t (*free)(void *); /*free main data struct */ + herr_t (*encode)(H5F_t *, bool, uint8_t *, const void *); + void *(*copy)(const void *, void *); /*copy native value */ + size_t (*raw_size)(const H5F_t *, bool, const void *); /*sizeof encoded message */ + herr_t (*reset)(void *); /*free nested data structs */ + herr_t (*free)(void *); /*free main data struct */ herr_t (*del)(H5F_t *, H5O_t *, void *); /* Delete space in file referenced by this message */ herr_t (*link)(H5F_t *, H5O_t *, void *); /* Increment any links in file reference by this message */ herr_t (*set_share)(void *, const H5O_shared_t *); /* Set shared information */ htri_t (*can_share)(const void *); /* Is message allowed to be shared? */ - herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, + herr_t (*pre_copy_file)(H5F_t *, const void *, bool *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */ - void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, + void *(*copy_file)(H5F_t *, void *, H5F_t *, bool *, unsigned *, H5O_copy_t *, void *); /*copy native value to file */ herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, H5O_copy_t *); /*"post copy" action when copying native value to file */ @@ -233,7 +233,7 @@ struct H5O_msg_class_t { struct H5O_mesg_t { const H5O_msg_class_t *type; /* type of message */ - hbool_t dirty; /* raw out of date wrt native */ + bool dirty; /* raw out of date wrt native */ uint8_t flags; /* message flags */ H5O_msg_crt_idx_t crt_idx; /* message creation index */ unsigned chunkno; /* chunk number for this mesg */ @@ -266,17 +266,17 @@ struct H5O_t { /* first field in structure */ /* File-specific information (not stored) */ - size_t sizeof_size; /* Size of file sizes */ - size_t sizeof_addr; /* Size of file addresses */ - hbool_t swmr_write; /* Whether we are doing SWMR writes */ + size_t sizeof_size; /* Size of file sizes */ + size_t sizeof_addr; /* Size of file addresses */ + bool swmr_write; /* Whether we are doing SWMR writes */ /* Debugging information (not stored) */ #ifdef H5O_ENABLE_BAD_MESG_COUNT - hbool_t store_bad_mesg_count; /* Flag to indicate that a bad message count should be stored */ - /* (This is to simulate a bug in earlier - * versions of the library) - */ -#endif /* H5O_ENABLE_BAD_MESG_COUNT */ + bool store_bad_mesg_count; /* Flag to indicate that a bad message count should be stored */ + /* (This is to simulate a bug in earlier + * versions of the library) + */ +#endif /* H5O_ENABLE_BAD_MESG_COUNT */ #ifndef NDEBUG size_t ndecode_dirtied; /* Number of messages dirtied by decoding */ #endif /* NDEBUG */ @@ -285,7 +285,7 @@ struct H5O_t { size_t rc; /* Reference count of [continuation] chunks using this structure */ /* Object information (stored) */ - hbool_t has_refcount_msg; /* Whether the object has a ref. count message */ + bool has_refcount_msg; /* Whether the object has a ref. count message */ unsigned nlink; /*link count */ uint8_t version; /*version number */ uint8_t flags; /*flags */ @@ -311,7 +311,7 @@ struct H5O_t { size_t nchunks; /*number of chunks */ size_t alloc_nchunks; /*chunks allocated */ H5O_chunk_t *chunk; /*array of chunks */ - hbool_t chunks_pinned; /* Whether chunks are pinned from ohdr protect */ + bool chunks_pinned; /* Whether chunks are pinned from ohdr protect */ /* Object header proxy information (not stored) */ H5AC_proxy_entry_t *proxy; /* Proxy cache entry for all ohdr entries */ @@ -336,7 +336,7 @@ typedef struct H5O_obj_class_t { typedef struct H5O_addr_map_t { H5_obj_t src_obj_pos; /* Location of source object */ haddr_t dst_addr; /* Address of object in destination file */ - hbool_t is_locked; /* Indicate that the destination object is locked currently */ + bool is_locked; /* Indicate that the destination object is locked currently */ hsize_t inc_ref_count; /* Number of deferred increments to reference count */ const H5O_obj_class_t *obj_class; /* Object class */ void *udata; /* Object class copy file udata */ @@ -360,11 +360,11 @@ typedef struct H5O_common_cache_ud_t { /* Callback information for loading object header prefix from disk */ typedef struct H5O_cache_ud_t { - hbool_t made_attempt; /* Whether the deserialize routine was already attempted */ + bool made_attempt; /* Whether the deserialize routine was already attempted */ unsigned v1_pfx_nmesgs; /* Number of messages from v1 prefix header */ size_t chunk0_size; /* Size of serialized first chunk */ H5O_t *oh; /* Partially deserialized object header, for later use */ - hbool_t free_oh; /* Whether to free the object header or not */ + bool free_oh; /* Whether to free the object header or not */ H5O_common_cache_ud_t common; /* Common object header cache callback info */ } H5O_cache_ud_t; @@ -393,7 +393,7 @@ typedef struct H5O_chunk_proxy_t { /* Callback information for loading object header chunk from disk */ typedef struct H5O_chk_cache_ud_t { - hbool_t decoding; /* Whether the object header is being decoded */ + bool decoding; /* Whether the object header is being decoded */ H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Index of chunk being brought in (for re-loads) */ size_t size; /* Size of chunk in the file */ @@ -545,12 +545,12 @@ H5_DLL void *H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc); H5_DLL herr_t H5O__copy(const H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); -H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted); +H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, bool *deleted); H5_DLL herr_t H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields); H5_DLL herr_t H5O__inc_rc(H5O_t *oh); H5_DLL herr_t H5O__dec_rc(H5O_t *oh); -H5_DLL herr_t H5O__free(H5O_t *oh, hbool_t force); +H5_DLL herr_t H5O__free(H5O_t *oh, bool force); /* Object header message routines */ H5_DLL herr_t H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_flags, @@ -562,9 +562,9 @@ H5_DLL herr_t H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t * H5_DLL herr_t H5O__msg_free_mesg(H5O_mesg_t *mesg); H5_DLL unsigned H5O__msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type); H5_DLL herr_t H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, int sequence, - H5O_operator_t op, void *op_data, hbool_t adj_link); + H5O_operator_t op, void *op_data, bool adj_link); H5_DLL void *H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); H5_DLL herr_t H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const H5O_mesg_operator_t *op, void *op_data); @@ -574,7 +574,7 @@ H5_DLL herr_t H5O__delete_mesg(H5F_t *f, H5O_t *open_oh, H5O_mesg_t *mesg); /* Object header chunk routines */ H5_DLL herr_t H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno); H5_DLL H5O_chunk_proxy_t *H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx); -H5_DLL herr_t H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied); +H5_DLL herr_t H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, bool chk_dirtied); H5_DLL herr_t H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O__chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy); H5_DLL herr_t H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx); @@ -583,7 +583,7 @@ H5_DLL herr_t H5O__chunk_dest(H5O_chunk_proxy_t *chunk_proxy); /* Cache corking functions */ H5_DLL herr_t H5O__disable_mdc_flushes(H5O_loc_t *oloc); H5_DLL herr_t H5O__enable_mdc_flushes(H5O_loc_t *oloc); -H5_DLL herr_t H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled); +H5_DLL herr_t H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, bool *are_disabled); /* Collect storage info for btree and heap */ H5_DLL herr_t H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info); @@ -595,7 +595,7 @@ H5_DLL herr_t H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_nu H5_DLL herr_t H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx); H5_DLL herr_t H5O__condense_header(H5F_t *f, H5O_t *oh); -H5_DLL herr_t H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link); +H5_DLL herr_t H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, bool adj_link); /* Shared object operators */ H5_DLL void *H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, @@ -607,7 +607,7 @@ H5_DLL herr_t H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t H5_DLL herr_t H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); H5_DLL herr_t H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, - const void *_native_src, void *_native_dst, hbool_t *recompute_size, + const void *_native_src, void *_native_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); H5_DLL herr_t H5O__shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, @@ -635,7 +635,7 @@ H5_DLL htri_t H5O__is_attr_empty_test(hid_t oid); H5_DLL htri_t H5O__is_attr_dense_test(hid_t oid); H5_DLL herr_t H5O__num_attrs_test(hid_t oid, hsize_t *nattrs); H5_DLL herr_t H5O__attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count); -H5_DLL herr_t H5O__check_msg_marked_test(hid_t oid, hbool_t flag_val); +H5_DLL herr_t H5O__check_msg_marked_test(hid_t oid, bool flag_val); H5_DLL herr_t H5O__expunge_chunks_test(const H5O_loc_t *oloc); H5_DLL herr_t H5O__get_rc_test(const H5O_loc_t *oloc, unsigned *rc); H5_DLL herr_t H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num); diff --git a/src/H5Opline.c b/src/H5Opline.c index 16dda50..1f6db59 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -33,7 +33,7 @@ static void *H5O__pline_copy(const void *_mesg, void *_dest); static size_t H5O__pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O__pline_reset(void *_mesg); static herr_t H5O__pline_free(void *_mesg); -static herr_t H5O__pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -585,8 +585,8 @@ H5O__pline_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, - hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) +H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, + const H5O_copy_t *cpy_info, void *_udata) { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 2d05e54..cdf4d6c 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -58,7 +58,7 @@ typedef struct H5O_mesg_t H5O_mesg_t; #define H5O_FHEAP_MAN_MAX_DIRECT_SIZE (64 * 1024) #define H5O_FHEAP_MAN_MAX_INDEX 40 #define H5O_FHEAP_MAN_START_ROOT_ROWS 1 -#define H5O_FHEAP_CHECKSUM_DBLOCKS TRUE +#define H5O_FHEAP_CHECKSUM_DBLOCKS true #define H5O_FHEAP_MAX_MAN_SIZE (4 * 1024) #define H5O_FHEAP_ID_LEN 8 @@ -113,7 +113,7 @@ typedef struct H5O_mesg_t H5O_mesg_t; #ifdef H5O_ENABLE_BAD_MESG_COUNT #define H5O_BAD_MESG_COUNT_NAME "bad message count" /* Flag setting bad message count */ -#define H5O_BAD_MESG_COUNT_SIZE sizeof(hbool_t) +#define H5O_BAD_MESG_COUNT_SIZE sizeof(bool) #endif /* H5O_ENABLE_BAD_MESG_COUNT */ /* ========= Object Copy properties ============ */ @@ -157,7 +157,7 @@ typedef union { typedef struct H5O_loc_t { H5F_t *file; /* File that object header is located within */ haddr_t addr; /* File address of object header */ - hbool_t holding_file; /* True if this object header has incremented + bool holding_file; /* True if this object header has incremented * its file's count of open objects. */ } H5O_loc_t; @@ -175,20 +175,20 @@ typedef struct H5O_mcdt_cb_info_t { /* Settings/flags for copying an object */ typedef struct H5O_copy_t { - hbool_t copy_shallow; /* Flag to perform shallow hierarchy copy */ - hbool_t expand_soft_link; /* Flag to expand soft links */ - hbool_t expand_ext_link; /* Flag to expand external links */ - hbool_t expand_ref; /* Flag to expand object references */ - hbool_t copy_without_attr; /* Flag to not copy attributes */ - hbool_t preserve_null; /* Flag to not delete NULL messages */ - hbool_t merge_comm_dt; /* Flag to merge committed datatypes in dest file */ + bool copy_shallow; /* Flag to perform shallow hierarchy copy */ + bool expand_soft_link; /* Flag to expand soft links */ + bool expand_ext_link; /* Flag to expand external links */ + bool expand_ref; /* Flag to expand object references */ + bool copy_without_attr; /* Flag to not copy attributes */ + bool preserve_null; /* Flag to not delete NULL messages */ + bool merge_comm_dt; /* Flag to merge committed datatypes in dest file */ H5O_copy_dtype_merge_list_t *dst_dt_suggestion_list; /* Suggestions for merging committed datatypes */ int curr_depth; /* Current depth in hierarchy copied */ int max_depth; /* Maximum depth in hierarchy to copy */ H5SL_t *map_list; /* Skip list to hold address mappings */ H5SL_t *dst_dt_list; /* Skip list to hold committed datatypes in dest file */ - hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only - populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ + bool dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only + populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ H5O_t *oh_dst; /* The destination object header */ H5F_t *file_dst; /* The destination file pointer */ /* This is used in the pre_copy_file callback to obtain @@ -252,7 +252,7 @@ typedef struct H5O_copy_t { /* Detect messages that aren't stored in message's object header */ #define H5O_IS_STORED_SHARED(T) \ - ((((T) == H5O_SHARE_TYPE_SOHM) || ((T) == H5O_SHARE_TYPE_COMMITTED)) ? TRUE : FALSE) + ((((T) == H5O_SHARE_TYPE_SOHM) || ((T) == H5O_SHARE_TYPE_COMMITTED)) ? true : false) /* Detect shared messages that are "tracked" in some other location */ #define H5O_IS_TRACKED_SHARED(T) ((T) > 0) @@ -295,8 +295,8 @@ typedef struct H5O_shared_t { */ typedef struct H5O_linfo_t { /* Creation order info */ - hbool_t track_corder; /* Are creation order values tracked on links? */ - hbool_t index_corder; /* Are creation order values indexed on links? */ + bool track_corder; /* Are creation order values tracked on links? */ + bool index_corder; /* Are creation order values indexed on links? */ int64_t max_corder; /* Current max. creation order value for group */ haddr_t corder_bt2_addr; /* Address of v2 B-tree for indexing creation order values of links */ @@ -336,7 +336,7 @@ struct H5O_fill_t { void *buf; /*the fill value */ H5D_alloc_time_t alloc_time; /* time to allocate space */ H5D_fill_time_t fill_time; /* time to write fill value */ - hbool_t fill_defined; /* whether fill value is defined */ + bool fill_defined; /* whether fill value is defined */ }; /* @@ -358,7 +358,7 @@ typedef struct H5O_link_ud_t { typedef struct H5O_link_t { H5L_type_t type; /* Type of link */ - hbool_t corder_valid; /* Creation order for link is valid (not stored) */ + bool corder_valid; /* Creation order for link is valid (not stored) */ int64_t corder; /* Creation order for link (stored if it's valid) */ H5T_cset_t cset; /* Character set of link name */ char *name; /* Link name */ @@ -492,9 +492,9 @@ typedef struct H5O_storage_chunk_t { } H5O_storage_chunk_t; typedef struct H5O_storage_compact_t { - hbool_t dirty; /* Dirty flag for compact dataset */ - size_t size; /* Size of buffer in bytes */ - void *buf; /* Buffer for compact dataset */ + bool dirty; /* Dirty flag for compact dataset */ + size_t size; /* Size of buffer in bytes */ + void *buf; /* Buffer for compact dataset */ } H5O_storage_compact_t; typedef struct H5O_storage_virtual_srcdset_t { @@ -507,7 +507,7 @@ typedef struct H5O_storage_virtual_srcdset_t { struct H5S_t *clipped_source_select; /* Clipped version of source_select */ struct H5S_t *clipped_virtual_select; /* Clipped version of virtual_select */ struct H5D_t *dset; /* Source dataset */ - hbool_t dset_exists; /* Whether the dataset exists (was opened successfully) */ + bool dset_exists; /* Whether the dataset exists (was opened successfully) */ /* Temporary - only used during I/O operation, NULL at all other times */ struct H5S_t *projected_mem_space; /* Selection within mem_space for this mapping */ @@ -575,11 +575,11 @@ typedef struct H5O_storage_virtual_t { min_dims[H5S_MAX_RANK]; /* Minimum extent of VDS (maximum of all non-unlimited selection bounds) */ H5D_vds_view_t view; /* Method for calculating the extent of the virtual dataset with unlimited selections */ - hsize_t printf_gap; /* Maximum number of sequential missing source datasets before terminating the search - for more */ - hid_t source_fapl; /* FAPL to use to open source files */ - hid_t source_dapl; /* DAPL to use to open source datasets */ - hbool_t init; /* Whether all information has been completely initialized */ + hsize_t printf_gap; /* Maximum number of sequential missing source datasets before terminating the search + for more */ + hid_t source_fapl; /* FAPL to use to open source files */ + hid_t source_dapl; /* DAPL to use to open source datasets */ + bool init; /* Whether all information has been completely initialized */ } H5O_storage_virtual_t; typedef struct H5O_storage_t { @@ -686,12 +686,12 @@ typedef struct H5O_ginfo_t { /* "New" format group info (stored) */ /* (storage management info) */ - hbool_t store_link_phase_change; /* Whether to store the link phase change values */ + bool store_link_phase_change; /* Whether to store the link phase change values */ uint16_t max_compact; /* Maximum # of compact links */ uint16_t min_dense; /* Minimum # of "dense" links */ /* (initial object header size info) */ - hbool_t store_est_entry_info; /* Whether to store the est. entry values */ + bool store_est_entry_info; /* Whether to store the est. entry values */ uint16_t est_num_entries; /* Estimated # of entries in group */ uint16_t est_name_len; /* Estimated length of entry name */ } H5O_ginfo_t; @@ -797,8 +797,8 @@ typedef struct H5O_drvinfo_t { */ typedef struct H5O_ainfo_t { /* Creation order info */ - hbool_t track_corder; /* Are creation order values tracked on attributes? */ - hbool_t index_corder; /* Are creation order values indexed on attributes? */ + bool track_corder; /* Are creation order values tracked on attributes? */ + bool index_corder; /* Are creation order values indexed on attributes? */ H5O_msg_crt_idx_t max_crt_idx; /* Maximum attribute creation index used */ haddr_t corder_bt2_addr; /* Address of v2 B-tree for indexing creation order values of "dense" attributes */ @@ -841,14 +841,14 @@ typedef unsigned H5O_unknown_t; /* Original message type ID */ typedef struct H5O_fsinfo_t { unsigned version; /* Version number */ H5F_fspace_strategy_t strategy; /* File space strategy */ - hbool_t persist; /* Persisting free-space or not */ + bool persist; /* Persisting free-space or not */ hsize_t threshold; /* Free-space section threshold */ hsize_t page_size; /* For paged aggregation: file space page size */ size_t pgend_meta_thres; /* For paged aggregation: page end metadata threshold */ haddr_t eoa_pre_fsm_fsalloc; /* For paged aggregation: the eoa before free-space headers & sinfo */ haddr_t fs_addr[H5F_MEM_PAGE_NTYPES - 1]; /* 13 addresses of free-space managers */ /* For non-paged aggregation: only 6 addresses are used */ - hbool_t mapped; /* Not stored */ + bool mapped; /* Not stored */ /* Indicate the message is mapped from version 0 to version 1 */ } H5O_fsinfo_t; @@ -905,15 +905,15 @@ H5_DLL herr_t H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hin H5O_loc_t *loc_out); H5_DLL herr_t H5O_open(H5O_loc_t *loc); H5_DLL void *H5O_open_by_loc(const H5G_loc_t *obj_loc, H5I_type_t *opened_type /*out*/); -H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/); +H5_DLL herr_t H5O_close(H5O_loc_t *loc, bool *file_closed /*out*/); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust); -H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks); +H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, bool pin_all_chunks); H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc); H5_DLL herr_t H5O_unpin(H5O_t *oh); H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc); H5_DLL herr_t H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags); -H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force); -H5_DLL herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force); +H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, bool force); +H5_DLL herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, bool force); #ifdef H5O_ENABLE_BOGUS H5_DLL herr_t H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); #endif /* H5O_ENABLE_BOGUS */ @@ -952,12 +952,12 @@ H5_DLL void *H5O_msg_copy(unsigned type_id, const void *mesg, void *dst); H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id); H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id); H5_DLL htri_t H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id); -H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link); +H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, bool adj_link); H5_DLL 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); + void *op_data, bool adj_link); H5_DLL herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, const H5O_mesg_operator_t *op, void *op_data); -H5_DLL size_t H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const void *mesg); +H5_DLL size_t H5O_msg_raw_size(const H5F_t *f, unsigned type_id, bool disable_shared, const void *mesg); H5_DLL size_t H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, const void *mesg, size_t extra_raw); H5_DLL size_t H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id, const void *mesg, @@ -968,7 +968,7 @@ H5_DLL htri_t H5O_msg_can_share_in_ohdr(unsigned type_id); H5_DLL herr_t H5O_msg_set_share(unsigned type_id, const H5O_shared_t *share, void *mesg); H5_DLL herr_t H5O_msg_reset_share(unsigned type_id, void *mesg); H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt_idx); -H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, +H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, bool disable_shared, unsigned char *buf, const void *obj); H5_DLL void *H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, size_t buf_size, const unsigned char *buf); @@ -980,12 +980,11 @@ H5_DLL herr_t H5O_flush(H5O_loc_t *oloc, hid_t obj_id); H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id); H5_DLL herr_t H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid); H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *obj_loc, H5VL_t *vol_driver, - hbool_t start_swmr); + bool start_swmr); /* Object copying routines */ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, - void **udata); + H5O_copy_t *cpy_info, bool inc_depth, H5O_type_t *obj_type, void **udata); H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, const H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info); @@ -1012,7 +1011,7 @@ H5_DLL herr_t H5O_fsinfo_check_version(H5F_libver_t high, H5O_fsinfo_t *fsinfo); /* Fill value operators */ H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill); -H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed); +H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, bool *fill_changed); H5_DLL herr_t H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill); /* Link operators */ diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 4fdfcc6..f35bdd0 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -745,7 +745,7 @@ H5_DLL herr_t H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5 * hid_t lcpl_id = H5Pcreate(H5P_LINK_CREATE); * * // Sets "create missing intermediate groups" property in that LCPL. - * int status = H5Pset_create_intermediate_group(lcpl_id, TRUE); + * int status = H5Pset_create_intermediate_group(lcpl_id, true); * * // Creates a group without linking it into the file structure. * hid_t gid = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index 7c0c71f..426d2be 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -29,11 +29,11 @@ /* PRIVATE PROTOTYPES */ static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__refcount_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__refcount_copy(const void *_mesg, void *_dest); -static size_t H5O__refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__refcount_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__refcount_free(void *_mesg); -static herr_t H5O__refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *udata); static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -126,7 +126,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, +H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; @@ -195,7 +195,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__refcount_size(const H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ @@ -243,7 +243,7 @@ H5O__refcount_free(void *mesg) */ static herr_t H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, - hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, + bool *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { FUNC_ENTER_PACKAGE_NOERR @@ -255,7 +255,7 @@ H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_U /* Always delete this message when copying objects between files. Let * the copy routine set the correct ref. count. */ - *deleted = TRUE; + *deleted = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__refcount_pre_copy_file() */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index cd0d3ed..cf68a76 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -30,7 +30,7 @@ static void *H5O__sdspace_copy(const void *_mesg, void *_dest); static size_t H5O__sdspace_size(const H5F_t *f, const void *_mesg); static herr_t H5O__sdspace_reset(void *_mesg); static herr_t H5O__sdspace_free(void *_mesg); -static herr_t H5O__sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, +static herr_t H5O__sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, bool *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -328,7 +328,7 @@ H5O__sdspace_copy(const void *_mesg, void *_dest) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Copy extent information */ - if (H5S__extent_copy_real(dest, mesg, TRUE) < 0) + if (H5S__extent_copy_real(dest, mesg, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent"); /* Set return value */ @@ -439,8 +439,8 @@ H5O__sdspace_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, - hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) +H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, bool H5_ATTR_UNUSED *deleted, + const H5O_copy_t *cpy_info, void *_udata) { const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ @@ -471,7 +471,7 @@ H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, FAIL, "dataspace extent allocation failed"); /* Create a copy of the dataspace extent */ - if (H5S__extent_copy_real(udata->src_space_extent, src_space_extent, TRUE) < 0) + if (H5S__extent_copy_real(udata->src_space_extent, src_space_extent, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent"); } /* end if */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index eb4eb26..f53fae5 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -156,7 +156,7 @@ H5O__shared_read(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t /* Build the object location for the shared message's object header */ oloc.file = f; oloc.addr = shared->u.loc.oh_addr; - oloc.holding_file = FALSE; + oloc.holding_file = false; if (open_oh && oloc.addr == H5O_OH_GET_ADDR(open_oh)) { /* The shared message is in the already opened object header. This @@ -238,14 +238,14 @@ H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_ /* Build the object location for the shared message's object header */ oloc.file = f; oloc.addr = shared->u.loc.oh_addr; - oloc.holding_file = FALSE; + oloc.holding_file = false; if (open_oh && oloc.addr == H5O_OH_GET_ADDR(open_oh)) { /* The shared message is in the already opened object header. This * is possible, for example, if an attribute's datatype is shared in * the same object header the attribute is in. Adjust the link * count directly. */ - hbool_t deleted = FALSE; /* This is used only to satisfy H5O__link_oh */ + bool deleted = false; /* This is used only to satisfy H5O__link_oh */ if (H5O__link_oh(f, adjust, open_oh, &deleted) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count"); @@ -540,7 +540,7 @@ done: herr_t H5O__shared_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, + bool H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { const H5O_shared_t *shared_src = @@ -629,7 +629,7 @@ H5O__shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O dst_oloc.file = f; src_oloc.file = shared_src->file; src_oloc.addr = shared_src->u.loc.oh_addr; - if (H5O_copy_header_map(&src_oloc, &dst_oloc, cpy_info, FALSE, NULL, NULL) < 0) + if (H5O_copy_header_map(&src_oloc, &dst_oloc, cpy_info, false, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object"); /* Set up destination message's shared info */ diff --git a/src/H5Oshared.h b/src/H5Oshared.h index a9c8c85..97539ba 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -91,7 +91,7 @@ done: *------------------------------------------------------------------------- */ static inline herr_t -H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg) +H5O_SHARED_ENCODE(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg) { const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -142,7 +142,7 @@ done: *------------------------------------------------------------------------- */ static inline size_t -H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) +H5O_SHARED_SIZE(const H5F_t *f, bool disable_shared, const void *_mesg) { const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -281,7 +281,7 @@ done: *------------------------------------------------------------------------- */ static inline void * -H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size, +H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { void *dst_mesg = NULL; /* Destination message */ diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 6588097..50d6652 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -24,9 +24,9 @@ static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__shmesg_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__shmesg_copy(const void *_mesg, void *_dest); -static size_t H5O__shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__shmesg_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* This message derives from H5O message class */ @@ -113,7 +113,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__shmesg_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__shmesg_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 24504f9..a9c3dd1 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -32,12 +32,12 @@ /* PRIVATE PROTOTYPES */ static void *H5O__stab_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static herr_t H5O__stab_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg); static void *H5O__stab_copy(const void *_mesg, void *_dest); -static size_t H5O__stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static size_t H5O__stab_size(const H5F_t *f, bool disable_shared, const void *_mesg); static herr_t H5O__stab_free(void *_mesg); static herr_t H5O__stab_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static void *H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, +static void *H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, bool *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); @@ -123,7 +123,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__stab_encode(H5F_t *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_stab_t *stab = (const H5O_stab_t *)_mesg; @@ -191,7 +191,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__stab_size(const H5F_t *f, bool H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ @@ -264,9 +264,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) +H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, bool H5_ATTR_UNUSED *recompute_size, + unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { H5O_stab_t *stab_src = (H5O_stab_t *)native_src; H5O_stab_t *stab_dst = NULL; diff --git a/src/H5Otest.c b/src/H5Otest.c index c646f42..2c23f0c 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -70,7 +70,7 @@ htri_t H5O__is_attr_dense_test(oid) hid_t oid; IN: object to check RETURNS - Non-negative TRUE/FALSE on success, negative on failure + Non-negative true/false on success, negative on failure DESCRIPTION Checks to see if the object is storing attributes in the "dense" or "compact" form. @@ -86,7 +86,7 @@ H5O__is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -98,10 +98,10 @@ H5O__is_attr_dense_test(hid_t oid) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* 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 load object header"); /* Check for attribute info stored */ @@ -117,15 +117,15 @@ H5O__is_attr_dense_test(hid_t oid) /* Check for any messages in object header */ assert(H5O__msg_count_real(oh, H5O_MSG_ATTR) == 0); - ret_value = TRUE; + ret_value = true; } /* end if */ else - ret_value = FALSE; + ret_value = false; done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -140,7 +140,7 @@ done: htri_t H5O__is_attr_empty_test(oid) hid_t oid; IN: object to check RETURNS - Non-negative TRUE/FALSE on success, negative on failure + Non-negative true/false on success, negative on failure DESCRIPTION Checks to see if the object is storing any attributes. GLOBAL VARIABLES @@ -155,10 +155,10 @@ H5O__is_attr_empty_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ H5O_ainfo_t ainfo; /* Attribute information for object */ - htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ + htri_t ainfo_exists = false; /* Whether the attribute info exists in the file */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -170,10 +170,10 @@ H5O__is_attr_empty_test(hid_t oid) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* 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 load object header"); /* Check for attribute info stored */ @@ -219,7 +219,7 @@ H5O__is_attr_empty_test(hid_t oid) } /* end if */ /* Set the return value */ - ret_value = (nattrs == 0) ? TRUE : FALSE; + ret_value = (nattrs == 0) ? true : false; done: /* Release resources */ @@ -227,7 +227,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index"); if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -260,7 +260,7 @@ H5O__num_attrs_test(hid_t oid, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t obj_nattrs; /* Number of attributes */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -272,10 +272,10 @@ H5O__num_attrs_test(hid_t oid, hsize_t *nattrs) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* 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 load object header"); /* Check for attribute info stored */ @@ -324,7 +324,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index"); if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -359,7 +359,7 @@ H5O__attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -371,13 +371,13 @@ H5O__attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Set metadata tag in API context */ H5_BEGIN_TAG(loc->addr) /* 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_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Check for attribute info stored */ @@ -428,7 +428,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index"); if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -443,7 +443,7 @@ done: USAGE herr_t H5O__check_msg_marked_test(oid, flag_val) hid_t oid; IN: Object to check - hbool_t flag_val; IN: Desired flag value + bool flag_val; IN: Desired flag value RETURNS Non-negative on success, negative on failure DESCRIPTION @@ -456,7 +456,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5O__check_msg_marked_test(hid_t oid, hbool_t flag_val) +H5O__check_msg_marked_test(hid_t oid, bool flag_val) { H5O_t *oh = NULL; /* Object header */ H5O_loc_t *loc; /* Pointer to object's location */ @@ -471,7 +471,7 @@ H5O__check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found"); /* 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 load object header"); /* Locate "unknown" message */ @@ -528,7 +528,7 @@ H5O__expunge_chunks_test(const H5O_loc_t *loc) FUNC_ENTER_PACKAGE /* Get the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header"); /* Safety check */ @@ -587,7 +587,7 @@ H5O__get_rc_test(const H5O_loc_t *loc, unsigned *rc) assert(rc); /* 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"); /* Save the refcount for the object header */ @@ -629,7 +629,7 @@ H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *idx_msg; /* Pointer to message */ unsigned idx; /* Index of message */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -641,10 +641,10 @@ H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* 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 load object header"); /* Locate first message of given type */ @@ -664,7 +664,7 @@ H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) @@ -696,7 +696,7 @@ H5O__msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *curr_msg; /* Pointer to current message */ unsigned idx; /* Index of message */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + bool api_ctx_pushed = false; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -708,10 +708,10 @@ H5O__msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) /* Set API context */ if (H5CX_push() < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context"); - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Get the object header */ - if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) + if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, false))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Locate first message of given type */ @@ -775,7 +775,7 @@ H5O__msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); - if (api_ctx_pushed && H5CX_pop(FALSE) < 0) + if (api_ctx_pushed && H5CX_pop(false) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5P.c b/src/H5P.c index 8d64bfd..b9be5a2 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -101,7 +101,7 @@ H5Pcopy(hid_t id) /* Compare property lists */ if (H5I_GENPROP_LST == H5I_get_type(id)) { - if ((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, TRUE)) < 0) + if ((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property list"); } /* end if */ /* Must be property classes */ @@ -113,7 +113,7 @@ H5Pcopy(hid_t id) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property class"); /* Get an ID for the copied class */ - if ((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) { + if ((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, true)) < 0) { H5P__close_class(copy_class); HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class"); @@ -192,7 +192,7 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list class"); /* Get an ID for the class */ - if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class"); done: @@ -238,7 +238,7 @@ H5Pcreate(hid_t cls_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list class"); /* Create the new property list */ - if ((ret_value = H5P_create_id(pclass, TRUE)) < 0) + if ((ret_value = H5P_create_id(pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list"); done: @@ -829,11 +829,11 @@ H5Pencode2(hid_t plist_id, void *buf, size_t *nalloc, hid_t fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Call the internal encode routine */ - if ((ret_value = H5P__encode(plist, TRUE, buf, nalloc)) < 0) + if ((ret_value = H5P__encode(plist, true, buf, nalloc)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to encode property list"); done: @@ -922,7 +922,7 @@ H5Pget_class(hid_t plist_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count"); /* Get an ID for the class */ - if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class"); done: @@ -980,7 +980,7 @@ H5Pget_nprops(hid_t id, size_t *nprops /*out*/) else if (H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); - if (H5P_get_nprops_pclass(pclass, nprops, FALSE) < 0) + if (H5P_get_nprops_pclass(pclass, nprops, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in pclass"); } /* end if */ else @@ -1000,7 +1000,7 @@ done: hid_t id1; IN: Property list or class ID to compare hid_t id2; IN: Property list or class ID to compare RETURNS - Success: TRUE if equal, FALSE if unequal + Success: true if equal, false if unequal Failure: negative DESCRIPTION Determines whether two property lists or two property classes are equal. @@ -1014,7 +1014,7 @@ htri_t H5Pequal(hid_t id1, hid_t id2) { void *obj1, *obj2; /* Property objects to compare */ - htri_t ret_value = FALSE; /* return value */ + htri_t ret_value = false; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", id1, id2); @@ -1036,12 +1036,12 @@ H5Pequal(hid_t id1, hid_t id2) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, FAIL, "can't compare property lists"); /* Set return value */ - ret_value = cmp_ret == 0 ? TRUE : FALSE; + ret_value = cmp_ret == 0 ? true : false; } /* end if */ /* Must be property classes */ else { if (H5P__cmp_class((const H5P_genclass_t *)obj1, (const H5P_genclass_t *)obj2) == 0) - ret_value = TRUE; + ret_value = true; } /* end else */ done: @@ -1058,7 +1058,7 @@ done: hid_t plist_id; IN: Property list to query hid_t pclass_id; IN: Property class to query RETURNS - Success: TRUE (1) or FALSE (0) + Success: true (1) or false (0) Failure: negative DESCRIPTION This routine queries whether a property list is a member of the property @@ -1211,7 +1211,7 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) if (H5I_GENPROP_LST == H5I_get_type(id)) { /* Iterate over a property list */ - if ((ret_value = H5P__iterate_plist((H5P_genplist_t *)obj, TRUE, (idx ? idx : &fake_idx), + if ((ret_value = H5P__iterate_plist((H5P_genplist_t *)obj, true, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ @@ -1576,7 +1576,7 @@ H5Pget_class_parent(hid_t pclass_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count"); /* Get an ID for the class */ - if ((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, parent, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class"); done: diff --git a/src/H5PB.c b/src/H5PB.c index 6f9f732..c671489 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -112,7 +112,7 @@ /* Iteration context for destroying page buffer */ typedef struct { H5PB_t *page_buf; - hbool_t actual_slist; + bool actual_slist; } H5PB_ud1_t; /********************/ @@ -464,12 +464,12 @@ H5PB_dest(H5F_shared_t *f_sh) op_data.page_buf = page_buf; /* Destroy the skip list containing all the entries in the PB */ - op_data.actual_slist = TRUE; + op_data.actual_slist = true; if (H5SL_destroy(page_buf->slist_ptr, H5PB__dest_cb, &op_data)) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTCLOSEOBJ, FAIL, "can't destroy page buffer skip list"); /* Destroy the skip list containing the new entries */ - op_data.actual_slist = FALSE; + op_data.actual_slist = false; if (H5SL_destroy(page_buf->mf_slist_ptr, H5PB__dest_cb, &op_data)) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTCLOSEOBJ, FAIL, "can't destroy page buffer skip list"); @@ -526,7 +526,7 @@ H5PB_add_new_page(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t page_addr) /* Initialize page fields */ page_entry->addr = page_addr; page_entry->type = (H5F_mem_page_t)type; - page_entry->is_dirty = FALSE; + page_entry->is_dirty = false; /* Insert entry in skip list */ if (H5SL_insert(page_buf->mf_slist_ptr, page_entry, &(page_entry->addr)) < 0) @@ -656,7 +656,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ size_t access_size = 0; - hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ + bool bypass_pb = false; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -672,7 +672,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * #ifdef H5_HAVE_PARALLEL if (H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI)) { #if 1 - bypass_pb = TRUE; + bypass_pb = true; #else /* MSC - why this stopped working ? */ int mpi_size; @@ -680,7 +680,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * if ((mpi_size = H5F_shared_mpi_get_size(f_sh)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size"); if (1 != mpi_size) - bypass_pb = TRUE; + bypass_pb = true; #endif } /* end if */ #endif @@ -865,7 +865,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * /* if make_space returns 0, then we can't use the page buffer for this I/O and we need to bypass */ if (0 == can_make_space) { - /* make space can't return FALSE on second touched page since the first is of the same + /* make space can't return false on second touched page since the first is of the same * type */ assert(0 == i); @@ -914,7 +914,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * page_entry->page_buf_ptr = new_page_buf; page_entry->addr = search_addr; page_entry->type = (H5F_mem_page_t)type; - page_entry->is_dirty = FALSE; + page_entry->is_dirty = false; /* Insert page into PB */ if (H5PB__insert_entry(page_buf, page_entry) < 0) @@ -955,7 +955,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ size_t access_size = 0; - hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ + bool bypass_pb = false; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -970,7 +970,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const #ifdef H5_HAVE_PARALLEL if (H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI)) { #if 1 - bypass_pb = TRUE; + bypass_pb = true; #else /* MSC - why this stopped working ? */ int mpi_size; @@ -978,7 +978,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const if ((mpi_size = H5F_shared_mpi_get_size(f_sh)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size"); if (1 != mpi_size) - bypass_pb = TRUE; + bypass_pb = true; #endif } /* end if */ #endif @@ -1070,7 +1070,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const page_buf->page_size - (size_t)offset); /* Mark page dirty and push to top of LRU */ - page_entry->is_dirty = TRUE; + page_entry->is_dirty = true; H5PB__MOVE_TO_TOP_LRU(page_buf, page_entry) } /* end if */ } /* end if */ @@ -1090,7 +1090,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const (size_t)((addr + size) - last_page_addr)); /* Mark page dirty and push to top of LRU */ - page_entry->is_dirty = TRUE; + page_entry->is_dirty = true; H5PB__MOVE_TO_TOP_LRU(page_buf, page_entry) } /* end if */ } /* end else-if */ @@ -1143,7 +1143,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const access_size); /* Mark page dirty and push to top of LRU */ - page_entry->is_dirty = TRUE; + page_entry->is_dirty = true; H5PB__MOVE_TO_TOP_LRU(page_buf, page_entry) /* Update statistics */ @@ -1263,7 +1263,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const H5MM_memcpy((uint8_t *)new_page_buf + offset, (const uint8_t *)buf + buf_offset, access_size); /* Page is dirty now */ - page_entry->is_dirty = TRUE; + page_entry->is_dirty = true; /* Insert page into PB, evicting other pages as necessary */ if (H5PB__insert_entry(page_buf, page_entry) < 0) @@ -1287,10 +1287,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) +H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, bool *enabled) { H5PB_t *page_buf; /* Page buffering info for this file */ - hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ + bool bypass_pb = false; /* Whether to bypass page buffering */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -1304,7 +1304,7 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) #ifdef H5_HAVE_PARALLEL if (H5F_SHARED_HAS_FEATURE(f_sh, H5FD_FEAT_HAS_MPI)) { #if 1 - bypass_pb = TRUE; + bypass_pb = true; #else /* MSC - why this stopped working ? */ int mpi_size; @@ -1312,7 +1312,7 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) if ((mpi_size = H5F_shared_mpi_get_size(f_sh)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size"); if (1 != mpi_size) - bypass_pb = TRUE; + bypass_pb = true; #endif } /* end if */ #endif @@ -1320,13 +1320,13 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) /* If page buffering is disabled, or if this is a parallel raw data access, * bypass page buffering. Note that page buffering may still be disabled for * large metadata access or large non-parallel raw data access, but this - * function doesn't take I/O size into account so if it returns TRUE the - * page buffer may still be disabled for some I/O. If it returns FALSE it is + * function doesn't take I/O size into account so if it returns true the + * page buffer may still be disabled for some I/O. If it returns false it is * always disabled for this access type. */ if (NULL == page_buf || (bypass_pb && H5FD_MEM_DRAW == type)) { /* Update statistics, since wherever this function is called, if it - * returns FALSE, the calling function performs I/O avoiding the page + * returns false, the calling function performs I/O avoiding the page * buffer layer */ if (page_buf) { assert(type == H5FD_MEM_DRAW); @@ -1334,11 +1334,11 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) } /* end if */ /* Page buffer is disabled, at least for this data access type */ - *enabled = FALSE; + *enabled = false; } /* end if */ else /* Page buffer may be enabled */ - *enabled = TRUE; + *enabled = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5PB_enabled() */ @@ -1409,7 +1409,7 @@ static htri_t H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) { H5PB_entry_t *page_entry; /* Pointer to page eviction candidate */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -1425,7 +1425,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) metadata, then we can't make space for raw data */ if (0 == page_buf->raw_count && page_buf->min_meta_count == page_buf->meta_count) { assert(page_buf->meta_count * page_buf->page_size == page_buf->max_size); - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* check the metadata threshold before evicting metadata items */ @@ -1442,7 +1442,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) raw data, then we can't make space for meta data */ if (0 == page_buf->meta_count && page_buf->min_raw_count == page_buf->raw_count) { assert(page_buf->raw_count * page_buf->page_size == page_buf->max_size); - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* check the raw data threshold before evicting raw data items */ @@ -1536,7 +1536,7 @@ H5PB__write_entry(H5F_shared_t *f_sh, H5PB_entry_t *page_entry) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed"); } /* end if */ - page_entry->is_dirty = FALSE; + page_entry->is_dirty = false; done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5PBpkg.h b/src/H5PBpkg.h index 603f565..527c109 100644 --- a/src/H5PBpkg.h +++ b/src/H5PBpkg.h @@ -34,7 +34,7 @@ typedef struct H5PB_entry_t { void *page_buf_ptr; /* Pointer to the buffer containing the data */ haddr_t addr; /* Address of the page in the file */ H5F_mem_page_t type; /* Type of the page entry (H5F_MEM_PAGE_RAW/META) */ - hbool_t is_dirty; /* Flag indicating whether the page has dirty data or not */ + bool is_dirty; /* Flag indicating whether the page has dirty data or not */ /* Fields supporting replacement policies */ struct H5PB_entry_t *next; /* next pointer in the LRU list */ diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index aa7048b..d4abf8e 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -83,7 +83,7 @@ H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, con H5_DLL herr_t H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr); H5_DLL herr_t H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /*out*/); H5_DLL herr_t H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf); -H5_DLL herr_t H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled); +H5_DLL herr_t H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, bool *enabled); /* Statistics routines */ H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf); diff --git a/src/H5PLint.c b/src/H5PLint.c index 73be42a..86103b4 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -59,11 +59,11 @@ */ static unsigned int H5PL_plugin_control_mask_g = H5PL_ALL_PLUGIN; -/* This flag will be set to FALSE if the HDF5_PLUGIN_PRELOAD +/* This flag will be set to false if the HDF5_PLUGIN_PRELOAD * environment variable was set to H5PL_NO_PLUGIN at * package initialization. */ -static hbool_t H5PL_allow_plugins_g = TRUE; +static bool H5PL_allow_plugins_g = true; /*------------------------------------------------------------------------- * Function: H5PL__get_plugin_control_mask @@ -143,7 +143,7 @@ H5PL_init(void) if (NULL != (env_var = HDgetenv(HDF5_PLUGIN_PRELOAD))) if (!HDstrcmp(env_var, H5PL_NO_PLUGIN)) { H5PL_plugin_control_mask_g = 0; - H5PL_allow_plugins_g = FALSE; + H5PL_allow_plugins_g = false; } /* Create the table of previously-loaded plugins */ @@ -174,8 +174,8 @@ done: int H5PL_term_package(void) { - hbool_t already_closed = FALSE; - int ret_value = 0; + bool already_closed = false; + int ret_value = 0; FUNC_ENTER_NOAPI_NOINIT @@ -213,7 +213,7 @@ const void * H5PL_load(H5PL_type_t type, const H5PL_key_t *key) { H5PL_search_params_t search_params; /* Plugin search parameters */ - hbool_t found = FALSE; /* Whether the plugin was found */ + bool found = false; /* Whether the plugin was found */ const void *plugin_info = NULL; /* Information from the plugin */ const void *ret_value = NULL; @@ -295,9 +295,9 @@ done: * NULL. * * On successful open of a plugin, the `success` parameter - * will be set to TRUE and the `plugin_type` and `plugin_info` + * will be set to true and the `plugin_type` and `plugin_info` * parameters will be filled appropriately. On failure, the - * `success` parameter will be set to FALSE, the `plugin_type` + * `success` parameter will be set to false, the `plugin_type` * parameter will be set to H5PL_TYPE_ERROR and the * `plugin_info` parameter will be set to NULL. * @@ -316,8 +316,8 @@ done: */ H5_GCC_CLANG_DIAG_OFF("pedantic") herr_t -H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *success, - H5PL_type_t *plugin_type, const void **plugin_info) +H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, bool *success, H5PL_type_t *plugin_type, + const void **plugin_info) { H5PL_HANDLE handle = NULL; H5PL_get_plugin_type_t get_plugin_type = NULL; @@ -336,7 +336,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s assert(plugin_info); /* Initialize out parameters */ - *success = FALSE; + *success = false; *plugin_info = NULL; if (plugin_type) *plugin_type = H5PL_TYPE_ERROR; @@ -386,7 +386,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s if (plugin_type) *plugin_type = H5PL_TYPE_FILTER; *plugin_info = (const void *)filter_info; - *success = TRUE; + *success = true; } break; diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 82d5422..9b2f987 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -64,7 +64,7 @@ static herr_t H5PL__replace_at(const char *path, unsigned int idx); static herr_t H5PL__expand_path_table(void); static herr_t H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type_t iter_type, H5PL_iterate_t iter_op, void *op_data); -static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, +static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found, const char *dir, const void **plugin_info); /*********************/ @@ -604,7 +604,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type { H5PL_type_t plugin_type; const void *plugin_info = NULL; - hbool_t plugin_loaded; + bool plugin_loaded; char *path = NULL; DIR *dirp = NULL; /* Directory stream */ struct dirent *dp = NULL; /* Directory entry */ @@ -631,7 +631,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type if (!HDstrncmp(dp->d_name, "cyg", (size_t)3) && HDstrstr(dp->d_name, ".dll")) { #endif - hbool_t plugin_matches; + bool plugin_matches; h5_stat_t my_stat; size_t len; @@ -656,7 +656,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type /* Attempt to open the dynamic library */ plugin_type = H5PL_TYPE_ERROR; plugin_info = NULL; - plugin_loaded = FALSE; + plugin_loaded = false; if (H5PL__open(path, H5PL_TYPE_NONE, NULL, &plugin_loaded, &plugin_type, &plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, H5_ITER_ERROR, "failed to open plugin '%s'", path); @@ -696,7 +696,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type HANDLE hFind = INVALID_HANDLE_VALUE; H5PL_type_t plugin_type; const void *plugin_info = NULL; - hbool_t plugin_loaded; + bool plugin_loaded; char *path = NULL; char service[2048]; herr_t ret_value = H5_ITER_CONT; @@ -717,8 +717,8 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type do { /* Ignore '.' and '..' */ if (HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { - hbool_t plugin_matches; - size_t len; + bool plugin_matches; + size_t len; /* Allocate & initialize the path name */ len = HDstrlen(plugin_path) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(fdFile.cFileName) + 1; @@ -735,7 +735,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type /* Attempt to open the dynamic library */ plugin_type = H5PL_TYPE_ERROR; plugin_info = NULL; - plugin_loaded = FALSE; + plugin_loaded = false; if (H5PL__open(path, H5PL_TYPE_NONE, NULL, &plugin_loaded, &plugin_type, &plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, H5_ITER_ERROR, "failed to open plugin '%s'", path); @@ -779,7 +779,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool_t *found, +H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, bool *found, const void **plugin_info) { unsigned int u; /* iterator */ @@ -793,7 +793,7 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool assert(plugin_info); /* Initialize output parameters */ - *found = FALSE; + *found = false; *plugin_info = NULL; /* Loop over the paths in the table, checking for an appropriate plugin */ @@ -823,7 +823,7 @@ done: * plugin library. Two function definitions are for Unix and * Windows. * - * The found parameter will be set to TRUE and the info + * The found parameter will be set to true and the info * parameter will be filled in on success. * * Return: SUCCEED/FAIL @@ -832,7 +832,7 @@ done: */ #ifndef H5_HAVE_WIN32_API static herr_t -H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, +H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found, const char *dir, const void **plugin_info) { char *path = NULL; @@ -849,7 +849,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo assert(plugin_info); /* Initialize the found parameter */ - *found = FALSE; + *found = false; /* Open the directory */ if (!(dirp = HDopendir(dir))) @@ -913,7 +913,7 @@ done: } /* end H5PL__find_plugin_in_path() */ #else /* H5_HAVE_WIN32_API */ static herr_t -H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, +H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found, const char *dir, const void **plugin_info) { WIN32_FIND_DATAA fdFile; @@ -931,7 +931,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo assert(plugin_info); /* Initialize the found parameter */ - *found = FALSE; + *found = false; /* Specify a file mask. *.* = We want everything! */ HDsnprintf(service, sizeof(service), "%s\\*.dll", dir); diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 9adbefa..24a7f34 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -131,16 +131,15 @@ H5_DLL herr_t H5PL__get_plugin_control_mask(unsigned int *mask /*out*/); H5_DLL herr_t H5PL__set_plugin_control_mask(unsigned int mask); /* Plugin search and manipulation */ -H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, const H5PL_key_t *key, - hbool_t *success /*out*/, H5PL_type_t *plugin_type /*out*/, - const void **plugin_info /*out*/); +H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, const H5PL_key_t *key, bool *success /*out*/, + H5PL_type_t *plugin_type /*out*/, const void **plugin_info /*out*/); H5_DLL herr_t H5PL__close(H5PL_HANDLE handle); /* Plugin cache calls */ H5_DLL herr_t H5PL__create_plugin_cache(void); -H5_DLL herr_t H5PL__close_plugin_cache(hbool_t *already_closed /*out*/); +H5_DLL herr_t H5PL__close_plugin_cache(bool *already_closed /*out*/); H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, const H5PL_key_t *key, H5PL_HANDLE handle); -H5_DLL herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, +H5_DLL herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, bool *found /*out*/, const void **plugin_info /*out*/); /* Plugin search path calls */ @@ -154,7 +153,7 @@ H5_DLL herr_t H5PL__insert_path(const char *path, unsigned int index); H5_DLL herr_t H5PL__remove_path(unsigned int index); H5_DLL const char *H5PL__get_path(unsigned int index); H5_DLL herr_t H5PL__path_table_iterate(H5PL_iterate_type_t iter_type, H5PL_iterate_t iter_op, void *op_data); -H5_DLL herr_t H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, - hbool_t *found /*out*/, const void **plugin_info /*out*/); +H5_DLL herr_t H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, bool *found /*out*/, + const void **plugin_info /*out*/); #endif /* H5PLpkg_H */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index e294dc7..e59de03 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -133,7 +133,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PL__close_plugin_cache(hbool_t *already_closed /*out*/) +H5PL__close_plugin_cache(bool *already_closed /*out*/) { unsigned int u; /* iterator */ herr_t ret_value = SUCCEED; @@ -153,10 +153,10 @@ H5PL__close_plugin_cache(hbool_t *already_closed /*out*/) H5PL_cache_capacity_g = 0; /* Note that actually closed the table (needed by package close call) */ - *already_closed = FALSE; + *already_closed = false; } else - *already_closed = TRUE; + *already_closed = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__close_plugin_cache() */ @@ -244,8 +244,7 @@ done: */ H5_GCC_CLANG_DIAG_OFF("pedantic") herr_t -H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, - const void **plugin_info) +H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, bool *found, const void **plugin_info) { unsigned int u; /* iterator */ herr_t ret_value = SUCCEED; @@ -258,12 +257,12 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f assert(plugin_info); /* Initialize output parameters */ - *found = FALSE; + *found = false; *plugin_info = NULL; /* Loop over all the plugins, looking for one that matches */ for (u = 0; u < H5PL_num_plugins_g; u++) { - hbool_t matched = FALSE; /* Whether cached plugin info matches */ + bool matched = false; /* Whether cached plugin info matches */ /* Determine if the plugin types match */ if (search_params->type != H5PL_cache_g[u].type) @@ -274,7 +273,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f case H5PL_TYPE_FILTER: /* Check if specified filter plugin ID matches cache entry's ID */ if (search_params->key->id == H5PL_cache_g[u].key.id) - matched = TRUE; + matched = true; break; @@ -286,7 +285,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f /* Check if specified VOL connector name matches cache entry's name */ if (!HDstrcmp(search_params->key->vol.u.name, H5PL_cache_g[u].key.vol.u.name)) - matched = TRUE; + matched = true; } else { assert(search_params->key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); @@ -297,7 +296,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f /* Check if specified VOL connector ID matches cache entry's ID */ if (search_params->key->vol.u.value == H5PL_cache_g[u].key.vol.u.value) - matched = TRUE; + matched = true; } break; @@ -310,7 +309,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f /* Check if specified VFD name matches cache entry's name */ if (!HDstrcmp(search_params->key->vfd.u.name, H5PL_cache_g[u].key.vfd.u.name)) - matched = TRUE; + matched = true; } else { assert(search_params->key->vfd.kind == H5FD_GET_DRIVER_BY_VALUE); @@ -321,7 +320,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f /* Check if specified VFD ID matches cache entry's ID */ if (search_params->key->vfd.u.value == H5PL_cache_g[u].key.vfd.u.value) - matched = TRUE; + matched = true; } break; @@ -349,7 +348,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info"); /* Set output parameters */ - *found = TRUE; + *found = true; *plugin_info = info; /* No need to continue processing */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 5254f6d..2e8e8a4 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -50,7 +50,7 @@ /* Define default layout information */ #define H5D_DEF_STORAGE_COMPACT_INIT \ { \ - (hbool_t) FALSE, (size_t)0, NULL \ + false, (size_t)0, NULL \ } #define H5D_DEF_STORAGE_CONTIG_INIT \ { \ @@ -90,7 +90,7 @@ { \ {HADDR_UNDEF, 0}, 0, NULL, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \ - H5D_VDS_ERROR, HSIZE_UNDEF, -1, -1, FALSE \ + H5D_VDS_ERROR, HSIZE_UNDEF, -1, -1, false \ } #define H5D_DEF_STORAGE_COMPACT \ { \ @@ -159,7 +159,7 @@ #define H5D_CRT_FILL_VALUE_DEF \ { \ {0, NULL, H5O_NULL_ID, {{0, HADDR_UNDEF}}}, H5O_FILL_VERSION_2, NULL, 0, NULL, H5D_ALLOC_TIME_LATE, \ - H5D_FILL_TIME_IFSET, FALSE \ + H5D_FILL_TIME_IFSET, false \ } #define H5D_CRT_FILL_VALUE_SET H5P__dcrt_fill_value_set #define H5D_CRT_FILL_VALUE_GET H5P__dcrt_fill_value_get @@ -189,10 +189,10 @@ #define H5D_CRT_EXT_FILE_LIST_CMP H5P__dcrt_ext_file_list_cmp #define H5D_CRT_EXT_FILE_LIST_CLOSE H5P__dcrt_ext_file_list_close /* Definitions for dataset object header minimization */ -#define H5D_CRT_MIN_DSET_HDR_SIZE_SIZE sizeof(hbool_t) -#define H5D_CRT_MIN_DSET_HDR_SIZE_DEF FALSE -#define H5D_CRT_MIN_DSET_HDR_SIZE_ENC H5P__encode_hbool_t -#define H5D_CRT_MIN_DSET_HDR_SIZE_DEC H5P__decode_hbool_t +#define H5D_CRT_MIN_DSET_HDR_SIZE_SIZE sizeof(bool) +#define H5D_CRT_MIN_DSET_HDR_SIZE_DEF false +#define H5D_CRT_MIN_DSET_HDR_SIZE_ENC H5P__encode_bool +#define H5D_CRT_MIN_DSET_HDR_SIZE_DEC H5P__decode_bool /******************/ /* Local Typedefs */ @@ -1276,7 +1276,7 @@ H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t H5_ATTR_UNUSED if (fill1->type != NULL && fill2->type == NULL) HGOTO_DONE(1); if (fill1->type != NULL) - if ((cmp_value = H5T_cmp(fill1->type, fill2->type, FALSE)) != 0) + if ((cmp_value = H5T_cmp(fill1->type, fill2->type, false)) != 0) HGOTO_DONE(cmp_value); /* Check the fill values in the buffers */ @@ -2034,8 +2034,8 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const H5S_t *src_space; /* Source dataset space selection */ H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */ H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */ - hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */ - hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */ + bool retrieved_layout = false; /* Whether the layout has been retrieved */ + bool free_list = false; /* Whether to free the list of virtual entries */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2062,7 +2062,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const /* Get the current layout */ if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout"); - retrieved_layout = TRUE; + retrieved_layout = true; /* If the layout was not already virtual, Start with default virtual layout. * Otherwise, add the mapping to the current list. */ @@ -2097,13 +2097,13 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const /* Add virtual dataset mapping entry */ ent = &virtual_layout.storage.u.virt.list[virtual_layout.storage.u.virt.list_nused]; memset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */ - if (NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE))) + if (NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, false, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); if (NULL == (ent->source_file_name = H5MM_xstrdup(src_file_name))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name"); if (NULL == (ent->source_dset_name = H5MM_xstrdup(src_dset_name))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name"); - if (NULL == (ent->source_select = H5S_copy(src_space, FALSE, TRUE))) + if (NULL == (ent->source_select = H5S_copy(src_space, false, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection"); if (H5D_virtual_parse_source_name(ent->source_file_name, &ent->parsed_source_file_name, &ent->psfn_static_strlen, &ent->psfn_nsubs) < 0) @@ -2152,7 +2152,7 @@ done: if (H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) { HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout"); if (old_list != virtual_layout.storage.u.virt.list) - free_list = TRUE; + free_list = true; } /* end if */ } /* end if */ @@ -2262,11 +2262,11 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx) if (idx >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)"); assert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - if (NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, FALSE, TRUE))) + if (NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, false, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection"); /* Register ID */ - if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); done: @@ -2350,11 +2350,11 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx) } /* end if */ /* Get the source space */ - if (NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_select, FALSE, TRUE))) + if (NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_select, false, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection"); /* Register ID */ - if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); done: @@ -2847,7 +2847,7 @@ H5Pset_shuffle(hid_t plist_id) H5TRACE1("e", "i", plist_id); /* Check arguments */ - if (TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) + if (true != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the plist structure */ @@ -2886,7 +2886,7 @@ H5Pset_nbit(hid_t plist_id) H5TRACE1("e", "i", plist_id); /* Check arguments */ - if (TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) + if (true != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the plist structure */ @@ -2942,7 +2942,7 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac H5TRACE3("e", "iZaIs", plist_id, scale_type, scale_factor); /* Check arguments */ - if (TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) + if (true != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (scale_factor < 0) @@ -3113,7 +3113,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ */ if (NULL == (tpath = H5T_path_find(fill.type, type))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes"); - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), FALSE)) < 0) + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); /* @@ -3135,7 +3135,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ H5MM_memcpy(buf, fill.buf, H5T_get_size(fill.type)); /* Do the conversion */ - if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_ALL), FALSE)) < 0) + if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); if (H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "datatype conversion failed"); @@ -3522,7 +3522,7 @@ done: herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize /*out*/) { - hbool_t setting = FALSE; + bool setting = false; H5P_genplist_t *plist = NULL; herr_t ret_value = SUCCEED; @@ -3564,7 +3564,7 @@ herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize) { H5P_genplist_t *plist = NULL; - hbool_t prev_set = FALSE; + bool prev_set = false; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 5c4e962..4374730 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -506,11 +506,11 @@ H5Pencode1(hid_t plist_id, void *buf, size_t *nalloc) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Call the internal encode routine */ - if ((ret_value = H5P__encode(plist, TRUE, buf, nalloc)) < 0) + if ((ret_value = H5P__encode(plist, true, buf, nalloc)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to encode property list"); done: @@ -531,7 +531,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh { H5F_fspace_strategy_t new_strategy; /* File space strategy type */ - hbool_t new_persist = H5F_FREE_SPACE_PERSIST_DEF; /* Persisting free-space or not */ + bool new_persist = H5F_FREE_SPACE_PERSIST_DEF; /* Persisting free-space or not */ hsize_t new_threshold = H5F_FREE_SPACE_THRESHOLD_DEF; /* Free-space section threshold */ H5F_file_space_type_t in_strategy = strategy; /* Input strategy */ hsize_t in_threshold = threshold; /* Input threshold */ @@ -557,7 +557,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh switch (in_strategy) { case H5F_FILE_SPACE_ALL_PERSIST: new_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; - new_persist = TRUE; + new_persist = true; new_threshold = in_threshold; break; @@ -600,7 +600,7 @@ herr_t H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy /*out*/, hsize_t *threshold /*out*/) { H5F_fspace_strategy_t new_strategy; /* File space strategy type */ - hbool_t new_persist; /* Persisting free-space or not */ + bool new_persist; /* Persisting free-space or not */ hsize_t new_threshold; /* Free-space section threshold */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 6babaf9..f6f7240 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -176,8 +176,8 @@ #define H5D_XFER_NO_SELECTION_IO_CAUSE_SIZE sizeof(uint32_t) #define H5D_XFER_NO_SELECTION_IO_CAUSE_DEF 0 /* Definitions for modify write buffer property */ -#define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(hbool_t) -#define H5D_XFER_MODIFY_WRITE_BUF_DEF FALSE +#define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(bool) +#define H5D_XFER_MODIFY_WRITE_BUF_DEF false #define H5D_XFER_MODIFY_WRITE_BUF_ENC H5P__dxfr_modify_write_buf_enc #define H5D_XFER_MODIFY_WRITE_BUF_DEC H5P__dxfr_modify_write_buf_dec @@ -295,7 +295,7 @@ static const H5S_t *H5D_def_dset_io_sel_g = H5D_XFER_DSET_IO_SEL_DEF; /* Default value for dataset I/O selection */ static const H5D_selection_io_mode_t H5D_def_selection_io_mode_g = H5D_XFER_SELECTION_IO_MODE_DEF; static const uint32_t H5D_def_no_selection_io_cause_g = H5D_XFER_NO_SELECTION_IO_CAUSE_DEF; -static const hbool_t H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; +static const bool H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; /*------------------------------------------------------------------------- * Function: H5P__dxfr_reg_prop @@ -1149,7 +1149,7 @@ done: * Purpose: When reading or writing compound data types and the * destination is partially initialized and the read/write is * intended to initialize the other members, one must set this - * property to TRUE. Otherwise the I/O pipeline treats the + * property to true. Otherwise the I/O pipeline treats the * destination datapoints as completely uninitialized. * * Return: Non-negative on success/Negative on failure @@ -1184,7 +1184,7 @@ done: * * Purpose: The inverse of H5Pset_preserve() * - * Return: Success: TRUE or FALSE + * Return: Success: true or false * * Failure: Negative * @@ -1209,7 +1209,7 @@ H5Pget_preserve(hid_t plist_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); /* Set return value */ - ret_value = need_bkg ? TRUE : FALSE; + ret_value = need_bkg ? true : false; done: FUNC_LEAVE_API(ret_value) @@ -2062,7 +2062,7 @@ H5P__dxfr_dset_io_hyp_sel_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U /* If there's a dataspace I/O selection set, copy it */ if (orig_space) { /* Make copy of dataspace */ - if (NULL == (new_space = H5S_copy(orig_space, FALSE, TRUE))) + if (NULL == (new_space = H5S_copy(orig_space, false, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "error copying the dataset I/O selection"); /* Set new value for property */ @@ -2113,7 +2113,7 @@ H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H /* Compare the extents of the dataspaces */ /* (Error & not-equal count the same) */ - if (TRUE != H5S_extent_equal(*space1, *space2)) + if (true != H5S_extent_equal(*space1, *space2)) HGOTO_DONE(-1); /* Compare the selection "shape" of the dataspaces @@ -2125,7 +2125,7 @@ H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H * we quiet the const warning. */ H5_GCC_CLANG_DIAG_OFF("cast-qual") - if (TRUE != H5S_select_shape_same((H5S_t *)*space1, (H5S_t *)*space2)) + if (true != H5S_select_shape_same((H5S_t *)*space1, (H5S_t *)*space2)) HGOTO_DONE(-1); H5_GCC_CLANG_DIAG_ON("cast-qual") } /* end if */ @@ -2254,8 +2254,8 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper { H5P_genplist_t *plist = NULL; /* Property list pointer */ H5S_t *space = NULL; /* Dataspace to hold selection */ - hbool_t space_created = FALSE; /* Whether a new dataspace has been created */ - hbool_t reset_prop_on_error = FALSE; /* Whether to reset the property on failure */ + bool space_created = false; /* Whether a new dataspace has been created */ + bool reset_prop_on_error = false; /* Whether to reset the property on failure */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -2308,7 +2308,7 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper space = NULL; /* Set flag to reset property list on error */ - reset_prop_on_error = TRUE; + reset_prop_on_error = true; } /* end if */ else HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "different rank for previous and new selections"); @@ -2327,7 +2327,7 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper /* Create dataspace of the correct dimensionality, with maximum dimensions */ if (NULL == (space = H5S_create_simple(rank, dims, NULL))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create dataspace for selection"); - space_created = TRUE; + space_created = true; } /* end if */ /* Set selection for dataspace */ @@ -2337,7 +2337,7 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper /* Update property list (takes ownership of dataspace, if new) */ if (H5P_poke(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "error setting dataset I/O selection"); - space_created = FALSE; /* Reset now that property owns the dataspace */ + space_created = false; /* Reset now that property owns the dataspace */ done: /* Cleanup on failure */ @@ -2471,8 +2471,8 @@ done: static herr_t H5P__dxfr_modify_write_buf_enc(const void *value, void **_pp /*out*/, size_t *size /*out*/) { - const hbool_t *modify_write_buf = (const hbool_t *)value; /* Create local alias for values */ - uint8_t **pp = (uint8_t **)_pp; + const bool *modify_write_buf = (const bool *)value; /* Create local alias for values */ + uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR @@ -2505,7 +2505,7 @@ H5P__dxfr_modify_write_buf_enc(const void *value, void **_pp /*out*/, size_t *si static herr_t H5P__dxfr_modify_write_buf_dec(const void **_pp, void *_value /*out*/) { - hbool_t *modify_write_buf = (hbool_t *)_value; /* Modify write buffer */ + bool *modify_write_buf = (bool *)_value; /* Modify write buffer */ const uint8_t **pp = (const uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR @@ -2516,7 +2516,7 @@ H5P__dxfr_modify_write_buf_dec(const void **_pp, void *_value /*out*/) assert(modify_write_buf); /* Decode selection I/O mode property */ - *modify_write_buf = (hbool_t) * (*pp)++; + *modify_write_buf = (bool)*(*pp)++; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P__dxfr_modify_write_buf_dec() */ diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 69396f4..a904b0f 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -44,7 +44,7 @@ /* Typedef for iterator when encoding a property list */ typedef struct { - hbool_t encode; /* Whether the property list should be encoded */ + bool encode; /* Whether the property list should be encoded */ size_t *enc_size_ptr; /* Pointer to size of encoded buffer */ void **pp; /* Pointer to encoding buffer pointer */ } H5P_enc_iter_ud_t; @@ -208,9 +208,9 @@ H5P__encode_uint8_t(const void *value, void **_pp, size_t *size) } /* end H5P__encode_uint8_t() */ /*------------------------------------------------------------------------- - * Function: H5P__encode_hbool_t + * Function: H5P__encode_bool * - * Purpose: Generic encoding callback routine for 'hbool_t' properties. + * Purpose: Generic encoding callback routine for 'bool' properties. * * Return: Success: Non-negative * Failure: Negative @@ -218,7 +218,7 @@ H5P__encode_uint8_t(const void *value, void **_pp, size_t *size) *------------------------------------------------------------------------- */ herr_t -H5P__encode_hbool_t(const void *value, void **_pp, size_t *size) +H5P__encode_bool(const void *value, void **_pp, size_t *size) { uint8_t **pp = (uint8_t **)_pp; @@ -230,13 +230,13 @@ H5P__encode_hbool_t(const void *value, void **_pp, size_t *size) if (NULL != *pp) /* Encode the value */ - *(*pp)++ = (uint8_t) * (const hbool_t *)value; + *(*pp)++ = (uint8_t) * (const bool *)value; /* Set size needed for encoding */ *size += 1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__encode_hbool_t() */ +} /* end H5P__encode_bool() */ /*------------------------------------------------------------------------- * Function: H5P__encode_double @@ -337,8 +337,8 @@ done: USAGE herr_t H5P__encode(plist, enc_all_prop, buf, nalloc) const H5P_genplist_t *plist; IN: Property list to encode - hbool_t enc_all_prop; IN: Whether to encode all properties (TRUE), - or just non-default (i.e. changed) properties (FALSE). + bool enc_all_prop; IN: Whether to encode all properties (true), + or just non-default (i.e. changed) properties (false). uint8_t *buf; OUT: buffer to hold the encoded plist size_t *nalloc; IN/OUT: size of buffer needed to encode plist RETURNS @@ -353,13 +353,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, size_t *nalloc) +H5P__encode(const H5P_genplist_t *plist, bool enc_all_prop, void *buf, size_t *nalloc) { H5P_enc_iter_ud_t udata; /* User data for property iteration callback */ uint8_t *p = (uint8_t *)buf; /* Temporary pointer to encoding buffer */ int idx; /* Index of property to start at */ size_t encode_size = 0; /* Size of buffer needed to encode properties */ - hbool_t encode = TRUE; /* Whether the property list should be encoded */ + bool encode = true; /* Whether the property list should be encoded */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -372,7 +372,7 @@ H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, size_t * space is needed to encode a property. */ if (NULL == p) - encode = FALSE; + encode = false; /* Encode property list description info */ if (encode) { @@ -547,9 +547,9 @@ H5P__decode_uint8_t(const void **_pp, void *_value) } /* end H5P__decode_uint8_t() */ /*------------------------------------------------------------------------- - * Function: H5P__decode_hbool_t + * Function: H5P__decode_bool * - * Purpose: Generic decoding callback routine for 'hbool_t' properties. + * Purpose: Generic decoding callback routine for 'bool' properties. * * Return: Success: Non-negative * Failure: Negative @@ -557,9 +557,9 @@ H5P__decode_uint8_t(const void **_pp, void *_value) *------------------------------------------------------------------------- */ herr_t -H5P__decode_hbool_t(const void **_pp, void *_value) +H5P__decode_bool(const void **_pp, void *_value) { - hbool_t *value = (hbool_t *)_value; /* Property value to return */ + bool *value = (bool *)_value; /* Property value to return */ const uint8_t **pp = (const uint8_t **)_pp; herr_t ret_value = SUCCEED; /* Return value */ @@ -571,10 +571,10 @@ H5P__decode_hbool_t(const void **_pp, void *_value) assert(value); /* Decode the value */ - *value = (hbool_t) * (*pp)++; + *value = (bool)*(*pp)++; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__decode_hbool_t() */ +} /* end H5P__decode_bool() */ /*------------------------------------------------------------------------- * Function: H5P__decode_double diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 0aca611..3221e27 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -161,8 +161,8 @@ /* Definition for whether to convert family to a single-file driver. * It's a private property only used by h5repart. */ -#define H5F_ACS_FAMILY_TO_SINGLE_SIZE sizeof(hbool_t) -#define H5F_ACS_FAMILY_TO_SINGLE_DEF FALSE +#define H5F_ACS_FAMILY_TO_SINGLE_SIZE sizeof(bool) +#define H5F_ACS_FAMILY_TO_SINGLE_DEF false /* Definition for data type in multi file driver */ #define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t) #define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT @@ -184,8 +184,8 @@ /* Definition for whether to query the file descriptor from the core VFD * instead of the memory address. (Private to library) */ -#define H5F_ACS_WANT_POSIX_FD_SIZE sizeof(hbool_t) -#define H5F_ACS_WANT_POSIX_FD_DEF FALSE +#define H5F_ACS_WANT_POSIX_FD_SIZE sizeof(bool) +#define H5F_ACS_WANT_POSIX_FD_DEF false /* Definition for external file cache size */ #define H5F_ACS_EFC_SIZE_SIZE sizeof(unsigned) #define H5F_ACS_EFC_SIZE_DEF 0 @@ -212,21 +212,21 @@ NULL, NULL \ } /* Definition for status_flags in the superblock */ -#define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(hbool_t) -#define H5F_ACS_CLEAR_STATUS_FLAGS_DEF FALSE +#define H5F_ACS_CLEAR_STATUS_FLAGS_SIZE sizeof(bool) +#define H5F_ACS_CLEAR_STATUS_FLAGS_DEF false /* Definition for dropping free-space to the floor when reading in the superblock */ -#define H5F_ACS_NULL_FSM_ADDR_SIZE sizeof(hbool_t) -#define H5F_ACS_NULL_FSM_ADDR_DEF FALSE +#define H5F_ACS_NULL_FSM_ADDR_SIZE sizeof(bool) +#define H5F_ACS_NULL_FSM_ADDR_DEF false /* Definition for skipping EOF check when reading in the superblock */ -#define H5F_ACS_SKIP_EOF_CHECK_SIZE sizeof(hbool_t) -#define H5F_ACS_SKIP_EOF_CHECK_DEF FALSE +#define H5F_ACS_SKIP_EOF_CHECK_SIZE sizeof(bool) +#define H5F_ACS_SKIP_EOF_CHECK_DEF false /* Definition for 'use metadata cache logging' flag */ -#define H5F_ACS_USE_MDC_LOGGING_SIZE sizeof(hbool_t) -#define H5F_ACS_USE_MDC_LOGGING_DEF FALSE -#define H5F_ACS_USE_MDC_LOGGING_ENC H5P__encode_hbool_t -#define H5F_ACS_USE_MDC_LOGGING_DEC H5P__decode_hbool_t +#define H5F_ACS_USE_MDC_LOGGING_SIZE sizeof(bool) +#define H5F_ACS_USE_MDC_LOGGING_DEF false +#define H5F_ACS_USE_MDC_LOGGING_ENC H5P__encode_bool +#define H5F_ACS_USE_MDC_LOGGING_DEC H5P__decode_bool /* Definition for 'mdc log location' flag */ #define H5F_ACS_MDC_LOG_LOCATION_SIZE sizeof(char *) #define H5F_ACS_MDC_LOG_LOCATION_DEF NULL /* default is no log location */ @@ -237,15 +237,15 @@ #define H5F_ACS_MDC_LOG_LOCATION_CMP H5P__facc_mdc_log_location_cmp #define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P__facc_mdc_log_location_close /* Definition for 'start metadata cache logging on access' flag */ -#define H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE sizeof(hbool_t) -#define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF FALSE -#define H5F_ACS_START_MDC_LOG_ON_ACCESS_ENC H5P__encode_hbool_t -#define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEC H5P__decode_hbool_t +#define H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE sizeof(bool) +#define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF false +#define H5F_ACS_START_MDC_LOG_ON_ACCESS_ENC H5P__encode_bool +#define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEC H5P__decode_bool /* Definition for evict on close property */ -#define H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE sizeof(hbool_t) -#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEF FALSE -#define H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC H5P__encode_hbool_t -#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC H5P__decode_hbool_t +#define H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE sizeof(bool) +#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEF false +#define H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC H5P__encode_bool +#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC H5P__decode_bool #ifdef H5_HAVE_PARALLEL /* Definition of collective metadata read mode flag */ #define H5F_ACS_COLL_MD_READ_FLAG_SIZE sizeof(H5P_coll_md_read_flag_t) @@ -253,10 +253,10 @@ #define H5F_ACS_COLL_MD_READ_FLAG_ENC H5P__encode_coll_md_read_flag_t #define H5F_ACS_COLL_MD_READ_FLAG_DEC H5P__decode_coll_md_read_flag_t /* Definition of collective metadata write mode flag */ -#define H5F_ACS_COLL_MD_WRITE_FLAG_SIZE sizeof(hbool_t) -#define H5F_ACS_COLL_MD_WRITE_FLAG_DEF FALSE -#define H5F_ACS_COLL_MD_WRITE_FLAG_ENC H5P__encode_hbool_t -#define H5F_ACS_COLL_MD_WRITE_FLAG_DEC H5P__decode_hbool_t +#define H5F_ACS_COLL_MD_WRITE_FLAG_SIZE sizeof(bool) +#define H5F_ACS_COLL_MD_WRITE_FLAG_DEF false +#define H5F_ACS_COLL_MD_WRITE_FLAG_ENC H5P__encode_bool +#define H5F_ACS_COLL_MD_WRITE_FLAG_DEC H5P__decode_bool /* Definition for the file's MPI communicator */ #define H5F_ACS_MPI_PARAMS_COMM_SIZE sizeof(MPI_Comm) #define H5F_ACS_MPI_PARAMS_COMM_DEF MPI_COMM_NULL @@ -313,26 +313,26 @@ /* Definition for using file locking or not. The default is set * via the configure step. */ -#define H5F_ACS_USE_FILE_LOCKING_SIZE sizeof(hbool_t) +#define H5F_ACS_USE_FILE_LOCKING_SIZE sizeof(bool) #if defined H5_USE_FILE_LOCKING && H5_USE_FILE_LOCKING -#define H5F_ACS_USE_FILE_LOCKING_DEF TRUE +#define H5F_ACS_USE_FILE_LOCKING_DEF true #else -#define H5F_ACS_USE_FILE_LOCKING_DEF FALSE +#define H5F_ACS_USE_FILE_LOCKING_DEF false #endif -#define H5F_ACS_USE_FILE_LOCKING_ENC H5P__encode_hbool_t -#define H5F_ACS_USE_FILE_LOCKING_DEC H5P__decode_hbool_t +#define H5F_ACS_USE_FILE_LOCKING_ENC H5P__encode_bool +#define H5F_ACS_USE_FILE_LOCKING_DEC H5P__decode_bool /* Definition for whether we ignore file locking errors when we can * tell that file locking has been disabled on the file system. * The default is set via the configure step. */ -#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE sizeof(hbool_t) +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE sizeof(bool) #if defined H5_IGNORE_DISABLED_FILE_LOCKS && H5_IGNORE_DISABLED_FILE_LOCKS -#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF TRUE +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF true #else -#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF FALSE +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF false #endif -#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC H5P__encode_hbool_t -#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC H5P__decode_hbool_t +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC H5P__encode_bool +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC H5P__decode_bool /******************/ /* Local Typedefs */ @@ -478,8 +478,7 @@ static const H5F_close_degree_t H5F_def_close_degree_g = H5F_CLOSE_DEGREE_DEF; / static const hsize_t H5F_def_family_offset_g = H5F_ACS_FAMILY_OFFSET_DEF; /* Default offset for family VFD */ static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; /* Default size of new files for family VFD */ -static const hbool_t H5F_def_family_to_single_g = - H5F_ACS_FAMILY_TO_SINGLE_DEF; /* Default ?? for family VFD */ +static const bool H5F_def_family_to_single_g = H5F_ACS_FAMILY_TO_SINGLE_DEF; /* Default ?? for family VFD */ static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */ @@ -488,7 +487,7 @@ static const H5F_libver_t H5F_def_libver_low_bound_g = static const H5F_libver_t H5F_def_libver_high_bound_g = H5F_ACS_LIBVER_HIGH_BOUND_DEF; /* Default setting for "high" bound of format version */ -static const hbool_t H5F_def_want_posix_fd_g = +static const bool H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = @@ -497,24 +496,24 @@ static const unsigned H5F_def_metadata_read_attempts_g = H5F_ACS_METADATA_READ_ATTEMPTS_DEF; /* Default setting for the # of metadata read attempts */ static const H5F_object_flush_t H5F_def_object_flush_cb_g = H5F_ACS_OBJECT_FLUSH_CB_DEF; /* Default setting for object flush callback */ -static const hbool_t H5F_def_clear_status_flags_g = +static const bool H5F_def_clear_status_flags_g = H5F_ACS_CLEAR_STATUS_FLAGS_DEF; /* Default to clear the superblock status_flags */ -static const hbool_t H5F_def_skip_eof_check_g = +static const bool H5F_def_skip_eof_check_g = H5F_ACS_SKIP_EOF_CHECK_DEF; /* Default setting for skipping EOF check */ -static const hbool_t H5F_def_null_fsm_addr_g = +static const bool H5F_def_null_fsm_addr_g = H5F_ACS_NULL_FSM_ADDR_DEF; /* Default setting for dropping free-space to the floor */ -static const hbool_t H5F_def_use_mdc_logging_g = +static const bool H5F_def_use_mdc_logging_g = H5F_ACS_USE_MDC_LOGGING_DEF; /* Default metadata cache logging flag */ -static const char *H5F_def_mdc_log_location_g = H5F_ACS_MDC_LOG_LOCATION_DEF; /* Default mdc log location */ -static const hbool_t H5F_def_start_mdc_log_on_access_g = +static const char *H5F_def_mdc_log_location_g = H5F_ACS_MDC_LOG_LOCATION_DEF; /* Default mdc log location */ +static const bool H5F_def_start_mdc_log_on_access_g = H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF; /* Default mdc log start on access flag */ -static const hbool_t H5F_def_evict_on_close_flag_g = +static const bool H5F_def_evict_on_close_flag_g = H5F_ACS_EVICT_ON_CLOSE_FLAG_DEF; /* Default setting for evict on close property */ #ifdef H5_HAVE_PARALLEL static const H5P_coll_md_read_flag_t H5F_def_coll_md_read_flag_g = H5F_ACS_COLL_MD_READ_FLAG_DEF; /* Default setting for the collective metedata read flag */ -static const hbool_t H5F_def_coll_md_write_flag_g = +static const bool H5F_def_coll_md_write_flag_g = H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */ static const MPI_Comm H5F_def_mpi_params_comm_g = H5F_ACS_MPI_PARAMS_COMM_DEF; /* Default MPI communicator */ static const MPI_Info H5F_def_mpi_params_info_g = H5F_ACS_MPI_PARAMS_INFO_DEF; /* Default MPI info struct */ @@ -526,9 +525,9 @@ static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer minimum raw data size */ -static const hbool_t H5F_def_use_file_locking_g = +static const bool H5F_def_use_file_locking_g = H5F_ACS_USE_FILE_LOCKING_DEF; /* Default use file locking flag */ -static const hbool_t H5F_def_ignore_disabled_file_locks_g = +static const bool H5F_def_ignore_disabled_file_locks_g = H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF; /* Default ignore disabled file locks flag */ /*------------------------------------------------------------------------- @@ -845,7 +844,7 @@ herr_t H5P__facc_set_def_driver(void) { const char *driver_env_var; - hbool_t driver_ref_inc = FALSE; + bool driver_ref_inc = false; hid_t driver_id = H5I_INVALID_HID; /* VFL driver ID */ herr_t ret_value = SUCCEED; @@ -868,24 +867,24 @@ H5P__facc_set_def_driver(void) if (driver_is_registered) { assert(driver_id >= 0); - if (H5I_inc_ref(driver_id, TRUE) < 0) + if (H5I_inc_ref(driver_id, true) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFD"); - driver_ref_inc = TRUE; + driver_ref_inc = true; } /* end else-if */ else { /* Check for VFL drivers that ship with the library */ if (H5P__facc_set_def_driver_check_predefined(driver_env_var, &driver_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't check for predefined VFL driver name"); else if (driver_id > 0) { - if (H5I_inc_ref(driver_id, TRUE) < 0) + if (H5I_inc_ref(driver_id, true) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "can't increment VFL driver refcount"); - driver_ref_inc = TRUE; + driver_ref_inc = true; } else { /* Register the VFL driver */ - if ((driver_id = H5FD_register_driver_by_name(driver_env_var, TRUE)) < 0) + if ((driver_id = H5FD_register_driver_by_name(driver_env_var, true)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTREGISTER, FAIL, "can't register VFL driver"); - driver_ref_inc = TRUE; + driver_ref_inc = true; } /* end else */ } /* end else */ @@ -1160,7 +1159,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive if (NULL == H5I_object_verify(new_driver_id, H5I_VFL)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver ID"); - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5FD_driver_prop_t driver_prop; /* Property for driver ID, info & config. string */ /* Prepare the driver property */ @@ -1237,7 +1236,7 @@ done: */ herr_t H5P_set_driver_by_name(H5P_genplist_t *plist, const char *driver_name, const char *driver_config, - hbool_t app_ref) + bool app_ref) { hid_t new_driver_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; @@ -1299,7 +1298,7 @@ H5Pset_driver_by_name(hid_t plist_id, const char *driver_name, const char *drive HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "driver_name parameter cannot be an empty string"); /* Set the driver */ - if (H5P_set_driver_by_name(plist, driver_name, driver_config, TRUE) < 0) + if (H5P_set_driver_by_name(plist, driver_name, driver_config, true) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver info"); done: @@ -1325,7 +1324,7 @@ done: */ herr_t H5P_set_driver_by_value(H5P_genplist_t *plist, H5FD_class_value_t driver_value, const char *driver_config, - hbool_t app_ref) + bool app_ref) { hid_t new_driver_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; @@ -1385,7 +1384,7 @@ H5Pset_driver_by_value(hid_t plist_id, H5FD_class_value_t driver_value, const ch HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "negative VFD value is disallowed"); /* Set the driver */ - if (H5P_set_driver_by_value(plist, driver_value, driver_config, TRUE) < 0) + if (H5P_set_driver_by_value(plist, driver_value, driver_config, true) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver info"); done: @@ -1415,7 +1414,7 @@ H5P_peek_driver(H5P_genplist_t *plist) FUNC_ENTER_NOAPI(FAIL) /* Get the current driver ID */ - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5FD_driver_prop_t driver_prop; /* Property for driver ID, info & configuration string */ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) @@ -1493,7 +1492,7 @@ H5P_peek_driver_info(H5P_genplist_t *plist) FUNC_ENTER_NOAPI(NULL) /* Get the current driver info */ - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5FD_driver_prop_t driver_prop; /* Property for driver ID, info & configuration string */ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) @@ -1565,7 +1564,7 @@ H5P_peek_driver_config_str(H5P_genplist_t *plist) FUNC_ENTER_NOAPI(NULL) /* Get the current driver configuration string */ - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5FD_driver_prop_t driver_prop; /* Property for driver ID, info & configuration string */ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) @@ -1661,7 +1660,7 @@ H5P__file_driver_copy(void *value) /* Copy the driver & info, if there is one */ if (info->driver_id > 0) { /* Increment the reference count on driver and copy driver info */ - if (H5I_inc_ref(info->driver_id, FALSE) < 0) + if (H5I_inc_ref(info->driver_id, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver"); /* Copy driver info, if it exists */ @@ -4858,7 +4857,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t H5_ATTR_PARALLEL_UNUSED evict_on_cl H5TRACE2("e", "ib", fapl_id, evict_on_close); /* Compare the property list's class against the other class */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist"); /* Get the plist structure */ @@ -4903,7 +4902,7 @@ H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close /*out*/) H5TRACE2("e", "ix", fapl_id, evict_on_close); /* Compare the property list's class against the other class */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist"); /* Get the plist structure */ @@ -4945,7 +4944,7 @@ H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when H5TRACE3("e", "ibb", fapl_id, use_file_locking, ignore_when_disabled); /* Make sure this is a fapl */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist"); /* Get the plist structure */ @@ -4984,7 +4983,7 @@ H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking /*out*/, hbool_t *i H5TRACE3("e", "ixx", fapl_id, use_file_locking, ignore_when_disabled); /* Make sure this is a fapl */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist"); /* Get the plist structure */ @@ -5098,10 +5097,10 @@ H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective) /* (Dataset, group, attribute, and named datatype access property lists * are sub-classes of link access property lists -QAK) */ - if (TRUE != H5P_isa_class(plist_id, H5P_LINK_ACCESS) && TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_LINK_ACCESS) && true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist"); - /* set property to either TRUE if > 0, or FALSE otherwise */ + /* set property to either true if > 0, or false otherwise */ if (is_collective) coll_meta_read = H5P_USER_TRUE; else @@ -5145,13 +5144,13 @@ H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/) /* (Dataset, group, attribute, and named datatype access property lists * are sub-classes of link access property lists -QAK) */ - if (TRUE != H5P_isa_class(plist_id, H5P_LINK_ACCESS) && TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_LINK_ACCESS) && true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist"); /* Get value */ if (is_collective) { H5P_coll_md_read_flag_t - internal_flag; /* property setting. we need to convert to either TRUE or FALSE */ + internal_flag; /* property setting. we need to convert to either true or false */ H5P_genplist_t *plist; /* Property list pointer */ /* Get the plist structure */ @@ -5162,9 +5161,9 @@ H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get core collective metadata read flag"); if (internal_flag < 0) - *is_collective = FALSE; + *is_collective = false; else - *is_collective = (hbool_t)internal_flag; + *is_collective = (bool)internal_flag; } /* end if */ done: @@ -5191,7 +5190,7 @@ H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective) H5TRACE2("e", "ib", plist_id, is_collective); /* Compare the property list's class against the other class */ - if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist"); /* Get the plist structure */ @@ -5225,7 +5224,7 @@ H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/ H5TRACE3("e", "ixx", plist_id, comm, info); /* Make sure that the property list is a fapl */ - if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist"); /* Get the plist structure */ @@ -5265,7 +5264,7 @@ H5Pset_mpi_params(hid_t plist_id, MPI_Comm comm, MPI_Info info) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "not a valid argument"); /* Make sure that the property list is a fapl */ - if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist"); /* Get the plist structure */ @@ -5669,7 +5668,7 @@ H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective /*out*/) H5TRACE2("e", "ix", plist_id, is_collective); /* Compare the property list's class against the other class */ - if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist"); /* Get the plist structure */ @@ -5792,7 +5791,7 @@ H5P_set_vol(H5P_genplist_t *plist, hid_t vol_id, const void *vol_info) if (NULL == H5I_object_verify(vol_id, H5I_VOL)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID"); - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5VL_connector_prop_t vol_prop; /* Property for VOL ID & info */ /* Prepare the VOL connector property */ @@ -5905,7 +5904,7 @@ H5Pget_vol_id(hid_t plist_id, hid_t *vol_id /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Get the current VOL ID */ - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ /* Get the connector property */ @@ -5913,7 +5912,7 @@ H5Pget_vol_id(hid_t plist_id, hid_t *vol_id /*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector info"); /* Increment the VOL ID's ref count */ - if (H5I_inc_ref(connector_prop.connector_id, TRUE) < 0) + if (H5I_inc_ref(connector_prop.connector_id, true) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL connector ID"); /* Set the connector ID to return */ @@ -5951,7 +5950,7 @@ H5Pget_vol_info(hid_t plist_id, void **vol_info /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Get the current VOL info */ - if (TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) { void *new_connector_info = NULL; /* Copy of connector info */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ @@ -6019,7 +6018,7 @@ H5Pget_vol_cap_flags(hid_t plist_id, uint64_t *cap_flags) if (H5P_DEFAULT == plist_id) plist_id = H5P_FILE_ACCESS_DEFAULT; - if (TRUE == H5P_isa_class(plist_id, H5P_FILE_ACCESS)) { + if (true == H5P_isa_class(plist_id, H5P_FILE_ACCESS)) { H5P_genplist_t *plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 9c14add..b15e2c9 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -102,10 +102,10 @@ #define H5F_CRT_FILE_SPACE_STRATEGY_DEF H5F_FILE_SPACE_STRATEGY_DEF #define H5F_CRT_FILE_SPACE_STRATEGY_ENC H5P__fcrt_fspace_strategy_enc #define H5F_CRT_FILE_SPACE_STRATEGY_DEC H5P__fcrt_fspace_strategy_dec -#define H5F_CRT_FREE_SPACE_PERSIST_SIZE sizeof(hbool_t) +#define H5F_CRT_FREE_SPACE_PERSIST_SIZE sizeof(bool) #define H5F_CRT_FREE_SPACE_PERSIST_DEF H5F_FREE_SPACE_PERSIST_DEF -#define H5F_CRT_FREE_SPACE_PERSIST_ENC H5P__encode_hbool_t -#define H5F_CRT_FREE_SPACE_PERSIST_DEC H5P__decode_hbool_t +#define H5F_CRT_FREE_SPACE_PERSIST_ENC H5P__encode_bool +#define H5F_CRT_FREE_SPACE_PERSIST_DEC H5P__decode_bool #define H5F_CRT_FREE_SPACE_THRESHOLD_SIZE sizeof(hsize_t) #define H5F_CRT_FREE_SPACE_THRESHOLD_DEF H5F_FREE_SPACE_THRESHOLD_DEF #define H5F_CRT_FREE_SPACE_THRESHOLD_ENC H5P__encode_hsize_t @@ -189,7 +189,7 @@ static const unsigned H5F_def_sohm_index_minsizes_g[H5O_SHMESG_MAX_NINDEXES] = static const unsigned H5F_def_sohm_list_max_g = H5F_CRT_SHMSG_LIST_MAX_DEF; static const unsigned H5F_def_sohm_btree_min_g = H5F_CRT_SHMSG_BTREE_MIN_DEF; static const H5F_fspace_strategy_t H5F_def_file_space_strategy_g = H5F_CRT_FILE_SPACE_STRATEGY_DEF; -static const hbool_t H5F_def_free_space_persist_g = H5F_CRT_FREE_SPACE_PERSIST_DEF; +static const bool H5F_def_free_space_persist_g = H5F_CRT_FREE_SPACE_PERSIST_DEF; static const hsize_t H5F_def_free_space_threshold_g = H5F_CRT_FREE_SPACE_THRESHOLD_DEF; static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SIZE_DEF; diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 9dac659..ff6a3a3 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -40,8 +40,8 @@ /* ======================== File Mount properties ====================*/ /* Definition for whether absolute symlinks local to file. */ -#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) -#define H5F_MNT_SYM_LOCAL_DEF FALSE +#define H5F_MNT_SYM_LOCAL_SIZE sizeof(bool) +#define H5F_MNT_SYM_LOCAL_DEF false /******************/ /* Local Typedefs */ @@ -90,7 +90,7 @@ const H5P_libclass_t H5P_CLS_FMNT[1] = {{ /*******************/ /* Property value defaults */ -static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether symlinks are local to file */ +static const bool H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether symlinks are local to file */ /*------------------------------------------------------------------------- * Function: H5P__fmnt_reg_prop diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index cf60f43..364955b 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -252,9 +252,9 @@ H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens /* Update fields */ if (max_compact != H5G_CRT_GINFO_MAX_COMPACT || min_dense != H5G_CRT_GINFO_MIN_DENSE) - ginfo.store_link_phase_change = TRUE; + ginfo.store_link_phase_change = true; else - ginfo.store_link_phase_change = FALSE; + ginfo.store_link_phase_change = false; ginfo.max_compact = (uint16_t)max_compact; ginfo.min_dense = (uint16_t)min_dense; @@ -350,9 +350,9 @@ H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name /* Update fields */ if (est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) - ginfo.store_est_entry_info = TRUE; + ginfo.store_est_entry_info = true; else - ginfo.store_est_entry_info = FALSE; + ginfo.store_est_entry_info = false; ginfo.est_num_entries = (uint16_t)est_num_entries; ginfo.est_name_len = (uint16_t)est_name_len; @@ -437,8 +437,8 @@ H5Pset_link_creation_order(hid_t plist_id, unsigned crt_order_flags) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get link info"); /* Update fields */ - linfo.track_corder = (hbool_t)((crt_order_flags & H5P_CRT_ORDER_TRACKED) ? TRUE : FALSE); - linfo.index_corder = (hbool_t)((crt_order_flags & H5P_CRT_ORDER_INDEXED) ? TRUE : FALSE); + linfo.track_corder = (bool)((crt_order_flags & H5P_CRT_ORDER_TRACKED) ? true : false); + linfo.index_corder = (bool)((crt_order_flags & H5P_CRT_ORDER_INDEXED) ? true : false); /* Set link info */ if (H5P_set(plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) @@ -556,15 +556,15 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) /* Update fields */ if (ginfo->max_compact != H5G_CRT_GINFO_MAX_COMPACT || ginfo->min_dense != H5G_CRT_GINFO_MIN_DENSE) - ginfo->store_link_phase_change = TRUE; + ginfo->store_link_phase_change = true; else - ginfo->store_link_phase_change = FALSE; + ginfo->store_link_phase_change = false; if (ginfo->est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || ginfo->est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) - ginfo->store_est_entry_info = TRUE; + ginfo->store_est_entry_info = true; else - ginfo->store_est_entry_info = FALSE; + ginfo->store_est_entry_info = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__gcrt_group_info_dec() */ @@ -641,8 +641,8 @@ H5P__gcrt_link_info_dec(const void **_pp, void *_value) H5_DECODE_UNSIGNED(*pp, crt_order_flags); /* Update fields */ - linfo->track_corder = (hbool_t)((crt_order_flags & H5P_CRT_ORDER_TRACKED) ? TRUE : FALSE); - linfo->index_corder = (hbool_t)((crt_order_flags & H5P_CRT_ORDER_INDEXED) ? TRUE : FALSE); + linfo->track_corder = (bool)((crt_order_flags & H5P_CRT_ORDER_TRACKED) ? true : false); + linfo->index_corder = (bool)((crt_order_flags & H5P_CRT_ORDER_INDEXED) ? true : false); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Pint.c b/src/H5Pint.c index b9db915..ccdf3a5 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -476,13 +476,13 @@ H5P_init_phase1(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register properties"); /* Register the new class */ - if ((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, *lib_class->pclass, FALSE)) < 0) + if ((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, *lib_class->pclass, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); /* Only register the default property list if it hasn't been created yet */ if (lib_class->def_plist_id && *lib_class->def_plist_id == (-1)) { /* Register the default property list for the new class*/ - if ((*lib_class->def_plist_id = H5P_create_id(*lib_class->pclass, FALSE)) < 0) + if ((*lib_class->def_plist_id = H5P_create_id(*lib_class->pclass, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register default property list for class"); } /* end if */ @@ -500,7 +500,7 @@ H5P_init_phase1(void) done: if (ret_value < 0 && tot_init > 0) { /* First uninitialize all default property lists */ - H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + H5I_clear_type(H5I_GENPROP_LST, false, false); /* Then uninitialize any initialized libclass */ for (u = 0; u < NELMTS(init_class); u++) { @@ -588,7 +588,7 @@ H5P_term_package(void) if ((nclass + nlist) > 0) { /* Clear the lists */ if (nlist > 0) { - (void)H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + (void)H5I_clear_type(H5I_GENPROP_LST, false, false); /* Reset the default property lists, if they've been closed */ if (H5I_nmembers(H5I_GENPROP_LST) == 0) { @@ -616,7 +616,7 @@ H5P_term_package(void) /* Only attempt to close the classes after all the lists are closed */ if (nlist == 0 && nclass > 0) { - (void)H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); + (void)H5I_clear_type(H5I_GENPROP_CLS, false, false); /* Reset the default property classes and IDs if they've been closed */ if (H5I_nmembers(H5I_GENPROP_CLS) == 0) { @@ -903,7 +903,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) +H5P_copy_plist(const H5P_genplist_t *old_plist, bool app_ref) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *new_plist = NULL; /* New property list generated from copy */ @@ -913,7 +913,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) H5SL_node_t *curr_node; /* Current node in skip list */ H5SL_t *seen = NULL; /* Skip list containing properties already seen */ size_t nseen; /* Number of items 'seen' */ - hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ + bool has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value = H5I_INVALID_HID; /* return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -931,7 +931,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) /* Set class state */ new_plist->pclass = old_plist->pclass; new_plist->nprops = 0; /* Initially the plist has the same number of properties as the class */ - new_plist->class_init = FALSE; /* Initially, wait until the class callback finishes to set */ + new_plist->class_init = false; /* Initially, wait until the class callback finishes to set */ /* Initialize the skip list to hold the changed properties */ if ((new_plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) @@ -1022,7 +1022,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) * initialize each with default value & make property 'copy' callback. */ tclass = old_plist->pclass; - has_parent_class = (hbool_t)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); + has_parent_class = (bool)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); while (tclass != NULL) { if (tclass->nprops > 0) { /* Walk through the properties in the old class */ @@ -1091,7 +1091,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) } /* end while */ /* Set the class initialization flag */ - new_plist->class_init = TRUE; + new_plist->class_init = true; /* Set the return value */ ret_value = new_plist_id; @@ -1149,7 +1149,7 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicating property for a class */ if (type == H5P_PROP_WITHIN_CLASS) { assert(oprop->type == H5P_PROP_WITHIN_CLASS); - assert(oprop->shared_name == FALSE); + assert(oprop->shared_name == false); /* Duplicate name */ prop->name = H5MM_xstrdup(oprop->name); @@ -1167,10 +1167,10 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicating a property from a class */ else { assert(oprop->type == H5P_PROP_WITHIN_CLASS); - assert(oprop->shared_name == FALSE); + assert(oprop->shared_name == false); /* Share the name */ - prop->shared_name = TRUE; + prop->shared_name = true; /* Set the type */ prop->type = type; @@ -1258,7 +1258,7 @@ H5P__create_prop(const char *name, size_t size, H5P_prop_within_t type, const vo /* Set the property initial values */ prop->name = H5MM_xstrdup(name); /* Duplicate name */ - prop->shared_name = FALSE; + prop->shared_name = false; prop->size = size; prop->type = type; @@ -1498,7 +1498,7 @@ static herr_t H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) { H5P_genprop_t *tprop = (H5P_genprop_t *)item; /* Temporary pointer to property */ - hbool_t make_cb = *(hbool_t *)op_data; /* Whether to make property 'close' callback */ + bool make_cb = *(bool *)op_data; /* Whether to make property 'close' callback */ FUNC_ENTER_PACKAGE_NOERR @@ -1598,7 +1598,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) case H5P_MOD_INC_REF: /* Increment the ID reference count*/ /* Reset the deleted flag if incrementing the reference count */ if (pclass->deleted) - pclass->deleted = FALSE; + pclass->deleted = false; pclass->ref_count++; break; @@ -1607,7 +1607,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) /* Mark the class object as deleted if reference count drops to zero */ if (pclass->ref_count == 0) - pclass->deleted = TRUE; + pclass->deleted = true; break; case H5P_MOD_ERR: @@ -1625,7 +1625,7 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) /* Free the class properties without making callbacks */ if (pclass->props) { - hbool_t make_cb = FALSE; + bool make_cb = false; H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ @@ -1748,7 +1748,7 @@ H5P__create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t pclass->plists = 0; /* No properties lists of this class yet */ pclass->classes = 0; /* No classes derived from this class yet */ pclass->ref_count = 1; /* This is the first reference to the new class */ - pclass->deleted = FALSE; /* Not deleted yet... :-) */ + pclass->deleted = false; /* Not deleted yet... :-) */ pclass->revision = H5P_GET_NEXT_REV; /* Get a revision number for the class */ /* Create the skip list for properties */ @@ -1779,7 +1779,7 @@ done: if (pclass->name) H5MM_xfree(pclass->name); if (pclass->props) { - hbool_t make_cb = FALSE; + bool make_cb = false; H5SL_destroy(pclass->props, H5P__free_prop_cb, &make_cb); } /* end if */ @@ -1838,7 +1838,7 @@ H5P__create(H5P_genclass_t *pclass) /* Set class state */ plist->pclass = pclass; plist->nprops = 0; /* Initially the plist has the same number of properties as the class */ - plist->class_init = FALSE; /* Initially, wait until the class callback finishes to set */ + plist->class_init = false; /* Initially, wait until the class callback finishes to set */ /* Create the skip list for changed properties */ if ((plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) @@ -1955,7 +1955,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) +H5P_create_id(H5P_genclass_t *pclass, bool app_ref) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *plist = NULL; /* Property list created */ @@ -1996,7 +1996,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) } /* end while */ /* Set the class initialization flag */ - plist->class_init = TRUE; + plist->class_init = true; /* Set the return value */ ret_value = plist_id; @@ -3321,25 +3321,25 @@ H5P_exist_plist(const H5P_genplist_t *plist, const char *name) /* Check for property in deleted property list */ if (H5SL_search(plist->del, name) != NULL) - ret_value = FALSE; + ret_value = false; else { /* Check for property in changed property list */ if (H5SL_search(plist->props, name) != NULL) - ret_value = TRUE; + ret_value = true; else { H5P_genclass_t *tclass; /* Temporary class pointer */ tclass = plist->pclass; while (tclass != NULL) { if (H5SL_search(tclass->props, name) != NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Go up to parent class */ tclass = tclass->parent; } /* end while */ /* If we've reached here, we couldn't find the property */ - ret_value = FALSE; + ret_value = false; } /* end else */ } /* end else */ @@ -3380,21 +3380,21 @@ H5P__exist_pclass(H5P_genclass_t *pclass, const char *name) /* Check for property in property list */ if (H5SL_search(pclass->props, name) != NULL) - ret_value = TRUE; + ret_value = true; else { H5P_genclass_t *tclass; /* Temporary class pointer */ tclass = pclass->parent; while (tclass != NULL) { if (H5SL_search(tclass->props, name) != NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Go up to parent class */ tclass = tclass->parent; } /* end while */ /* If we've reached here, we couldn't find the property */ - ret_value = FALSE; + ret_value = false; } /* end else */ done: @@ -3534,7 +3534,7 @@ H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) herr_t H5P_get_nprops_pclass(pclass, nprops) H5P_genclass_t *pclass; IN: Property class to check size_t *nprops; OUT: Number of properties in the property list - hbool_t recurse; IN: Include properties in parent class(es) also + bool recurse; IN: Include properties in parent class(es) also RETURNS Success: non-negative value (can't fail) Failure: negative value @@ -3547,7 +3547,7 @@ H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, hbool_t recurse) +H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, bool recurse) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3950,7 +3950,7 @@ H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int * udata.plist2 = plist2; /* Iterate over properties in first property list */ - if ((ret_value = H5P__iterate_plist(plist1, TRUE, &idx, H5P__cmp_plist_cb, &udata)) < 0) + if ((ret_value = H5P__iterate_plist(plist1, true, &idx, H5P__cmp_plist_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); if (ret_value != 0) { *cmp_ret = udata.cmp_value; @@ -3979,7 +3979,7 @@ done: H5P_genclass_t *pclass1; IN: Property class to check H5P_genclass_t *pclass2; IN: Property class to compare with RETURNS - Success: TRUE (1) or FALSE (0) + Success: true (1) or false (0) Failure: negative value DESCRIPTION This routine queries whether a property class is the same as another class, @@ -4003,14 +4003,14 @@ H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) /* Compare property classes */ if (H5P__cmp_class(pclass1, pclass2) == 0) { - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } else { /* Check if the class is derived, and walk up the chain, if so */ if (pclass1->parent != NULL) ret_value = H5P_class_isa(pclass1->parent, pclass2); else - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end else */ done: @@ -4027,7 +4027,7 @@ done: hid_t plist_id; IN: Property list to query hid_t pclass_id; IN: Property class to query RETURNS - Success: TRUE (1) or FALSE (0) + Success: true (1) or false (0) Failure: negative DESCRIPTION This routine queries whether a property list is a member of the property @@ -4101,7 +4101,7 @@ H5P_object_verify(hid_t plist_id, hid_t pclass_id) FUNC_ENTER_NOAPI(NULL) /* Compare the property list's class against the other class */ - if (H5P_isa_class(plist_id, pclass_id) != TRUE) + if (H5P_isa_class(plist_id, pclass_id) != true) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, NULL, "property list is not a member of the class"); /* Get the plist structure */ @@ -4216,9 +4216,9 @@ H5P__iterate_plist_pclass_cb(void *_item, void *_key, void *_udata) USAGE int H5P__iterate_plist(plist, iter_all_prop, idx, cb_func, iter_data) const H5P_genplist_t *plist; IN: Property list to iterate over - hbool_t iter_all_prop; IN: Whether to iterate over all properties - (TRUE), or just non-default (i.e. changed) - properties (FALSE). + bool iter_all_prop; IN: Whether to iterate over all properties + (true), or just non-default (i.e. changed) + properties (false). int *idx; IN/OUT: Index of the property to begin with H5P_iterate_t cb_func; IN: Function pointer to function to be called with each property iterated over. @@ -4263,7 +4263,7 @@ iteration, the function's behavior is undefined. REVISION LOG --------------------------------------------------------------------------*/ int -H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, H5P_iterate_int_t cb_func, +H5P__iterate_plist(const H5P_genplist_t *plist, bool iter_all_prop, int *idx, H5P_iterate_int_t cb_func, void *udata) { H5P_genclass_t *tclass; /* Temporary class pointer */ @@ -5131,7 +5131,7 @@ H5P_close(H5P_genplist_t *plist) H5P_genclass_t *tclass; /* Temporary class pointer */ H5SL_t *seen = NULL; /* Skip list to hold names of properties already seen */ size_t nseen; /* Number of items 'seen' */ - hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ + bool has_parent_class; /* Flag to indicate that this property list's class has a parent */ size_t ndel; /* Number of items deleted */ H5SL_node_t *curr_node; /* Current node in skip list */ H5P_genprop_t *tmp; /* Temporary pointer to properties */ @@ -5198,7 +5198,7 @@ H5P_close(H5P_genplist_t *plist) * initialize each with default value & make property 'remove' callback. */ tclass = plist->pclass; - has_parent_class = (hbool_t)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); + has_parent_class = (bool)(tclass != NULL && tclass->parent != NULL && tclass->parent->nprops > 0); while (tclass != NULL) { if (tclass->nprops > 0) { /* Walk through the properties in the class */ @@ -5421,7 +5421,7 @@ H5P__open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) + if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes"); else if (NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class"); @@ -5439,7 +5439,7 @@ H5P__open_class_path(const char *path) check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, FALSE) < 0) + if (H5I_iterate(H5I_GENPROP_CLS, H5P__open_class_path_cb, &check_info, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes"); else if (NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class"); @@ -5651,7 +5651,7 @@ H5P__new_plist_of_type(H5P_plist_type_t type) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, H5I_INVALID_HID, "not a property class"); /* Create the new property list */ - if ((ret_value = H5P_create_id(pclass, TRUE)) < 0) + if ((ret_value = H5P_create_id(pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list"); done: diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 19a63bc..f70c72c 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -261,7 +261,7 @@ H5P__lacc_elink_fapl_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); - if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) + if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); } /* end if */ @@ -300,7 +300,7 @@ H5P__lacc_elink_fapl_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); - if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) + if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); } /* end if */ @@ -326,7 +326,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) const hid_t *elink_fapl = (const hid_t *)value; /* Property to encode */ uint8_t **pp = (uint8_t **)_pp; H5P_genplist_t *fapl_plist; /* Pointer to property list */ - hbool_t non_default_fapl = FALSE; /* Whether the FAPL is non-default */ + bool non_default_fapl = false; /* Whether the FAPL is non-default */ size_t fapl_size = 0; /* FAPL's encoded size */ herr_t ret_value = SUCCEED; /* Return value */ @@ -336,7 +336,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) if (*elink_fapl != H5P_DEFAULT) { if (NULL == (fapl_plist = (H5P_genplist_t *)H5P_object_verify(*elink_fapl, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property list"); - non_default_fapl = TRUE; + non_default_fapl = true; } /* end if */ if (NULL != *pp) { @@ -347,7 +347,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* Encode the property list, if non-default */ /* (if *pp == NULL, will only compute the size) */ if (non_default_fapl) { - if (H5P__encode(fapl_plist, TRUE, NULL, &fapl_size) < 0) + if (H5P__encode(fapl_plist, true, NULL, &fapl_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list"); if (*pp) { @@ -362,7 +362,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode the plist */ - if (H5P__encode(fapl_plist, TRUE, *pp, &fapl_size) < 0) + if (H5P__encode(fapl_plist, true, *pp, &fapl_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list"); *pp += fapl_size; @@ -393,7 +393,7 @@ H5P__lacc_elink_fapl_dec(const void **_pp, void *_value) { hid_t *elink_fapl = (hid_t *)_value; /* The elink FAPL value */ const uint8_t **pp = (const uint8_t **)_pp; - hbool_t non_default_fapl; /* Whether the FAPL is non-default */ + bool non_default_fapl; /* Whether the FAPL is non-default */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -405,7 +405,7 @@ H5P__lacc_elink_fapl_dec(const void **_pp, void *_value) HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Determine if the FAPL is non-default */ - non_default_fapl = (hbool_t) * (*pp)++; + non_default_fapl = (bool)*(*pp)++; if (non_default_fapl) { size_t fapl_size = 0; /* Encoded size of property list */ @@ -494,7 +494,7 @@ H5P__lacc_elink_fapl_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); - if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) + if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); } /* end if */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b164711..2382756 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -443,7 +443,7 @@ H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times /*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object header flags"); /* Set track times flag to return */ - *track_times = (hbool_t)((ohdr_flags & H5O_HDR_STORE_TIMES) ? TRUE : FALSE); + *track_times = (bool)((ohdr_flags & H5O_HDR_STORE_TIMES) ? true : false); } /* end if */ done: @@ -933,7 +933,7 @@ done: * Purpose: This is a query routine to verify that all the filters set * in the dataset creation property list are available currently. * - * Return: Success: TRUE if all filters available, FALSE if one or + * Return: Success: true if all filters available, false if one or * more filters not currently available. * Failure: FAIL on error * @@ -971,8 +971,8 @@ done: * Purpose: Check whether the filter is in the pipeline of the object * creation property list. * - * Return: TRUE: found - * FALSE: not found + * Return: true: found + * false: not found * FAIL: error * *------------------------------------------------------------------------- @@ -1319,16 +1319,16 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode filter name if it exists */ if (NULL != pline->filter[u].name) { - /* encode TRUE indicating that it exits */ - *(*pp)++ = (uint8_t)TRUE; + /* encode true indicating that it exits */ + *(*pp)++ = (uint8_t) true; /* encode filter name */ H5MM_memcpy(*pp, (uint8_t *)(pline->filter[u].name), H5Z_COMMON_NAME_LEN); *pp += H5Z_COMMON_NAME_LEN; } /* end if */ else - /* encode FALSE indicating that it does not exist */ - *(*pp)++ = (uint8_t)FALSE; + /* encode false indicating that it does not exist */ + *(*pp)++ = (uint8_t) false; /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 9a58d00..e249c7f 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -62,7 +62,7 @@ typedef struct H5P_genprop_t { size_t size; /* Size of property value */ void *value; /* Pointer to property value */ H5P_prop_within_t type; /* Type of object the property is within */ - hbool_t shared_name; /* Whether the name is shared or not */ + bool shared_name; /* Whether the name is shared or not */ /* Callback function pointers & info */ H5P_prp_create_func_t create; /* Function to call when a property is created */ @@ -86,8 +86,8 @@ struct H5P_genclass_t { plists; /* Number of property lists that have been created since the last modification to the class */ unsigned classes; /* Number of classes that have been derived since the last modification to the class */ unsigned ref_count; /* Number of outstanding ID's open on this class object */ - hbool_t deleted; /* Whether this class has been deleted and is waiting for dependent classes & proplists - to close */ + bool deleted; /* Whether this class has been deleted and is waiting for dependent classes & proplists + to close */ unsigned revision; /* Revision number of a particular class (global) */ H5SL_t *props; /* Skip list containing properties */ @@ -105,7 +105,7 @@ struct H5P_genplist_t { H5P_genclass_t *pclass; /* Pointer to class info */ hid_t plist_id; /* Copy of the property list ID (for use in close callback) */ size_t nprops; /* Number of properties in class */ - hbool_t class_init; /* Whether the class initialization callback finished successfully */ + bool class_init; /* Whether the class initialization callback finished successfully */ H5SL_t *del; /* Skip list containing names of deleted properties */ H5SL_t *props; /* Skip list containing properties */ }; @@ -152,7 +152,7 @@ H5_DLL herr_t H5P__get_size_pclass(H5P_genclass_t *pclass, const char *name, siz H5_DLL herr_t H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops); H5_DLL int H5P__cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2); H5_DLL herr_t H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int *cmp_ret); -H5_DLL int H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, +H5_DLL int H5P__iterate_plist(const H5P_genplist_t *plist, bool iter_all_prop, int *idx, H5P_iterate_int_t iter_func, void *iter_data); H5_DLL int H5P__iterate_pclass(const H5P_genclass_t *pclass, int *idx, H5P_iterate_int_t iter_func, void *iter_data); @@ -167,19 +167,19 @@ H5_DLL H5P_genprop_t *H5P__find_prop_plist(const H5P_genplist_t *plist, const c H5_DLL hid_t H5P__new_plist_of_type(H5P_plist_type_t type); /* Encode/decode routines */ -H5_DLL herr_t H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, size_t *nalloc); +H5_DLL herr_t H5P__encode(const H5P_genplist_t *plist, bool enc_all_prop, void *buf, size_t *nalloc); H5_DLL hid_t H5P__decode(const void *buf); H5_DLL herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__encode_size_t(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__encode_unsigned(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__encode_uint8_t(const void *value, void **_pp, size_t *size); -H5_DLL herr_t H5P__encode_hbool_t(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_bool(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__encode_double(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__decode_hsize_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_size_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_unsigned(const void **_pp, void *value); H5_DLL herr_t H5P__decode_uint8_t(const void **_pp, void *value); -H5_DLL herr_t H5P__decode_hbool_t(const void **_pp, void *value); +H5_DLL herr_t H5P__decode_bool(const void **_pp, void *value); H5_DLL herr_t H5P__decode_double(const void **_pp, void *value); H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__decode_coll_md_read_flag_t(const void **_pp, void *value); diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index e26c81e..fa70e38 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -161,8 +161,8 @@ H5_DLL herr_t H5P_init_phase2(void); /* Internal versions of API routines */ H5_DLL herr_t H5P_close(H5P_genplist_t *plist); -H5_DLL hid_t H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref); -H5_DLL hid_t H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref); +H5_DLL hid_t H5P_create_id(H5P_genclass_t *pclass, bool app_ref); +H5_DLL hid_t H5P_copy_plist(const H5P_genplist_t *old_plist, bool app_ref); H5_DLL herr_t H5P_get(H5P_genplist_t *plist, const char *name, void *value); H5_DLL herr_t H5P_set(H5P_genplist_t *plist, const char *name, const void *value); H5_DLL herr_t H5P_peek(H5P_genplist_t *plist, const char *name, void *value); @@ -178,16 +178,16 @@ H5_DLL htri_t H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t H5_DLL char *H5P_get_class_name(H5P_genclass_t *pclass); /* Internal helper routines */ -H5_DLL herr_t H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, hbool_t recurse); +H5_DLL herr_t H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, bool recurse); H5_DLL hid_t H5P_peek_driver(H5P_genplist_t *plist); H5_DLL const void *H5P_peek_driver_info(H5P_genplist_t *plist); H5_DLL const char *H5P_peek_driver_config_str(H5P_genplist_t *plist); H5_DLL herr_t H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_driver_info, const char *new_driver_config_str); H5_DLL herr_t H5P_set_driver_by_name(H5P_genplist_t *plist, const char *driver_name, - const char *driver_config, hbool_t app_ref); + const char *driver_config, bool app_ref); H5_DLL herr_t H5P_set_driver_by_value(H5P_genplist_t *plist, H5FD_class_value_t driver_value, - const char *driver_config, hbool_t app_ref); + const char *driver_config, bool app_ref); H5_DLL herr_t H5P_set_vol(H5P_genplist_t *plist, hid_t vol_id, const void *vol_info); H5_DLL herr_t H5P_reset_vol_class(const H5P_genclass_t *pclass, const struct H5VL_connector_prop_t *vol_prop); H5_DLL herr_t H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func, void *alloc_info, diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 124f661..9a455c7 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -916,14 +916,14 @@ H5_DLL herr_t H5Pget(hid_t plist_id, const char *name, void *value); * \code * plist_class_id = H5Pget_class (dsetA_plist); * - * if H5Pequal (plist_class_id, H5P_OBJECT_CREATE) = TRUE; + * if H5Pequal (plist_class_id, H5P_OBJECT_CREATE) = true; * [ H5P_OBJECT_CREATE is the property list class ] * [ returned by H5Pget_class. ] * - * else if H5Pequal (plist_class_id, H5P_DATASET_CREATE) = TRUE; + * else if H5Pequal (plist_class_id, H5P_DATASET_CREATE) = true; * [ H5P_DATASET_CREATE is the property list class. ] * - * else if H5Pequal (plist_class_id, H5P_DATASET_XFER) = TRUE; + * else if H5Pequal (plist_class_id, H5P_DATASET_XFER) = true; * [ H5P_DATASET_XFER is the property list class. ] * * . @@ -2081,7 +2081,7 @@ H5_DLL int H5Pget_nfilters(hid_t plist_id); * are being recorded * * \plist_id - * \param[out] track_times Boolean value, 1 (TRUE) or 0 (FALSE), + * \param[out] track_times Boolean value, 1 (true) or 0 (false), * specifying whether object times are being recorded * * \return \herr_t @@ -5807,7 +5807,7 @@ H5_DLL herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *opts); * no dataset attributes hint setting for the dataset * creation property list \p dcpl_id. This setting is used to * inform the library to create minimized dataset object headers - * when TRUE. The setting value is returned in the boolean pointer + * when true. The setting value is returned in the boolean pointer * \p minimize. * * \since 1.10.5 @@ -6296,13 +6296,13 @@ H5_DLL herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned opts); * hint setting for the dataset creation property list \p dcpl_id. * Datasets created with the dataset creation property list * \p dcpl_id will have their object headers minimized if the - * boolean flag \p minimize is set to TRUE. By setting \p minimize - * to TRUE, the library expects that no attributes will be added + * boolean flag \p minimize is set to true. By setting \p minimize + * to true, the library expects that no attributes will be added * to the dataset. Attributes can be added, but they are appended * with a continuation message, which can reduce performance. * * This setting interacts with H5Fset_dset_no_attrs_hint(): if - * either is set to TRUE, then the created dataset's object header + * either is set to true, then the created dataset's object header * will be minimized. * * \since 1.10.5 @@ -8408,14 +8408,14 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * \details H5Pset_modify_write_buf() sets whether the library is allowed to * modify the contents of write buffers passed to HDF5 API routines * that are passed the dataset transfer property list \p plist_id. The - * default value for modify_write_buf is FALSE. + * default value for modify_write_buf is false. * * This function can be used to allow the library to perform in-place * type conversion on write operations to save memory space. After making an - * API call with this parameter set to TRUE, the contents of the write buffer + * API call with this parameter set to true, the contents of the write buffer * are undefined. * - * \note When modify_write_buf is set to TRUE the library may violate the + * \note When modify_write_buf is set to true the library may violate the * const qualifier on the API parameter for the write buffer. * * \since 1.14.1 @@ -8438,7 +8438,7 @@ H5_DLL herr_t H5Pset_modify_write_buf(hid_t plist_id, hbool_t modify_write_buf); * from the dataset transfer property list \p plist_id. This property * determines whether the library is allowed to modify the contents of * write buffers passed to HDF5 API routines that are passed - * \p plist_id. The default value for modify_write_buf is FALSE. + * \p plist_id. The default value for modify_write_buf is false. * * \since 1.14.1 * diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 0bb1c31..5d2446c 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -107,7 +107,7 @@ H5P__open_class_path_test(const char *path) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to find class with full path"); /* Get an ID for the class */ - if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class"); done: diff --git a/src/H5R.c b/src/H5R.c index a43b638..8f07174 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -103,7 +103,7 @@ H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_p /* Get object access property list */ if (H5P_DEFAULT == oapl_id) oapl_id = H5P_LINK_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) + else if (true != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "oapl_id is not a link access property list ID"); /* Get the VOL object */ @@ -115,7 +115,7 @@ H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_p HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, obj_type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, obj_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Retrieve VOL file object */ @@ -151,7 +151,7 @@ H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_p HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create object reference"); /* Attach loc_id to reference and hold reference to it */ - if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, TRUE, TRUE) < 0) + if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, true, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference"); done: @@ -204,7 +204,7 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, /* Get object access property list */ if (H5P_DEFAULT == oapl_id) oapl_id = H5P_LINK_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) + else if (true != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "oapl_id is not a link access property list ID"); /* Get the VOL object */ @@ -216,7 +216,7 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, obj_type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, obj_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Retrieve VOL file object */ @@ -253,7 +253,7 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create region reference"); /* Attach loc_id to reference and hold reference to it */ - if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, TRUE, TRUE) < 0) + if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, true, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference"); done: @@ -302,7 +302,7 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl /* Get object access property list */ if (H5P_DEFAULT == oapl_id) oapl_id = H5P_LINK_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) + else if (true != H5P_isa_class(oapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "oapl_id is not a link access property list ID"); /* Get the VOL object */ @@ -314,7 +314,7 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, obj_type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, obj_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Retrieve VOL file object */ @@ -351,7 +351,7 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create attribute reference"); /* Attach loc_id to reference and hold reference to it */ - if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, TRUE, TRUE) < 0) + if (H5R__set_loc_id((H5R_ref_priv_t *)ref_ptr, file_id, true, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference"); done: @@ -429,7 +429,7 @@ done: * * Purpose: Compare two references * - * Return: TRUE if equal, FALSE if unequal, FAIL if error + * Return: true if equal, false if unequal, FAIL if error * *------------------------------------------------------------------------- */ @@ -526,7 +526,7 @@ H5R__open_object_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, vo } /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&oapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&oapl_id, H5P_CLS_DACC, loc_id, false) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get object token */ @@ -543,7 +543,7 @@ H5R__open_object_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, vo HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object by token"); /* Register object */ - if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -682,7 +682,7 @@ H5R__open_region_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, vo HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object by token"); /* Register object */ - if ((opened_obj_id = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, FALSE)) < 0) + if ((opened_obj_id = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, false)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); /* Get VOL object object */ @@ -852,11 +852,11 @@ H5R__open_attr_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id, void HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object by token"); /* Register object */ - if ((opened_obj_id = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, FALSE)) < 0) + if ((opened_obj_id = H5VL_register(opened_type, opened_obj, (*vol_obj_ptr)->connector, false)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, false) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Set location parameters */ @@ -875,7 +875,7 @@ H5R__open_attr_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id, void H5R_REF_ATTRNAME((const H5R_ref_priv_t *)ref_ptr)); /* Register the attribute and get an ID for it */ - if ((ret_value = H5VL_register(H5I_ATTR, opened_attr, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_ATTR, opened_attr, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute handle"); done: diff --git a/src/H5RS.c b/src/H5RS.c index 1ad22f3..46e9266 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -49,7 +49,7 @@ struct H5RS_str_t { char *end; /* Pointer to terminating NUL character at the end of the string */ size_t len; /* Current length of the string */ size_t max; /* Size of allocated buffer */ - hbool_t wrapped; /* Indicates that the string to be ref-counted is not copied */ + bool wrapped; /* Indicates that the string to be ref-counted is not copied */ unsigned n; /* Reference count of number of pointers sharing string */ }; @@ -191,7 +191,7 @@ H5RS__prepare_for_append(H5RS_str_t *rs) if (rs->wrapped) { if (H5RS__xstrdup(rs, rs->s) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string"); - rs->wrapped = FALSE; + rs->wrapped = false; } /* end if */ } /* end else */ @@ -316,7 +316,7 @@ H5RS_wrap(const char *s) * * We ignore warnings about storing a const char pointer in the struct * since we never modify or free the string when the wrapped struct - * field is set to TRUE. + * field is set to true. */ H5_GCC_CLANG_DIAG_OFF("cast-qual") ret_value->s = (char *)s; @@ -325,7 +325,7 @@ H5RS_wrap(const char *s) ret_value->len = HDstrlen(s); ret_value->end = ret_value->s + ret_value->len; - ret_value->wrapped = TRUE; + ret_value->wrapped = true; ret_value->max = 0; /* Wrapped, not allocated */ ret_value->n = 1; @@ -602,7 +602,7 @@ H5RS_incr(H5RS_str_t *rs) if (rs->wrapped) { if (H5RS__xstrdup(rs, rs->s) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string"); - rs->wrapped = FALSE; + rs->wrapped = false; } /* end if */ /* Increment reference count for string */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index e3ea606..773d8b0 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -101,7 +101,7 @@ H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(vol_obj, &is_native) < 0) @@ -113,7 +113,7 @@ H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref #endif /* NDEBUG */ /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Retrieve VOL object */ @@ -349,7 +349,7 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object by token"); /* Register object */ - if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -406,7 +406,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(vol_obj, &is_native) < 0) @@ -437,7 +437,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve object token"); /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, vol_obj_type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, vol_obj_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Retrieve VOL object */ @@ -581,7 +581,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *re HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) + if (H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, false) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get the VOL object */ @@ -607,7 +607,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *re HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object by token"); /* Register object */ - if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: @@ -656,7 +656,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(vol_obj, &is_native) < 0) @@ -673,7 +673,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier"); /* Get the file for the object */ - if ((file_id = H5F_get_file_id(vol_obj, vol_obj_type, FALSE)) < 0) + if ((file_id = H5F_get_file_id(vol_obj, vol_obj_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file or file object"); /* Retrieve VOL object */ @@ -697,7 +697,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataspace"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, space, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: diff --git a/src/H5Rint.c b/src/H5Rint.c index 1e4b57e..c09b261 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -231,7 +231,7 @@ H5R__create_region(const H5O_token_t *obj_token, size_t token_size, H5S_t *space /* Create new reference */ ref->info.obj.filename = NULL; - if (NULL == (ref->info.reg.space = H5S_copy(space, FALSE, TRUE))) + if (NULL == (ref->info.reg.space = H5S_copy(space, false, true))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace"); ref->loc_id = H5I_INVALID_HID; @@ -389,7 +389,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, hbool_t inc_ref, hbool_t app_ref) +H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, bool inc_ref, bool app_ref) { herr_t ret_value = SUCCEED; /* Return value */ @@ -471,7 +471,7 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id) /* TODO add search path */ /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get the VOL info from the fapl */ @@ -494,7 +494,7 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file"); /* Get an ID for the file */ - if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0) + if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, true)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); /* Get the file object */ @@ -519,7 +519,7 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id) } /* end if */ /* Attach loc_id to reference */ - if (H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, FALSE, TRUE) < 0) + if (H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, false, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "unable to attach location id to reference"); done: @@ -554,14 +554,14 @@ H5R__get_type(const H5R_ref_priv_t *ref) * * Purpose: Compare two references * - * Return: TRUE if equal, FALSE if unequal, FAIL if error + * Return: true if equal, false if unequal, FAIL if error * *------------------------------------------------------------------------- */ htri_t H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) { - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_PACKAGE @@ -570,21 +570,21 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) /* Compare reference types */ if (ref1->type != ref2->type) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Compare object addresses */ if (ref1->token_size != ref2->token_size) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (0 != memcmp(&ref1->info.obj.token, &ref2->info.obj.token, ref1->token_size)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Compare filenames */ if ((ref1->info.obj.filename && (NULL == ref2->info.obj.filename)) || ((NULL == ref1->info.obj.filename) && ref2->info.obj.filename)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (ref1->info.obj.filename && ref1->info.obj.filename && (0 != HDstrcmp(ref1->info.obj.filename, ref2->info.obj.filename))) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); switch (ref1->type) { case H5R_OBJECT2: @@ -596,7 +596,7 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) case H5R_ATTR: assert(ref1->info.attr.name && ref2->info.attr.name); if (0 != HDstrcmp(ref1->info.attr.name, ref2->info.attr.name)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); break; case H5R_OBJECT1: case H5R_DATASET_REGION1: @@ -640,7 +640,7 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) case H5R_OBJECT2: break; case H5R_DATASET_REGION2: - if (NULL == (dst_ref->info.reg.space = H5S_copy(src_ref->info.reg.space, FALSE, TRUE))) + if (NULL == (dst_ref->info.reg.space = H5S_copy(src_ref->info.reg.space, false, true))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace"); break; case H5R_ATTR: @@ -671,9 +671,9 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) /* Set location ID and hold reference to it */ dst_ref->loc_id = src_ref->loc_id; - if (H5I_inc_ref(dst_ref->loc_id, TRUE) < 0) + if (H5I_inc_ref(dst_ref->loc_id, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed"); - dst_ref->app_ref = TRUE; + dst_ref->app_ref = true; } done: @@ -762,7 +762,7 @@ H5R__get_region(const H5R_ref_priv_t *ref, H5S_t *space) assert(space); /* Copy reference selection to destination */ - if (H5S_select_copy(space, ref->info.reg.space, FALSE) < 0) + if (H5S_select_copy(space, ref->info.reg.space, false) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy selection"); done: diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index b4f1bbf..8ce6041 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -77,7 +77,7 @@ typedef struct H5R_ref_priv_t { uint32_t encode_size; /* Cached encoding size */ int8_t type; /* Reference type */ uint8_t token_size; /* Cached token size */ - hbool_t app_ref; /* App ref on loc_id */ + bool app_ref; /* App ref on loc_id */ } H5R_ref_priv_t; /*****************************/ @@ -94,7 +94,7 @@ H5_DLL herr_t H5R__create_attr(const H5O_token_t *obj_token, size_t token_size, H5R_ref_priv_t *ref); H5_DLL herr_t H5R__destroy(H5R_ref_priv_t *ref); -H5_DLL herr_t H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, hbool_t inc_ref, hbool_t app_ref); +H5_DLL herr_t H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, bool inc_ref, bool app_ref); H5_DLL hid_t H5R__get_loc_id(const H5R_ref_priv_t *ref); H5_DLL hid_t H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id); diff --git a/src/H5S.c b/src/H5S.c index 1050e03..3eb9ecd 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -148,11 +148,11 @@ H5S_top_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5I_nmembers(H5I_DATASPACE) > 0) { - (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + (void)H5I_clear_type(H5I_DATASPACE, false, false); n++; } if (H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) { - (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE); + (void)H5I_clear_type(H5I_SPACE_SEL_ITER, false, false); n++; } @@ -283,7 +283,7 @@ H5S_create(H5S_class_t type) } /* end switch */ /* Start with "all" selection */ - if (H5S_select_all(new_ds, FALSE) < 0) + if (H5S_select_all(new_ds, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); /* Reset common selection info pointer */ @@ -339,7 +339,7 @@ H5Screate(H5S_class_t type) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, new_ds, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, new_ds, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); done: @@ -472,11 +472,11 @@ H5Scopy(hid_t space_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace"); /* Copy */ - if (NULL == (dst = H5S_copy(src, FALSE, TRUE))) + if (NULL == (dst = H5S_copy(src, false, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, dst, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, dst, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: @@ -540,13 +540,13 @@ H5S_extent_copy(H5S_t *dst, const H5S_t *src) assert(src); /* Copy extent */ - if (H5S__extent_copy_real(&(dst->extent), &(src->extent), TRUE) < 0) + if (H5S__extent_copy_real(&(dst->extent), &(src->extent), true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent"); /* If the selection is 'all', update the number of elements selected in the * destination space */ if (H5S_SEL_ALL == H5S_GET_SELECT_TYPE(dst)) - if (H5S_select_all(dst, FALSE) < 0) + if (H5S_select_all(dst, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); done: @@ -563,7 +563,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max) +H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, bool copy_max) { unsigned u; herr_t ret_value = SUCCEED; /* Return value */ @@ -635,7 +635,7 @@ done: *------------------------------------------------------------------------- */ H5S_t * -H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max) +H5S_copy(const H5S_t *src, bool share_selection, bool copy_max) { H5S_t *dst = NULL; H5S_t *ret_value = NULL; /* Return value */ @@ -1058,7 +1058,7 @@ H5S_read(const H5O_loc_t *loc) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header"); /* Default to entire dataspace being selected */ - if (H5S_select_all(ds, FALSE) < 0) + if (H5S_select_all(ds, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); /* Set the value for successful return */ @@ -1081,7 +1081,7 @@ done: htri_t H5S__is_simple(sdim) H5S_t *sdim; IN: Pointer to dataspace object to query RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION This function determines the if a dataspace is "simple". ie. if it has orthogonal, evenly spaced dimensions. @@ -1098,7 +1098,7 @@ H5S__is_simple(const H5S_t *sdim) /* H5S_NULL shouldn't be simple dataspace */ ret_value = - (H5S_GET_EXTENT_TYPE(sdim) == H5S_SIMPLE || H5S_GET_EXTENT_TYPE(sdim) == H5S_SCALAR) ? TRUE : FALSE; + (H5S_GET_EXTENT_TYPE(sdim) == H5S_SIMPLE || H5S_GET_EXTENT_TYPE(sdim) == H5S_SCALAR) ? true : false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__is_simple() */ @@ -1112,7 +1112,7 @@ H5S__is_simple(const H5S_t *sdim) htri_t H5Sis_simple(space_id) hid_t space_id; IN: ID of dataspace object to query RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION This function determines the if a dataspace is "simple". ie. if it has orthogonal, evenly spaced dimensions. @@ -1260,11 +1260,11 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hs /* Set offset to zeros */ memset(space->select.offset, 0, sizeof(hsize_t) * space->extent.rank); - space->select.offset_changed = FALSE; + space->select.offset_changed = false; /* If the selection is 'all', update the number of elements selected */ if (H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) - if (H5S_select_all(space, FALSE) < 0) + if (H5S_select_all(space, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); done: @@ -1325,7 +1325,7 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, H5I_INVALID_HID, "can't create simple dataspace"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: @@ -1393,7 +1393,7 @@ H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); if (H5S_encode(dspace, (unsigned char **)&buf, nalloc) < 0) @@ -1430,7 +1430,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct"); /* Find out the size of buffer needed for extent */ - if ((extent_size = H5O_msg_raw_size(f, H5O_SDSPACE_ID, TRUE, obj)) == 0) + if ((extent_size = H5O_msg_raw_size(f, H5O_SDSPACE_ID, true, obj)) == 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size"); /* Find out the size of buffer needed for selection */ @@ -1458,7 +1458,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc) UINT32ENCODE(pp, extent_size); /* Encode the extent part of dataspace */ - if (H5O_msg_encode(f, H5O_SDSPACE_ID, TRUE, pp, obj) < 0) + if (H5O_msg_encode(f, H5O_SDSPACE_ID, true, pp, obj) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space"); pp += extent_size; @@ -1504,7 +1504,7 @@ H5Sdecode(const void *buf) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, H5I_INVALID_HID, "can't decode object"); /* Register the type and return the ID */ - if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, ds, true)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace"); done: @@ -1571,7 +1571,7 @@ H5S_decode(const unsigned char **p) extent = H5FL_FREE(H5S_extent_t, extent); /* Initialize to "all" selection. Deserialization relies on valid existing selection. */ - if (H5S_select_all(ds, FALSE) < 0) + if (H5S_select_all(ds, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); /* Decode the select part of dataspace. @@ -1692,7 +1692,7 @@ done: * * Purpose: Modify the dimensions of a dataspace. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ @@ -1700,7 +1700,7 @@ htri_t H5S_set_extent(H5S_t *space, const hsize_t *size) { unsigned u; /* Local index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1718,7 +1718,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) (unsigned long long)size[u], (unsigned long long)space->extent.max[u]); /* Indicate that dimension size can be modified */ - ret_value = TRUE; + ret_value = true; } /* end if */ /* Update dimension size(s) */ @@ -1736,24 +1736,24 @@ done: * Purpose: Determines if a simple dataspace's extent has been set (e.g., * by H5Sset_extent_simple() ). Helps avoid write errors. * - * Return: TRUE if dataspace has extent set - * FALSE if dataspace's extent is uninitialized + * Return: true if dataspace has extent set + * false if dataspace's extent is uninitialized * *------------------------------------------------------------------------- */ -H5_ATTR_PURE hbool_t +H5_ATTR_PURE bool H5S_has_extent(const H5S_t *ds) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR assert(ds); if (0 == ds->extent.rank && 0 == ds->extent.nelem && H5S_NULL != ds->extent.type) - ret_value = FALSE; + ret_value = false; else - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_has_extent() */ @@ -1790,7 +1790,7 @@ H5S_set_extent_real(H5S_t *space, const hsize_t *size) /* If the selection is 'all', update the number of elements selected */ if (H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)) - if (H5S_select_all(space, FALSE) < 0) + if (H5S_select_all(space, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); /* Mark the dataspace as no longer shared if it was before */ @@ -1806,7 +1806,7 @@ done: * * Purpose: Determines if two dataspace extents are equal. * - * Return: Success: TRUE if equal, FALSE if unequal + * Return: Success: true if equal, false if unequal * * Failure: FAIL * @@ -1844,7 +1844,7 @@ done: htri_t H5S_extent_equal(ds1, ds2) H5S_t *ds1, *ds2; IN: Dataspace objects to compare RETURNS - TRUE if equal, FALSE if unequal on success/Negative on failure + true if equal, false if unequal on success/Negative on failure DESCRIPTION Compare two dataspaces if their extents are identical. --------------------------------------------------------------------------*/ @@ -1852,7 +1852,7 @@ H5_ATTR_PURE htri_t H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) { unsigned u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1862,11 +1862,11 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) /* Make certain the dataspaces are the same type */ if (ds1->extent.type != ds2->extent.type) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Make certain the dataspaces are the same rank */ if (ds1->extent.rank != ds2->extent.rank) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Make certain the dataspaces' current dimensions are the same size */ if (ds1->extent.rank > 0) { @@ -1874,7 +1874,7 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) assert(ds2->extent.size); for (u = 0; u < ds1->extent.rank; u++) if (ds1->extent.size[u] != ds2->extent.size[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* Make certain the dataspaces' maximum dimensions are the same size */ @@ -1883,11 +1883,11 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) if (ds1->extent.max != NULL && ds2->extent.max != NULL) { for (u = 0; u < ds1->extent.rank; u++) if (ds1->extent.max[u] != ds2->extent.max[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ else if ((ds1->extent.max == NULL && ds2->extent.max != NULL) || (ds1->extent.max != NULL && ds2->extent.max == NULL)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ done: diff --git a/src/H5SM.c b/src/H5SM.c index 4c57e3f..5179a28 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -49,7 +49,7 @@ typedef struct H5SM_read_udata_t { /* Local Prototypes */ /********************/ static herr_t H5SM__create_index(H5F_t *f, H5SM_index_header_t *header); -static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap); +static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, bool delete_heap); static haddr_t H5SM__create_list(H5F_t *f, H5SM_index_header_t *header); static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *empty_pos, size_t *list_pos); @@ -57,10 +57,10 @@ static herr_t H5SM__convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header H5HF_t *fheap, H5O_t *open_oh); static herr_t H5SM__bt2_convert_to_list_op(const void *record, void *op_data); static herr_t H5SM__convert_btree_to_list(H5F_t *f, H5SM_index_header_t *header); -static herr_t H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed); -static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t defer, +static herr_t H5SM__incr_ref(void *record, void *_op_data, bool *changed); +static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, bool defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr); -static herr_t H5SM__decr_ref(void *record, void *op_data, hbool_t *changed); +static herr_t H5SM__decr_ref(void *record, void *op_data, bool *changed); static herr_t H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t *mesg, unsigned *cache_flags, size_t */*out*/ mesg_size, void **/*out*/ encoded_mesg); @@ -208,7 +208,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, const H5O_loc_t *ext_loc) * indices must be tracked on object header message in the file. */ if (type_flags_used & H5O_SHMESG_ATTR_FLAG) - H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); + H5F_SET_STORE_MSG_CRT_IDX(f, true); /* Set the ring type to superblock extension */ H5AC_set_ring(H5AC_RING_SBE, NULL); @@ -330,7 +330,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id) H5SM_master_table_t *table = NULL; /* Shared object master table */ unsigned type_flag; /* Flag corresponding to message type */ size_t u; /* Local index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) @@ -351,14 +351,14 @@ H5SM_type_shared(H5F_t *f, unsigned type_id) } /* end if */ else /* No shared messages of any type */ - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Search the indexes until we find one that matches this flag or we've * searched them all. */ for (u = 0; u < table->num_indexes; u++) if (table->indexes[u].mesg_types & type_flag) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); done: /* Release the master SOHM table */ @@ -516,10 +516,10 @@ done: * * Purpose: De-allocates storage for an index whose header is HEADER. * - * If DELETE_HEAP is TRUE, deletes the index's heap, eliminating + * If DELETE_HEAP is true, deletes the index's heap, eliminating * it completely. * - * If DELETE_HEAP is FALSE, the heap is not deleted. This is + * If DELETE_HEAP is false, the heap is not deleted. This is * useful when deleting only the index header as the index is * converted from a list to a B-tree and back again. * @@ -528,7 +528,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) +H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, bool delete_heap) { herr_t ret_value = SUCCEED; /* Return value */ @@ -567,7 +567,7 @@ H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) } /* end else */ /* Free the index's heap if requested. */ - if (delete_heap == TRUE) { + if (delete_heap == true) { if (H5HF_delete(f, header->heap_addr) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete fractal heap"); header->heap_addr = HADDR_UNDEF; @@ -740,7 +740,7 @@ H5SM__convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, H5SM_list_t * * still using!) */ num_messages = header->num_messages; /* preserve this across the index deletion */ - if (H5SM__delete_index(f, header, FALSE) < 0) + if (H5SM__delete_index(f, header, false) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't free list index"); /* Set/restore header info */ @@ -861,8 +861,8 @@ done: * routines and are the "fast" checks before we need to protect * the SOHM master table. * - * Return: TRUE if message could be a SOHM - * FALSE if this message couldn't be a SOHM + * Return: true if message could be a SOHM + * false if this message couldn't be a SOHM * Negative on failure * *------------------------------------------------------------------------- @@ -877,13 +877,13 @@ H5SM__can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) /* Check whether this message ought to be shared or not */ /* If sharing is disabled in this file, don't share the message */ if (!H5_addr_defined(H5F_SOHM_ADDR(f))) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Type-specific check */ if ((ret_value = H5O_msg_can_share(type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "can_share callback returned error"); - if (ret_value == FALSE) - HGOTO_DONE(FALSE); + if (ret_value == false) + HGOTO_DONE(false); /* At this point, the message passes the "trivial" checks and is worth * further checks. @@ -899,10 +899,10 @@ done: * Purpose: Checks if an object header message would be shared or is * already shared. * - * If not, returns FALSE and does nothing. + * If not, returns false and does nothing. * - * Return: TRUE if message will be a SOHM - * FALSE if this message won't be a SOHM + * Return: true if message will be a SOHM + * false if this message won't be a SOHM * Negative on failure * *------------------------------------------------------------------------- @@ -915,15 +915,15 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, un H5SM_master_table_t *my_table = NULL; ssize_t index_num; htri_t tri_ret; - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ if ((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error"); - if (tri_ret == FALSE) - HGOTO_DONE(FALSE); + if (tri_ret == false) + HGOTO_DONE(false); /* Look up the master SOHM table */ /* (use incoming master SOHM table if possible) */ @@ -945,14 +945,14 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, un */ if ((index_num = H5SM__get_index(my_table, type_id)) < 0) { H5E_clear_stack(NULL); /*ignore error*/ - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* If the message isn't big enough, don't bother sharing it */ - if (0 == (mesg_size = H5O_msg_raw_size(f, type_id, TRUE, mesg))) + if (0 == (mesg_size = H5O_msg_raw_size(f, type_id, true, mesg))) HGOTO_ERROR(H5E_SOHM, H5E_BADMESG, FAIL, "unable to get OH message size"); if (mesg_size < my_table->indexes[index_num].min_mesg_size) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* At this point, the message will be shared, set the index number if requested. */ if (sohm_index_num) @@ -1003,23 +1003,23 @@ done: * If the message should be shared (if sharing has been * enabled and this message qualifies), this function turns the * message into a shared message, sets the H5O_MSG_FLAG_SHARED - * flag in mesg_flags, and returns TRUE. + * flag in mesg_flags, and returns true. * - * If the message isn't shared, returns FALSE. If the message + * If the message isn't shared, returns false. If the message * isn't shared but was entered in the shared message index, * the H5O_MSG_FLAG_SHAREABLE flag will be set in mesg_flags - * and returns TRUE. + * and returns true. * * If this message was already shared, increments its reference - * count, and leaves it otherwise unchanged, returning TRUE and + * count, and leaves it otherwise unchanged, returning true and * setting the H5O_MSG_FLAG_SHARED flag in mesg_flags. * * If mesg_flags is NULL, the calling function should just look * at the return value to determine if the message was shared * or not. Such messages should never be "unique but shareable." * - * Return: TRUE if message is now a SOHM - * FALSE if this message is not a SOHM + * Return: true if message is now a SOHM + * false if this message is not a SOHM * Negative on failure * *------------------------------------------------------------------------- @@ -1036,7 +1036,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, #ifndef NDEBUG unsigned deferred_type = UINT_MAX; #endif - htri_t ret_value = TRUE; + htri_t ret_value = true; FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) @@ -1050,16 +1050,16 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, #else /* NDEBUG */ if ((((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_HERE) && (((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_SOHM)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); #endif /* NDEBUG */ /* "trivial" sharing checks */ if (mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if ((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error"); - if (tri_ret == FALSE) - HGOTO_DONE(FALSE); + if (tri_ret == false) + HGOTO_DONE(false); /* Set up user data for callback */ cache_udata.f = f; @@ -1072,8 +1072,8 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, /* "complex" sharing checks */ if ((tri_ret = H5SM_can_share(f, table, &index_num, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'complex' sharing checks returned error"); - if (tri_ret == FALSE) - HGOTO_DONE(FALSE); + if (tri_ret == false) + HGOTO_DONE(false); /* At this point, the message will be shared. */ @@ -1104,7 +1104,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, } /* end if */ done: - assert((ret_value != TRUE) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || + assert((ret_value != true) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); #ifndef NDEBUG /* If we previously deferred this operation, make sure the saved message @@ -1135,7 +1135,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) +H5SM__incr_ref(void *record, void *_op_data, bool *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *)record; H5SM_incr_ref_opdata *op_data = (H5SM_incr_ref_opdata *)_op_data; @@ -1168,7 +1168,7 @@ H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) } /* end else */ /* If we got here, the message has changed */ - *changed = TRUE; + *changed = true; /* Check for retrieving the heap ID */ if (op_data) @@ -1184,15 +1184,15 @@ done: * Purpose: This routine adds a shareable message to an index. * The behavior is controlled by the DEFER parameter: * - * If DEFER is TRUE, this routine Simulates adding a shareable + * If DEFER is true, this routine Simulates adding a shareable * message to an index. It determines what the outcome would - * be with DEFER set the FALSE and updates the shared message + * be with DEFER set the false and updates the shared message * info, but does not actually add the message to a heap, list, * or b-tree. Assumes that an open object header will be * available when H5SM__write_mesg is called with DEFER set to - * FALSE. + * false. * - * If DEFER is FALSE, this routine adds a shareable message to + * If DEFER is false, this routine adds a shareable message to * an index. If this is the first such message and we have an * object header location for this message, we record it in the * index but don't modify the message passed in. If the message @@ -1208,14 +1208,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t defer, unsigned type_id, +H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, bool defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr) { H5SM_list_t *list = NULL; /* List index */ H5SM_mesg_key_t key; /* Key used to search the index */ H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ H5O_shared_t shared; /* Shared H5O message */ - hbool_t found = FALSE; /* Was the message in the index? */ + bool found = false; /* Was the message in the index? */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ size_t buf_size; /* Size of the encoded message */ @@ -1231,11 +1231,11 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t assert(cache_flags_ptr); /* Encode the message to be written */ - if ((buf_size = H5O_msg_raw_size(f, type_id, TRUE, mesg)) == 0) + if ((buf_size = H5O_msg_raw_size(f, type_id, true, mesg)) == 0) HGOTO_ERROR(H5E_SOHM, H5E_BADSIZE, FAIL, "can't find message size"); if (NULL == (encoding_buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't allocate buffer for encoding"); - if (H5O_msg_encode(f, type_id, TRUE, (unsigned char *)encoding_buf, mesg) < 0) + if (H5O_msg_encode(f, type_id, true, (unsigned char *)encoding_buf, mesg) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTENCODE, FAIL, "can't encode message to be shared"); /* Open the fractal heap for this index */ @@ -1275,7 +1275,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t if (defer) { if (list_pos != SIZE_MAX) - found = TRUE; + found = true; } /* end if */ else { if (list_pos != SIZE_MAX) { @@ -1300,7 +1300,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t /* Set up the shared location to point to the shared location */ shared.u.heap_id = list->messages[list_pos].u.heap_loc.fheap_id; - found = TRUE; + found = true; } /* end if */ } /* end else */ } /* end if */ @@ -1334,7 +1334,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t */ if (H5B2_modify(bt2, &key, H5SM__incr_ref, &op_data) >= 0) { shared.u.heap_id = op_data.fheap_id; - found = TRUE; + found = true; } /* end if */ else H5E_clear_stack(NULL); /*ignore error*/ @@ -1668,7 +1668,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) +H5SM__decr_ref(void *record, void *op_data, bool *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *)record; @@ -1684,7 +1684,7 @@ H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) */ if (message->location == H5SM_IN_HEAP) { --message->u.heap_loc.ref_count; - *changed = TRUE; + *changed = true; } /* end if */ if (op_data) @@ -1857,7 +1857,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c fheap = NULL; /* Delete the index and its heap */ - if (H5SM__delete_index(f, header, TRUE) < 0) + if (H5SM__delete_index(f, header, true) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't delete empty index"); } /* end if */ else if (header->index_type == H5SM_BTREE && header->num_messages < header->btree_min) { @@ -1973,7 +1973,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) * indices must be tracked on object header message in the file. */ if (index_flags[u] & H5O_SHMESG_ATTR_FLAG) - H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); + H5F_SET_STORE_MSG_CRT_IDX(f, true); } /* end for */ /* Set values in the property list */ @@ -2158,7 +2158,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize message = list->messages[list_pos]; } /* end if */ else { - hbool_t msg_exists; /* Whether the message exists in the v2 B-tree */ + bool msg_exists; /* Whether the message exists in the v2 B-tree */ /* Index is a B-tree */ assert(header->index_type == H5SM_BTREE); @@ -2168,7 +2168,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index"); /* Look up the message in the v2 B-tree */ - msg_exists = FALSE; + msg_exists = false; if (H5B2_find(bt2, &key, &msg_exists, H5SM__get_refcount_bt2_cb, &message) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index"); if (!msg_exists) @@ -2339,7 +2339,7 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *open_oh HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "unable to open object header"); /* Load the object header from the cache */ - if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, FALSE))) + if (NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, false))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load object header"); } /* end if */ else diff --git a/src/H5SMcache.c b/src/H5SMcache.c index f12f5be..029e402 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -51,14 +51,14 @@ /* Metadata cache (H5AC) callbacks */ static herr_t H5SM__cache_table_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_table_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5SM__cache_table_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5SM__cache_table_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_table_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5SM__cache_table_free_icr(void *thing); static herr_t H5SM__cache_list_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_list_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); -static void *H5SM__cache_list_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); +static void *H5SM__cache_list_deserialize(const void *image, size_t len, void *udata, bool *dirty); static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_list_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5SM__cache_list_free_icr(void *thing); @@ -145,7 +145,7 @@ H5SM__cache_table_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -156,7 +156,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -167,7 +167,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__cache_table_verify_chksum() */ @@ -187,7 +187,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU */ static void * H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5F_t *f; /* File pointer -- from user data */ H5SM_master_table_t *table = NULL; /* Shared message table that we deserializing */ @@ -467,7 +467,7 @@ H5SM__cache_list_get_initial_load_size(void *_udata, size_t *image_len) * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * - * Return: Success: TRUE/FALSE + * Return: Success: true/false * Failure: Negative * *------------------------------------------------------------------------- @@ -480,7 +480,7 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo size_t chk_size; /* Exact size of the node with checksum at the end */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -495,7 +495,7 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo H5F_get_checksums(image, chk_size, &stored_chksum, &computed_chksum); if (stored_chksum != computed_chksum) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__cache_list_verify_chksum() */ @@ -514,7 +514,7 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo */ static void * H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) + bool H5_ATTR_UNUSED *dirty) { H5SM_list_t *list = NULL; /* The SOHM list being read in */ H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 62f55de..0450ee7 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -42,12 +42,12 @@ /********************/ /* Selection callbacks */ -static herr_t H5S__all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__all_copy(H5S_t *dst, const H5S_t *src, bool share_selection); static herr_t H5S__all_release(H5S_t *space); static htri_t H5S__all_is_valid(const H5S_t *space); static hssize_t H5S__all_serial_size(H5S_t *space); static herr_t H5S__all_serialize(H5S_t *space, uint8_t **p); -static herr_t H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip); +static herr_t H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip); static herr_t H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__all_offset(const H5S_t *space, hsize_t *off); static int H5S__all_unlim_dim(const H5S_t *space); @@ -248,7 +248,7 @@ H5S__all_iter_nelmts(const H5S_sel_iter_t *iter) htri_t H5S__all_iter_has_next_block(iter) const H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS - Non-negative (TRUE/FALSE) on success/Negative on failure + Non-negative (true/false) on success/Negative on failure DESCRIPTION Check if there is another block available in the selection iterator. GLOBAL VARIABLES @@ -264,7 +264,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) /* Check args */ assert(iter); - FUNC_LEAVE_NOAPI(FALSE) + FUNC_LEAVE_NOAPI(false) } /* end H5S__all_iter_has_next_block() */ /*-------------------------------------------------------------------------- @@ -466,7 +466,7 @@ H5S__all_release(H5S_t *space) herr_t H5S__all_copy(dst, src, share_selection) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace - hbool_t; IN: Whether to share the selection between the dataspaces + bool; IN: Whether to share the selection between the dataspaces RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -478,7 +478,7 @@ H5S__all_release(H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) +H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, bool H5_ATTR_UNUSED share_selection) { FUNC_ENTER_PACKAGE_NOERR @@ -501,7 +501,7 @@ H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSE htri_t H5S__all_is_valid(space); H5S_t *space; IN: Dataspace pointer to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -518,7 +518,7 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__all_is_valid() */ /*-------------------------------------------------------------------------- @@ -622,7 +622,7 @@ H5S__all_serialize(H5S_t *space, uint8_t **p) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip) +H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip) { uint32_t version; /* Version number */ H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, @@ -661,7 +661,7 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hboo *p += 8; /* Change to "all" selection */ - if (H5S_select_all(tmp_space, TRUE) < 0) + if (H5S_select_all(tmp_space, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); /* Return space to the caller if allocated */ @@ -798,7 +798,7 @@ H5S__all_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__all_is_contiguous(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is contiguous. This is primarily used for reading the entire selection in one swoop. @@ -814,7 +814,7 @@ H5S__all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__all_is_contiguous() */ /*-------------------------------------------------------------------------- @@ -826,7 +826,7 @@ H5S__all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__all_is_single(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is a single block. This is primarily used for reading the entire selection in one swoop. @@ -842,7 +842,7 @@ H5S__all_is_single(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__all_is_single() */ /*-------------------------------------------------------------------------- @@ -854,7 +854,7 @@ H5S__all_is_single(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__all_is_regular(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in a dataspace is the a regular pattern. @@ -872,7 +872,7 @@ H5S__all_is_regular(H5S_t H5_ATTR_UNUSED *space) /* Check args */ assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__all_is_regular() */ /*-------------------------------------------------------------------------- @@ -885,7 +885,7 @@ H5S__all_is_regular(H5S_t H5_ATTR_UNUSED *space) H5S_t *space1; IN: First dataspace to check H5S_t *space2; IN: Second dataspace to check RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in each dataspace are the same shape. @@ -899,7 +899,7 @@ H5S__all_shape_same(H5S_t *space1, H5S_t *space2) { int space1_dim; /* Current dimension in first dataspace */ int space2_dim; /* Current dimension in second dataspace */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -918,7 +918,7 @@ H5S__all_shape_same(H5S_t *space1, H5S_t *space2) */ while (space2_dim >= 0) { if (space1->extent.size[space1_dim] != space2->extent.size[space2_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; space2_dim--; @@ -929,7 +929,7 @@ H5S__all_shape_same(H5S_t *space1, H5S_t *space2) */ while (space1_dim >= 0) { if (space1->extent.size[space1_dim] != 1) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; } /* end while */ @@ -949,7 +949,7 @@ done: const hsize_t *start; IN: Starting coordinate for block const hsize_t *end; IN: Ending coordinate for block RETURNS - Non-negative TRUE / FALSE on success, negative on failure + Non-negative true / false on success, negative on failure DESCRIPTION Quickly detect intersections with a block GLOBAL VARIABLES @@ -969,7 +969,7 @@ H5S__all_intersect_block(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUS assert(start); assert(end); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__all_intersect_block() */ /*-------------------------------------------------------------------------- @@ -1081,7 +1081,7 @@ H5S__all_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, H5S_t *new_space assert(offset); /* Select the entire new space */ - if (H5S_select_all(new_space, TRUE) < 0) + if (H5S_select_all(new_space, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "unable to set all selection"); done: @@ -1096,7 +1096,7 @@ done: USAGE herr_t H5S_select_all(dsid) hid_t dsid; IN: Dataspace ID of selection to modify - hbool_t rel_prev; IN: Flag whether to release previous selection or not + bool rel_prev; IN: Flag whether to release previous selection or not RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -1107,7 +1107,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_all(H5S_t *space, hbool_t rel_prev) +H5S_select_all(H5S_t *space, bool rel_prev) { herr_t ret_value = SUCCEED; /* return value */ @@ -1162,7 +1162,7 @@ H5Sselect_all(hid_t spaceid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); /* Call internal routine to do the work */ - if (H5S_select_all(space, TRUE) < 0) + if (H5S_select_all(space, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection"); done: diff --git a/src/H5Sdeprec.c b/src/H5Sdeprec.c index 78f4281..fc85087 100644 --- a/src/H5Sdeprec.c +++ b/src/H5Sdeprec.c @@ -93,7 +93,7 @@ H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + if (H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, true) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Use (earliest, latest) i.e. not latest format */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index d83c0ce..84944a0 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -50,7 +50,7 @@ if (recover) { \ if (H5S__hyper_free_span(curr_span) < 0) \ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, ERR, "unable to free span"); \ - (recover) = FALSE; \ + (recover) = false; \ } \ \ /* Set the current span to saved next span */ \ @@ -94,7 +94,7 @@ typedef struct { hsize_t skip; /* Number of elements to skip in projected space */ hsize_t nelem; /* Number of elements to add to projected space (after skip) */ uint64_t op_gen; /* Operation generation for counting elements */ - hbool_t share_selection; /* Whether span trees in dst_space can be shared with proj_space */ + bool share_selection; /* Whether span trees in dst_space can be shared with proj_space */ } H5S_hyper_project_intersect_ud_t; /* Assert that H5S_MAX_RANK is <= 32 so our trick with using a 32 bit bitmap @@ -113,7 +113,7 @@ static H5S_hyper_span_info_t *H5S__hyper_new_span_info(unsigned rank); static H5S_hyper_span_info_t *H5S__hyper_copy_span_helper(H5S_hyper_span_info_t *spans, unsigned rank, unsigned op_info_i, uint64_t op_gen); static H5S_hyper_span_info_t *H5S__hyper_copy_span(H5S_hyper_span_info_t *spans, unsigned rank); -static hbool_t H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, +static bool H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2); static herr_t H5S__hyper_free_span_info(H5S_hyper_span_info_t *span_info); static herr_t H5S__hyper_free_span(H5S_hyper_span_t *span); @@ -138,10 +138,10 @@ static H5S_hyper_span_info_t *H5S__hyper_make_spans(unsigned rank, const hsize_t static herr_t H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t *new_hyper_diminfo); static herr_t H5S__hyper_generate_spans(H5S_t *space); -static hbool_t H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, +static bool H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_span_info_t *spans2); static herr_t H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *space2_span_lst, - hbool_t can_own_span2, hbool_t *span2_owned, hbool_t *updated_spans, + bool can_own_span2, bool *span2_owned, bool *updated_spans, H5S_t **result); static herr_t H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], const hsize_t stride[], const hsize_t count[], const hsize_t block[]); @@ -163,17 +163,16 @@ static herr_t H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_ unsigned depth, H5S_hyper_project_intersect_ud_t *udata); static void H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, hsize_t *block, hsize_t clip_size); -static hsize_t H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, - hbool_t incl_trail); +static hsize_t H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, bool incl_trail); /* Selection callbacks */ -static herr_t H5S__hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__hyper_copy(H5S_t *dst, const H5S_t *src, bool share_selection); static herr_t H5S__hyper_release(H5S_t *space); static htri_t H5S__hyper_is_valid(const H5S_t *space); static hsize_t H5S__hyper_span_nblocks(H5S_hyper_span_info_t *spans); static hssize_t H5S__hyper_serial_size(H5S_t *space); static herr_t H5S__hyper_serialize(H5S_t *space, uint8_t **p); -static herr_t H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip); +static herr_t H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip); static herr_t H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__hyper_offset(const H5S_t *space, hsize_t *offset); static int H5S__hyper_unlim_dim(const H5S_t *space); @@ -610,17 +609,17 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) for (u = (rank - 1); u > 0; u--) { if (tdiminfo[u].count == 1 && tdiminfo[u].block == mem_size[u]) { cont_dim++; - iter->u.hyp.flattened[u] = TRUE; + iter->u.hyp.flattened[u] = true; } /* end if */ else - iter->u.hyp.flattened[u] = FALSE; + iter->u.hyp.flattened[u] = false; } /* end for */ - iter->u.hyp.flattened[0] = FALSE; + iter->u.hyp.flattened[0] = false; } /* end if */ /* Check if the regular selection can be "flattened" */ if (cont_dim > 0) { - hbool_t last_dim_flattened = TRUE; /* Flag to indicate that the last dimension was flattened */ + bool last_dim_flattened = true; /* Flag to indicate that the last dimension was flattened */ unsigned flat_rank = rank - cont_dim; /* Number of dimensions after flattening */ unsigned curr_dim; /* Current dimension */ @@ -636,7 +635,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) acc *= mem_size[i]; /* Indicate that the dimension was flattened */ - last_dim_flattened = TRUE; + last_dim_flattened = true; } /* end if */ else { if (last_dim_flattened) { @@ -654,7 +653,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) iter->u.hyp.sel_off[curr_dim] = iter->sel_off[i] * (hssize_t)acc; /* Reset the "last dim flattened" flag to avoid flattened any further dimensions */ - last_dim_flattened = FALSE; + last_dim_flattened = false; /* Reset the "accumulator" for possible further dimension flattening */ acc = 1; @@ -699,7 +698,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) } /* end else */ /* Flag the diminfo information as valid in the iterator */ - iter->u.hyp.diminfo_valid = TRUE; + iter->u.hyp.diminfo_valid = true; /* Initialize irregular region information also (for release) */ iter->u.hyp.spans = NULL; @@ -751,7 +750,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) slab_size = iter->dims; /* Flag the diminfo information as not valid in the iterator */ - iter->u.hyp.diminfo_valid = FALSE; + iter->u.hyp.diminfo_valid = false; } /* end else */ /* Compute the cumulative size of dataspace dimensions */ @@ -933,7 +932,7 @@ H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter) htri_t H5S__hyper_iter_has_next_block(iter) const H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS - Non-negative (TRUE/FALSE) on success/Negative on failure + Non-negative (true/false) on success/Negative on failure DESCRIPTION Check if there is another block available in the selection iterator. GLOBAL VARIABLES @@ -945,7 +944,7 @@ static H5_ATTR_PURE htri_t H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *iter) { unsigned u; /* Local index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -965,14 +964,14 @@ H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *iter) if (tdiminfo[u].count == 1) continue; if (toff[u] != (tdiminfo[u].start + ((tdiminfo[u].count - 1) * tdiminfo[u].stride))) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end for */ } /* end if */ else { /* Check for any levels of the tree with more sequences in them */ for (u = 0; u < iter->rank; u++) if (iter->u.hyp.span[u]->next != NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end else */ done: @@ -2605,7 +2604,7 @@ H5S__hyper_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem const hssize_t *sel_off; /* Selection offset in dataspace */ unsigned ndims; /* Number of dimensions of dataset */ unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ - hbool_t single_block; /* Whether the selection is a single block */ + bool single_block; /* Whether the selection is a single block */ unsigned u; /* Local index variable */ /* Set a local copy of the diminfo pointer */ @@ -2696,10 +2695,10 @@ H5S__hyper_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem } /* end else */ /* Check for a single block selected */ - single_block = TRUE; + single_block = true; for (u = 0; u < ndims; u++) if (1 != tdiminfo[u].count) { - single_block = FALSE; + single_block = false; break; } /* end if */ @@ -2986,11 +2985,11 @@ done: PURPOSE Check if two hyperslab span trees are the same USAGE - hbool_t H5S__hyper_cmp_spans(span1, span2) + bool H5S__hyper_cmp_spans(span1, span2) H5S_hyper_span_info_t *span_info1; IN: First span tree to compare H5S_hyper_span_info_t *span_info2; IN: Second span tree to compare RETURNS - TRUE (1) or FALSE (0) on success, can't fail + true (1) or false (0) on success, can't fail DESCRIPTION Compare two hyperslab span trees to determine if they refer to the same selection. If span1 & span2 are both NULL, that counts as equal. @@ -2999,10 +2998,10 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static H5_ATTR_PURE hbool_t +static H5_ATTR_PURE bool H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2) { - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -3010,16 +3009,16 @@ H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_sp if (span_info1 != span_info2) { /* Check for one span being NULL */ if (span_info1 == NULL || span_info2 == NULL) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Compare low & high bounds for this span list */ /* (Could compare lower dimensions also, but not certain if * that's worth it. - QAK, 2019/01/23) */ if (span_info1->low_bounds[0] != span_info2->low_bounds[0]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if (span_info1->high_bounds[0] != span_info2->high_bounds[0]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { const H5S_hyper_span_t *span1; const H5S_hyper_span_t *span2; @@ -3036,19 +3035,19 @@ H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_sp while (1) { /* Check for both spans being NULL */ if (span1 == NULL && span2 == NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); else { /* Check for one span being NULL */ if (span1 == NULL || span2 == NULL) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Check if the actual low & high span information is the same */ if (span1->low != span2->low || span1->high != span2->high) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { if (span1->down != NULL || span2->down != NULL) { if (!H5S__hyper_cmp_spans(span1->down, span2->down)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Keep going... */ } /* end else */ @@ -3068,7 +3067,7 @@ H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_sp } /* end else */ } /* end if */ - /* Fall through, with default return value of 'TRUE' if spans were already visited */ + /* Fall through, with default return value of 'true' if spans were already visited */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -3185,7 +3184,7 @@ done: herr_t H5S__hyper_copy(dst, src, share_selection) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace - hbool_t; IN: Whether to share the selection between the dataspaces + bool; IN: Whether to share the selection between the dataspaces RETURNS Non-negative on success, negative on failure DESCRIPTION @@ -3202,7 +3201,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection) +H5S__hyper_copy(H5S_t *dst, const H5S_t *src, bool share_selection) { H5S_hyper_sel_t *dst_hslab; /* Pointer to destination hyperslab info */ const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */ @@ -3261,7 +3260,7 @@ done: htri_t H5S__hyper_is_valid(space); H5S_t *space; IN: Dataspace pointer to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -3276,7 +3275,7 @@ H5S__hyper_is_valid(const H5S_t *space) { const hsize_t *low_bounds, *high_bounds; /* Pointers to the correct pair of low & high bounds */ unsigned u; /* Counter */ - htri_t ret_value = TRUE; /* return value */ + htri_t ret_value = true; /* return value */ FUNC_ENTER_PACKAGE_NOERR @@ -3284,7 +3283,7 @@ H5S__hyper_is_valid(const H5S_t *space) /* Check for unlimited selection */ if (space->select.sel_info.hslab->unlim_dim >= 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check which set of low & high bounds we should be using */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { @@ -3300,9 +3299,9 @@ H5S__hyper_is_valid(const H5S_t *space) for (u = 0; u < space->extent.rank; u++) { /* Bounds check the selected point + offset against the extent */ if (((hssize_t)low_bounds[u] + space->select.offset[u]) < 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if ((high_bounds[u] + (hsize_t)space->select.offset[u]) >= space->extent.size[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end for */ done: @@ -3423,7 +3422,7 @@ H5S__hyper_span_nblocks(H5S_hyper_span_info_t *spans) USAGE hsize_t H5S__get_select_hyper_nblocks(space, app_ref) H5S_t *space; IN: Dataspace ptr of selection to query - hbool_t app_ref; IN: Whether this is an appl. ref. call + bool app_ref; IN: Whether this is an appl. ref. call RETURNS The number of hyperslab blocks in selection on success, negative on failure DESCRIPTION @@ -3434,7 +3433,7 @@ H5S__hyper_span_nblocks(H5S_hyper_span_info_t *spans) REVISION LOG --------------------------------------------------------------------------*/ static hsize_t -H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref) +H5S__get_select_hyper_nblocks(const H5S_t *space, bool app_ref) { hsize_t ret_value = 0; /* Return value */ @@ -3494,7 +3493,7 @@ H5Sget_select_hyper_nblocks(hid_t spaceid) HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot get number of blocks for unlimited selection"); - ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space, TRUE); + ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space, true); done: FUNC_LEAVE_API(ret_value) @@ -3574,8 +3573,8 @@ H5S__hyper_get_version_enc_size(H5S_t *space, hsize_t block_count, uint32_t *ver { hsize_t bounds_start[H5S_MAX_RANK]; /* Starting coordinate of bounding box */ hsize_t bounds_end[H5S_MAX_RANK]; /* Opposite coordinate of bounding box */ - hbool_t count_up_version = FALSE; /* Whether number of blocks exceed H5S_UINT32_MAX */ - hbool_t bound_up_version = FALSE; /* Whether high bounds exceed H5S_UINT32_MAX */ + bool count_up_version = false; /* Whether number of blocks exceed H5S_UINT32_MAX */ + bool bound_up_version = false; /* Whether high bounds exceed H5S_UINT32_MAX */ H5F_libver_t low_bound; /* The 'low' bound of library format versions */ H5F_libver_t high_bound; /* The 'high' bound of library format versions */ htri_t is_regular; /* A regular hyperslab or not */ @@ -3595,11 +3594,11 @@ H5S__hyper_get_version_enc_size(H5S_t *space, hsize_t block_count, uint32_t *ver /* Determine whether the number of blocks or the high bounds in the selection exceed (2^32 - 1) */ if (block_count > H5S_UINT32_MAX) - count_up_version = TRUE; + count_up_version = true; else { for (u = 0; u < space->extent.rank; u++) if (bounds_end[u] > H5S_UINT32_MAX) { - bound_up_version = TRUE; + bound_up_version = true; break; } /* end if */ } /* end else */ @@ -3736,7 +3735,7 @@ H5S__hyper_serial_size(H5S_t *space) /* Determine the number of blocks */ if (space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ - block_count = H5S__get_select_hyper_nblocks(space, FALSE); + block_count = H5S__get_select_hyper_nblocks(space, false); /* Determine the version and the encoded size */ if (H5S__hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0) @@ -3954,8 +3953,8 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned ndims; /* Rank of the dataspace */ unsigned u; /* Local counting variable */ - hbool_t complete = FALSE; /* Whether we are done with the iteration */ - hbool_t is_regular; /* Whether selection is regular */ + bool complete = false; /* Whether we are done with the iteration */ + bool is_regular; /* Whether selection is regular */ uint8_t enc_size; /* Encoded size */ herr_t ret_value = SUCCEED; /* return value */ @@ -3973,7 +3972,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) /* Calculate the # of blocks */ if (space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ - block_count = H5S__get_select_hyper_nblocks(space, FALSE); + block_count = H5S__get_select_hyper_nblocks(space, false); /* Determine the version and the encoded size */ if (H5S__hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0) @@ -4087,7 +4086,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) } /* end for */ /* Go iterate over the hyperslabs */ - while (complete == FALSE) { + while (complete == false) { /* Iterate over the blocks in the fastest dimension */ while (tmp_count[fast_dim] > 0) { /* Add 8 bytes times the rank for each hyperslab selected */ @@ -4117,7 +4116,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) /* Bubble up the decrement to the slower changing dimensions */ temp_dim = (int)fast_dim - 1; - while (temp_dim >= 0 && complete == FALSE) { + while (temp_dim >= 0 && complete == false) { /* Decrement the block count */ tmp_count[temp_dim]--; @@ -4127,7 +4126,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) /* Check for getting out of iterator */ if (temp_dim == 0) - complete = TRUE; + complete = true; /* Reset the block count in this dimension */ tmp_count[temp_dim] = diminfo[temp_dim].count; @@ -4216,7 +4215,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip) +H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip) { H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either *space or a newly allocated one */ @@ -4658,7 +4657,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo hsize_t end[H5S_MAX_RANK]; /* End of elements in dataspace */ unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned ndims; /* Rank of the dataspace */ - hbool_t done; /* Whether we are done with the iteration */ + bool done; /* Whether we are done with the iteration */ unsigned u; /* Counter */ /* Set some convenience values */ @@ -4688,7 +4687,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo } /* end for */ /* We're not done with the iteration */ - done = FALSE; + done = false; /* Go iterate over the hyperslabs */ while (!done && numblocks > 0) { @@ -4758,7 +4757,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo /* Check for getting out of iterator */ if (temp_dim == 0) - done = TRUE; + done = true; /* Wrapped a dimension, go up to next dimension */ temp_dim--; @@ -5111,7 +5110,7 @@ done: htri_t H5S__hyper_is_contiguous(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is contiguous. This is primarily used for reading the entire selection in one swoop. @@ -5123,10 +5122,10 @@ done: static H5_ATTR_PURE htri_t H5S__hyper_is_contiguous(const H5S_t *space) { - hbool_t small_contiguous, /* Flag for small contiguous block */ + bool small_contiguous, /* Flag for small contiguous block */ large_contiguous; /* Flag for large contiguous block */ unsigned u; /* index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5152,31 +5151,31 @@ H5S__hyper_is_contiguous(const H5S_t *space) */ /* Initialize flags */ - large_contiguous = TRUE; /* assume true and reset if the dimensions don't match */ - small_contiguous = FALSE; /* assume false initially */ + large_contiguous = true; /* assume true and reset if the dimensions don't match */ + small_contiguous = false; /* assume false initially */ /* Check for a "large contiguous" block */ for (u = 0; u < space->extent.rank; u++) { if (diminfo[u].count > 1) { - large_contiguous = FALSE; + large_contiguous = false; break; } /* end if */ if (u > 0 && diminfo[u].block != space->extent.size[u]) { - large_contiguous = FALSE; + large_contiguous = false; break; } /* end if */ } /* end for */ /* If we didn't find a large contiguous block, check for a small one */ if (!large_contiguous) { - small_contiguous = TRUE; + small_contiguous = true; for (u = 0; u < space->extent.rank; u++) { if (diminfo[u].count > 1) { - small_contiguous = FALSE; + small_contiguous = false; break; } /* end if */ if (u < (space->extent.rank - 1) && diminfo[u].block != 1) { - small_contiguous = FALSE; + small_contiguous = false; break; } /* end if */ } /* end for */ @@ -5184,7 +5183,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* Indicate true if it's either a large or small contiguous block */ if (large_contiguous || small_contiguous) - ret_value = TRUE; + ret_value = true; } /* end if */ else { H5S_hyper_span_info_t *spans; /* Hyperslab span info node */ @@ -5198,8 +5197,8 @@ H5S__hyper_is_contiguous(const H5S_t *space) * block size must be 1 in all but the fastest changing dimension. */ /* Initialize flags */ - large_contiguous = TRUE; /* assume true and reset if the dimensions don't match */ - small_contiguous = FALSE; /* assume false initially */ + large_contiguous = true; /* assume true and reset if the dimensions don't match */ + small_contiguous = false; /* assume false initially */ /* Get information for slowest changing information */ spans = space->select.sel_info.hslab->span_lst; @@ -5207,7 +5206,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* If there are multiple spans in the slowest changing dimension, the selection isn't contiguous */ if (span->next != NULL) - large_contiguous = FALSE; + large_contiguous = false; else { /* Now check the rest of the dimensions */ if (span->down != NULL) { @@ -5222,14 +5221,14 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* Check that this is the only span and it spans the entire dimension */ if (span->next != NULL) { - large_contiguous = FALSE; + large_contiguous = false; break; } /* end if */ else { /* If this span doesn't cover the entire dimension, then this selection isn't * contiguous */ if (((span->high - span->low) + 1) != space->extent.size[u]) { - large_contiguous = FALSE; + large_contiguous = false; break; } /* end if */ else { @@ -5246,7 +5245,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* If we didn't find a large contiguous block, check for a small one */ if (!large_contiguous) { - small_contiguous = TRUE; + small_contiguous = true; /* Get information for slowest changing information */ spans = space->select.sel_info.hslab->span_lst; @@ -5261,14 +5260,14 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* Check that this is the only span and it spans the entire dimension */ if (span->next != NULL) { - small_contiguous = FALSE; + small_contiguous = false; break; } /* end if */ else { /* If this span doesn't cover the entire dimension, then this selection isn't contiguous */ if (u < (space->extent.rank - 1) && ((span->high - span->low) + 1) != 1) { - small_contiguous = FALSE; + small_contiguous = false; break; } /* end if */ else { @@ -5284,7 +5283,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) /* Indicate true if it's either a large or small contiguous block */ if (large_contiguous || small_contiguous) - ret_value = TRUE; + ret_value = true; } /* end else */ FUNC_LEAVE_NOAPI(ret_value) @@ -5299,7 +5298,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) htri_t H5S__hyper_is_single(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is a single block. This is primarily used for reading the entire selection in one swoop. @@ -5311,7 +5310,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) static H5_ATTR_PURE htri_t H5S__hyper_is_single(const H5S_t *space) { - htri_t ret_value = TRUE; /* return value */ + htri_t ret_value = true; /* return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5332,7 +5331,7 @@ H5S__hyper_is_single(const H5S_t *space) /* Check for a single block */ for (u = 0; u < space->extent.rank; u++) if (space->select.sel_info.hslab->diminfo.opt[u].count > 1) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ else { H5S_hyper_span_info_t *spans; /* Hyperslab span info node */ @@ -5351,7 +5350,7 @@ H5S__hyper_is_single(const H5S_t *space) /* Check that this is the only span and it spans the entire dimension */ if (span->next != NULL) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else /* Walk down to the next span */ spans = span->down; @@ -5371,7 +5370,7 @@ done: htri_t H5S__hyper_is_regular(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in a dataspace is the a regular pattern. @@ -5399,9 +5398,9 @@ H5S__hyper_is_regular(H5S_t *space) /* Only simple check for regular hyperslabs for now... */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_is_regular() */ @@ -5412,15 +5411,15 @@ H5S__hyper_is_regular(H5S_t *space) PURPOSE Helper routine to check if two hyperslab span trees are the same shape USAGE - hbool_t H5S__hyper_spans_shape_same_helper(span1, span2, offset, rest_zeros) + bool H5S__hyper_spans_shape_same_helper(span1, span2, offset, rest_zeros) H5S_hyper_span_info_t *span_info1; IN: First span tree to compare H5S_hyper_span_info_t *span_info2; IN: Second span tree to compare hssize_t offset[]; IN: Offset between the span trees - hbool_t rest_zeros[]; IN: Array of flags which indicate + bool rest_zeros[]; IN: Array of flags which indicate the rest of the offset[] array is zero values. RETURNS - TRUE (1) or FALSE (0) on success, can't fail + true (1) or false (0) on success, can't fail DESCRIPTION Compare two hyperslab span trees to determine if they refer to a selection with the same shape, with a possible (constant) offset between their @@ -5431,12 +5430,12 @@ H5S__hyper_is_regular(H5S_t *space) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static H5_ATTR_PURE hbool_t +static H5_ATTR_PURE bool H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2, hssize_t offset[], - hbool_t rest_zeros[]) + bool rest_zeros[]) { - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5451,9 +5450,9 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, * that's worth it. - QAK, 2019/01/23) */ if ((hsize_t)((hssize_t)span_info1->low_bounds[0] + offset[0]) != span_info2->low_bounds[0]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else if ((hsize_t)((hssize_t)span_info1->high_bounds[0] + offset[0]) != span_info2->high_bounds[0]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { const H5S_hyper_span_t *span1; const H5S_hyper_span_t *span2; @@ -5470,23 +5469,23 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, while (1) { /* Check for both spans being NULL */ if (span1 == NULL && span2 == NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Check for one span being NULL */ if (span1 == NULL || span2 == NULL) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check if the actual low & high span information is the same */ if ((hsize_t)((hssize_t)span1->low + offset[0]) != span2->low || (hsize_t)((hssize_t)span1->high + offset[0]) != span2->high) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check for down tree for this span */ if (span1->down != NULL || span2->down != NULL) { /* If the rest of the span trees have a zero offset, use the faster comparison routine */ if (rest_zeros[0]) { if (!H5S__hyper_cmp_spans(span1->down, span2->down)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Keep going... */ } /* end else */ @@ -5494,7 +5493,7 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, else { if (!H5S__hyper_spans_shape_same_helper(span1->down, span2->down, &offset[1], &rest_zeros[1])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Keep going... */ } /* end else */ @@ -5510,7 +5509,7 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, } /* end while */ } /* end else */ - /* Fall through, with default return value of 'TRUE' if spans were already visited */ + /* Fall through, with default return value of 'true' if spans were already visited */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -5522,11 +5521,11 @@ done: PURPOSE Check if two hyperslab span trees are the same shape USAGE - hbool_t H5S__hyper_spans_shape_same(span1, span2) + bool H5S__hyper_spans_shape_same(span1, span2) H5S_hyper_span_info_t *span_info1; IN: First span tree to compare H5S_hyper_span_info_t *span_info2; IN: Second span tree to compare RETURNS - TRUE (1) or FALSE (0) on success, can't fail + true (1) or false (0) on success, can't fail DESCRIPTION Compare two hyperslab span trees to determine if they refer to a selection with the same shape. Very similar to H5S__hyper_cmp_spans, except the @@ -5536,17 +5535,17 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static H5_ATTR_PURE hbool_t +static H5_ATTR_PURE bool H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2, unsigned ndims) { const H5S_hyper_span_t *span1; /* Pointer to spans in first span tree */ const H5S_hyper_span_t *span2; /* Pointer to spans in second span tree */ hssize_t offset[H5S_MAX_RANK]; /* Offset vector for selections */ - hbool_t rest_zeros[H5S_MAX_RANK]; /* Vector of flags to indicate when remaining offset is all zero */ - hbool_t zero_offset; /* Whether the two selections have a non-zero offset */ + bool rest_zeros[H5S_MAX_RANK]; /* Vector of flags to indicate when remaining offset is all zero */ + bool zero_offset; /* Whether the two selections have a non-zero offset */ unsigned u; /* Local index variable */ - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5562,7 +5561,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h /* Check for an offset between the two selections */ span1 = span_info1->head; span2 = span_info2->head; - zero_offset = TRUE; + zero_offset = true; for (u = 0; u < ndims; u++) { /* Check for offset in this dimension */ if (span1->low != span2->low) { @@ -5570,7 +5569,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h /* Indicate that the offset vector is not all zeros */ if (zero_offset) - zero_offset = FALSE; + zero_offset = false; } /* end if */ /* Sanity check */ @@ -5591,7 +5590,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h /* Find first non-zero offset, from the fastest dimension up */ for (i = (int)(ndims - 1); i >= 0; i--) if (offset[i]) { - rest_zeros[i] = TRUE; + rest_zeros[i] = true; break; } /* end if */ @@ -5622,7 +5621,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h H5S_t *space1; IN: First dataspace to check H5S_t *space2; IN: Second dataspace to check RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in each dataspace are the same shape. @@ -5641,7 +5640,7 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) { unsigned space1_rank; /* Number of dimensions of first dataspace */ unsigned space2_rank; /* Number of dimensions of second dataspace */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -5680,15 +5679,15 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) while (space2_dim >= 0) { if (space1->select.sel_info.hslab->diminfo.opt[space1_dim].stride != space2->select.sel_info.hslab->diminfo.opt[space2_dim].stride) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (space1->select.sel_info.hslab->diminfo.opt[space1_dim].count != space2->select.sel_info.hslab->diminfo.opt[space2_dim].count) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (space1->select.sel_info.hslab->diminfo.opt[space1_dim].block != space2->select.sel_info.hslab->diminfo.opt[space2_dim].block) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; space2_dim--; @@ -5696,7 +5695,7 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) while (space1_dim >= 0) { if (space1->select.sel_info.hslab->diminfo.opt[space1_dim].block != 1) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; } /* end while */ @@ -5732,11 +5731,11 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) /* Check for more spans in this dimension */ if (span->next) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check for span size > 1 element */ if (span->low != span->high) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Walk down to the next dimension */ spans1 = span->down; @@ -5753,7 +5752,7 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) ret_value = H5S__hyper_spans_shape_same(spans1, space2->select.sel_info.hslab->span_lst, space2_rank); } /* end else */ - /* Fall through with 'TRUE' value, if not set earlier */ + /* Fall through with 'true' value, if not set earlier */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -5923,7 +5922,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra /* Check & update high bounds for lower dimensions */ if (*first_dim_modified >= 0) { unsigned first_dim; /* First dimension modified, relative to this span tree */ - hbool_t first_dim_set = FALSE; /* Whether first dimension modified is set */ + bool first_dim_set = false; /* Whether first dimension modified is set */ unsigned u; /* Local index variable */ /* Adjust first dimension modified to be relative to this span tree */ @@ -5942,7 +5941,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra /* Need to signal to higher dimensions if high bounds changed */ if (!first_dim_set) { *first_dim_modified = (int)u; - first_dim_set = TRUE; + first_dim_set = true; } /* end if */ } /* end if */ } /* end for */ @@ -5986,7 +5985,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra */ tmp_span = tail_span->down->head; while (tmp_span != stop_span) { - hbool_t attempt_merge_spans = FALSE; /* Whether to merge spans */ + bool attempt_merge_spans = false; /* Whether to merge spans */ /* Different tests for when to run the 'merge' algorithm, * depending whether there's "down trees" or not. @@ -5994,7 +5993,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra if (NULL == tmp_span->down) { /* Spin through spans until we find the one before the 'stop' span */ if (tmp_span->next == stop_span) - attempt_merge_spans = TRUE; + attempt_merge_spans = true; } /* end if */ else { /* Check if we've compared the 'stop' span's "down tree" to @@ -6002,7 +6001,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra */ if (tmp_span->down->op_info[0].op_gen != op_gen) { if (H5S__hyper_cmp_spans(tmp_span->down, stop_span->down)) - attempt_merge_spans = TRUE; + attempt_merge_spans = true; /* Remember that we visited this span's "down tree" already */ /* (Because it wasn't the same as the 'stop' span's down tree @@ -6216,7 +6215,7 @@ done: PURPOSE Helper routine to detect intersections in span trees USAGE - hbool_t H5S__hyper_intersect_block_helper(spans, rank, start, end, op_info_i, op_gen) + bool H5S__hyper_intersect_block_helper(spans, rank, start, end, op_info_i, op_gen) H5S_hyper_span_info_t *spans; IN: First span tree to operate with unsigned rank; IN: Number of dimensions for span tree hsize_t *start; IN: Starting coordinate for block @@ -6224,7 +6223,7 @@ done: unsigned op_info_i; IN: Index of op info to use uint64_t op_gen; IN: Operation generation RETURN - Non-negative (TRUE/FALSE) on success, can't fail + Non-negative (true/false) on success, can't fail DESCRIPTION Quickly detect intersections between span tree and block GLOBAL VARIABLES @@ -6232,11 +6231,11 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static hbool_t +static bool H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hsize_t *start, const hsize_t *end, unsigned op_info_i, uint64_t op_gen) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -6255,7 +6254,7 @@ H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, c */ for (u = 0; u < rank; u++) if (start[u] > spans->high_bounds[u] || end[u] < spans->low_bounds[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Get the span list for spans in this tree */ curr = spans->head; @@ -6268,12 +6267,12 @@ H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, c curr = curr->next; /* If this span is past the end of the block, then we're done in this dimension */ else if (curr->low > *end) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* block & span overlap */ else { /* If this is the bottom dimension, then the span tree overlaps the block */ if (curr->down == NULL) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Recursively check spans in next dimension down */ else { /* If there is an intersection in the "down" dimensions, @@ -6281,7 +6280,7 @@ H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, c */ if (H5S__hyper_intersect_block_helper(curr->down, rank - 1, start + 1, end + 1, op_info_i, op_gen)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* No intersection in down dimensions, advance to next span */ curr = curr->next; @@ -6293,7 +6292,7 @@ H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, c spans->op_info[op_info_i].op_gen = op_gen; } /* end if */ - /* Fall through with 'FALSE' return value */ + /* Fall through with 'false' return value */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -6310,7 +6309,7 @@ done: const hsize_t *start; IN: Starting coordinate for block const hsize_t *end; IN: Ending coordinate for block RETURNS - Non-negative TRUE / FALSE on success, negative on failure + Non-negative true / false on success, negative on failure DESCRIPTION Quickly detect intersections between both regular hyperslabs and span trees with a block @@ -6341,24 +6340,24 @@ H5S__hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en /* Check for regular hyperslab intersection */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { - hbool_t single_block; /* Whether the regular selection is a single block */ + bool single_block; /* Whether the regular selection is a single block */ unsigned u; /* Local index variable */ /* Check for a single block */ /* For a regular hyperslab to be single, it must have only one block * (i.e. count == 1 in all dimensions). */ - single_block = TRUE; + single_block = true; for (u = 0; u < space->extent.rank; u++) if (space->select.sel_info.hslab->diminfo.opt[u].count > 1) - single_block = FALSE; + single_block = false; /* Single blocks have already been "compared" above, in the low / high - * bound checking, so just return TRUE if we've reached here - they + * bound checking, so just return true if we've reached here - they * would have been rejected earlier, if they didn't intersect. */ if (single_block) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); else { /* Loop over the dimensions, checking for an intersection */ for (u = 0; u < space->extent.rank; u++) { @@ -6403,15 +6402,15 @@ H5S__hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en * it doesn't intersect. */ if (adj_end < space->select.sel_info.hslab->diminfo.opt[u].stride) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ } /* end if */ } /* end for */ /* If we've looped through all dimensions and none of them didn't - * overlap, then all of them do, so we report TRUE. + * overlap, then all of them do, so we report true. */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end else */ } /* end if */ else { @@ -6518,7 +6517,7 @@ H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs static herr_t H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) { - hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ + bool non_zero_offset = false; /* Whether any offset is non-zero */ unsigned u; /* Local index variable */ FUNC_ENTER_PACKAGE_NOERR @@ -6530,7 +6529,7 @@ H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) if (0 != offset[u]) { - non_zero_offset = TRUE; + non_zero_offset = true; break; } @@ -7053,7 +7052,7 @@ H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs static herr_t H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) { - hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ + bool non_zero_offset = false; /* Whether any offset is non-zero */ unsigned u; /* Local index variable */ FUNC_ENTER_PACKAGE_NOERR @@ -7065,7 +7064,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) if (0 != offset[u]) { - non_zero_offset = TRUE; + non_zero_offset = true; break; } /* end if */ @@ -7117,7 +7116,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) H5S_t *space; IN/OUT: Pointer to dataspace to move hssize_t *old_offset; OUT: Pointer to space to store old offset RETURNS - TRUE/FALSE for hyperslab selection, FAIL on error + true/false for hyperslab selection, FAIL on error DESCRIPTION Copies the current selection offset into the array provided, then inverts the selection offset, subtracts the offset from the hyperslab @@ -7130,7 +7129,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -7156,7 +7155,7 @@ H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset) memset(space->select.offset, 0, sizeof(hssize_t) * space->extent.rank); /* Indicate that the offset was normalized */ - ret_value = TRUE; + ret_value = true; } /* end if */ done: @@ -7285,8 +7284,8 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ H5S_hyper_span_info_t *new_down; /* Down pointer for new span node */ /* Sanity check */ - /* (If down_cmp was set to TRUE above, we won't be in this branch) */ - assert(down_cmp != TRUE); + /* (If down_cmp was set to true above, we won't be in this branch) */ + assert(down_cmp != true); /* Check if there is actually a down span */ if (down) { @@ -7316,7 +7315,7 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ /* Check if we are sharing down spans with a previous node */ /* (Only need to check for bounds changing if down spans aren't shared) */ - if (down_cmp == FALSE) { + if (down_cmp == false) { unsigned u; /* Local index variable */ /* Loop over lower dimensions, checking & updating low & high bounds */ @@ -7389,10 +7388,10 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s unsigned ndims, H5S_hyper_span_info_t **a_not_b, H5S_hyper_span_info_t **a_and_b, H5S_hyper_span_info_t **b_not_a) { - hbool_t need_a_not_b; /* Whether to generate a_not_b list */ - hbool_t need_a_and_b; /* Whether to generate a_and_b list */ - hbool_t need_b_not_a; /* Whether to generate b_not_a list */ - herr_t ret_value = SUCCEED; /* Return value */ + bool need_a_not_b; /* Whether to generate a_not_b list */ + bool need_a_and_b; /* Whether to generate a_and_b list */ + bool need_b_not_a; /* Whether to generate b_not_a list */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7452,14 +7451,14 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s else { H5S_hyper_span_t *span_a; /* Pointer to a node in span tree 'a' */ H5S_hyper_span_t *span_b; /* Pointer to a node in span tree 'b' */ - hbool_t recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ + bool recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ /* Get the pointers to the new and old span lists */ span_a = a_spans->head; span_b = b_spans->head; /* No spans to recover yet */ - recover_a = recover_b = FALSE; + recover_a = recover_b = false; /* Work through the list of spans in the new list */ while (span_a != NULL && span_b != NULL) { @@ -7536,7 +7535,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - assert(need_a_not_b == TRUE); + assert(need_a_not_b == true); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_b->low, span_a->high, @@ -7551,7 +7550,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - assert(need_a_and_b == TRUE); + assert(need_a_and_b == true); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_b->low, span_a->high, @@ -7566,7 +7565,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - assert(need_b_not_a == TRUE); + assert(need_b_not_a == true); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_b->low, span_a->high, @@ -7594,7 +7593,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Make upper part of span 'b' into new span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, tmp_span, FAIL); - recover_b = TRUE; + recover_b = true; } /* end if */ /* No upper part of span 'b' to split */ else { @@ -7647,7 +7646,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - assert(need_a_not_b == TRUE); + assert(need_a_not_b == true); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_b->low, span_b->high, @@ -7662,7 +7661,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - assert(need_a_and_b == TRUE); + assert(need_a_and_b == true); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_b->low, span_b->high, @@ -7677,7 +7676,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - assert(need_b_not_a == TRUE); + assert(need_b_not_a == true); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_b->low, span_b->high, @@ -7700,7 +7699,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Make upper part of span 'a' the new span 'a' */ H5S_HYPER_ADVANCE_SPAN(recover_a, span_a, tmp_span, FAIL); - recover_a = TRUE; + recover_a = true; /* Advance span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, span_b->next, FAIL); @@ -7755,7 +7754,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - assert(need_a_not_b == TRUE); + assert(need_a_not_b == true); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_a->low, span_a->high, @@ -7770,7 +7769,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - assert(need_a_and_b == TRUE); + assert(need_a_and_b == true); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_a->low, span_a->high, @@ -7785,7 +7784,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - assert(need_b_not_a == TRUE); + assert(need_b_not_a == true); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_a->low, span_a->high, @@ -7813,7 +7812,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Make upper part of span 'b' the new span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, tmp_span, FAIL); - recover_b = TRUE; + recover_b = true; } /* end if */ else { /* Advance both span 'a' & span 'b' */ @@ -7873,7 +7872,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - assert(need_a_not_b == TRUE); + assert(need_a_not_b == true); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_a->low, span_b->high, @@ -7888,7 +7887,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - assert(need_a_and_b == TRUE); + assert(need_a_and_b == true); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_a->low, span_b->high, @@ -7903,7 +7902,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - assert(need_b_not_a == TRUE); + assert(need_b_not_a == true); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_a->low, span_b->high, @@ -7926,7 +7925,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Make upper part of span 'a' into new span 'a' */ H5S_HYPER_ADVANCE_SPAN(recover_a, span_a, tmp_span, FAIL); - recover_a = TRUE; + recover_a = true; /* Advance span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, span_b->next, FAIL); @@ -8062,14 +8061,14 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf else { H5S_hyper_span_t *span_a; /* Pointer to current span 'a' working on */ H5S_hyper_span_t *span_b; /* Pointer to current span 'b' working on */ - hbool_t recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ + bool recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ /* Get the pointers to the 'a' and 'b' span lists */ span_a = a_spans->head; span_b = b_spans->head; /* No spans to recover yet */ - recover_a = recover_b = FALSE; + recover_a = recover_b = false; /* Work through the list of spans in the new list */ while (span_a != NULL && span_b != NULL) { @@ -8135,7 +8134,7 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Set new span 'b' to tmp_span */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, tmp_span, NULL); - recover_b = TRUE; + recover_b = true; } /* end if */ else { /* Advance both span 'a' & 'b' */ @@ -8184,7 +8183,7 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Set new span 'a' to tmp_span */ H5S_HYPER_ADVANCE_SPAN(recover_a, span_a, tmp_span, NULL); - recover_a = TRUE; + recover_a = true; /* Advance span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, span_b->next, NULL); @@ -8240,7 +8239,7 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Set new span 'b' to tmp_span */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, tmp_span, NULL); - recover_b = TRUE; + recover_b = true; } /* end if */ else { /* Advance both spans */ @@ -8296,7 +8295,7 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Set new span 'a' to tmp_span */ H5S_HYPER_ADVANCE_SPAN(recover_a, span_a, tmp_span, NULL); - recover_a = TRUE; + recover_a = true; /* Advance span 'b' */ H5S_HYPER_ADVANCE_SPAN(recover_b, span_b, span_b->next, NULL); @@ -8764,7 +8763,7 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t space->select.sel_info.hslab->diminfo_valid = H5S_DIMINFO_VALID_NO; else { H5S_hyper_dim_t tmp_diminfo[H5S_MAX_RANK]; /* Temporary dimension info */ - hbool_t found_nonidentical_dim = FALSE; + bool found_nonidentical_dim = false; unsigned curr_dim; /* Copy current diminfo.opt values */ @@ -8897,7 +8896,7 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t } /* end else */ /* Indicate that we found a nonidentical dim */ - found_nonidentical_dim = TRUE; + found_nonidentical_dim = true; } /* end if */ } /* end for */ @@ -8943,7 +8942,7 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t const H5S_hyper_span_t *spans; IN: Portion of span tree to check H5S_hyper_dim_t span_slab_info[]; OUT: Rebuilt section of hyperslab description RETURNS - TRUE/FALSE for hyperslab selection rebuilt + true/false for hyperslab selection rebuilt DESCRIPTION Examine the span tree for a hyperslab selection and rebuild the start/stride/count/block information for the selection, if possible. @@ -8955,7 +8954,7 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t REVISION LOG KY, 2005/9/22 --------------------------------------------------------------------------*/ -static hbool_t +static bool H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t span_slab_info[]) { const H5S_hyper_span_t *span; /* Hyperslab span */ @@ -8965,7 +8964,7 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp hsize_t block; /* Block size for this dimension */ hsize_t prev_low; /* Low bound for previous span */ size_t spancount; /* Number of spans encountered in this dimension */ - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -8982,7 +8981,7 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp if (span->down) /* Go to the next down span and check whether the selection can be rebuilt */ if (!H5S__hyper_rebuild_helper(span->down, &span_slab_info[1])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Assign the initial starting point & block size for this dimension */ start = span->low; @@ -9002,7 +9001,7 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp /* (Can skip check if previous span's down pointer is same as current one) */ if (span->down && prev_span->down != span->down) if (!H5S__hyper_cmp_spans(span->down, prev_span->down)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Obtain values for stride and block */ curr_stride = span->low - prev_low; @@ -9012,10 +9011,10 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp * three spans are needed. Account for the first two spans. */ if (curr_block != block) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (spancount > 1) { if (stride != curr_stride) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ else stride = curr_stride; @@ -9074,7 +9073,7 @@ H5S__hyper_rebuild(H5S_t *space) /* Check whether the slab can be rebuilt */ /* (Only regular selection can be rebuilt. If yes, fill in correct values) */ - if (FALSE == H5S__hyper_rebuild_helper(space->select.sel_info.hslab->span_lst, rebuilt_slab_info)) + if (false == H5S__hyper_rebuild_helper(space->select.sel_info.hslab->span_lst, rebuilt_slab_info)) space->select.sel_info.hslab->diminfo_valid = H5S_DIMINFO_VALID_IMPOSSIBLE; else { /* Set the dimension info & bounds for the dataspace, from the rebuilt info */ @@ -9156,21 +9155,21 @@ done: PURPOSE Check if two selections' bounds overlap. USAGE - hbool_t H5S__check_spans_overlap(spans1, spans2) + bool H5S__check_spans_overlap(spans1, spans2) const H5S_hyper_span_info_t *spans1; IN: Second span list const H5S_hyper_span_info_t *spans2; IN: Second span list RETURNS - TRUE for overlap, FALSE for no overlap + true for overlap, false for no overlap PROGRAMMER GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static H5_ATTR_PURE hbool_t +static H5_ATTR_PURE bool H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_span_info_t *spans2) { - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -9196,10 +9195,10 @@ H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_sp /* Check lower dimensions for overlap */ if (H5S__check_spans_overlap(span1->down, span2->down)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ else - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ /* Advance one of the spans */ @@ -9242,10 +9241,10 @@ done: H5S_t *space1; IN: Dataspace containing the first span list H5S_seloper_t op; IN: Selection operation H5S_hyper_span_info_t *space2_span_lst; IN: Second span list - hbool_t can_own_span2; IN: Indicates whether the 2nd span list could be + bool can_own_span2; IN: Indicates whether the 2nd span list could be owned by the result. If not, the 2nd span list has to be copied. - hbool_t *span2_owned; OUT: Indicates if the 2nd span list is actually owned + bool *span2_owned; OUT: Indicates if the 2nd span list is actually owned H5S_t **result; OUT: The dataspace containing the new selection. It could be same with the 1st dataspace. RETURNS @@ -9259,16 +9258,16 @@ done: --------------------------------------------------------------------------*/ static herr_t H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *space2_span_lst, - hbool_t can_own_span2, hbool_t *span2_owned, hbool_t *updated_spans, H5S_t **result) + bool can_own_span2, bool *span2_owned, bool *updated_spans, H5S_t **result) { H5S_hyper_span_info_t *a_not_b = NULL; /* Span tree for hyperslab spans in old span tree and not in new span tree */ H5S_hyper_span_info_t *a_and_b = NULL; /* Span tree for hyperslab spans in both old and new span trees */ H5S_hyper_span_info_t *b_not_a = NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */ - hbool_t overlapped = FALSE; /* Whether selections overlap */ - hbool_t is_result_new = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool overlapped = false; /* Whether selections overlap */ + bool is_result_new = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -9281,16 +9280,16 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s assert(span2_owned); /* Reset flags to return */ - *span2_owned = FALSE; - *updated_spans = FALSE; + *span2_owned = false; + *updated_spans = false; /* The result shares the same info from space1 */ if (*result == NULL) { - if (NULL == ((*result) = H5S_copy(space1, TRUE, TRUE))) + if (NULL == ((*result) = H5S_copy(space1, true, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace"); space1->select.sel_info.hslab->span_lst->count--; (*result)->select.sel_info.hslab->span_lst = NULL; - is_result_new = TRUE; + is_result_new = true; } /* end if */ /* Check both spaces to see if they overlap */ @@ -9316,11 +9315,11 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s else { if (H5S__hyper_add_disjoint_spans(*result, space2_span_lst) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't append hyperslabs"); - *span2_owned = TRUE; + *span2_owned = true; } /* end else */ /* Indicate that the spans changed */ - *updated_spans = TRUE; + *updated_spans = true; break; case H5S_SELECT_AND: @@ -9336,7 +9335,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s H5S__hyper_copy_span(space1->select.sel_info.hslab->span_lst, space1->extent.rank); /* Indicate that the spans changed */ - *updated_spans = TRUE; + *updated_spans = true; break; case H5S_SELECT_NOTA: @@ -9355,14 +9354,14 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s H5S__hyper_copy_span(space2_span_lst, space1->extent.rank); else { (*result)->select.sel_info.hslab->span_lst = space2_span_lst; - *span2_owned = TRUE; + *span2_owned = true; } /* Reset the number of items in selection */ (*result)->select.num_elem = H5S__hyper_spans_nelem(space2_span_lst); /* Indicate that the spans changed */ - *updated_spans = TRUE; + *updated_spans = true; break; case H5S_SELECT_NOOP: @@ -9461,7 +9460,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s (*result)->select.num_elem = H5S__hyper_spans_nelem(a_not_b); /* Indicate that the spans were updated */ - *updated_spans = TRUE; + *updated_spans = true; /* Indicate that the a_not_b spans are owned */ a_not_b = NULL; @@ -9484,7 +9483,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s (*result)->select.num_elem = H5S__hyper_spans_nelem(a_and_b); /* Indicate that the spans were updated */ - *updated_spans = TRUE; + *updated_spans = true; /* Indicate that the a_and_b spans are owned */ a_and_b = NULL; @@ -9499,19 +9498,19 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s (*result)->select.num_elem += H5S__hyper_spans_nelem(b_not_a); /* Indicate that the spans were updated */ - *updated_spans = TRUE; + *updated_spans = true; } /* end if */ } /* end else for the case the new span overlaps with the old (i.e. space) */ /* Check if the spans weren't updated, and reset selection if so */ if (!*updated_spans) { - /* If updated_spans remains FALSE as in this branch, it means the + /* If updated_spans remains false as in this branch, it means the * result has been cleared in XOR / AND / NOTB / NOTA cases, and the * result is a copy of the dataspace in the OR case. * * If two dataspaces have generated any of the three clipped * span trees (i.e. a_not_b, a_and_b, and b_not_a), the - * updated_spans must be TRUE. + * updated_spans must be true. */ if (H5S_SELECT_OR != op) { /* Convert *result to "none" selection */ @@ -9582,11 +9581,11 @@ H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], c new_spans = NULL; } else { - hbool_t new_spans_owned = FALSE; - hbool_t updated_spans = FALSE; + bool new_spans_owned = false; + bool updated_spans = false; /* Generate new spans for space */ - if (H5S__fill_in_new_space(space, op, new_spans, TRUE, &new_spans_owned, &updated_spans, &space) < 0) + if (H5S__fill_in_new_space(space, op, new_spans, true, &new_spans_owned, &updated_spans, &space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't generate the specified hyperslab"); /* Check if the spans were updated by H5S__fill_in_new_space */ @@ -9733,8 +9732,8 @@ static herr_t H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const hsize_t block[]) { hsize_t select_end, block_end; /* End of block & selection */ - hbool_t single_block; /* Whether the selection is a single block */ - hbool_t overlap; /* Whether block & selection overlap */ + bool single_block; /* Whether the selection is a single block */ + bool overlap; /* Whether block & selection overlap */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -9746,10 +9745,10 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h assert(block); /* Check for single block selection in dataspace */ - single_block = TRUE; + single_block = true; for (u = 0; u < space->extent.rank; u++) if (1 != space->select.sel_info.hslab->diminfo.opt[u].count) { - single_block = FALSE; + single_block = false; break; } /* end if */ @@ -9759,7 +9758,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h hsize_t new_block[H5S_MAX_RANK]; /* New block size */ /* Check for overlap and compute new start offset & block sizes */ - overlap = TRUE; + overlap = true; for (u = 0; u < space->extent.rank; u++) { /* Compute the end of the selection & block in this dimension */ select_end = space->select.sel_info.hslab->diminfo.high_bounds[u]; @@ -9768,7 +9767,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check for overlap */ if (!H5S_RANGE_OVERLAP(space->select.sel_info.hslab->diminfo.opt[u].start, select_end, start[u], block_end)) { - overlap = FALSE; + overlap = false; break; } /* end if */ @@ -9794,15 +9793,15 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h hsize_t new_count[H5S_MAX_RANK]; /* New count for hyperslab selection */ hsize_t stride[H5S_MAX_RANK]; /* Stride for hyperslab selection */ hsize_t new_block[H5S_MAX_RANK]; /* New block for hyperslab selection */ - hbool_t partial_first_span; /* Whether first span in intersection is partial */ - hbool_t partial_last_span; /* Whether last span in intersection is partial */ + bool partial_first_span; /* Whether first span in intersection is partial */ + bool partial_last_span; /* Whether last span in intersection is partial */ /* Iterate over selection, checking for overlap and computing first / last * span that intersects with the block. */ - overlap = TRUE; - partial_first_span = FALSE; - partial_last_span = FALSE; + overlap = true; + partial_first_span = false; + partial_last_span = false; for (u = 0; u < space->extent.rank; u++) { hsize_t first_span_start, first_span_end; /* Start / end of first span */ hsize_t last_span_start, last_span_end; /* Start / end of last span */ @@ -9815,7 +9814,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check for overlap */ if (!H5S_RANGE_OVERLAP(space->select.sel_info.hslab->diminfo.opt[u].start, select_end, start[u], block_end)) { - overlap = FALSE; + overlap = false; break; } /* end if */ @@ -9827,7 +9826,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check if first span overlaps _end_ of block */ if (block_end >= first_span_start && block_end <= first_span_end) - partial_first_span = TRUE; + partial_first_span = true; } /* end if */ else { hsize_t adj_start; /* Start coord, adjusted for hyperslab selection parameters */ @@ -9848,7 +9847,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check if first span overlaps start of block */ if (first_span_start < start[u] && first_span_end >= start[u]) - partial_first_span = TRUE; + partial_first_span = true; /* Advance first span to start higher than block's start, * if it's not partial. @@ -9867,7 +9866,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check if last span overlaps _start_ of block */ if (start[u] >= last_span_start && start[u] <= last_span_end) - partial_last_span = TRUE; + partial_last_span = true; } /* end if */ else { hsize_t adj_end; /* End coord, adjusted for hyperslab selection parameters */ @@ -9888,13 +9887,13 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h /* Check if last span overlaps end of block */ if (block_end >= last_span_start && block_end <= last_span_end) - partial_last_span = TRUE; + partial_last_span = true; } /* end else */ /* Check if no spans are inside block */ /* (Can happen when block falls in "gap" between spans) */ if (last_span_end < start[u]) { - overlap = FALSE; + overlap = false; break; } /* end if */ @@ -10188,7 +10187,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't set regular hyperslab selection"); } /* end if */ else if (op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA) { - hbool_t single_block; /* Whether the selection is a single block */ + bool single_block; /* Whether the selection is a single block */ /* Sanity check */ assert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); @@ -10230,10 +10229,10 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons } /* end if */ /* Check for a single block selected */ - single_block = TRUE; + single_block = true; for (u = 0; u < space->extent.rank; u++) if (1 != opt_count[u]) { - single_block = FALSE; + single_block = false; break; } /* end if */ @@ -10398,7 +10397,7 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */ /* Convert to "none" selection */ /* Copy the first dataspace without sharing the list of spans */ - if (NULL == ((*new_space) = H5S_copy(old_space, TRUE, TRUE))) + if (NULL == ((*new_space) = H5S_copy(old_space, true, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace"); if (H5S_select_none((*new_space)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't convert selection"); @@ -10408,7 +10407,7 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st case H5S_SELECT_XOR: /* Binary "xor" operation for hyperslabs */ case H5S_SELECT_NOTB: /* Binary "A not B" operation for hyperslabs */ /* Copy the first dataspace with sharing the list of spans */ - if (NULL == ((*new_space) = H5S_copy(old_space, FALSE, TRUE))) + if (NULL == ((*new_space) = H5S_copy(old_space, false, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace"); HGOTO_DONE(SUCCEED); /* Selection stays same */ @@ -10428,7 +10427,7 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st hsize_t *old_high_bounds; hsize_t new_low_bounds[H5S_MAX_RANK]; /* New space's low & high bounds */ hsize_t new_high_bounds[H5S_MAX_RANK]; - hbool_t overlapped = FALSE; + bool overlapped = false; /* Set up old space's low & high bounds */ if (old_space->select.sel_info.hslab->span_lst) { @@ -10448,14 +10447,14 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st /* Check bound box of both spaces to see if they overlap */ if (H5S_RANGE_OVERLAP(old_low_bounds[0], old_high_bounds[0], new_low_bounds[0], new_high_bounds[0])) - overlapped = TRUE; + overlapped = true; /* Non-overlapping situations can be handled in special ways */ if (!overlapped) { H5S_hyper_span_info_t *new_spans = NULL; H5S_hyper_dim_t new_hyper_diminfo[H5S_MAX_RANK]; - if (NULL == ((*new_space) = H5S_copy(old_space, TRUE, TRUE))) + if (NULL == ((*new_space) = H5S_copy(old_space, true, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy dataspace"); if (NULL != (*new_space)->select.sel_info.hslab->span_lst) { old_space->select.sel_info.hslab->span_lst->count--; @@ -10527,7 +10526,7 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st } /* end if the selection of old space is H5S_SEL_HYPERSLABS */ /* Copy the first dataspace with sharing the list of spans */ - if (NULL == ((*new_space) = H5S_copy(old_space, TRUE, TRUE))) + if (NULL == ((*new_space) = H5S_copy(old_space, true, true))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace"); /* Note: a little overhead in calling the function as some conditions are checked again */ @@ -10551,9 +10550,9 @@ done: static herr_t H5S__fill_in_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2, H5S_t **result) { - hbool_t span2_owned; - hbool_t updated_spans; - herr_t ret_value = SUCCEED; /* Return value */ + bool span2_owned; + bool updated_spans; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -10568,7 +10567,7 @@ H5S__fill_in_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2, H5S_t **resu assert(space2->select.sel_info.hslab->span_lst); /* Note: the offset of space2 is not considered here for bounding box */ - if (H5S__fill_in_new_space(space1, op, space2->select.sel_info.hslab->span_lst, FALSE, &span2_owned, + if (H5S__fill_in_new_space(space1, op, space2->select.sel_info.hslab->span_lst, false, &span2_owned, &updated_spans, result) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't create the specified selection"); @@ -10641,7 +10640,7 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], co HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to set hyperslab selection"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, new_space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: @@ -10780,7 +10779,7 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to create hyperslab selection"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, new_space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID"); done: @@ -11407,18 +11406,18 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper hsize_t low; /* Low bounds of current intersection */ hsize_t old_skip; /* Value of udata->skip before main loop */ hsize_t old_nelem; /* Value of udata->nelem before main loop */ - hbool_t check_intersect; /* Whether to check for intersecting elements */ + bool check_intersect; /* Whether to check for intersecting elements */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Check for non-overlapping bounds */ - check_intersect = TRUE; + check_intersect = true; for (u = 0; u < (udata->ss_rank - depth); u++) if (!H5S_RANGE_OVERLAP(ss_span_info->low_bounds[u], ss_span_info->high_bounds[u], sis_span_info->low_bounds[u], sis_span_info->high_bounds[u])) { - check_intersect = FALSE; + check_intersect = false; break; } /* end if */ @@ -11647,7 +11646,7 @@ done: src_intersect_space H5S_t *dst_space; IN: Selection that is mapped to src_space, and which contains the result H5S_t *src_intersect_space; IN: Selection whose intersection with src_space is projected to dst_space to obtain the result H5S_t *proj_space; OUT: Will contain the result (intersection of src_intersect_space -and src_space projected from src_space to dst_space) after the operation hbool_t share_selection; IN: Whether +and src_space projected from src_space to dst_space) after the operation bool share_selection; IN: Whether we are allowed to share structures inside dst_space with proj_space RETURNS Non-negative on success/Negative on failure. DESCRIPTION Projects the intersection of of the selections of src_space and src_intersect_space within the selection of src_space as a selection within the selection of dst_space. The result is placed in @@ -11658,7 +11657,7 @@ if dst_space must be preserved. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS EXA --------------------------------------------------------------------------*/ herr_t H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space, - H5S_t *proj_space, hbool_t share_selection) + H5S_t *proj_space, bool share_selection) { H5S_hyper_project_intersect_ud_t udata; /* User data for subroutines */ H5S_hyper_span_info_t *ss_span_info; @@ -11756,7 +11755,7 @@ H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i /* Check for elements in projected space */ if (udata.ps_span_info[0]) { /* Allocate space for the hyperslab selection information (note this sets - * diminfo_valid to FALSE, diminfo arrays to 0, and span list to NULL) */ + * diminfo_valid to false, diminfo arrays to 0, and span list to NULL) */ if (NULL == (proj_space->select.sel_info.hslab = H5FL_CALLOC(H5S_hyper_sel_t))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab info"); @@ -12013,7 +12012,7 @@ done: hsize_t H5S__hyper_get_clip_extent_real(clip_space,num_slices,incl_trail) const H5S_t *clip_space, IN: Space that clip size will be calculated based on hsize_t num_slizes, IN: Number of slices clip_space should contain when clipped - hbool_t incl_trail; IN: Whether to include trailing unselected space + bool incl_trail; IN: Whether to include trailing unselected space RETURNS Clip extent to match num_slices (never fails) DESCRIPTION @@ -12021,7 +12020,7 @@ done: (via H5S_hyper_clip_unlim) in order for it to contain num_slices slices in the unlimited dimension. If the clipped selection would end immediately before a section of unselected space (i.e. at the end of a - block), then if incl_trail is TRUE, the returned clip extent is + block), then if incl_trail is true, the returned clip extent is selected to include that trailing "blank" space, otherwise it is selected to end at the end before the blank space. GLOBAL VARIABLES @@ -12031,7 +12030,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static hsize_t -H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, hbool_t incl_trail) +H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, bool incl_trail) { const H5S_hyper_dim_t *diminfo; /* Convenience pointer to opt_unlim_diminfo in unlimited dimension */ hsize_t count; @@ -12091,16 +12090,16 @@ H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, hbo hsize_t H5S__hyper_get_clip_extent(clip_space,match_space,incl_trail) const H5S_t *clip_space, IN: Space that clip size will be calculated based on const H5S_t *match_space, IN: Space containing the same number of elements as clip_space should after -clipping hbool_t incl_trail; IN: Whether to include trailing unselected space RETURNS Calculated clip +clipping bool incl_trail; IN: Whether to include trailing unselected space RETURNS Calculated clip extent (never fails) DESCRIPTION Calculates and returns the extent that clip_space should be clipped to (via H5S_hyper_clip_unlim) in order for it to contain the same number of elements as match_space. If the clipped selection would end immediately before a section of unselected space (i.e. at the end of a block), then if -incl_trail is TRUE, the returned clip extent is selected to include that trailing "blank" space, otherwise it +incl_trail is true, the returned clip extent is selected to include that trailing "blank" space, otherwise it is selected to end at the end before the blank space. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Note this assumes the offset has been normalized. EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ hsize_t -H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, hbool_t incl_trail) +H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, bool incl_trail) { hsize_t num_slices; /* Number of slices in unlimited dimension */ hsize_t ret_value = 0; /* Return value */ @@ -12142,18 +12141,18 @@ H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, hbo const H5S_t *clip_space, IN: Space that clip size will be calculated based on const H5S_t *match_space, IN: Space that, after being clipped to match_clip_size, contains the same number of elements as clip_space should after clipping hsize_t match_clip_size, IN: Extent match_space would -be clipped to to match the number of elements in clip_space hbool_t incl_trail; IN: Whether to include +be clipped to to match the number of elements in clip_space bool incl_trail; IN: Whether to include trailing unselected space RETURNS Calculated clip extent (never fails) DESCRIPTION Calculates and returns the extent that clip_space should be clipped to (via H5S_hyper_clip_unlim) in order for it to contain the same number of elements as match_space would have after being clipped to match_clip_size. If the clipped selection would end immediately before a section of unselected space (i.e. at the end of a block), then if incl_trail is -TRUE, the returned clip extent is selected to include that trailing "blank" space, otherwise it is selected to +true, the returned clip extent is selected to include that trailing "blank" space, otherwise it is selected to end at the end before the blank space. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Note this assumes the offset has been normalized. EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ hsize_t H5S_hyper_get_clip_extent_match(const H5S_t *clip_space, const H5S_t *match_space, hsize_t match_clip_size, - hbool_t incl_trail) + bool incl_trail) { const H5S_hyper_dim_t *match_diminfo; /* Convenience pointer to opt_unlim_diminfo in unlimited dimension in match_space */ @@ -12220,7 +12219,7 @@ H5S_hyper_get_clip_extent_match(const H5S_t *clip_space, const H5S_t *match_spac H5S_t *H5S_hyper_get_unlim_block(space,block_index) const H5S_t *space, IN: Space with unlimited selection hsize_t block_index, IN: Index of block to return in unlimited dimension - hbool_t incl_trail; IN: Whether to include trailing unselected space + bool incl_trail; IN: Whether to include trailing unselected space RETURNS New space on success/NULL on failure. DESCRIPTION @@ -12273,7 +12272,7 @@ H5S_hyper_get_unlim_block(const H5S_t *space, hsize_t block_index) /* Create output space, copy extent */ if (NULL == (space_out = H5S_create(H5S_SIMPLE))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "unable to create output dataspace"); - if (H5S__extent_copy_real(&space_out->extent, &space->extent, TRUE) < 0) + if (H5S__extent_copy_real(&space_out->extent, &space->extent, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "unable to copy destination space extent"); /* Select block as defined by start/stride/count/block computed above */ @@ -12301,15 +12300,15 @@ done: hsize_t H5S_hyper_get_first_inc_block(space,clip_size,partial) const H5S_t *space, IN: Space with unlimited selection hsize_t clip_size, IN: Extent space would be clipped to - hbool_t *partial; OUT: Whether the ret_valueth block (first incomplete block) is partial + bool *partial; OUT: Whether the ret_valueth block (first incomplete block) is partial RETURNS Index of first incomplete block in clip_size (never fails). DESCRIPTION Calculates and returns the index (as would be passed to H5S_hyper_get_unlim_block()) of the first block in the unlimited dimension of space which would be incomplete or missing when space is - clipped to clip_size. partial is set to TRUE if the first incomplete - block is partial, and FALSE if the first incomplete block is missing. + clipped to clip_size. partial is set to true if the first incomplete + block is partial, and false if the first incomplete block is missing. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Note this assumes the offset has been normalized. @@ -12317,7 +12316,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hsize_t -H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *partial) +H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, bool *partial) { H5S_hyper_sel_t *hslab; /* Convenience pointer to hyperslab info */ H5S_hyper_dim_t *diminfo; /* Convenience pointer to diminfo in unlimited dimension */ @@ -12338,7 +12337,7 @@ H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *pa if (diminfo->start >= clip_size) { ret_value = 0; if (partial) - partial = FALSE; + partial = false; } /* end if */ else { /* Calculate index of first incomplete block */ @@ -12347,9 +12346,9 @@ H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *pa if (partial) { /* Check for partial block */ if ((diminfo->stride * ret_value) < (clip_size - diminfo->start)) - *partial = TRUE; + *partial = true; else - *partial = FALSE; + *partial = false; } /* end if */ } /* end else */ @@ -12365,7 +12364,7 @@ H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *pa htri_t H5Sis_regular_hyperslab(dsid) hid_t dsid; IN: Dataspace ID of hyperslab selection to query RETURNS - TRUE/FALSE for hyperslab selection, FAIL on error or when querying other + true/false for hyperslab selection, FAIL on error or when querying other selection types. DESCRIPTION If a hyperslab can be represented as a single call to H5Sselect_hyperslab, @@ -12439,7 +12438,7 @@ H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[] /*out*/, hsize_t stride[ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); if (H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection"); - if (TRUE != H5S__hyper_is_regular(space)) + if (true != H5S__hyper_is_regular(space)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a regular hyperslab selection"); /* Retrieve hyperslab parameters */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 1797399..10a9cd5 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -62,19 +62,19 @@ typedef struct H5S_mpio_mpitype_list_t { /* Local Prototypes */ /********************/ static herr_t H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type); -static herr_t H5S__mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); + bool *is_derived_type); +static herr_t H5S__mpio_none_type(MPI_Datatype *new_type, int *count, bool *is_derived_type); static herr_t H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, MPI_Aint *disp, MPI_Datatype *new_type); static herr_t H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute_map, - hbool_t *is_permuted); + bool *is_derived_type, bool do_permute, hsize_t **permute_map, + bool *is_permuted); static herr_t H5S__mpio_permute_type(H5S_t *space, size_t elmt_size, hsize_t **permute_map, - MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); + MPI_Datatype *new_type, int *count, bool *is_derived_type); static herr_t H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type); + bool *is_derived_type); static herr_t H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, - int *count, hbool_t *is_derived_type); + int *count, bool *is_derived_type); static herr_t H5S__release_datatype(H5S_mpio_mpitype_list_t *type_list); static herr_t H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t elmt_size, const MPI_Datatype *elmt_type, MPI_Datatype *span_type, @@ -110,7 +110,7 @@ H5FL_EXTERN(H5S_sel_iter_t); */ static herr_t H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type) + bool *is_derived_type) { hsize_t total_bytes; hssize_t snelmts; /* Total number of elmts (signed) */ @@ -136,7 +136,7 @@ H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, /* fill in the return values */ *new_type = MPI_BYTE; H5_CHECKED_ASSIGN(*count, int, total_bytes, hsize_t); - *is_derived_type = FALSE; + *is_derived_type = false; } else { /* Create a LARGE derived datatype for this transfer */ @@ -144,7 +144,7 @@ H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large datatype from the all selection"); *count = 1; - *is_derived_type = TRUE; + *is_derived_type = true; } done: @@ -166,14 +166,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5S__mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) +H5S__mpio_none_type(MPI_Datatype *new_type, int *count, bool *is_derived_type) { FUNC_ENTER_PACKAGE_NOERR /* fill in the return values */ *new_type = MPI_BYTE; *count = 0; - *is_derived_type = FALSE; + *is_derived_type = false; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S__mpio_none_type() */ @@ -193,7 +193,7 @@ static herr_t H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, MPI_Aint *disp, MPI_Datatype *new_type) { MPI_Datatype elmt_type; /* MPI datatype for individual element */ - hbool_t elmt_type_created = FALSE; /* Whether the element MPI datatype was created */ + bool elmt_type_created = false; /* Whether the element MPI datatype was created */ int *inner_blocks = NULL; /* Arrays for MPI datatypes when "large" datatype needed */ MPI_Aint *inner_disps = NULL; MPI_Datatype *inner_types = NULL; @@ -210,7 +210,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, MPI_Aint * /* Create an MPI datatype for an element */ if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) - elmt_type_created = TRUE; + elmt_type_created = true; bigio_count = H5_mpi_get_bigio_count(); @@ -357,7 +357,7 @@ done: */ static herr_t H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute, hbool_t *is_permuted) + bool *is_derived_type, bool do_permute, hsize_t **permute, bool *is_permuted) { MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ H5S_pnt_node_t *curr = NULL; /* Current point being operated on in from the selection */ @@ -414,7 +414,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ if (u > 0 && disp[u] < disp[u - 1]) { hsize_t s = 0, l = u, m = u / 2; - *is_permuted = TRUE; + *is_permuted = true; do { if (disp[u] > disp[m]) s = m + 1; @@ -453,7 +453,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ /* Set values about MPI datatype created */ *count = 1; - *is_derived_type = TRUE; + *is_derived_type = true; done: if (NULL != disp) @@ -491,11 +491,11 @@ done: */ static herr_t H5S__mpio_permute_type(H5S_t *space, size_t elmt_size, hsize_t **permute, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type) + bool *is_derived_type) { MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ H5S_sel_iter_t *sel_iter = NULL; /* Selection iteration info */ - hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */ + bool sel_iter_init = false; /* Selection iteration info has been initialized */ hssize_t snum_points; /* Signed number of elements in selection */ hsize_t num_points; /* Number of points in the selection */ hsize_t *off = NULL; @@ -531,7 +531,7 @@ H5S__mpio_permute_type(H5S_t *space, size_t elmt_size, hsize_t **permute, MPI_Da /* Initialize selection iterator */ if (H5S_select_iter_init(sel_iter, space, elmt_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - sel_iter_init = TRUE; /* Selection iteration info has been initialized */ + sel_iter_init = true; /* Selection iteration info has been initialized */ /* Set the number of elements to iterate over */ H5_CHECKED_ASSIGN(max_elem, size_t, num_points, hsize_t); @@ -597,7 +597,7 @@ H5S__mpio_permute_type(H5S_t *space, size_t elmt_size, hsize_t **permute, MPI_Da /* Set values about MPI datatype created */ *count = 1; - *is_derived_type = TRUE; + *is_derived_type = true; done: /* Release selection iterator */ @@ -637,10 +637,10 @@ done: */ static herr_t H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type) + bool *is_derived_type) { H5S_sel_iter_t *sel_iter = NULL; /* Selection iteration info */ - hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */ + bool sel_iter_init = false; /* Selection iteration info has been initialized */ struct dim { /* less hassle than malloc/free & ilk */ hssize_t start; @@ -678,7 +678,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, /* Initialize selection iterator */ if (H5S_select_iter_init(sel_iter, space, elmt_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - sel_iter_init = TRUE; /* Selection iteration info has been initialized */ + sel_iter_init = true; /* Selection iteration info has been initialized */ /* Abbreviate args */ diminfo = sel_iter->u.hyp.diminfo; @@ -954,7 +954,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, /* fill in the remaining return values */ *count = 1; /* only have to move one of these suckers! */ - *is_derived_type = TRUE; + *is_derived_type = true; done: /* Release selection iterator */ @@ -989,11 +989,11 @@ done: */ static herr_t H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type) + bool *is_derived_type) { H5S_mpio_mpitype_list_t type_list; /* List to track MPI data types created */ MPI_Datatype elmt_type; /* MPI datatype for an element */ - hbool_t elmt_type_is_derived = FALSE; /* Whether the element type has been created */ + bool elmt_type_is_derived = false; /* Whether the element type has been created */ MPI_Datatype span_type; /* MPI datatype for overall span tree */ hsize_t bigio_count; /* Transition point to create derived type */ hsize_t down[H5S_MAX_RANK]; /* 'down' sizes for each dimension */ @@ -1018,7 +1018,7 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *ne else if (H5_mpio_create_large_type(elmt_size, 0, MPI_BYTE, &elmt_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection"); - elmt_type_is_derived = TRUE; + elmt_type_is_derived = true; /* Compute 'down' sizes for each dimension */ H5VM_array_down(space->extent.rank, space->extent.size, down); @@ -1044,7 +1044,7 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *ne /* fill in the remaining return values */ *count = 1; - *is_derived_type = TRUE; + *is_derived_type = true; done: /* Release resources */ @@ -1120,7 +1120,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t e size_t alloc_count = 0; /* Number of span tree nodes allocated at this level */ size_t outercount = 0; /* Number of span tree nodes at this level */ MPI_Datatype *inner_type = NULL; - hbool_t inner_types_freed = FALSE; /* Whether the inner_type MPI datatypes have been freed */ + bool inner_types_freed = false; /* Whether the inner_type MPI datatypes have been freed */ int *blocklen = NULL; MPI_Aint *disp = NULL; size_t u; /* Local index variable */ @@ -1148,7 +1148,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t e /* If this is the fastest changing dimension, it is the base case for derived datatype. */ span = spans->head; if (NULL == span->down) { - hbool_t large_block = FALSE; /* Whether the block length is larger than 32 bit integer */ + bool large_block = false; /* Whether the block length is larger than 32 bit integer */ outercount = 0; while (span) { @@ -1182,14 +1182,14 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t e blocklen[outercount] = (int)nelmts; if (bigio_count < (hsize_t)blocklen[outercount]) - large_block = TRUE; /* at least one block type is large, so set this flag to true */ + large_block = true; /* at least one block type is large, so set this flag to true */ span = span->next; outercount++; } /* end while */ /* Everything fits into integers, so cast them and use hindexed */ - if (bigio_count >= outercount && large_block == FALSE) { + if (bigio_count >= outercount && large_block == false) { if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)outercount, blocklen, disp, *elmt_type, &spans->op_info[op_info_i].u.down_type))) @@ -1307,7 +1307,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t e for (u = 0; u < outercount; u++) if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&inner_type[u]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - inner_types_freed = TRUE; + inner_types_freed = true; } /* end else */ /* Allocate space for the MPI data type list node */ @@ -1366,8 +1366,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, - hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted) +H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, bool *is_derived_type, + bool do_permute, hsize_t **permute_map, bool *is_permuted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1386,7 +1386,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int * out-of-order point selection, then permute this selection which * should be a memory selection to match the file space permutation. */ - if (TRUE == *is_permuted) { + if (true == *is_permuted) { switch (H5S_GET_SELECT_TYPE(space)) { case H5S_SEL_NONE: if (H5S__mpio_none_type(new_type, count, is_derived_type) < 0) @@ -1436,7 +1436,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int break; case H5S_SEL_HYPERSLABS: - if ((H5S_SELECT_IS_REGULAR(space) == TRUE)) { + if ((H5S_SELECT_IS_REGULAR(space) == true)) { if (H5S__mpio_reg_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, diff --git a/src/H5Snone.c b/src/H5Snone.c index a20f37b..c4fdd4c 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -42,12 +42,12 @@ /********************/ /* Selection callbacks */ -static herr_t H5S__none_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__none_copy(H5S_t *dst, const H5S_t *src, bool share_selection); static herr_t H5S__none_release(H5S_t *space); static htri_t H5S__none_is_valid(const H5S_t *space); static hssize_t H5S__none_serial_size(H5S_t *space); static herr_t H5S__none_serialize(H5S_t *space, uint8_t **p); -static herr_t H5S__none_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip); +static herr_t H5S__none_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip); static herr_t H5S__none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__none_offset(const H5S_t *space, hsize_t *off); static int H5S__none_unlim_dim(const H5S_t *space); @@ -226,7 +226,7 @@ H5S__none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) htri_t H5S__none_iter_has_next_block(iter) const H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS - Non-negative (TRUE/FALSE) on success/Negative on failure + Non-negative (true/false) on success/Negative on failure DESCRIPTION Check if there is another block available in the selection iterator. GLOBAL VARIABLES @@ -422,7 +422,7 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) herr_t H5S__none_copy(dst, src, share_selection) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace - hbool_t; IN: Whether to share the selection between the dataspaces + bool; IN: Whether to share the selection between the dataspaces RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -434,7 +434,7 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) +H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, bool H5_ATTR_UNUSED share_selection) { FUNC_ENTER_PACKAGE_NOERR @@ -457,7 +457,7 @@ H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUS htri_t H5S__none_is_valid(space); H5S_t *space; IN: Dataspace pointer to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -474,7 +474,7 @@ H5S__none_is_valid(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__none_is_valid() */ /*-------------------------------------------------------------------------- @@ -578,7 +578,7 @@ H5S__none_serialize(H5S_t *space, uint8_t **p) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip) +H5S__none_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip) { H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either *space or a newly allocated one */ @@ -738,7 +738,7 @@ H5S__none_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__none_is_contiguous(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is contiguous. This is primarily used for reading the entire selection in one swoop. @@ -754,7 +754,7 @@ H5S__none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(FALSE) + FUNC_LEAVE_NOAPI(false) } /* end H5S__none_is_contiguous() */ /*-------------------------------------------------------------------------- @@ -766,7 +766,7 @@ H5S__none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__none_is_single(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is a single block. This is primarily used for reading the entire selection in one swoop. @@ -782,7 +782,7 @@ H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) assert(space); - FUNC_LEAVE_NOAPI(FALSE) + FUNC_LEAVE_NOAPI(false) } /* end H5S__none_is_single() */ /*-------------------------------------------------------------------------- @@ -794,7 +794,7 @@ H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__none_is_regular(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in a dataspace is the a regular pattern. @@ -812,7 +812,7 @@ H5S__none_is_regular(H5S_t H5_ATTR_UNUSED *space) /* Check args */ assert(space); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__none_is_regular() */ /*-------------------------------------------------------------------------- @@ -825,7 +825,7 @@ H5S__none_is_regular(H5S_t H5_ATTR_UNUSED *space) H5S_t *space1; IN: First dataspace to check H5S_t *space2; IN: Second dataspace to check RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in each dataspace are the same shape. @@ -843,7 +843,7 @@ H5S__none_shape_same(H5S_t H5_ATTR_UNUSED *space1, H5S_t H5_ATTR_UNUSED *space2) assert(space1); assert(space2); - FUNC_LEAVE_NOAPI(TRUE) + FUNC_LEAVE_NOAPI(true) } /* end H5S__none_shape_same() */ /*-------------------------------------------------------------------------- @@ -857,7 +857,7 @@ H5S__none_shape_same(H5S_t H5_ATTR_UNUSED *space1, H5S_t H5_ATTR_UNUSED *space2) const hsize_t *start; IN: Starting coordinate for block const hsize_t *end; IN: Ending coordinate for block RETURNS - Non-negative TRUE / FALSE on success, negative on failure + Non-negative true / false on success, negative on failure DESCRIPTION Quickly detect intersections with a block GLOBAL VARIABLES @@ -877,7 +877,7 @@ H5S__none_intersect_block(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNU assert(start); assert(end); - FUNC_LEAVE_NOAPI(FALSE) + FUNC_LEAVE_NOAPI(false) } /* end H5S__none_intersect_block() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 4367a4d..3ae63a5 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -232,7 +232,7 @@ typedef struct { /* Selection information methods */ /* Method to copy a selection */ -typedef herr_t (*H5S_sel_copy_func_t)(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +typedef herr_t (*H5S_sel_copy_func_t)(H5S_t *dst, const H5S_t *src, bool share_selection); /* Method to release current selection */ typedef herr_t (*H5S_sel_release_func_t)(H5S_t *space); /* Method to determine if current selection is valid for dataspace */ @@ -243,7 +243,7 @@ typedef hssize_t (*H5S_sel_serial_size_func_t)(H5S_t *space); typedef herr_t (*H5S_sel_serialize_func_t)(H5S_t *space, uint8_t **p); /* Method to create selection from "serialized" form (a byte sequence suitable for storing on disk) */ typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t **space, const uint8_t **p, const size_t p_size, - hbool_t skip); + bool skip); /* Method to determine smallest n-D bounding box containing the current selection */ typedef herr_t (*H5S_sel_bounds_func_t)(const H5S_t *space, hsize_t *start, hsize_t *end); /* Method to determine linear offset of initial element in selection within dataspace */ @@ -312,7 +312,7 @@ typedef struct { typedef struct { const H5S_select_class_t *type; /* Pointer to selection's class info */ - hbool_t offset_changed; /* Indicate that the offset for the selection has been changed */ + bool offset_changed; /* Indicate that the offset for the selection has been changed */ hssize_t offset[H5S_MAX_RANK]; /* Offset within the extent */ hsize_t num_elem; /* Number of elements in selection */ @@ -395,14 +395,14 @@ H5_DLLVAR const unsigned H5O_sdspace_ver_bounds[H5F_LIBVER_NBOUNDS]; /* Extent functions */ H5_DLL herr_t H5S__extent_release(H5S_extent_t *extent); -H5_DLL herr_t H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max); +H5_DLL herr_t H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, bool copy_max); /* Operations on hyperslab selections */ H5_DLL uint64_t H5S__hyper_get_op_gen(void); H5_DLL void H5S__hyper_rebuild(H5S_t *space); H5_DLL herr_t H5S__modify_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2); H5_DLL herr_t H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space, - H5S_t *proj_space, hbool_t share_space); + H5S_t *proj_space, bool share_space); /* Operations on selection iterators */ H5_DLL herr_t H5S__sel_iter_close_cb(H5S_sel_iter_t *_sel_iter, void **request); diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 7118e2e..48a8a0e 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -52,12 +52,12 @@ static H5S_pnt_list_t *H5S__copy_pnt_list(const H5S_pnt_list_t *src, unsigned ra static void H5S__free_pnt_list(H5S_pnt_list_t *pnt_lst); /* Selection callbacks */ -static herr_t H5S__point_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__point_copy(H5S_t *dst, const H5S_t *src, bool share_selection); static herr_t H5S__point_release(H5S_t *space); static htri_t H5S__point_is_valid(const H5S_t *space); static hssize_t H5S__point_serial_size(H5S_t *space); static herr_t H5S__point_serialize(H5S_t *space, uint8_t **p); -static herr_t H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip); +static herr_t H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip); static herr_t H5S__point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__point_offset(const H5S_t *space, hsize_t *off); static int H5S__point_unlim_dim(const H5S_t *space); @@ -284,7 +284,7 @@ H5S__point_iter_nelmts(const H5S_sel_iter_t *iter) htri_t H5S__point_iter_has_next_block(iter) const H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS - Non-negative (TRUE/FALSE) on success/Negative on failure + Non-negative (true/false) on success/Negative on failure DESCRIPTION Check if there is another block available in the selection iterator. GLOBAL VARIABLES @@ -295,7 +295,7 @@ H5S__point_iter_nelmts(const H5S_sel_iter_t *iter) static htri_t H5S__point_iter_has_next_block(const H5S_sel_iter_t *iter) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -304,7 +304,7 @@ H5S__point_iter_has_next_block(const H5S_sel_iter_t *iter) /* Check if there is another point in the list */ if (iter->u.pnt.curr->next == NULL) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); done: FUNC_LEAVE_NOAPI(ret_value) @@ -892,7 +892,7 @@ H5S__free_pnt_list(H5S_pnt_list_t *pnt_lst) herr_t H5S__point_copy(dst, src, share_selection) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace - hbool_t share_selection; IN: Whether to share the selection between the dataspaces + bool share_selection; IN: Whether to share the selection between the dataspaces RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -904,7 +904,7 @@ H5S__free_pnt_list(H5S_pnt_list_t *pnt_lst) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__point_copy(H5S_t *dst, const H5S_t *src, hbool_t H5_ATTR_UNUSED share_selection) +H5S__point_copy(H5S_t *dst, const H5S_t *src, bool H5_ATTR_UNUSED share_selection) { herr_t ret_value = SUCCEED; /* Return value */ @@ -933,7 +933,7 @@ done: htri_t H5S__point_is_valid(space); const H5S_t *space; IN: Dataspace pointer to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -947,7 +947,7 @@ static htri_t H5S__point_is_valid(const H5S_t *space) { unsigned u; /* Counter */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -958,9 +958,9 @@ H5S__point_is_valid(const H5S_t *space) /* Bounds check the selected point + offset against the extent */ if ((space->select.sel_info.pnt_lst->high_bounds[u] + (hsize_t)space->select.offset[u]) > space->extent.size[u]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (((hssize_t)space->select.sel_info.pnt_lst->low_bounds[u] + space->select.offset[u]) < 0) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end for */ done: @@ -1037,8 +1037,8 @@ done: static herr_t H5S__point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size) { - hbool_t count_up_version = FALSE; /* Whether number of points exceed H5S_UINT32_MAX */ - hbool_t bound_up_version = FALSE; /* Whether high bounds exceed H5S_UINT32_MAX */ + bool count_up_version = false; /* Whether number of points exceed H5S_UINT32_MAX */ + bool bound_up_version = false; /* Whether high bounds exceed H5S_UINT32_MAX */ H5F_libver_t low_bound; /* The 'low' bound of library format versions */ H5F_libver_t high_bound; /* The 'high' bound of library format versions */ uint32_t tmp_version; /* Local temporary version */ @@ -1057,11 +1057,11 @@ H5S__point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t * /* Determine whether number of points or high bounds exceeds (2^32 - 1) */ if (space->select.num_elem > H5S_UINT32_MAX) - count_up_version = TRUE; + count_up_version = true; else for (u = 0; u < space->extent.rank; u++) if (bounds_end[u] > H5S_UINT32_MAX) { - bound_up_version = TRUE; + bound_up_version = true; break; } /* end if */ @@ -1337,7 +1337,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbool_t skip) +H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, bool skip) { H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either *space or a newly allocated one */ @@ -1801,7 +1801,7 @@ H5S__point_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) htri_t H5S__point_is_contiguous(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is contiguous. This is primarily used for reading the entire selection in one swoop. @@ -1824,10 +1824,10 @@ H5S__point_is_contiguous(const H5S_t *space) /* One point is definitely contiguous */ if (space->select.num_elem == 1) - ret_value = TRUE; + ret_value = true; else /* More than one point might be contiguous, but it's complex to check and we don't need it right now */ - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_contiguous() */ @@ -1841,7 +1841,7 @@ H5S__point_is_contiguous(const H5S_t *space) htri_t H5S__point_is_single(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspace is a single block. This is primarily used for reading the entire selection in one swoop. @@ -1861,9 +1861,9 @@ H5S__point_is_single(const H5S_t *space) /* One point is definitely 'single' :-) */ if (space->select.num_elem == 1) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_single() */ @@ -1877,7 +1877,7 @@ H5S__point_is_single(const H5S_t *space) htri_t H5S__point_is_regular(space) H5S_t *space; IN: Dataspace pointer to check RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in a dataspace is the a regular pattern. @@ -1901,9 +1901,9 @@ H5S__point_is_regular(H5S_t *space) /* Only simple check for regular points for now... */ if (space->select.num_elem == 1) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_regular() */ @@ -1918,7 +1918,7 @@ H5S__point_is_regular(H5S_t *space) H5S_t *space1; IN: First dataspace to check H5S_t *space2; IN: Second dataspace to check RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in each dataspace are the same shape. @@ -1936,7 +1936,7 @@ H5S__point_shape_same(H5S_t *space1, H5S_t *space2) unsigned space2_rank; /* Number of dimensions of second dataspace */ int space1_dim; /* Current dimension in first dataspace */ int space2_dim; /* Current dimension in second dataspace */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -1990,7 +1990,7 @@ H5S__point_shape_same(H5S_t *space1, H5S_t *space2) /* Compare locations in common dimensions, including relative offset */ while (space2_dim >= 0) { if ((hsize_t)((hssize_t)pnt1->pnt[space1_dim] + offset[space1_dim]) != pnt2->pnt[space2_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; space2_dim--; @@ -2000,7 +2000,7 @@ H5S__point_shape_same(H5S_t *space1, H5S_t *space2) while (space1_dim >= 0) { /* Compare the absolute offset in the remaining dimensions */ if ((hssize_t)pnt1->pnt[space1_dim] != offset[space1_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space1_dim--; } /* end while */ @@ -2025,7 +2025,7 @@ done: const hsize_t *start; IN: Starting coordinate for block const hsize_t *end; IN: Ending coordinate for block RETURNS - Non-negative TRUE / FALSE on success, negative on failure + Non-negative true / false on success, negative on failure DESCRIPTION Quickly detect intersections with a block GLOBAL VARIABLES @@ -2037,7 +2037,7 @@ htri_t H5S__point_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end) { H5S_pnt_node_t *pnt; /* Point information node */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -2059,7 +2059,7 @@ H5S__point_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en /* Check if point was within block for all dimensions */ if (u == space->extent.rank) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Advance to next point */ pnt = pnt->next; @@ -2090,7 +2090,7 @@ done: static herr_t H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) { - hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ + bool non_zero_offset = false; /* Whether any offset is non-zero */ H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ unsigned u; /* Local index variable */ @@ -2103,7 +2103,7 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) if (0 != offset[u]) { - non_zero_offset = TRUE; + non_zero_offset = true; break; } @@ -2157,7 +2157,7 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) static herr_t H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) { - hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ + bool non_zero_offset = false; /* Whether any offset is non-zero */ H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ unsigned u; /* Local index variable */ @@ -2170,7 +2170,7 @@ H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) if (0 != offset[u]) { - non_zero_offset = TRUE; + non_zero_offset = true; break; } /* end if */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index ac46d9e..8fd73f5 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -61,13 +61,13 @@ typedef struct { * which there are contiguous regions in the lower * dimensions that have been "flattened") */ - hbool_t diminfo_valid; /* Whether the dimension information is valid */ + bool diminfo_valid; /* Whether the dimension information is valid */ /* "Flattened" regular hyperslab selection fields */ H5S_hyper_dim_t diminfo[H5S_MAX_RANK]; /* "Flattened" regular selection information */ hsize_t size[H5S_MAX_RANK]; /* "Flattened" dataspace extent information */ hssize_t sel_off[H5S_MAX_RANK]; /* "Flattened" selection offset information */ - hbool_t flattened[H5S_MAX_RANK]; /* Whether this dimension has been flattened */ + bool flattened[H5S_MAX_RANK]; /* Whether this dimension has been flattened */ /* Irregular hyperslab selection fields */ hsize_t loc_off[H5S_MAX_RANK]; /* Byte offset in buffer, for each dimension's current offset */ @@ -201,12 +201,12 @@ typedef struct H5S_t H5S_t; /* Operations on dataspaces */ H5_DLL herr_t H5S_init(void); -H5_DLL H5S_t *H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max); +H5_DLL H5S_t *H5S_copy(const H5S_t *src, bool share_selection, bool copy_max); H5_DLL herr_t H5S_close(H5S_t *ds); H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds); H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds); H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds); -H5_DLL hbool_t H5S_has_extent(const H5S_t *ds); +H5_DLL bool H5S_has_extent(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[] /*out*/, hsize_t max_dims[] /*out*/); H5_DLL herr_t H5S_write(H5F_t *f, struct H5O_t *oh, unsigned update_flags, H5S_t *ds); @@ -241,7 +241,7 @@ H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset); H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space); H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim); H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset); -H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection); H5_DLL htri_t H5S_select_shape_same(H5S_t *space1, H5S_t *space2); H5_DLL htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end); H5_DLL herr_t H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, @@ -258,12 +258,12 @@ H5_DLL herr_t H5S_select_adjust_s(H5S_t *space, const hssize_t *offset); H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset); H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); H5_DLL herr_t H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space, - H5S_t **new_space_ptr, hbool_t share_space); + H5S_t **new_space_ptr, bool share_space); H5_DLL herr_t H5S_select_subtract(H5S_t *space, H5S_t *subtract_space); -H5_DLL herr_t H5S_select_contig_block(H5S_t *space, hbool_t *is_contig, hsize_t *off, size_t *len); +H5_DLL herr_t H5S_select_contig_block(H5S_t *space, bool *is_contig, hsize_t *off, size_t *len); /* Operations on all selections */ -H5_DLL herr_t H5S_select_all(H5S_t *space, hbool_t rel_prev); +H5_DLL herr_t H5S_select_all(H5S_t *space, bool rel_prev); /* Operations on none selections */ H5_DLL herr_t H5S_select_none(H5S_t *space); @@ -281,12 +281,11 @@ H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank, const hsi H5_DLL htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset); H5_DLL herr_t H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset); H5_DLL herr_t H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size); -H5_DLL hsize_t H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, - hbool_t incl_trail); +H5_DLL hsize_t H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, bool incl_trail); H5_DLL hsize_t H5S_hyper_get_clip_extent_match(const H5S_t *clip_space, const H5S_t *match_space, - hsize_t match_clip_size, hbool_t incl_trail); + hsize_t match_clip_size, bool incl_trail); H5_DLL H5S_t *H5S_hyper_get_unlim_block(const H5S_t *space, hsize_t block_index); -H5_DLL hsize_t H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *partial); +H5_DLL hsize_t H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, bool *partial); /* Operations on selection iterators */ H5_DLL herr_t H5S_select_iter_init(H5S_sel_iter_t *iter, H5S_t *space, size_t elmt_size, unsigned flags); @@ -300,8 +299,8 @@ H5_DLL herr_t H5S_sel_iter_close(H5S_sel_iter_t *sel_iter); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5S_mpio_space_type(H5S_t *space, size_t elmt_size, - /* out: */ MPI_Datatype *new_type, int *count, hbool_t *is_derived_type, - hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted); + /* out: */ MPI_Datatype *new_type, int *count, bool *is_derived_type, + bool do_permute, hsize_t **permute_map, bool *is_permuted); #endif /* H5_HAVE_PARALLEL */ #endif /* H5Sprivate_H */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 3087df3..13440cd 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -101,7 +101,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) H5MM_memcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); /* Indicate that the offset was changed */ - space->select.offset_changed = TRUE; + space->select.offset_changed = true; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_select_offset() */ @@ -186,7 +186,7 @@ H5Sselect_copy(hid_t dst_id, hid_t src_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); /* Copy */ - if (H5S_select_copy(dst, src, FALSE) < 0) + if (H5S_select_copy(dst, src, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy selection"); done: @@ -202,7 +202,7 @@ done: herr_t H5S_select_copy(dst, src, share_selection) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace - hbool_t; IN: Whether to share the selection between the dataspaces + bool; IN: Whether to share the selection between the dataspaces RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -219,7 +219,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection) +H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection) { herr_t ret_value = FAIL; /* Return value */ @@ -420,7 +420,7 @@ H5S_get_select_npoints(const H5S_t *space) htri_t H5Sselect_void(dsid) hid_t dsid; IN: Dataspace ID to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -459,7 +459,7 @@ done: htri_t H5S_select_void(space) H5S_t *space; IN: Dataspace to query RETURNS - TRUE if the selection fits within the extent, FALSE if it does not and + true if the selection fits within the extent, false if it does not and Negative on an error. DESCRIPTION Determines if the current selection at the current offset fits within the @@ -518,7 +518,7 @@ H5S_select_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size) uint32_t sel_type; /* Pointer to the selection type */ herr_t ret_value = FAIL; /* Return value */ const uint8_t *p_end = *p + p_size - 1; /* Pointer to last valid byte in buffer */ - hbool_t skip = (p_size == SIZE_MAX ? TRUE : FALSE); /* If p_size is unknown, skip buffer checks */ + bool skip = (p_size == SIZE_MAX ? true : false); /* If p_size is unknown, skip buffer checks */ FUNC_ENTER_NOAPI(FAIL) assert(space); @@ -784,7 +784,7 @@ done: htri_t H5S_select_is_contiguous(space) const H5S_t *space; IN: Dataspace of selection to query RETURNS - Non-negative (TRUE/FALSE) on success, negative on failure + Non-negative (true/false) on success, negative on failure DESCRIPTION Checks the selection to determine if the points to iterated over will be contiguous in the particular dataspace. @@ -820,7 +820,7 @@ H5S_select_is_contiguous(const H5S_t *space) htri_t H5S_select_is_single(space) const H5S_t *space; IN: Dataspace of selection to query RETURNS - Non-negative (TRUE/FALSE) on success, negative on failure + Non-negative (true/false) on success, negative on failure DESCRIPTION Checks the selection to determine if it occupies a single block in the particular dataspace. @@ -856,7 +856,7 @@ H5S_select_is_single(const H5S_t *space) htri_t H5S_select_is_regular(space) const H5S_t *space; IN: Dataspace of selection to query RETURNS - Non-negative (TRUE/FALSE) on success, negative on failure + Non-negative (true/false) on success, negative on failure DESCRIPTION Checks the selection to determine if it is "regular" (i.e. a single block or a strided pattern) in the particular dataspace. @@ -1360,7 +1360,7 @@ herr_t H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op, void *op_data) { H5S_sel_iter_t *iter = NULL; /* Selection iteration info */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ hsize_t *off = NULL; /* Array to store sequence offsets */ size_t *len = NULL; /* Array to store sequence lengths */ hssize_t nelmts; /* Number of elements in selection */ @@ -1390,7 +1390,7 @@ H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_ite /* Initialize iterator */ if (H5S_select_iter_init(iter, space, elmt_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - iter_init = TRUE; /* Selection iteration info has been initialized */ + iter_init = true; /* Selection iteration info has been initialized */ /* Get the number of elements in selection */ if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) @@ -1584,7 +1584,7 @@ H5S_get_select_type(const H5S_t *space) const H5S_t *space1; IN: 1st Dataspace pointer to compare const H5S_t *space2; IN: 2nd Dataspace pointer to compare RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspaces are the same dimensionality and shape. @@ -1602,9 +1602,9 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) { H5S_sel_iter_t *iter_a = NULL; /* Selection a iteration info */ H5S_sel_iter_t *iter_b = NULL; /* Selection b iteration info */ - hbool_t iter_a_init = FALSE; /* Selection a iteration info has been initialized */ - hbool_t iter_b_init = FALSE; /* Selection b iteration info has been initialized */ - htri_t ret_value = TRUE; /* Return value */ + bool iter_a_init = false; /* Selection a iteration info has been initialized */ + bool iter_b_init = false; /* Selection b iteration info has been initialized */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1614,7 +1614,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) /* Check for different number of elements selected */ if (H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Check special cases if both dataspaces aren't scalar */ /* (If only one is, the number of selected points check is sufficient) */ @@ -1684,7 +1684,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) /* Verify that the ranges are the same */ if ((high_a[space_a_dim] - low_a[space_a_dim]) != (high_b[space_b_dim] - low_b[space_b_dim])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Go to next dimension */ space_a_dim--; @@ -1698,7 +1698,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) /* This range should be flat to be the same in a lower dimension */ if (low_a[space_a_dim] != high_a[space_a_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space_a_dim--; } /* end while */ @@ -1709,7 +1709,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) * the same, then the selections are the same, even if the * selection types are different. */ - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ } /* end if */ @@ -1725,7 +1725,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) hsize_t end_a[H5S_MAX_RANK]; /* End point of selection block in dataspace a */ hsize_t end_b[H5S_MAX_RANK]; /* End point of selection block in dataspace b */ hssize_t offset[H5S_MAX_RANK]; /* Offset of selection b blocks relative to selection a blocks */ - hbool_t first_block = TRUE; /* Flag to indicate the first block */ + bool first_block = true; /* Flag to indicate the first block */ /* Allocate the selection iterators */ if (NULL == (iter_a = H5FL_MALLOC(H5S_sel_iter_t))) @@ -1740,10 +1740,10 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) */ if (H5S_select_iter_init(iter_a, space_a, (size_t)0, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator a"); - iter_a_init = TRUE; + iter_a_init = true; if (H5S_select_iter_init(iter_b, space_b, (size_t)0, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator b"); - iter_b_init = TRUE; + iter_b_init = true; /* Iterate over all the blocks in each selection */ while (1) { @@ -1768,7 +1768,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) while (space_b_dim >= 0) { if ((end_a[space_a_dim] - start_a[space_a_dim]) != (end_b[space_b_dim] - start_b[space_b_dim])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* Set the relative locations of the selections */ offset[space_a_dim] = (hssize_t)start_b[space_b_dim] - (hssize_t)start_a[space_a_dim]; @@ -1782,13 +1782,13 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) */ while (space_a_dim >= 0) { if (start_a[space_a_dim] != end_a[space_a_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space_a_dim--; } /* end while */ /* Reset "first block" flag */ - first_block = FALSE; + first_block = false; } /* end if */ /* Check over the blocks for each selection */ else { @@ -1797,12 +1797,12 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) /* Check if the blocks are in the same relative location */ if ((hsize_t)((hssize_t)start_a[space_a_dim] + offset[space_a_dim]) != start_b[space_b_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); /* If the block sizes from each selection doesn't match, get out */ if ((end_a[space_a_dim] - start_a[space_a_dim]) != (end_b[space_b_dim] - start_b[space_b_dim])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space_a_dim--; space_b_dim--; @@ -1812,7 +1812,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) while (space_a_dim >= 0) { /* If the block size isn't 1, get out */ if (start_a[space_a_dim] != end_a[space_a_dim]) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); space_a_dim--; } /* end while */ @@ -1826,10 +1826,10 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to check iterator block b"); /* Did we run out of blocks at the same time? */ - if ((status_a == FALSE) && (status_b == FALSE)) + if ((status_a == false) && (status_b == false)) break; else if (status_a != status_b) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); else { /* Advance to next block in selection iterators */ if (H5S_SELECT_ITER_NEXT_BLOCK(iter_a) < 0) @@ -1867,7 +1867,7 @@ done: hid_t space1_id; IN: ID of 1st Dataspace pointer to compare hid_t space2_id; IN: ID of 2nd Dataspace pointer to compare RETURNS - TRUE/FALSE/FAIL + true/false/FAIL DESCRIPTION Checks to see if the current selection in the dataspaces are the same dimensionality and shape. @@ -1909,7 +1909,7 @@ done: const hsize_t *start; IN: Starting coordinate of block const hsize_t *end; IN: Opposite ("ending") coordinate of block RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in the dataspace intersects with the block given. @@ -1924,7 +1924,7 @@ done: htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1947,7 +1947,7 @@ H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en for (u = 0; u < space->extent.rank; u++) /* If selection bounds & block don't overlap, can leave now */ if (!H5S_RANGE_OVERLAP(low[u], high[u], start[u], end[u])) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end if */ /* Call selection type's intersect routine */ @@ -1969,7 +1969,7 @@ done: const hsize_t *start; IN: Starting coordinate of block const hsize_t *end; IN: Opposite ("ending") coordinate of block RETURNS - TRUE / FALSE / FAIL + true / false / FAIL DESCRIPTION Checks to see if the current selection in the dataspace intersects with the block given. @@ -2237,14 +2237,14 @@ H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, unsign sizeof(new_space->select.offset[0]) * new_space_rank); /* Propagate the offset changed flag into the new dataspace. */ - new_space->select.offset_changed = TRUE; + new_space->select.offset_changed = true; } /* end if */ } /* end else */ /* If we have done the projection correctly, the following assertion * should hold. */ - assert(TRUE == H5S_select_shape_same(base_space, new_space)); + assert(true == H5S_select_shape_same(base_space, new_space)); /* load the address of the new space into *new_space_ptr */ *new_space_ptr = new_space; @@ -2296,7 +2296,7 @@ herr_t H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *_buf) { H5S_sel_iter_t *iter = NULL; /* Selection iteration info */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ hsize_t *off = NULL; /* Array to store sequence offsets */ size_t *len = NULL; /* Array to store sequence lengths */ hssize_t nelmts; /* Number of elements in selection */ @@ -2318,7 +2318,7 @@ H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *_buf) /* Initialize iterator */ if (H5S_select_iter_init(iter, space, fill_size, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - iter_init = TRUE; /* Selection iteration info has been initialized */ + iter_init = true; /* Selection iteration info has been initialized */ /* Get the number of elements in selection */ if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) @@ -2391,7 +2391,7 @@ done: src_intersect_space H5S_t *dst_space; IN: Selection that is mapped to src_space H5S_t *src_intersect_space; IN: Selection whose intersection with src_space is projected to dst_space to obtain the result H5S_t **new_space_ptr; OUT: Will contain the result (intersection of src_intersect_space and src_space -projected from src_space to dst_space) after the operation hbool_t share_selection; IN: Whether we are allowed +projected from src_space to dst_space) after the operation bool share_selection; IN: Whether we are allowed to share structures inside dst_space with proj_space RETURNS @@ -2410,14 +2410,14 @@ to share structures inside dst_space with proj_space --------------------------------------------------------------------------*/ herr_t H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space, - H5S_t **new_space_ptr, hbool_t share_selection) + H5S_t **new_space_ptr, bool share_selection) { H5S_t *new_space = NULL; /* New dataspace constructed */ H5S_t *tmp_src_intersect_space = NULL; /* Temporary SIS converted from points->hyperslabs */ H5S_sel_iter_t *ss_iter = NULL; /* Selection iterator for src_space */ - hbool_t ss_iter_init = FALSE; /* Whether ss_iter has been initialized */ + bool ss_iter_init = false; /* Whether ss_iter has been initialized */ H5S_sel_iter_t *ds_iter = NULL; /* Selection iterator for dst_space */ - hbool_t ds_iter_init = FALSE; /* Whether ds_iter has been initialized */ + bool ds_iter_init = false; /* Whether ds_iter has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2438,14 +2438,14 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i /* Create new space, using dst extent. Start with "all" selection. */ if (NULL == (new_space = H5S_create(H5S_SIMPLE))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create output dataspace"); - if (H5S__extent_copy_real(&new_space->extent, &dst_space->extent, TRUE) < 0) + if (H5S__extent_copy_real(&new_space->extent, &dst_space->extent, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy destination space extent"); /* If the intersecting space is "all", the intersection must be equal to the * source space and the projection must be equal to the destination space */ if (H5S_GET_SELECT_TYPE(src_intersect_space) == H5S_SEL_ALL) { /* Copy the destination selection. */ - if (H5S_select_copy(new_space, dst_space, FALSE) < 0) + if (H5S_select_copy(new_space, dst_space, false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy destination space selection"); } /* end if */ /* If any of the selections contain no elements, the projection must be @@ -2486,7 +2486,7 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i /* Select all or none as appropriate */ if (intersect) { - if (H5S_select_all(new_space, TRUE) < 0) + if (H5S_select_all(new_space, true) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't select all"); } /* end if */ else if (H5S_select_none(new_space) < 0) @@ -2507,7 +2507,7 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create temporary source intersect dataspace"); if (H5S__extent_copy_real(&tmp_src_intersect_space->extent, &src_intersect_space->extent, - FALSE) < 0) + false) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy source intersect space extent"); @@ -2543,11 +2543,11 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i if (H5S_select_iter_init(ss_iter, src_space, 1, H5S_SEL_ITER_SHARE_WITH_DATASPACE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't initialize source space selection iterator"); - ss_iter_init = TRUE; + ss_iter_init = true; if (H5S_select_iter_init(ds_iter, dst_space, 1, H5S_SEL_ITER_SHARE_WITH_DATASPACE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't initialize destination space selection iterator"); - ds_iter_init = TRUE; + ds_iter_init = true; /* Iterate over points */ do { @@ -2688,11 +2688,11 @@ H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id, hid_t src "rank of source space does not match rank of source intersect space"); /* Perform operation */ - if (H5S_select_project_intersection(src_space, dst_space, src_intersect_space, &proj_space, FALSE) < 0) + if (H5S_select_project_intersection(src_space, dst_space, src_intersect_space, &proj_space, false) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project dataspace intersection"); /* Register */ - if ((ret_value = H5I_register(H5I_DATASPACE, proj_space, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATASPACE, proj_space, true)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); done: @@ -2840,7 +2840,7 @@ H5Ssel_iter_create(hid_t space_id, size_t elmt_size, unsigned flags) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to initialize selection iterator"); /* Register */ - if ((ret_value = H5I_register(H5I_SPACE_SEL_ITER, sel_iter, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_SPACE_SEL_ITER, sel_iter, true)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace selection iterator ID"); @@ -2938,7 +2938,7 @@ done: USAGE herr_t H5S_select_contig_block(space, is_contig, off, len) H5S_t *space; IN: Selection to check - hbool_t *is_contig; OUT: Whether the selection is contiguous + bool *is_contig; OUT: Whether the selection is contiguous hsize_t *off; OUT: Offset of selection size_t *len; OUT: Length of selection @@ -2955,10 +2955,10 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_contig_block(H5S_t *space, hbool_t *is_contig, hsize_t *off, size_t *len) +H5S_select_contig_block(H5S_t *space, bool *is_contig, hsize_t *off, size_t *len) { H5S_sel_iter_t *iter = NULL; /* Selection iterator */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + bool iter_init = false; /* Selection iteration info has been initialized */ size_t nseq_tmp; size_t nelem_tmp; hsize_t sel_off; @@ -2975,7 +2975,7 @@ H5S_select_contig_block(H5S_t *space, hbool_t *is_contig, hsize_t *off, size_t * HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate iterator"); if (H5S_select_iter_init(iter, space, 1, 0) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize memory selection information"); - iter_init = TRUE; + iter_init = true; /* Get list of sequences for selection, to check if it is contiguous */ if (H5S_SELECT_ITER_GET_SEQ_LIST(iter, (size_t)1, (size_t)-1, &nseq_tmp, &nelem_tmp, &sel_off, &sel_len) < @@ -2986,14 +2986,14 @@ H5S_select_contig_block(H5S_t *space, hbool_t *is_contig, hsize_t *off, size_t * H5_CHECK_OVERFLOW(space->select.num_elem, hsize_t, size_t); if (sel_len == (size_t)space->select.num_elem) { if (is_contig) - *is_contig = TRUE; + *is_contig = true; if (off) *off = sel_off; if (len) *len = sel_len; } else if (is_contig) - *is_contig = FALSE; + *is_contig = false; done: if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0) diff --git a/src/H5Stest.c b/src/H5Stest.c index e5888ef..4978de0 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -168,7 +168,7 @@ H5S__check_spans_tail_ptr(const H5S_hyper_span_info_t *span_lst) { H5S_hyper_span_t *cur_elem; H5S_hyper_span_t *actual_tail = NULL; - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -217,7 +217,7 @@ H5S__check_points_tail_ptr(const H5S_pnt_list_t *pnt_lst) { H5S_pnt_node_t *cur_elem; H5S_pnt_node_t *actual_tail = NULL; - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -337,7 +337,7 @@ done: htri_t H5S__internal_consistency_test(hid_t space_id) hid_t space_id; IN: dataspace id RETURNS - Non-negative TRUE/FALSE on success, negative on failure + Non-negative true/false on success, negative on failure DESCRIPTION Check the states of internal data structures of the hyperslab, and see whether they are consistent or not @@ -351,7 +351,7 @@ htri_t H5S__internal_consistency_test(hid_t space_id) { H5S_t *space; /* Pointer to 1st dataspace */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5T.c b/src/H5T.c index bad068a..0934a20 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -251,7 +251,7 @@ { \ H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \ H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ - dt->shared->force_conv = TRUE; \ + dt->shared->force_conv = true; \ dt->shared->u.atomic.u.r.file = NULL; \ dt->shared->u.atomic.u.r.loc = H5T_LOC_BADLOC; \ dt->shared->u.atomic.u.r.cls = NULL; \ @@ -261,7 +261,7 @@ { \ H5T_INIT_TYPE_REF_COMMON \ dt->shared->u.atomic.u.r.rtype = H5R_OBJECT1; \ - dt->shared->u.atomic.u.r.opaque = FALSE; \ + dt->shared->u.atomic.u.r.opaque = false; \ dt->shared->u.atomic.u.r.version = 0; \ } @@ -269,7 +269,7 @@ { \ H5T_INIT_TYPE_REF_COMMON \ dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION1; \ - dt->shared->u.atomic.u.r.opaque = FALSE; \ + dt->shared->u.atomic.u.r.opaque = false; \ dt->shared->u.atomic.u.r.version = 0; \ } @@ -280,7 +280,7 @@ { \ H5T_INIT_TYPE_REF_COMMON \ dt->shared->u.atomic.u.r.rtype = H5R_OBJECT2; \ - dt->shared->u.atomic.u.r.opaque = TRUE; \ + dt->shared->u.atomic.u.r.opaque = true; \ dt->shared->u.atomic.u.r.version = H5R_ENCODE_VERSION; \ dt->shared->version = H5O_DTYPE_VERSION_4; \ } @@ -326,7 +326,7 @@ H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \ \ /* Register result */ \ - if (((GLOBAL) = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ + if (((GLOBAL) = H5I_register(H5I_DATATYPE, dt, false)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom"); \ } @@ -349,12 +349,12 @@ static herr_t H5T__set_size(H5T_t *dt, size_t size); static herr_t H5T__close_cb(H5T_t *dt, void **request); static H5T_path_t *H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_func_t *conv); -static hbool_t H5T__detect_vlen_ref(const H5T_t *dt); +static bool H5T__detect_vlen_ref(const H5T_t *dt); static H5T_t *H5T__initiate_copy(const H5T_t *old_dt); static H5T_t *H5T__copy_transient(H5T_t *old_dt); static H5T_t *H5T__copy_all(H5T_t *old_dt); static herr_t H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo, - hbool_t set_memory_type, H5T_copy_func_t copyfn); + bool set_memory_type, H5T_copy_func_t copyfn); /*****************************/ /* Library Private Variables */ @@ -612,9 +612,9 @@ H5T__init_inf(void) /* +Inf */ d = (uint8_t *)&H5T_NATIVE_FLOAT_POS_INF_g; - H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE); - H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, false); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, true); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, false); /* Swap the bytes if the machine architecture is big-endian */ if (H5T_ORDER_BE == H5T_native_order_g) { @@ -628,9 +628,9 @@ H5T__init_inf(void) /* -Inf */ d = (uint8_t *)&H5T_NATIVE_FLOAT_NEG_INF_g; - H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE); - H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, true); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, true); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, false); /* Swap the bytes if the machine architecture is big-endian */ if (H5T_ORDER_BE == H5T_native_order_g) { @@ -653,9 +653,9 @@ H5T__init_inf(void) /* +Inf */ d = (uint8_t *)&H5T_NATIVE_DOUBLE_POS_INF_g; - H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE); - H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, false); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, true); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, false); /* Swap the bytes if the machine architecture is big-endian */ if (H5T_ORDER_BE == H5T_native_order_g) { @@ -669,9 +669,9 @@ H5T__init_inf(void) /* -Inf */ d = (uint8_t *)&H5T_NATIVE_DOUBLE_NEG_INF_g; - H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE); - H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, true); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, true); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, false); /* Swap the bytes if the machine architecture is big-endian */ if (H5T_ORDER_BE == H5T_native_order_g) { @@ -734,8 +734,8 @@ H5T_init(void) H5T_t *ref = NULL; /* Datatype structure for opaque references */ hsize_t dim[1] = {1}; /* Dimension info for array datatype */ herr_t status; - hbool_t copied_dtype = - TRUE; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ + bool copied_dtype = + true; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -813,8 +813,8 @@ H5T_init(void) /* herr_t */ H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HERR_g, COPY, native_int, SET, sizeof(herr_t)) - /* hbool_t */ - H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HBOOL_g, COPY, native_uint, SET, sizeof(hbool_t)) + /* bool */ + H5T_INIT_TYPE(OFFSET, H5T_NATIVE_HBOOL_g, COPY, native_uint, SET, sizeof(bool)) /*------------------------------------------------------------ * IEEE Types @@ -955,7 +955,7 @@ H5T_init(void) /* Indicate that the types that are created from here down are allocated * H5FL_ALLOC(), not copied with H5T_copy() */ - copied_dtype = FALSE; + copied_dtype = false; /* Opaque data */ H5T_INIT_TYPE(OPAQ, H5T_NATIVE_OPAQUE_g, ALLOC, -, SET, 1) @@ -1388,7 +1388,7 @@ H5T_init(void) assert(H5P_CLS_DATATYPE_CREATE_g != NULL); /* Register the default datatype creation property list */ - if ((H5P_LST_DATATYPE_CREATE_ID_g = H5P_create_id(H5P_CLS_DATATYPE_CREATE_g, FALSE)) < 0) + if ((H5P_LST_DATATYPE_CREATE_ID_g = H5P_create_id(H5P_CLS_DATATYPE_CREATE_g, false)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't insert property into class"); } /* end if */ @@ -1535,11 +1535,11 @@ H5T_top_term_package(void) /* Unlock all datatypes, then free them */ /* note that we are ignoring the return value from H5I_iterate() */ /* Also note that we are incrementing 'n' in the callback */ - H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); + H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, false); /* Release all datatype IDs */ if (H5I_nmembers(H5I_DATATYPE) > 0) { - (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); + (void)H5I_clear_type(H5I_DATATYPE, false, false); n++; /*H5I*/ } /* end if */ @@ -1753,7 +1753,7 @@ H5Tcreate(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type"); /* Get an ID for the datatype */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype ID"); done: @@ -1848,7 +1848,7 @@ H5Tcopy(hid_t obj_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy"); /* Get an ID for the copied datatype */ - if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype atom"); done: @@ -1963,7 +1963,7 @@ done: * * Purpose: Determines if two datatypes are equal. * - * Return: Success: TRUE if equal, FALSE if unequal + * Return: Success: true if equal, false if unequal * * Failure: Negative * @@ -1985,7 +1985,7 @@ H5Tequal(hid_t type1_id, hid_t type2_id) if (NULL == (dt2 = (H5T_t *)H5I_object_verify(type2_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); - ret_value = (0 == H5T_cmp(dt1, dt2, FALSE)) ? TRUE : FALSE; + ret_value = (0 == H5T_cmp(dt1, dt2, false)) ? true : false; done: FUNC_LEAVE_API(ret_value) @@ -2021,7 +2021,7 @@ H5Tlock(hid_t type_id) if (H5T_STATE_NAMED == dt->shared->state || H5T_STATE_OPEN == dt->shared->state) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to lock named datatype"); - if (H5T_lock(dt, TRUE) < 0) + if (H5T_lock(dt, true) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype"); done: @@ -2053,7 +2053,7 @@ H5Tget_class(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype"); /* Set return value */ - ret_value = H5T_get_class(dt, FALSE); + ret_value = H5T_get_class(dt, false); done: FUNC_LEAVE_API(ret_value) @@ -2099,7 +2099,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) * Purpose: Check whether a datatype contains (or is) a certain type of * datatype. * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: true (1) or false (0) on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -2119,7 +2119,7 @@ H5Tdetect_class(hid_t type, H5T_class_t cls) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype class"); /* Set return value */ - if ((ret_value = H5T_detect_class(dt, cls, TRUE)) < 0) + if ((ret_value = H5T_detect_class(dt, cls, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5T_NO_CLASS, "can't get datatype class"); done: @@ -2132,15 +2132,15 @@ done: * Purpose: Check whether a datatype contains (or is) a certain type of * datatype. * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: true (1) or false (0) on success/Negative on failure * *------------------------------------------------------------------------- */ htri_t -H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) +H5T_detect_class(const H5T_t *dt, H5T_class_t cls, bool from_api) { unsigned i; - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -2157,7 +2157,7 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) /* Check if this type is the correct type */ if (dt->shared->type == cls) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* check for types that might have the correct type as a component */ switch (dt->shared->type) { @@ -2167,12 +2167,12 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) /* Check if this field's type is the correct type */ if (dt->shared->u.compnd.memb[i].type->shared->type == cls) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Recurse if it's VL, compound, enum or array */ if (H5T_IS_COMPLEX(dt->shared->u.compnd.memb[i].type->shared->type)) if ((nested_ret = H5T_detect_class(dt->shared->u.compnd.memb[i].type, cls, from_api)) != - FALSE) + false) HGOTO_DONE(nested_ret); } /* end for */ break; @@ -2204,7 +2204,7 @@ done: * * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: true (1) or false (0) on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -2234,7 +2234,7 @@ done: * * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: true (1) or false (0) on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -2357,7 +2357,7 @@ H5Tget_super(hid_t type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype"); if (NULL == (super = H5T_get_super(dt))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "not a datatype"); - if ((ret_value = H5I_register(H5I_DATATYPE, super, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, super, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register parent datatype"); done: @@ -2424,7 +2424,7 @@ H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T assert(func); /* Set up conversion function wrapper */ - conv_func.is_app = FALSE; + conv_func.is_app = false; conv_func.u.lib_func = func; /* Register conversion */ @@ -2474,7 +2474,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con if (H5T_PERS_HARD == pers) { /* Only bother to register the path if it's not a no-op path (for this machine) */ - if (H5T_cmp(src, dst, FALSE)) { + if (H5T_cmp(src, dst, false)) { /* Locate or create a new conversion path */ if (NULL == (new_path = H5T__path_find_real(src, dst, name, conv))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path"); @@ -2487,7 +2487,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con */ for (i = 0; i < H5T_g.npaths; i++) if (new_path != H5T_g.path[i]) - H5T_g.path[i]->cdata.recalc = TRUE; + H5T_g.path[i]->cdata.recalc = true; } /* end if */ } /* end if */ else { @@ -2522,8 +2522,8 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con old_path->dst->shared->type != dst->shared->type) continue; - if ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE)) < 0 || - (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE)) < 0) + if ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), false)) < 0 || + (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query"); memset(&cdata, 0, sizeof cdata); @@ -2556,7 +2556,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con NULL == (new_path->dst = H5T_copy(old_path->dst, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data types"); new_path->conv = *conv; - new_path->is_hard = FALSE; + new_path->is_hard = false; new_path->cdata = cdata; /* Replace previous path */ @@ -2660,7 +2660,7 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_c HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified"); /* Set up conversion function wrapper */ - conv_func.is_app = TRUE; + conv_func.is_app = true; conv_func.u.app_func = func; /* Go register the function */ @@ -2719,8 +2719,8 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c /* Not a match */ if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) || - (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, FALSE)) || - (dst && H5T_cmp(dst, path->dst, FALSE)) || (func && func != path->conv.u.app_func)) { + (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, false)) || + (dst && H5T_cmp(dst, path->dst, false)) || (func && func != path->conv.u.app_func)) { /* * Notify all other functions to recalculate private data since some * functions might cache a list of conversion functions. For @@ -2728,7 +2728,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c * functions for the members, so removing a function should cause * the list to be recalculated to avoid the removed function. */ - path->cdata.recalc = TRUE; + path->cdata.recalc = true; } /* end if */ else { /* Remove from table */ @@ -2860,8 +2860,8 @@ done: * A hard conversion uses compiler's casting; a soft conversion * uses the library's own conversion function. * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. + * Return: true: hard conversion. + * false: soft conversion. * FAIL: failed. * *------------------------------------------------------------------------- @@ -2924,7 +2924,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *backgroun HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list"); /* Set DXPL for operation */ @@ -2973,7 +2973,7 @@ H5Treclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; - else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); /* Set DXPL for operation */ @@ -3056,7 +3056,7 @@ H5Tdecode(const void *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object"); /* Register the type and return the ID */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type"); done: @@ -3094,7 +3094,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct"); /* Find out the size of buffer needed */ - if ((buf_size = H5O_msg_raw_size(f, H5O_DTYPE_ID, TRUE, obj)) == 0) + if ((buf_size = H5O_msg_raw_size(f, H5O_DTYPE_ID, true, obj)) == 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size"); /* Don't encode if buffer size isn't big enough or buffer is empty */ @@ -3108,7 +3108,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) *buf++ = H5T_ENCODE_VERSION; /* Encode into user's buffer */ - if (H5O_msg_encode(f, H5O_DTYPE_ID, TRUE, buf, obj) < 0) + if (H5O_msg_encode(f, H5O_DTYPE_ID, true, buf, obj) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode object"); } /* end else */ @@ -3220,7 +3220,7 @@ H5T__create(H5T_class_t type, size_t size) dt->shared->type = type; if (type == H5T_COMPOUND) { - dt->shared->u.compnd.packed = FALSE; /* Start out unpacked */ + dt->shared->u.compnd.packed = false; /* Start out unpacked */ dt->shared->u.compnd.memb_size = 0; } /* end if */ else if (type == H5T_OPAQUE) @@ -3411,7 +3411,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo, hbool_t set_memory_type, +H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo, bool set_memory_type, H5T_copy_func_t copyfn) { H5T_t *tmp = NULL; /* Temporary copy of compound field's datatype */ @@ -3716,7 +3716,7 @@ H5T_copy_reopen(H5T_t *old_dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reopen named data type"); /* Insert opened named datatype into opened object list for the file */ - if (H5FO_insert(old_dt->sh_loc.file, old_dt->sh_loc.u.loc.oh_addr, new_dt->shared, FALSE) < 0) + if (H5FO_insert(old_dt->sh_loc.file, old_dt->sh_loc.u.loc.oh_addr, new_dt->shared, false) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL, "can't insert datatype into list of open objects"); @@ -3758,7 +3758,7 @@ H5T_copy_reopen(H5T_t *old_dt) new_dt->shared->state = H5T_STATE_RDONLY; /* Finish making the copy of the datatype */ - if (H5T__complete_copy(new_dt, old_dt, reopened_fo, TRUE, H5T_copy_reopen) < 0) + if (H5T__complete_copy(new_dt, old_dt, reopened_fo, true, H5T_copy_reopen) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "can't complete datatype initialization"); /* Set return value */ @@ -3792,7 +3792,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_lock(H5T_t *dt, hbool_t immutable) +H5T_lock(H5T_t *dt, bool immutable) { herr_t ret_value = SUCCEED; /* Return value */ @@ -4032,7 +4032,7 @@ H5T_close(H5T_t *dt) /* Close things down if this is the last reference to the open named datatype */ if (0 == dt->shared->fo_count) { - hbool_t corked; /* Whether the named datatype is corked or not */ + bool corked; /* Whether the named datatype is corked or not */ /* Uncork cache entries with object address tag for named datatype */ if (H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) @@ -4199,7 +4199,7 @@ H5T__set_size(H5T_t *dt, size_t size) * Force conversions (i.e. memory to memory conversions * should duplicate data, not point to the same VL strings) */ - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; /* Before we mess with the info in the union, extract the * values we need */ @@ -4304,11 +4304,11 @@ H5T_get_size(const H5T_t *dt) * true if and only if the type keeps a pointer to a file VOL * object internally. * - * Return: TRUE/FALSE (never fails) + * Return: true/false (never fails) * *------------------------------------------------------------------------- */ -hbool_t +bool H5T_get_force_conv(const H5T_t *dt) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -4335,11 +4335,11 @@ H5T_get_force_conv(const H5T_t *dt) *------------------------------------------------------------------------- */ int -H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) +H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, bool superset) { unsigned *idx1 = NULL, *idx2 = NULL; size_t base_size; - hbool_t swapped; + bool swapped; unsigned u; int tmp; int ret_value = 0; @@ -4399,28 +4399,28 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if (dt1->shared->u.enumer.nmembs > 1) { int i; - for (i = (int)dt1->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for (i = (int)dt1->shared->u.compnd.nmembs - 1, swapped = true; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) + for (j = 0, swapped = false; j < i; j++) if (HDstrcmp(dt1->shared->u.compnd.memb[idx1[j]].name, dt1->shared->u.compnd.memb[idx1[j + 1]].name) > 0) { unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j + 1]; idx1[j + 1] = tmp_idx; - swapped = TRUE; + swapped = true; } } - for (i = (int)dt2->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for (i = (int)dt2->shared->u.compnd.nmembs - 1, swapped = true; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) + for (j = 0, swapped = false; j < i; j++) if (HDstrcmp(dt2->shared->u.compnd.memb[idx2[j]].name, dt2->shared->u.compnd.memb[idx2[j + 1]].name) > 0) { unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j + 1]; idx2[j + 1] = tmp_idx; - swapped = TRUE; + swapped = true; } } } /* end if */ @@ -4490,16 +4490,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) idx1[u] = u; if (dt1->shared->u.enumer.nmembs > 1) { int i; - for (i = (int)dt1->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for (i = (int)dt1->shared->u.enumer.nmembs - 1, swapped = true; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) + for (j = 0, swapped = false; j < i; j++) if (HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], dt1->shared->u.enumer.name[idx1[j + 1]]) > 0) { unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j + 1]; idx1[j + 1] = tmp_idx; - swapped = TRUE; + swapped = true; } } } @@ -4508,16 +4508,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if (dt2->shared->u.enumer.nmembs > 1) { int i; - for (i = (int)dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for (i = (int)dt2->shared->u.enumer.nmembs - 1, swapped = true; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) + for (j = 0, swapped = false; j < i; j++) if (HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], dt2->shared->u.enumer.name[idx2[j + 1]]) > 0) { unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j + 1]; idx2[j + 1] = tmp_idx; - swapped = TRUE; + swapped = true; } } } @@ -4823,7 +4823,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst) assert(dst->shared); /* Set up conversion function wrapper */ - conv_func.is_app = FALSE; + conv_func.is_app = false; conv_func.u.lib_func = NULL; /* Call the internal routine, with additional parameters */ @@ -4891,7 +4891,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path"); HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); - H5T_g.path[0]->conv.is_app = FALSE; + H5T_g.path[0]->conv.is_app = false; H5T_g.path[0]->conv.u.lib_func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; if (H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, @@ -4902,7 +4902,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co #endif H5E_clear_stack(NULL); /*ignore the error*/ } /* end if */ - H5T_g.path[0]->is_noop = TRUE; + H5T_g.path[0]->is_noop = true; H5T_g.npaths = 1; } /* end if */ @@ -4913,8 +4913,8 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co * Only allow the no-op conversion to occur if no "force conversion" flags * are set */ - if (src->shared->force_conv == FALSE && dst->shared->force_conv == FALSE && - 0 == H5T_cmp(src, dst, TRUE)) { + if (src->shared->force_conv == false && dst->shared->force_conv == false && + 0 == H5T_cmp(src, dst, true)) { table = H5T_g.path[0]; cmp = 0; md = 0; @@ -4927,9 +4927,9 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co while (cmp && lt < rt) { md = (lt + rt) / 2; assert(H5T_g.path[md]); - cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); + cmp = H5T_cmp(src, H5T_g.path[md]->src, false); if (0 == cmp) - cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); + cmp = H5T_cmp(dst, H5T_g.path[md]->dst, false); if (cmp < 0) rt = md; else if (cmp > 0) @@ -4977,10 +4977,10 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co (!table || (table && conv->is_app) || (table && !table->is_hard && !conv->is_app))) { assert(path != table); assert(NULL == path->conv.u.app_func); - if (path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + if (path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query"); - if (path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + if (path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query"); path->cdata.command = H5T_CONV_INIT; @@ -4998,7 +4998,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co H5I_dec_ref(dst_id); src_id = dst_id = -1; path->conv = *conv; - path->is_hard = TRUE; + path->is_hard = true; } /* end if */ /* @@ -5009,14 +5009,14 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co */ assert(path->conv.u.app_func || (src && dst)); for (i = H5T_g.nsoft - 1; i >= 0 && !path->conv.u.app_func; --i) { - hbool_t path_init_error = FALSE; + bool path_init_error = false; if (src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) continue; - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register src conversion type for query"); - if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query"); path->cdata.command = H5T_CONV_INIT; @@ -5025,14 +5025,14 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { memset(&(path->cdata), 0, sizeof(H5T_cdata_t)); H5E_clear_stack(NULL); /*ignore the error*/ - path_init_error = TRUE; + path_init_error = true; } /* end if */ } /* end if */ else if ((H5T_g.soft[i].conv.u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { memset(&(path->cdata), 0, sizeof(H5T_cdata_t)); H5E_clear_stack(NULL); /*ignore the error*/ - path_init_error = TRUE; + path_init_error = true; } /* end if */ /* Finish operation, if no error */ @@ -5040,7 +5040,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); path->name[H5T_NAMELEN - 1] = '\0'; path->conv = H5T_g.soft[i].conv; - path->is_hard = FALSE; + path->is_hard = false; } /* end else */ H5I_dec_ref(src_id); H5I_dec_ref(dst_id); @@ -5060,9 +5060,9 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co while (cmp && lt < rt) { md = (lt + rt) / 2; assert(H5T_g.path[md]); - cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); + cmp = H5T_cmp(src, H5T_g.path[md]->src, false); if (0 == cmp) - cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); + cmp = H5T_cmp(dst, H5T_g.path[md]->dst, false); if (cmp < 0) rt = md; else if (cmp > 0) @@ -5126,11 +5126,11 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co /* Set the flag to indicate both source and destination types are compound types * for the optimization of data reading (in H5Dio.c). - * Make sure that path->are_compounds is only TRUE for compound types. + * Make sure that path->are_compounds is only true for compound types. */ - path->are_compounds = FALSE; - if (H5T_COMPOUND == H5T_get_class(src, TRUE) && H5T_COMPOUND == H5T_get_class(dst, TRUE)) - path->are_compounds = TRUE; + path->are_compounds = false; + if (H5T_COMPOUND == H5T_get_class(src, true) && H5T_COMPOUND == H5T_get_class(dst, true)) + path->are_compounds = true; /* Set return value */ ret_value = path; @@ -5159,18 +5159,18 @@ done: * path in a multi-threaded application if one thread is using * the no-op path when some other thread changes its definition. * - * Return: TRUE/FALSE (can't fail) + * Return: true/false (can't fail) * *------------------------------------------------------------------------- */ -hbool_t +bool H5T_path_noop(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR assert(p); - FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0 == H5T_cmp(p->src, p->dst, FALSE))) + FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0 == H5T_cmp(p->src, p->dst, false))) } /* end H5T_path_noop() */ /*------------------------------------------------------------------------- @@ -5234,8 +5234,8 @@ H5T_path_bkg(const H5T_path_t *p) * library's conversion function from type SRC to type DST * is a hard conversion. * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. + * Return: true: hard conversion. + * false: soft conversion. * FAIL: function failed. * *------------------------------------------------------------------------- @@ -5395,23 +5395,23 @@ done: * * Purpose: Check if a datatype is immutable. * - * Return: TRUE + * Return: true * - * FALSE + * false * *------------------------------------------------------------------------- */ htri_t H5T_is_immutable(const H5T_t *dt) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_NOAPI_NOERR assert(dt); if (dt->shared->state == H5T_STATE_IMMUTABLE) - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } @@ -5421,21 +5421,21 @@ H5T_is_immutable(const H5T_t *dt) * * Purpose: Check if a datatype is named/committed. * - * Return: TRUE/FALSE/FAIL + * Return: true/false/FAIL * *------------------------------------------------------------------------- */ htri_t H5T_is_named(const H5T_t *dt) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_NOAPI_NOERR assert(dt); if (dt->vol_obj) - ret_value = TRUE; + ret_value = true; else ret_value = (H5T_STATE_OPEN == dt->shared->state || H5T_STATE_NAMED == dt->shared->state); @@ -5530,7 +5530,7 @@ H5T_get_ref_type(const H5T_t *dt) * Purpose: Determines if a data type is sensible to store on disk * (i.e. not partially initialized) * - * Return: Success: TRUE, FALSE + * Return: Success: true, false * * Failure: Negative * @@ -5549,17 +5549,17 @@ H5T_is_sensible(const H5T_t *dt) case H5T_COMPOUND: /* Only allow compound datatypes with at least one member to be stored on disk */ if (dt->shared->u.compnd.nmembs > 0) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; break; case H5T_ENUM: /* Only allow enum datatypes with at least one member to be stored on disk */ if (dt->shared->u.enumer.nmembs > 0) - ret_value = TRUE; + ret_value = true; else - ret_value = FALSE; + ret_value = false; break; case H5T_NO_CLASS: @@ -5575,7 +5575,7 @@ H5T_is_sensible(const H5T_t *dt) case H5T_NCLASSES: default: /* Assume all other datatype are sensible to store on disk */ - ret_value = TRUE; + ret_value = true; break; } /* end switch */ @@ -5595,8 +5595,8 @@ H5T_is_sensible(const H5T_t *dt) RETURNS One of two values on success: - TRUE - If the location of any vlen types changed - FALSE - If the location of any vlen types is the same + true - If the location of any vlen types changed + false - If the location of any vlen types is the same <0 is returned on failure DESCRIPTION Recursively descends any VL or compound datatypes to mark all VL datatypes @@ -5757,8 +5757,8 @@ done: * * Return: * One of two values on success: - * TRUE - If the location of any vlen types changed - * FALSE - If the location of any vlen types is the same + * true - If the location of any vlen types changed + * false - If the location of any vlen types is the same * <0 is returned on failure * *------------------------------------------------------------------------- @@ -5766,7 +5766,7 @@ done: htri_t H5T_is_relocatable(const H5T_t *dt) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_NOAPI_NOERR @@ -5774,8 +5774,8 @@ H5T_is_relocatable(const H5T_t *dt) assert(dt); /* VL and reference datatypes are relocatable */ - if (H5T_detect_class(dt, H5T_VLEN, FALSE) || H5T_detect_class(dt, H5T_REFERENCE, FALSE)) - ret_value = TRUE; + if (H5T_detect_class(dt, H5T_VLEN, false) || H5T_detect_class(dt, H5T_REFERENCE, false)) + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_is_relocatable() */ @@ -5786,16 +5786,16 @@ H5T_is_relocatable(const H5T_t *dt) * Purpose: Check whether a datatype contains (or is) a vlen reference * datatype. * - * Return: TRUE (1) or FALSE (0) on success + * Return: true (1) or false (0) on success * (Can't fail) * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5T__detect_vlen_ref(const H5T_t *dt) { unsigned u; /* Local index variable */ - hbool_t ret_value = FALSE; /* Return value */ + bool ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -5805,7 +5805,7 @@ H5T__detect_vlen_ref(const H5T_t *dt) /* Check if this datatype is a vlen reference */ /* TODO currently H5T_STD_REF is always considered as a vlen type */ if (H5T_REFERENCE == dt->shared->type && !dt->shared->u.atomic.u.r.opaque) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); /* Check for types that might have the correct type as a component */ switch (dt->shared->type) { @@ -5814,7 +5814,7 @@ H5T__detect_vlen_ref(const H5T_t *dt) for (u = 0; u < dt->shared->u.compnd.nmembs; u++) /* Recurse on field's datatype */ if (H5T__detect_vlen_ref(dt->shared->u.compnd.memb[u].type)) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); break; case H5T_ARRAY: @@ -5850,8 +5850,8 @@ done: * * Return: * One of two values on success: - * TRUE - If the datatype will be stored in a variable-length form - * FALSE - If the datatype will NOT be stored in a variable-length form + * true - If the datatype will be stored in a variable-length form + * false - If the datatype will NOT be stored in a variable-length form * <0 is returned on failure * *------------------------------------------------------------------------- @@ -5859,7 +5859,7 @@ done: htri_t H5T_is_vl_storage(const H5T_t *dt) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_NOAPI_NOERR @@ -5867,12 +5867,12 @@ H5T_is_vl_storage(const H5T_t *dt) assert(dt); /* VL and region reference datatypes are stored in variable-length form */ - if (H5T_detect_class(dt, H5T_VLEN, FALSE)) - ret_value = TRUE; - else if (H5T_detect_class(dt, H5T_REFERENCE, FALSE)) + if (H5T_detect_class(dt, H5T_VLEN, false)) + ret_value = true; + else if (H5T_detect_class(dt, H5T_REFERENCE, false)) ret_value = H5T__detect_vlen_ref(dt); else - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_is_vl_storage() */ diff --git a/src/H5TS.c b/src/H5TS.c index 52cb1ce..8aadd90 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -792,7 +792,7 @@ H5TS_cancel_count_dec(void) H5_DLL BOOL CALLBACK H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) { - BOOL ret_value = TRUE; + BOOL ret_value = true; FUNC_ENTER_NOAPI_NAMECHECK_ONLY @@ -801,15 +801,15 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) /* Set up thread local storage */ if (TLS_OUT_OF_INDEXES == (H5TS_errstk_key_g = TlsAlloc())) - ret_value = FALSE; + ret_value = false; #ifdef H5_HAVE_CODESTACK if (TLS_OUT_OF_INDEXES == (H5TS_funcstk_key_g = TlsAlloc())) - ret_value = FALSE; + ret_value = false; #endif /* H5_HAVE_CODESTACK */ if (TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc())) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_process_enter() */ diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 2c3d7c1..423baf9 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -104,7 +104,7 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype"); /* Register the type */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype"); done: @@ -163,8 +163,8 @@ H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) ret_value->shared->size = ret_value->shared->parent->shared->size * ret_value->shared->u.array.nelem; /* Set the "force conversion" flag if the base datatype indicates */ - if (base->shared->force_conv == TRUE) - ret_value->shared->force_conv = TRUE; + if (base->shared->force_conv == true) + ret_value->shared->force_conv = true; /* Array datatypes need a later version of the datatype object header message */ ret_value->shared->version = MAX(base->shared->version, H5O_DTYPE_VERSION_2); @@ -336,7 +336,7 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype"); /* Register the type */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype"); done: diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 29d5347..dd852a6 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -324,7 +324,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) *------------------------------------------------------------------------- */ void -H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) +H5T__bit_set(uint8_t *buf, size_t offset, size_t size, bool value) { int idx; @@ -383,7 +383,7 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) *------------------------------------------------------------------------- */ ssize_t -H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) +H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, bool value) { ssize_t base = (ssize_t)offset; ssize_t idx, i; @@ -393,8 +393,8 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR - /* Some functions call this with value=TRUE */ - assert(TRUE == 1); + /* Some functions call this with value=true */ + assert(true == 1); switch (direction) { case H5T_BIT_LSB: @@ -405,7 +405,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi /* Beginning */ if (offset) { for (iu = offset; iu < 8 && size > 0; iu++, size--) - if (value == (hbool_t)((buf[idx] >> iu) & 0x01)) + if (value == (bool)((buf[idx] >> iu) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)iu - base); offset = 0; @@ -416,7 +416,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi while (size >= 8) { if ((value ? 0x00 : 0xff) != buf[idx]) for (i = 0; i < 8; i++) - if (value == (hbool_t)((buf[idx] >> i) & 0x01)) + if (value == (bool)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); size -= 8; @@ -425,7 +425,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi /* End */ for (i = 0; i < (ssize_t)size; i++) - if (value == (hbool_t)((buf[idx] >> i) & 0x01)) + if (value == (bool)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); break; @@ -437,7 +437,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi /* Beginning */ if (size > 8 - offset && (offset + size) % 8) { for (iu = (offset + size) % 8; iu > 0; --iu, --size) - if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (value == (bool)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); --idx; @@ -447,7 +447,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi while (size >= 8) { if ((value ? 0x00 : 0xff) != buf[idx]) { for (i = 7; i >= 0; --i) - if (value == (hbool_t)((buf[idx] >> i) & 0x01)) + if (value == (bool)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); } /* end if */ @@ -458,7 +458,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi /* End */ if (size > 0) { for (iu = offset + size; iu > offset; --iu) - if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (value == (bool)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); } break; @@ -477,11 +477,11 @@ done: * Purpose: Increment part of a bit field by adding 1. The bit field * starts with bit position START and is SIZE bits long. * - * Return: The carry-out value. TRUE if overflows, FALSE otherwise. + * Return: The carry-out value. true if overflows, false otherwise. * *------------------------------------------------------------------------- */ -hbool_t +bool H5T__bit_inc(uint8_t *buf, size_t start, size_t size) { size_t idx = start / 8; @@ -531,7 +531,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) buf[idx] |= (uint8_t)(acc & mask); } - FUNC_LEAVE_NOAPI(carry ? TRUE : FALSE) + FUNC_LEAVE_NOAPI(carry ? true : false) } /* end H5T__bit_inc() */ /*------------------------------------------------------------------------- @@ -540,12 +540,12 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) * Purpose: Decrement part of a bit field by subtracting 1. The bit * field starts with bit position START and is SIZE bits long. * - * Return: The "borrow-in" value. It's TRUE if underflows, FALSE + * Return: The "borrow-in" value. It's true if underflows, false * otherwise. * *------------------------------------------------------------------------- */ -hbool_t +bool H5T__bit_dec(uint8_t *buf, size_t start, size_t size) { size_t idx = start / 8; @@ -608,7 +608,7 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size) } } - FUNC_LEAVE_NOAPI(borrow ? TRUE : FALSE) + FUNC_LEAVE_NOAPI(borrow ? true : false) } /* end H5T__bit_dec() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 2973f5e..4f43a79 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -120,20 +120,20 @@ H5T__commit_api_common(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl /* Get correct property list */ if (H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) + else if (true != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list"); /* Get correct property list */ if (H5P_DEFAULT == tcpl_id) tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) + else if (true != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list"); /* Set the LCPL for the API context */ H5CX_set_lcpl(lcpl_id); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, TRUE, &tapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, true, &tapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set object access arguments"); /* Commit the type */ @@ -336,16 +336,16 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) /* Get correct property list */ if (H5P_DEFAULT == tcpl_id) tcpl_id = H5P_DATATYPE_CREATE_DEFAULT; - else if (TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) + else if (true != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list"); if (H5P_DEFAULT == tapl_id) tapl_id = H5P_DATATYPE_ACCESS_DEFAULT; - else if (TRUE != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS)) + else if (true != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list"); /* Verify access property list and set up collective metadata if appropriate */ - if (H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + if (H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, true) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info"); /* Fill in location struct fields */ @@ -427,7 +427,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) { H5O_loc_t temp_oloc; /* Temporary object header location */ H5G_name_t temp_path; /* Temporary path */ - hbool_t loc_init = FALSE; /* Have temp_oloc and temp_path been initialized? */ + bool loc_init = false; /* Have temp_oloc and temp_path been initialized? */ size_t dtype_size; /* Size of the datatype message */ herr_t ret_value = SUCCEED; /* Return value */ @@ -466,7 +466,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location"); if (H5G_name_reset(&temp_path) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path"); - loc_init = TRUE; + loc_init = true; /* Set the version for datatype */ if (H5T_set_version(file, type) < 0) @@ -491,7 +491,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location"); if (H5G_name_copy(&(type->path), &temp_path, H5_COPY_SHALLOW) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location"); - loc_init = FALSE; + loc_init = false; /* Set the shared info fields */ H5T_update_shared(type); @@ -501,7 +501,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) /* Add datatype to the list of open objects in the file */ if (H5FO_top_incr(type->sh_loc.file, type->sh_loc.u.loc.oh_addr) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't incr object ref. count"); - if (H5FO_insert(type->sh_loc.file, type->sh_loc.u.loc.oh_addr, type->shared, TRUE) < 0) + if (H5FO_insert(type->sh_loc.file, type->sh_loc.u.loc.oh_addr, type->shared, true) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert datatype into list of open objects"); /* Mark datatype as being on memory again. Since this datatype may still be @@ -537,7 +537,7 @@ done: * * Purpose: Determines if a datatype is committed or not. * - * Return: TRUE/FALSE/Negative + * Return: true/false/Negative * *------------------------------------------------------------------------- */ @@ -621,7 +621,7 @@ H5T__open_api_common(hid_t loc_id, const char *name, hid_t tapl_id, void **token HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string"); /* Set up object access arguments */ - if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, FALSE, &tapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, false, &tapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments"); /* Open the datatype */ @@ -630,7 +630,7 @@ H5T__open_api_common(hid_t loc_id, const char *name, hid_t tapl_id, void **token HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype"); /* Register the type and return the ID */ - if ((ret_value = H5VL_register(H5I_DATATYPE, dt, (*vol_obj_ptr)->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATATYPE, dt, (*vol_obj_ptr)->connector, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype"); done: @@ -755,13 +755,13 @@ H5Tget_create_plist(hid_t dtype_id) /* If the datatype is not committed/named, just copy the default * creation property list and return that. */ - if (FALSE == is_named) { + if (false == is_named) { H5P_genplist_t *tcpl_plist = NULL; /* Copy the default datatype creation property list */ if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list"); - if ((ret_value = H5P_copy_plist(tcpl_plist, TRUE)) < 0) + if ((ret_value = H5P_copy_plist(tcpl_plist, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list"); } /* end if */ @@ -906,7 +906,7 @@ H5T__get_create_plist(const H5T_t *type) /* Copy the default datatype creation property list */ if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list"); - if ((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) + if ((new_tcpl_id = H5P_copy_plist(tcpl_plist, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list"); /* Get property list object for new TCPL */ @@ -947,7 +947,7 @@ H5T__open_name(const H5G_loc_t *loc, const char *name) H5O_loc_t oloc; /* Datatype object location */ H5G_loc_t type_loc; /* Group object for datatype */ H5O_type_t obj_type; /* Type of object at location */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ + bool obj_found = false; /* Object at 'name' found */ H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -967,7 +967,7 @@ H5T__open_name(const H5G_loc_t *loc, const char *name) */ if (H5G_loc_find(loc, name, &type_loc /*out*/) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found"); - obj_found = TRUE; + obj_found = true; /* Check that the object found is the correct type */ if (H5O_obj_type(&oloc, &obj_type) < 0) @@ -1023,7 +1023,7 @@ H5T_open(const H5G_loc_t *loc) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found"); /* Add the datatype to the list of opened objects in the file */ - if (H5FO_insert(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr, dt->shared, FALSE) < 0) + if (H5FO_insert(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr, dt->shared, false) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL, "can't insert datatype into list of open objects"); @@ -1378,11 +1378,11 @@ done: * * Purpose: Check if the committed datatype is already VOL managed * - * Return: TRUE / FALSE + * Return: true / false * *------------------------------------------------------------------------- */ -hbool_t +bool H5T_already_vol_managed(const H5T_t *dt) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 725525b..a6a27de 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -159,7 +159,7 @@ H5Tget_member_class(hid_t type_id, unsigned membno) /* Get the type's class. We have to use this function to get type class * because of the concern of variable-length string. */ - ret_value = H5T_GET_CLASS(dt->shared->u.compnd.memb[membno].type->shared, FALSE); + ret_value = H5T_GET_CLASS(dt->shared->u.compnd.memb[membno].type->shared, false); done: FUNC_LEAVE_API(ret_value) @@ -201,7 +201,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type"); /* Get an ID for the datatype */ - if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype ID"); done: @@ -369,7 +369,7 @@ H5Tpack(hid_t type_id) /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)) || - H5T_detect_class(dt, H5T_COMPOUND, TRUE) <= 0) + H5T_detect_class(dt, H5T_COMPOUND, true) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound datatype"); /* Pack */ @@ -458,8 +458,8 @@ H5T__insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) H5T__update_packed(parent); /* Set the "force conversion" flag if the field's datatype indicates */ - if (member->shared->force_conv == TRUE) - parent->shared->force_conv = TRUE; + if (member->shared->force_conv == true) + parent->shared->force_conv = true; /* Check for member having a later version than the parent */ if (parent->shared->version < member->shared->version) @@ -493,9 +493,9 @@ H5T__pack(const H5T_t *dt) assert(dt); - if (H5T_detect_class(dt, H5T_COMPOUND, FALSE) > 0) { + if (H5T_detect_class(dt, H5T_COMPOUND, false) > 0) { /* If datatype has been packed, skip packing it and indicate success */ - if (TRUE == H5T__is_packed(dt)) + if (true == H5T__is_packed(dt)) HGOTO_DONE(SUCCEED); /* Check for packing unmodifiable datatype */ @@ -538,7 +538,7 @@ H5T__pack(const H5T_t *dt) dt->shared->size = MAX(1, offset); /* Mark the type as packed now */ - dt->shared->u.compnd.packed = TRUE; + dt->shared->u.compnd.packed = true; } /* end if */ } /* end if */ @@ -559,7 +559,7 @@ done: static htri_t H5T__is_packed(const H5T_t *dt) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -600,18 +600,18 @@ H5T__update_packed(const H5T_t *dt) /* First check if all space is used in the "top level" type */ if (dt->shared->size == dt->shared->u.compnd.memb_size) { - /* Set the packed flag to TRUE */ - dt->shared->u.compnd.packed = TRUE; + /* Set the packed flag to true */ + dt->shared->u.compnd.packed = true; /* Now check if all members are packed */ for (i = 0; i < dt->shared->u.compnd.nmembs; i++) if (!H5T__is_packed(dt->shared->u.compnd.memb[i].type)) { - dt->shared->u.compnd.packed = FALSE; + dt->shared->u.compnd.packed = false; break; } /* end if */ } /* end if */ else - dt->shared->u.compnd.packed = FALSE; + dt->shared->u.compnd.packed = false; FUNC_LEAVE_NOAPI_VOID } /* end H5T__update_packed() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index daa282c..016c3f4 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -718,7 +718,7 @@ H5T_t *st, *dt; /*datatype descriptors */ \ ST src_aligned; /*source aligned type */ \ DT dst_aligned; /*destination aligned type */ \ - hbool_t s_mv, d_mv; /*move data to align it? */ \ + bool s_mv, d_mv; /*move data to align it? */ \ ssize_t s_stride, d_stride; /*src and dst strides */ \ size_t safe; /*how many elements are safe to process in each pass */ \ H5T_conv_cb_t cb_struct; /*conversion callback structure */ \ @@ -1681,7 +1681,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz uint8_t *src_rev = NULL; /*order-reversed source buffer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ - hbool_t reverse; /*if reverse the order of destination */ + bool reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1784,7 +1784,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Initiate these variables */ except_ret = H5T_CONV_UNHANDLED; - reverse = TRUE; + reverse = true; /* * Copy the significant part of the value. If the source is larger @@ -1808,13 +1808,13 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it*/ - reverse = FALSE; + reverse = false; } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec, - dst->shared->u.atomic.prec - src->shared->u.atomic.prec, FALSE); + dst->shared->u.atomic.prec - src->shared->u.atomic.prec, false); } /* @@ -1822,11 +1822,11 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ switch (dst->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: - H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, FALSE); + H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, false); break; case H5T_PAD_ONE: - H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); + H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, true); break; case H5T_PAD_ERROR: @@ -1838,11 +1838,11 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz msb_pad_offset = dst->shared->u.atomic.offset + dst->shared->u.atomic.prec; switch (dst->shared->u.atomic.msb_pad) { case H5T_PAD_ZERO: - H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, FALSE); + H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, false); break; case H5T_PAD_ONE: - H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); + H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, true); break; case H5T_PAD_ERROR: @@ -2006,7 +2006,7 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) priv->src_nmembs = src_nmembs; /* The flag of special optimization to indicate if source members and destination - * members are a subset of each other. Initialize it to FALSE */ + * members are a subset of each other. Initialize it to false */ priv->subset_info.subset = H5T_SUBSET_FALSE; priv->subset_info.copy_size = 0; @@ -2036,12 +2036,12 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) H5T_t *type; type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL); - tid = H5I_register(H5I_DATATYPE, type, FALSE); + tid = H5I_register(H5I_DATATYPE, type, false); assert(tid >= 0); priv->src_memb_id[i] = tid; type = H5T_copy(dst->shared->u.compnd.memb[src2dst[i]].type, H5T_COPY_ALL); - tid = H5I_register(H5I_DATATYPE, type, FALSE); + tid = H5I_register(H5I_DATATYPE, type, false); assert(tid >= 0); priv->dst_memb_id[src2dst[i]] = tid; } /* end if */ @@ -2088,7 +2088,7 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) */ if (src2dst[i] != (int)i || (src->shared->u.compnd.memb[i].offset != dst->shared->u.compnd.memb[i].offset) || - (priv->memb_path[i])->is_noop == FALSE) { + (priv->memb_path[i])->is_noop == false) { priv->subset_info.subset = H5T_SUBSET_FALSE; break; } /* end if */ @@ -2108,7 +2108,7 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * there's conversion between members, don't do the optimization. */ if (src2dst[i] != (int)i || (src->shared->u.compnd.memb[i].offset != dst->shared->u.compnd.memb[i].offset) || - (priv->memb_path[i])->is_noop == FALSE) { + (priv->memb_path[i])->is_noop == false) { priv->subset_info.subset = H5T_SUBSET_FALSE; break; } @@ -2126,7 +2126,7 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { } - cdata->recalc = FALSE; + cdata->recalc = false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -2432,7 +2432,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm size_t elmtno; /*element counter */ size_t copy_size; /*size of element for copying */ H5T_conv_struct_t *priv = NULL; /*private data */ - hbool_t no_stride = FALSE; /*flag to indicate no stride */ + bool no_stride = false; /*flag to indicate no stride */ unsigned u; /*counters */ int i; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2538,7 +2538,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm if (!buf_stride || !bkg_stride) bkg_stride = dst->shared->size; if (!buf_stride) { - no_stride = TRUE; + no_stride = true; buf_stride = src->shared->size; } /* end if */ @@ -3034,7 +3034,7 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne "unable to convert between src and dest datatype"); } else if (!H5T_path_noop(tpath)) { - if ((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < + if ((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); @@ -3085,8 +3085,8 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si { H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ H5T_path_t *tpath = NULL; /* Type conversion path */ - hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ - hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ + bool noop_conv = false; /* Flag to indicate a noop conversion */ + bool write_to_file = false; /* Flag to indicate writing to file */ htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatype */ size_t bg_seq_len = 0; /* The number of elements in the background sequence */ hid_t tsrc_id = -1, tdst_id = -1; /*temporary type atoms */ @@ -3103,7 +3103,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si size_t conv_buf_size = 0; /*size of conversion buffer in bytes */ void *tmp_buf = NULL; /*temporary background buffer */ size_t tmp_buf_size = 0; /*size of temporary bkg buffer */ - hbool_t nested = FALSE; /*flag of nested VL case */ + bool nested = false; /*flag of nested VL case */ size_t elmtno; /*element number counter */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3195,16 +3195,16 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si if (H5T_set_loc(tdst_cpy, dst->shared->u.vlen.file, dst->shared->u.vlen.loc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set datatype location"); - if (((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, FALSE)) < 0) || - ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, FALSE)) < 0)) + if (((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, false)) < 0) || + ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, false)) < 0)) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } /* end else-if */ else - noop_conv = TRUE; + noop_conv = true; /* Check if we need a temporary buffer for this conversion */ - if ((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0) + if ((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class"); if (tpath->cdata.need_bkg || parent_is_vlen) { @@ -3221,11 +3221,11 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si /* Set flags to indicate we are writing to or reading from the file */ if (dst->shared->u.vlen.file != NULL) - write_to_file = TRUE; + write_to_file = true; /* Set the flag for nested VL case */ if (write_to_file && parent_is_vlen && bkg != NULL) - nested = TRUE; + nested = true; /* The outer loop of the type conversion macro, controlling which */ /* direction the buffer is walked */ @@ -3271,7 +3271,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si } /* end else */ for (elmtno = 0; elmtno < safe; elmtno++) { - hbool_t is_nil; /* Whether sequence is "nil" */ + bool is_nil; /* Whether sequence is "nil" */ /* Check for "nil" source sequence */ if ((*(src->shared->u.vlen.cls->isnull))(src->shared->u.vlen.file, s, &is_nil) < 0) @@ -3540,9 +3540,9 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s } else if (!H5T_path_noop(tpath)) { if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), - FALSE)) < 0 || + false)) < 0 || (tdst_id = - H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), FALSE)) < 0) + H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), false)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } @@ -3722,9 +3722,9 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } /* end else */ for (elmtno = 0; elmtno < safe; elmtno++) { - size_t buf_size; - hbool_t dst_copy = FALSE; - hbool_t is_nil; /* Whether reference is "nil" */ + size_t buf_size; + bool dst_copy = false; + bool is_nil; /* Whether reference is "nil" */ /* Check for "nil" source reference */ if ((*(src->shared->u.atomic.u.r.cls->isnull))(src->shared->u.atomic.u.r.file, s, @@ -3833,7 +3833,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t i; /*Local index variables */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ - hbool_t reverse; /*if reverse the order of destination */ + bool reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3948,19 +3948,19 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * bit number is relative to the significant part of the number. */ sfirst = H5T__bit_find(s, src->shared->u.atomic.offset, src->shared->u.atomic.prec, - H5T_BIT_MSB, TRUE); + H5T_BIT_MSB, true); first = (size_t)sfirst; /* Set these variables to default */ except_ret = H5T_CONV_UNHANDLED; - reverse = TRUE; + reverse = true; if (sfirst < 0) { /* * The source has no bits set and must therefore be zero. * Set the destination to zero. */ - H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, false); } else if (H5T_SGN_NONE == src->shared->u.atomic.u.i.sign && H5T_SGN_NONE == dst->shared->u.atomic.u.i.sign) { @@ -3974,7 +3974,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec, - dst->shared->u.atomic.prec - src->shared->u.atomic.prec, FALSE); + dst->shared->u.atomic.prec - src->shared->u.atomic.prec, false); } else if (first >= dst->shared->u.atomic.prec) { /*overflow*/ @@ -3986,14 +3986,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) { - H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, true); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, @@ -4019,20 +4019,20 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) { - H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, false); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else if (src->shared->u.atomic.prec < dst->shared->u.atomic.prec) { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec - 1); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec - 1, - (dst->shared->u.atomic.prec - src->shared->u.atomic.prec) + 1, FALSE); + (dst->shared->u.atomic.prec - src->shared->u.atomic.prec) + 1, false); } else if (first >= dst->shared->u.atomic.prec) { /*overflow - source is positive*/ @@ -4044,13 +4044,13 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) - H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, true); else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, @@ -4075,22 +4075,22 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec - 1, - TRUE); + true); H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec - 1), - (size_t)1, FALSE); + (size_t)1, false); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else if (src->shared->u.atomic.prec < dst->shared->u.atomic.prec) { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec, - dst->shared->u.atomic.prec - src->shared->u.atomic.prec, FALSE); + dst->shared->u.atomic.prec - src->shared->u.atomic.prec, false); } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, @@ -4106,7 +4106,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * possible magnitude. */ ssize_t sfz = H5T__bit_find(s, src->shared->u.atomic.offset, - src->shared->u.atomic.prec - 1, H5T_BIT_MSB, FALSE); + src->shared->u.atomic.prec - 1, H5T_BIT_MSB, false); size_t fz = (size_t)sfz; if (sfz >= 0 && fz + 1 >= dst->shared->u.atomic.prec) { @@ -4120,22 +4120,22 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec - 1, - FALSE); + false); H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec - 1), - (size_t)1, TRUE); + (size_t)1, true); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else if (src->shared->u.atomic.prec < dst->shared->u.atomic.prec) { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec, - dst->shared->u.atomic.prec - src->shared->u.atomic.prec, TRUE); + dst->shared->u.atomic.prec - src->shared->u.atomic.prec, true); } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, @@ -4160,22 +4160,22 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec - 1, - TRUE); + true); H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec - 1), - (size_t)1, FALSE); + (size_t)1, false); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ - reverse = FALSE; + reverse = false; } else if (src->shared->u.atomic.prec < dst->shared->u.atomic.prec) { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); H5T__bit_set(d, dst->shared->u.atomic.offset + src->shared->u.atomic.prec, - dst->shared->u.atomic.prec - src->shared->u.atomic.prec, FALSE); + dst->shared->u.atomic.prec - src->shared->u.atomic.prec, false); } else { H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, @@ -4190,7 +4190,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz assert(H5T_PAD_ZERO == dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad); H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, - (hbool_t)(H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad)); + (bool)(H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec != 8 * dst->shared->size) { assert(H5T_PAD_ZERO == dst->shared->u.atomic.msb_pad || @@ -4198,7 +4198,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz H5T__bit_set(d, dst->shared->u.atomic.offset + dst->shared->u.atomic.prec, 8 * dst->shared->size - (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec), - (hbool_t)(H5T_PAD_ONE == dst->shared->u.atomic.msb_pad)); + (bool)(H5T_PAD_ONE == dst->shared->u.atomic.msb_pad)); } /* @@ -4277,13 +4277,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t mpos; /*offset to useful mant is src */ uint64_t sign; /*source sign bit value */ size_t mrsh; /*amount to right shift mantissa*/ - hbool_t carry = FALSE; /*carry after rounding mantissa */ + bool carry = false; /*carry after rounding mantissa */ size_t i; /*miscellaneous counters */ size_t implied; /*destination implied bits */ - hbool_t denormalized = FALSE; /*is either source or destination denormalized?*/ + bool denormalized = false; /*is either source or destination denormalized?*/ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ - hbool_t reverse; /*if reverse the order of destination */ + bool reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_PACKAGE @@ -4364,7 +4364,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz for (elmtno = 0; elmtno < nelmts; elmtno++) { /* Set these variables to default */ except_ret = H5T_CONV_UNHANDLED; - reverse = TRUE; + reverse = true; /* * If the source and destination buffers overlap then use a @@ -4427,15 +4427,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* * Check for special cases: +0, -0, +Inf, -Inf, NaN */ - if (H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, TRUE) < 0) { - if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, TRUE) < 0) { + if (H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, true) < 0) { + if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, true) < 0) { /* +0 or -0 */ H5T__bit_copy(d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, FALSE); - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, false); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); goto padding; } - else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* +Inf or -Inf */ if (cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -4451,17 +4451,17 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { H5T__bit_copy(d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, true); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is *this case.*/ if (H5T_NORM_NONE == dst.u.f.norm) - H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - 1, (size_t)1, TRUE); + H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - 1, (size_t)1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -4472,8 +4472,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } } else if (H5T_NORM_NONE == src.u.f.norm && - H5T__bit_find(s, src.u.f.mpos, src.u.f.msize - 1, H5T_BIT_LSB, TRUE) < 0 && - H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + H5T__bit_find(s, src.u.f.mpos, src.u.f.msize - 1, H5T_BIT_LSB, true) < 0 && + H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ @@ -4491,17 +4491,17 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { H5T__bit_copy(d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, true); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is *this case.*/ if (H5T_NORM_NONE == dst.u.f.norm) - H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - 1, (size_t)1, TRUE); + H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - 1, (size_t)1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -4514,7 +4514,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * remain in place. */ } - else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* NaN */ if (cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -4527,12 +4527,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* There are many NaN values, so we just set all bits of * the significand. */ H5T__bit_copy(d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, TRUE); + H5T__bit_set(d, dst.u.f.epos, dst.u.f.esize, true); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -4549,7 +4549,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if (expo == 0) - denormalized = TRUE; + denormalized = true; /* * Set markers for the source mantissa, excluding the leading `1' @@ -4559,12 +4559,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz mpos = src.u.f.mpos; mrsh = 0; if (0 == expo || H5T_NORM_NONE == src.u.f.norm) { - if ((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + if ((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, true)) > 0) { msize = (size_t)bitno; } else if (0 == bitno) { msize = 1; - H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); + H5T__bit_set(s, src.u.f.mpos, (size_t)1, false); } } else if (H5T_NORM_IMPLIED == src.u.f.norm) { @@ -4614,7 +4614,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ expo = 0; - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); msize = 0; } else if (expo <= 0) { @@ -4626,7 +4626,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ mrsh += (size_t)(1 - expo); expo = 0; - denormalized = TRUE; + denormalized = true; } else if (expo >= expo_max) { /* @@ -4646,13 +4646,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); msize = 0; } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { - reverse = FALSE; + reverse = false; goto next; } } @@ -4672,7 +4672,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. * To do rounding and increment exponent in this case will create an infinity value.*/ if ((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, - FALSE) >= 0 || + false) >= 0 || expo < expo_max - 1)) { carry = H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); if (carry) @@ -4684,25 +4684,25 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } else - carry = FALSE; + carry = false; /* * Write the mantissa to the destination */ if (mrsh > dst.u.f.msize + 1) { - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); } else if (mrsh == dst.u.f.msize + 1) { - H5T__bit_set(d, dst.u.f.mpos + 1, dst.u.f.msize - 1, FALSE); - H5T__bit_set(d, dst.u.f.mpos, (size_t)1, TRUE); + H5T__bit_set(d, dst.u.f.mpos + 1, dst.u.f.msize - 1, false); + H5T__bit_set(d, dst.u.f.mpos, (size_t)1, true); } else if (mrsh == dst.u.f.msize) { - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); H5T__bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied); } else { if (mrsh > 0) { - H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - mrsh, mrsh, FALSE); + H5T__bit_set(d, dst.u.f.mpos + dst.u.f.msize - mrsh, mrsh, false); H5T__bit_set_d(d, dst.u.f.mpos + dst.u.f.msize - mrsh, (size_t)2, (hsize_t)implied); } if (mrsh + msize >= dst.u.f.msize) { @@ -4711,7 +4711,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else { H5T__bit_copy(d, dst.u.f.mpos + dst.u.f.msize - (mrsh + msize), s, mpos, msize); - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize - (mrsh + msize), FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize - (mrsh + msize), false); } } @@ -4737,19 +4737,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; - H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, false); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { - reverse = FALSE; + reverse = false; goto next; } } } /*reset CARRY*/ - carry = FALSE; + carry = false; H5_CHECK_OVERFLOW(expo, hssize_t, hsize_t); H5T__bit_set_d(d, dst.u.f.epos, dst.u.f.esize, (hsize_t)expo); @@ -4761,12 +4761,12 @@ padding: */ if (dst.offset > 0) { assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); - H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst.offset, (bool)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), - (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); + (bool)(H5T_PAD_ONE == dst.msb_pad)); } /* @@ -7913,8 +7913,8 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t first; /*first bit(MSB) in an integer */ ssize_t sfirst; /*a signed version of `first' */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - hbool_t truncated; /*if fraction value is dropped */ - hbool_t reverse; /*if reverse order of destination at the end */ + bool truncated; /*if fraction value is dropped */ + bool reverse; /*if reverse order of destination at the end */ H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value = SUCCEED; /* Return value */ @@ -7990,8 +7990,8 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz for (elmtno = 0; elmtno < nelmts; elmtno++) { /* Set these variables to default */ except_ret = H5T_CONV_UNHANDLED; - truncated = FALSE; - reverse = TRUE; + truncated = false; + reverse = true; /* * If the source and destination buffers overlap then use a @@ -8046,7 +8046,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } /*zero-set all destination bits*/ - H5T__bit_set(d, dst.offset, dst.prec, FALSE); + H5T__bit_set(d, dst.offset, dst.prec, false); /* * Find the sign bit value of the source. @@ -8056,13 +8056,13 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* * Check for special cases: +0, -0, +Inf, -Inf, NaN */ - if (H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, TRUE) < 0) { - if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, TRUE) < 0) { + if (H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, true) < 0) { + if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, true) < 0) { /* +0 or -0 */ /* Set all bits to zero */ goto padding; } - else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* +Infinity or -Infinity */ if (sign) { /* -Infinity */ if (cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -8075,11 +8075,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_2 == dst.u.i.sign) - H5T__bit_set(d, dst.prec - 1, (size_t)1, TRUE); + H5T__bit_set(d, dst.prec - 1, (size_t)1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8097,13 +8097,13 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_NONE == dst.u.i.sign) - H5T__bit_set(d, dst.offset, dst.prec, TRUE); + H5T__bit_set(d, dst.offset, dst.prec, true); else if (H5T_SGN_2 == dst.u.i.sign) - H5T__bit_set(d, dst.offset, dst.prec - 1, TRUE); + H5T__bit_set(d, dst.offset, dst.prec - 1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8114,8 +8114,8 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } } else if (H5T_NORM_NONE == src.u.f.norm && - H5T__bit_find(s, src.u.f.mpos, src.u.f.msize - 1, H5T_BIT_LSB, TRUE) < 0 && - H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + H5T__bit_find(s, src.u.f.mpos, src.u.f.msize - 1, H5T_BIT_LSB, true) < 0 && + H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ @@ -8131,11 +8131,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_2 == dst.u.i.sign) - H5T__bit_set(d, dst.prec - 1, (size_t)1, TRUE); + H5T__bit_set(d, dst.prec - 1, (size_t)1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8153,13 +8153,13 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_NONE == dst.u.i.sign) - H5T__bit_set(d, dst.offset, dst.prec, TRUE); + H5T__bit_set(d, dst.offset, dst.prec, true); else if (H5T_SGN_2 == dst.u.i.sign) - H5T__bit_set(d, dst.offset, dst.prec - 1, TRUE); + H5T__bit_set(d, dst.offset, dst.prec - 1, true); } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8168,7 +8168,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } goto padding; } - else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE) < 0) { + else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* NaN */ if (cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -8183,7 +8183,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8246,14 +8246,14 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * during conversion. Set exception type to be "truncate" */ if ((size_t)expo < src.u.f.msize && cb_struct.func) - truncated = TRUE; + truncated = true; /* * What is the bit position for the most significant bit(MSB) of S * which is set? This is checked before converted to negative * integer. */ - sfirst = H5T__bit_find(int_buf, (size_t)0, 8 * buf_size, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, 8 * buf_size, H5T_BIT_MSB, true); first = (size_t)sfirst; if (sfirst < 0) { @@ -8283,7 +8283,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } } @@ -8300,10 +8300,10 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) - H5T__bit_set(d, dst.offset, dst.prec, TRUE); + H5T__bit_set(d, dst.offset, dst.prec, true); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8325,7 +8325,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, first + 1); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } else if (except_ret == H5T_CONV_ABORT) @@ -8353,14 +8353,14 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /*copy source value into destination*/ H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, dst.prec - 1); - H5T__bit_set(d, (dst.offset + dst.prec - 1), (size_t)1, TRUE); + H5T__bit_set(d, (dst.offset + dst.prec - 1), (size_t)1, true); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } } @@ -8377,13 +8377,13 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) - H5T__bit_set(d, (dst.offset + dst.prec - 1), (size_t)1, TRUE); + H5T__bit_set(d, (dst.offset + dst.prec - 1), (size_t)1, true); else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } } @@ -8400,13 +8400,13 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_UNHANDLED) - H5T__bit_set(d, dst.offset, dst.prec - 1, TRUE); + H5T__bit_set(d, dst.offset, dst.prec - 1, true); else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } } @@ -8429,7 +8429,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = false; goto next; } } @@ -8442,12 +8442,12 @@ padding: */ if (dst.offset > 0) { assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); - H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst.offset, (bool)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), - (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); + (bool)(H5T_PAD_ONE == dst.msb_pad)); } /* @@ -8531,8 +8531,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz hsize_t expo; /*destination exponent */ hsize_t expo_max; /*maximal possible exponent value */ size_t sign; /*source sign bit value */ - hbool_t is_max_neg; /*source is maximal negative value*/ - hbool_t do_round; /*whether there is roundup */ + bool is_max_neg; /*source is maximal negative value*/ + bool do_round; /*whether there is roundup */ uint8_t *int_buf = NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ @@ -8540,7 +8540,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz ssize_t sfirst; /*a signed version of `first' */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ - hbool_t reverse; /*if reverse the order of destination */ + bool reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -8615,7 +8615,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz for (elmtno = 0; elmtno < nelmts; elmtno++) { /* Set these variables to default */ except_ret = H5T_CONV_UNHANDLED; - reverse = TRUE; + reverse = true; /* Make sure these variables are reset to 0. */ sign = 0; /*source sign bit value */ @@ -8661,7 +8661,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } /* Zero-set all destination bits*/ - H5T__bit_set(d, dst.offset, dst.prec, FALSE); + H5T__bit_set(d, dst.offset, dst.prec, false); /* Copy source into a temporary buffer */ H5T__bit_copy(int_buf, (size_t)0, s, src.offset, src.prec); @@ -8674,13 +8674,13 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * bit(MSB) of S which is set? */ if (H5T_SGN_2 == src.u.i.sign) { - sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, true); if (sign && sfirst < 0) /* The case 0x80...00, which is negative with maximal value */ is_max_neg = 1; } else if (H5T_SGN_NONE == src.u.i.sign) - sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, true); /* Handle special cases here. Integer is zero */ if (!sign && sfirst < 0) @@ -8692,7 +8692,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Equivalent to ~(i - 1) */ H5T__bit_dec(int_buf, (size_t)0, buf_size * 8); H5T__bit_neg(int_buf, (size_t)0, buf_size * 8); - sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, true); } else { /* If it's maximal negative number 0x80...000, treat it as if it overflowed @@ -8751,7 +8751,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } if (except_ret == H5T_CONV_HANDLED) { - reverse = FALSE; + reverse = false; goto padding; } else if (except_ret == H5T_CONV_ABORT) @@ -8824,7 +8824,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); else if (except_ret == H5T_CONV_HANDLED) { - reverse = FALSE; + reverse = false; goto padding; } } @@ -8851,12 +8851,12 @@ padding: */ if (dst.offset > 0) { assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); - H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst.offset, (bool)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), - (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); + (bool)(H5T_PAD_ONE == dst.msb_pad)); } /* diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 6fd4d45..34e3687 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -179,7 +179,7 @@ H5Topen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype"); /* Register the type and return the ID */ - if ((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->connector, TRUE)) < 0) + if ((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->connector, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype"); done: diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 3544ef5..d526508 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -59,7 +59,7 @@ H5Tenum_create(hid_t parent_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type"); /* Register the type */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type ID"); done: @@ -334,7 +334,7 @@ H5T__enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t H5T_t *copied_dt = NULL; /* Do sorting in copied datatype */ unsigned lt, md = 0, rt; /* Indices for binary search */ int cmp = (-1); /* Comparison result */ - hbool_t alloc_name = FALSE; /* Whether name has been allocated */ + bool alloc_name = false; /* Whether name has been allocated */ char *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -380,7 +380,7 @@ H5T__enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t if (!name) { if (NULL == (name = (char *)H5MM_malloc(HDstrlen(copied_dt->shared->u.enumer.name[md]) + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - alloc_name = TRUE; + alloc_name = true; } /* end if */ HDstrncpy(name, copied_dt->shared->u.enumer.name[md], size); if (HDstrlen(copied_dt->shared->u.enumer.name[md]) >= size) diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 9d423d1..4ed4f52 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -261,7 +261,7 @@ H5T__sort_value(const H5T_t *dt, int *map) { unsigned nmembs; /* Number of members for datatype */ size_t size; - hbool_t swapped; /* Whether we've swapped fields */ + bool swapped; /* Whether we've swapped fields */ uint8_t tbuf[32]; unsigned i, j; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ @@ -277,8 +277,8 @@ H5T__sort_value(const H5T_t *dt, int *map) if (H5T_SORT_VALUE != dt->shared->u.compnd.sorted) { dt->shared->u.compnd.sorted = H5T_SORT_VALUE; nmembs = dt->shared->u.compnd.nmembs; - for (i = nmembs - 1, swapped = TRUE; i > 0 && swapped; --i) { - for (j = 0, swapped = FALSE; j < i; j++) { + for (i = nmembs - 1, swapped = true; i > 0 && swapped; --i) { + for (j = 0, swapped = false; j < i; j++) { if (dt->shared->u.compnd.memb[j].offset > dt->shared->u.compnd.memb[j + 1].offset) { H5T_cmemb_t tmp = dt->shared->u.compnd.memb[j]; dt->shared->u.compnd.memb[j] = dt->shared->u.compnd.memb[j + 1]; @@ -289,7 +289,7 @@ H5T__sort_value(const H5T_t *dt, int *map) map[j] = map[j + 1]; map[j + 1] = x; } /* end if */ - swapped = TRUE; + swapped = true; } /* end if */ } /* end for */ } /* end for */ @@ -306,8 +306,8 @@ H5T__sort_value(const H5T_t *dt, int *map) nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; assert(size <= sizeof(tbuf)); - for (i = (nmembs - 1), swapped = TRUE; i > 0 && swapped; --i) { - for (j = 0, swapped = FALSE; j < i; j++) { + for (i = (nmembs - 1), swapped = true; i > 0 && swapped; --i) { + for (j = 0, swapped = false; j < i; j++) { if (memcmp((uint8_t *)dt->shared->u.enumer.value + (j * size), (uint8_t *)dt->shared->u.enumer.value + ((j + 1) * size), size) > 0) { /* Swap names */ @@ -329,7 +329,7 @@ H5T__sort_value(const H5T_t *dt, int *map) map[j + 1] = x; } /* end if */ - swapped = TRUE; + swapped = true; } /* end if */ } /* end for */ } /* end for */ @@ -363,7 +363,7 @@ H5T__sort_name(const H5T_t *dt, int *map) { unsigned i, j, nmembs; size_t size; - hbool_t swapped; + bool swapped; uint8_t tbuf[32]; FUNC_ENTER_PACKAGE_NOERR @@ -377,14 +377,14 @@ H5T__sort_name(const H5T_t *dt, int *map) if (H5T_SORT_NAME != dt->shared->u.compnd.sorted) { dt->shared->u.compnd.sorted = H5T_SORT_NAME; nmembs = dt->shared->u.compnd.nmembs; - for (i = nmembs - 1, swapped = TRUE; i > 0 && swapped; --i) { - for (j = 0, swapped = FALSE; j < i; j++) { + for (i = nmembs - 1, swapped = true; i > 0 && swapped; --i) { + for (j = 0, swapped = false; j < i; j++) { if (HDstrcmp(dt->shared->u.compnd.memb[j].name, dt->shared->u.compnd.memb[j + 1].name) > 0) { H5T_cmemb_t tmp = dt->shared->u.compnd.memb[j]; dt->shared->u.compnd.memb[j] = dt->shared->u.compnd.memb[j + 1]; dt->shared->u.compnd.memb[j + 1] = tmp; - swapped = TRUE; + swapped = true; if (map) { int x = map[j]; map[j] = map[j + 1]; @@ -408,8 +408,8 @@ H5T__sort_name(const H5T_t *dt, int *map) nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; assert(size <= sizeof(tbuf)); - for (i = nmembs - 1, swapped = TRUE; i > 0 && swapped; --i) { - for (j = 0, swapped = FALSE; j < i; j++) { + for (i = nmembs - 1, swapped = true; i > 0 && swapped; --i) { + for (j = 0, swapped = false; j < i; j++) { if (HDstrcmp(dt->shared->u.enumer.name[j], dt->shared->u.enumer.name[j + 1]) > 0) { /* Swap names */ char *tmp = dt->shared->u.enumer.name[j]; @@ -429,7 +429,7 @@ H5T__sort_name(const H5T_t *dt, int *map) map[j + 1] = x; } - swapped = TRUE; + swapped = true; } } } diff --git a/src/H5Tinit_float.c b/src/H5Tinit_float.c index 3a8c0bd..3b9e127 100644 --- a/src/H5Tinit_float.c +++ b/src/H5Tinit_float.c @@ -489,7 +489,7 @@ H5T__init_native_float_types(void) dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; /* Register the type and set global variables */ - if ((H5T_NATIVE_FLOAT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) + if ((H5T_NATIVE_FLOAT_g = H5I_register(H5I_DATATYPE, dt, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype"); H5T_NATIVE_FLOAT_ALIGN_g = det.comp_align; @@ -520,7 +520,7 @@ H5T__init_native_float_types(void) dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; /* Register the type and set global variables */ - if ((H5T_NATIVE_DOUBLE_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) + if ((H5T_NATIVE_DOUBLE_g = H5I_register(H5I_DATATYPE, dt, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype"); H5T_NATIVE_DOUBLE_ALIGN_g = det.comp_align; @@ -551,7 +551,7 @@ H5T__init_native_float_types(void) dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; /* Register the type and set global variables */ - if ((H5T_NATIVE_LDOUBLE_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) + if ((H5T_NATIVE_LDOUBLE_g = H5I_register(H5I_DATATYPE, dt, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype"); H5T_NATIVE_LDOUBLE_ALIGN_g = det.comp_align; diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index 801d474..b4f9289 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -763,7 +763,7 @@ * #H5T_NATIVE_HBOOL * * - * hbool_t + * bool * * * diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 76ef403..7574748 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -86,7 +86,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "cannot retrieve native type"); /* Get an ID for the new type */ - if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type"); done: @@ -137,7 +137,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali assert(dtype); - if (H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, FALSE))) + if (H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class"); if (0 == (size = H5T_get_size(dtype))) @@ -219,7 +219,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); /* Update size, offset and compound alignment for parent. */ - if (0 == H5T_cmp(ret_value, dt, FALSE)) { + if (0 == H5T_cmp(ret_value, dt, false)) { align = H5T_HOBJREF_ALIGN_g; ref_size = sizeof(hobj_ref_t); } /* end if */ @@ -228,7 +228,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali if (NULL == (dt = (H5T_t *)H5I_object(H5T_STD_REF_DSETREG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); - if (0 == H5T_cmp(ret_value, dt, FALSE)) { + if (0 == H5T_cmp(ret_value, dt, false)) { align = H5T_HDSETREGREF_ALIGN_g; ref_size = sizeof(hdset_reg_ref_t); } /* end if */ @@ -344,9 +344,9 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali H5T__get_native_type(super_type, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed"); - if ((super_type_id = H5I_register(H5I_DATATYPE, super_type, FALSE)) < 0) + if ((super_type_id = H5I_register(H5I_DATATYPE, super_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype"); - if ((nat_super_type_id = H5I_register(H5I_DATATYPE, nat_super_type, FALSE)) < 0) + if ((nat_super_type_id = H5I_register(H5I_DATATYPE, nat_super_type, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype"); /* Allocate room for the enum values */ @@ -1240,7 +1240,7 @@ H5T__init_native_internal(void) dt->shared->u.atomic.order = byte_order; *table[j].alignmentp = table[j].alignment; - if ((*table[j].hidp = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) + if ((*table[j].hidp = H5I_register(H5I_DATATYPE, dt, false)) < 0) return FAIL; } } diff --git a/src/H5Toh.c b/src/H5Toh.c index 9269aa7..6d43561 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -75,8 +75,8 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ * Purpose: Determines if an object has the requisite messages for being * a datatype. * - * Return: Success: TRUE if the required data type messages are - * present; FALSE otherwise. + * Return: Success: true if the required data type messages are + * present; false otherwise. * * Failure: FAIL if the existence of certain messages * cannot be determined. diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 23fa960..7a79d44 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -156,7 +156,7 @@ typedef herr_t (*H5T_lib_conv_t)(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* Conversion callbacks (library internal ones don't need DXPL) */ typedef struct H5T_conv_func_t { - hbool_t is_app; /* Whether conversion function is registered from application */ + bool is_app; /* Whether conversion function is registered from application */ union { H5T_conv_t app_func; /* Application data conversion function */ H5T_lib_conv_t lib_func; /* Library internal data conversion function */ @@ -169,18 +169,18 @@ struct H5T_path_t { H5T_t *src; /*source datatype */ H5T_t *dst; /*destination datatype */ H5T_conv_func_t conv; /* Conversion function */ - hbool_t is_hard; /*is it a hard function? */ - hbool_t is_noop; /*is it the noop conversion? */ - hbool_t are_compounds; /*are source and dest both compounds?*/ + bool is_hard; /*is it a hard function? */ + bool is_noop; /*is it the noop conversion? */ + bool are_compounds; /*are source and dest both compounds?*/ H5T_stats_t stats; /*statistics for the conversion */ H5T_cdata_t cdata; /*data for this function */ }; /* Reference function pointers */ -typedef herr_t (*H5T_ref_isnullfunc_t)(const H5VL_object_t *file, const void *src_buf, hbool_t *isnull); +typedef herr_t (*H5T_ref_isnullfunc_t)(const H5VL_object_t *file, const void *src_buf, bool *isnull); typedef herr_t (*H5T_ref_setnullfunc_t)(H5VL_object_t *file, void *dst_buf, void *bg_buf); typedef size_t (*H5T_ref_getsizefunc_t)(H5VL_object_t *src_file, const void *src_buf, size_t src_size, - H5VL_object_t *dst_file, hbool_t *dst_copy); + H5VL_object_t *dst_file, bool *dst_copy); typedef herr_t (*H5T_ref_readfunc_t)(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size); typedef herr_t (*H5T_ref_writefunc_t)(H5VL_object_t *src_file, const void *src_buf, size_t src_size, @@ -225,7 +225,7 @@ typedef struct H5T_atomic_t { struct { H5R_type_t rtype; /* type of reference stored */ unsigned version; /* version of encoded reference */ - hbool_t opaque; /* opaque reference type */ + bool opaque; /* opaque reference type */ H5T_loc_t loc; /* location of data in buffer */ H5VL_object_t *file; /* file VOL pointer (if data is on disk) */ const H5T_ref_class_t *cls; /* Pointer to ref class callbacks */ @@ -253,7 +253,7 @@ typedef struct H5T_compnd_t { unsigned nalloc; /*num entries allocated in MEMB array*/ unsigned nmembs; /*number of members defined in struct*/ H5T_sort_t sorted; /*how are members sorted? */ - hbool_t packed; /*are members packed together? */ + bool packed; /*are members packed together? */ H5T_cmemb_t *memb; /*array of struct members */ size_t memb_size; /*total of all member sizes */ } H5T_compnd_t; @@ -278,7 +278,7 @@ typedef enum { /* VL function pointers */ typedef herr_t (*H5T_vlen_getlen_func_t)(H5VL_object_t *file, const void *vl_addr, size_t *len); typedef void *(*H5T_vlen_getptr_func_t)(void *vl_addr); -typedef herr_t (*H5T_vlen_isnull_func_t)(const H5VL_object_t *file, void *vl_addr, hbool_t *isnull); +typedef herr_t (*H5T_vlen_isnull_func_t)(const H5VL_object_t *file, void *vl_addr, bool *isnull); typedef herr_t (*H5T_vlen_setnull_func_t)(H5VL_object_t *file, void *_vl, void *_bg); typedef herr_t (*H5T_vlen_read_func_t)(H5VL_object_t *file, void *_vl, void *buf, size_t len); typedef herr_t (*H5T_vlen_write_func_t)(H5VL_object_t *file, const H5T_vlen_alloc_info_t *vl_alloc_info, @@ -334,8 +334,7 @@ typedef struct H5T_shared_t { H5T_class_t type; /*which class of type is this? */ size_t size; /*total size of an instance of this type */ unsigned version; /* Version of object header message to encode this object with */ - hbool_t - force_conv; /* Set if this type always needs to be converted and H5T__conv_noop cannot be called */ + bool force_conv; /* Set if this type always needs to be converted and H5T__conv_noop cannot be called */ struct H5T_t *parent; /*parent type for derived datatypes */ H5VL_object_t *owned_vol_obj; /* Vol object owned by this type (free on close) */ union { @@ -836,13 +835,13 @@ H5_DLL herr_t H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t * H5_DLL void H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_offset, size_t size); H5_DLL herr_t H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size); -H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value); +H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, bool value); H5_DLL uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size); H5_DLL void H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val); H5_DLL ssize_t H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, - hbool_t value); -H5_DLL hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size); -H5_DLL hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size); + bool value); +H5_DLL bool H5T__bit_inc(uint8_t *buf, size_t start, size_t size); +H5_DLL bool H5T__bit_dec(uint8_t *buf, size_t start, size_t size); H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size); /* VL functions */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index a0c19cd..0332679 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -111,15 +111,15 @@ H5_DLLVAR H5T_order_t H5T_native_order_g; H5_DLL herr_t H5T_init(void); H5_DLL H5T_t *H5T_copy(const H5T_t *old_dt, H5T_copy_t method); H5_DLL H5T_t *H5T_copy_reopen(H5T_t *old_dt); -H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable); +H5_DLL herr_t H5T_lock(H5T_t *dt, bool immutable); H5_DLL herr_t H5T_close(H5T_t *dt); H5_DLL herr_t H5T_close_real(H5T_t *dt); H5_DLL H5T_t *H5T_get_super(const H5T_t *dt); H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal); -H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api); +H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, bool from_api); H5_DLL size_t H5T_get_size(const H5T_t *dt); -H5_DLL hbool_t H5T_get_force_conv(const H5T_t *dt); -H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset); +H5_DLL bool H5T_get_force_conv(const H5T_t *dt); +H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, bool superset); H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc); H5_DLL H5T_t *H5T_decode(size_t buf_size, const unsigned char *buf); H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE *stream); @@ -130,7 +130,7 @@ H5_DLL htri_t H5T_is_named(const H5T_t *dt); H5_DLL herr_t H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_relocatable(const H5T_t *dt); H5_DLL H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst); -H5_DLL hbool_t H5T_path_noop(const H5T_path_t *p); +H5_DLL bool H5T_path_noop(const H5T_path_t *p); H5_DLL H5T_bkg_t H5T_path_bkg(const H5T_path_t *p); H5_DLL H5T_subset_info_t *H5T_path_compound_subset(const H5T_path_t *p); H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, @@ -151,7 +151,7 @@ H5_DLL H5VL_object_t *H5T_get_named_type(const H5T_t *dt); H5_DLL H5T_t *H5T_get_actual_type(H5T_t *dt); H5_DLL herr_t H5T_save_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared); H5_DLL herr_t H5T_restore_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared); -H5_DLL hbool_t H5T_already_vol_managed(const H5T_t *dt); +H5_DLL bool H5T_already_vol_managed(const H5T_t *dt); H5_DLL htri_t H5T_is_vl_storage(const H5T_t *dt); H5_DLL herr_t H5T_invoke_vol_optional(H5T_t *dt, H5VL_optional_args_t *args, hid_t dxpl_id, void **req, H5VL_object_t **vol_obj_ptr); diff --git a/src/H5Tref.c b/src/H5Tref.c index 0e6d6dd..cd60394 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -71,20 +71,20 @@ struct H5Tref_dsetreg { /* Local Prototypes */ /********************/ -static herr_t H5T__ref_mem_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull); +static herr_t H5T__ref_mem_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull); static herr_t H5T__ref_mem_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf); static size_t H5T__ref_mem_getsize(H5VL_object_t *src_file, const void *src_buf, size_t src_size, - H5VL_object_t *dst_file, hbool_t *dst_copy); + H5VL_object_t *dst_file, bool *dst_copy); static herr_t H5T__ref_mem_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size); static herr_t H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5R_type_t src_type, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size, void *bg_buf); -static herr_t H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull); +static herr_t H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull); static herr_t H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf); static size_t H5T__ref_disk_getsize(H5VL_object_t *src_file, const void *src_buf, size_t src_size, - H5VL_object_t *dst_file, hbool_t *dst_copy); + H5VL_object_t *dst_file, bool *dst_copy); static herr_t H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size); static herr_t H5T__ref_disk_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size, @@ -92,16 +92,15 @@ static herr_t H5T__ref_disk_write(H5VL_object_t *src_file, const void *src_buf, size_t dst_size, void *bg_buf); /* For compatibility */ -static herr_t H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull); +static herr_t H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull); static size_t H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void *src_buf, size_t src_size, - H5VL_object_t *dst_file, hbool_t *dst_copy); + H5VL_object_t *dst_file, bool *dst_copy); static herr_t H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size); -static herr_t H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, - hbool_t *isnull); +static herr_t H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull); static size_t H5T__ref_dsetreg_disk_getsize(H5VL_object_t *src_file, const void *src_buf, size_t src_size, - H5VL_object_t *dst_file, hbool_t *dst_copy); + H5VL_object_t *dst_file, bool *dst_copy); static herr_t H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5VL_object_t *dst_file, void *dst_buf, size_t dst_size); @@ -150,8 +149,8 @@ static const H5T_ref_class_t H5T_ref_dsetreg_disk_g = { * * Return: * One of two values on success: - * TRUE - If the location of any reference types changed - * FALSE - If the location of any reference types is the same + * true - If the location of any reference types changed + * false - If the location of any reference types is the same * Negative value is returned on failure * *------------------------------------------------------------------------- @@ -159,7 +158,7 @@ static const H5T_ref_class_t H5T_ref_dsetreg_disk_g = { htri_t H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) { - htri_t ret_value = FALSE; /* Indicate success, but no location change */ + htri_t ret_value = false; /* Indicate success, but no location change */ FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG("loc=%d", (int)loc); @@ -170,7 +169,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Only change the location if it's different */ if (loc == dt->shared->u.atomic.u.r.loc && file == dt->shared->u.atomic.u.r.file) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); switch (loc) { case H5T_LOC_MEMORY: /* Memory based reference datatype */ @@ -237,7 +236,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the file is using the native VOL connector */ + bool is_native = false; /* Whether the file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(file, &is_native) < 0) @@ -265,7 +264,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the file is using the native VOL connector */ + bool is_native = false; /* Whether the file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(file, &is_native) < 0) @@ -342,7 +341,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) } /* end switch */ /* Indicate that the location changed */ - ret_value = TRUE; + ret_value = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -358,7 +357,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, hbool_t *isnull) +H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, bool *isnull) { const unsigned char zeros[H5T_REF_MEM_SIZE] = {0}; herr_t ret_value = SUCCEED; @@ -370,7 +369,7 @@ H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, const void *sr assert(src_buf); assert(isnull); - *isnull = (0 == memcmp(src_buf, zeros, H5T_REF_MEM_SIZE)) ? TRUE : FALSE; + *isnull = (0 == memcmp(src_buf, zeros, H5T_REF_MEM_SIZE)) ? true : false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__ref_mem_isnull() */ @@ -408,7 +407,7 @@ H5T__ref_mem_setnull(H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, H5_A */ static size_t H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, - size_t H5_ATTR_UNUSED src_size, H5VL_object_t *dst_file, hbool_t *dst_copy) + size_t H5_ATTR_UNUSED src_size, H5VL_object_t *dst_file, bool *dst_copy) { H5VL_object_t *vol_obj = NULL; /* VOL object for src ref's location */ const H5R_ref_priv_t *src_ref = (const H5R_ref_priv_t *)src_buf; @@ -425,7 +424,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf assert(src_size == H5T_REF_MEM_SIZE); if (NULL != dst_file) { - hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */ + bool files_equal = true; /* Whether src & dst references are in same file */ /* Retrieve VOL object */ if (NULL == (vol_obj = H5VL_vol_object(src_ref->loc_id))) @@ -447,7 +446,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf /* Pass the correct encoding version for the selection depending on the * file libver bounds, this is later retrieved in H5S hyper encode */ if (src_ref->type == (int8_t)H5R_DATASET_REGION2) { - hbool_t is_native = FALSE; /* Whether the dest. file is using the native VOL connector */ + bool is_native = false; /* Whether the dest. file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(dst_file, &is_native) < 0) @@ -502,7 +501,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf else { /* Can do a direct copy and skip blob decoding */ if (src_ref->type == (int8_t)H5R_OBJECT2) - *dst_copy = TRUE; + *dst_copy = true; /* Get cached encoding size */ ret_value = src_ref->encode_size; @@ -529,7 +528,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s { H5VL_object_t *vol_obj; /* VOL object for src ref's location */ const H5R_ref_priv_t *src_ref = (const H5R_ref_priv_t *)src_buf; - hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */ + bool files_equal = true; /* Whether src & dst references are in same file */ char *file_name = NULL; /* Actual file name */ char file_name_buf_static[256] = {'\0'}; /* File name */ char *file_name_buf_dyn = @@ -564,7 +563,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s /* Pass the correct encoding version for the selection depending on the * file libver bounds, this is later retrieved in H5S hyper encode */ if (src_ref->type == (int8_t)H5R_DATASET_REGION2) { - hbool_t is_native = FALSE; /* Whether the dest. file is using the native VOL connector */ + bool is_native = false; /* Whether the dest. file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(dst_file, &is_native) < 0) @@ -666,7 +665,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size #ifndef NDEBUG if ((src_type == H5R_OBJECT1) || (src_type == H5R_DATASET_REGION1)) { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -727,12 +726,12 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size /* If no filename set, this is not an external reference */ if (NULL == H5R_REF_FILENAME(&tmp_ref)) { /* TODO temporary hack to retrieve file object */ - if ((file_id = H5F_get_file_id(src_file, H5I_FILE, FALSE)) < 0) + if ((file_id = H5F_get_file_id(src_file, H5I_FILE, false)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Attach loc ID to reference and hold reference to it, this is a - * user exposed reference so set app_ref to TRUE. */ - if (H5R__set_loc_id(&tmp_ref, file_id, TRUE, TRUE) < 0) + * user exposed reference so set app_ref to true. */ + if (H5R__set_loc_id(&tmp_ref, file_id, true, true) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference"); } /* end if */ @@ -763,7 +762,7 @@ done: */ H5_GCC_CLANG_DIAG_OFF("cast-qual") static herr_t -H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull) +H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull) { const uint8_t *p = (const uint8_t *)src_buf; H5R_type_t ref_type; @@ -781,7 +780,7 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t ref_type = (H5R_type_t)*p++; if (ref_type) { /* This is a valid reference */ - *isnull = FALSE; + *isnull = false; } else { H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */ @@ -868,7 +867,7 @@ done: */ static size_t H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, size_t src_size, - H5VL_object_t H5_ATTR_UNUSED *dst_file, hbool_t *dst_copy) + H5VL_object_t H5_ATTR_UNUSED *dst_file, bool *dst_copy) { const uint8_t *p = (const uint8_t *)src_buf; unsigned flags; @@ -890,7 +889,7 @@ H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_bu if (!(flags & H5R_IS_EXTERNAL) && (ref_type == H5R_OBJECT2)) { /* Can do a direct copy and skip blob decoding */ - *dst_copy = TRUE; + *dst_copy = true; ret_value = src_size; } /* end if */ @@ -1031,7 +1030,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull) +H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull) { H5F_t *src_f; const uint8_t *p = (const uint8_t *)src_buf; @@ -1048,7 +1047,7 @@ H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbo #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -1067,7 +1066,7 @@ H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbo H5F_addr_decode(src_f, &p, &addr); /* Check if heap address is 'nil' */ - *isnull = (addr == 0) ? TRUE : FALSE; + *isnull = (addr == 0) ? true : false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1085,7 +1084,7 @@ done: static size_t H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *src_buf, size_t H5_ATTR_UNUSED src_size, H5VL_object_t H5_ATTR_UNUSED *dst_file, - hbool_t H5_ATTR_UNUSED *dst_copy) + bool H5_ATTR_UNUSED *dst_copy) { H5F_t *src_f; size_t ret_value = 0; @@ -1098,7 +1097,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -1146,7 +1145,7 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -1183,7 +1182,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t *isnull) +H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, bool *isnull) { H5F_t *src_f; const uint8_t *p = (const uint8_t *)src_buf; @@ -1200,7 +1199,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -1219,7 +1218,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, H5F_addr_decode(src_f, &p, &addr); /* Check if heap address is 'nil' */ - *isnull = (addr == 0) ? TRUE : FALSE; + *isnull = (addr == 0) ? true : false; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1237,7 +1236,7 @@ done: static size_t H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void H5_ATTR_UNUSED *src_buf, size_t H5_ATTR_UNUSED src_size, H5VL_object_t H5_ATTR_UNUSED *dst_file, - hbool_t H5_ATTR_UNUSED *dst_copy) + bool H5_ATTR_UNUSED *dst_copy) { size_t ret_value = sizeof(struct H5Tref_dsetreg); @@ -1252,8 +1251,8 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void #ifndef NDEBUG { - H5F_t *src_f; - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + H5F_t *src_f; + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) @@ -1304,7 +1303,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t #ifndef NDEBUG { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + bool is_native = false; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ if (H5VL_object_is_native(src_file, &is_native) < 0) diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index 73c05cb..dd328c0 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -80,8 +80,8 @@ herr_t H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) { - hbool_t is_complex; /* Flag indicating current datatype is "complex" */ - herr_t ret_value = SUCCEED; /* Return value */ + bool is_complex; /* Flag indicating current datatype is "complex" */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index ac5d3c0..e503a88 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -53,7 +53,7 @@ /* Memory-based VL sequence callbacks */ static herr_t H5T__vlen_mem_seq_getlen(H5VL_object_t *file, const void *_vl, size_t *len); static void *H5T__vlen_mem_seq_getptr(void *_vl); -static herr_t H5T__vlen_mem_seq_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull); +static herr_t H5T__vlen_mem_seq_isnull(const H5VL_object_t *file, void *_vl, bool *isnull); static herr_t H5T__vlen_mem_seq_setnull(H5VL_object_t *file, void *_vl, void *_bg); static herr_t H5T__vlen_mem_seq_read(H5VL_object_t *file, void *_vl, void *_buf, size_t len); static herr_t H5T__vlen_mem_seq_write(H5VL_object_t *file, const H5T_vlen_alloc_info_t *vl_alloc_info, @@ -62,7 +62,7 @@ static herr_t H5T__vlen_mem_seq_write(H5VL_object_t *file, const H5T_vlen_alloc_ /* Memory-based VL string callbacks */ static herr_t H5T__vlen_mem_str_getlen(H5VL_object_t *file, const void *_vl, size_t *len); static void *H5T__vlen_mem_str_getptr(void *_vl); -static herr_t H5T__vlen_mem_str_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull); +static herr_t H5T__vlen_mem_str_isnull(const H5VL_object_t *file, void *_vl, bool *isnull); static herr_t H5T__vlen_mem_str_setnull(H5VL_object_t *file, void *_vl, void *_bg); static herr_t H5T__vlen_mem_str_read(H5VL_object_t *file, void *_vl, void *_buf, size_t len); static herr_t H5T__vlen_mem_str_write(H5VL_object_t *file, const H5T_vlen_alloc_info_t *vl_alloc_info, @@ -70,7 +70,7 @@ static herr_t H5T__vlen_mem_str_write(H5VL_object_t *file, const H5T_vlen_alloc_ /* Disk-based VL sequence (and string) callbacks */ static herr_t H5T__vlen_disk_getlen(H5VL_object_t *file, const void *_vl, size_t *len); -static herr_t H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull); +static herr_t H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, bool *isnull); static herr_t H5T__vlen_disk_setnull(H5VL_object_t *file, void *_vl, void *_bg); static herr_t H5T__vlen_disk_read(H5VL_object_t *file, void *_vl, void *_buf, size_t len); static herr_t H5T__vlen_disk_write(H5VL_object_t *file, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, @@ -157,7 +157,7 @@ H5Tvlen_create(hid_t base_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location"); /* Register the type */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, true)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype"); done: @@ -196,7 +196,7 @@ H5T__vlen_create(const H5T_t *base) * Force conversions (i.e. memory to memory conversions should duplicate * data, not point to the same VL sequences) */ - dt->shared->force_conv = TRUE; + dt->shared->force_conv = true; if (NULL == (dt->shared->parent = H5T_copy(base, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy base datatype"); @@ -228,8 +228,8 @@ done: * * Return: * One of two values on success: - * TRUE - If the location of any vlen types changed - * FALSE - If the location of any vlen types is the same + * true - If the location of any vlen types changed + * false - If the location of any vlen types is the same * <0 is returned on failure * *------------------------------------------------------------------------- @@ -237,7 +237,7 @@ done: htri_t H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) { - htri_t ret_value = FALSE; /* Indicate success, but no location change */ + htri_t ret_value = false; /* Indicate success, but no location change */ FUNC_ENTER_PACKAGE @@ -337,7 +337,7 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Indicate that the location changed */ - ret_value = TRUE; + ret_value = true; } /* end if */ done: @@ -405,7 +405,7 @@ H5T__vlen_mem_seq_getptr(void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T__vlen_mem_seq_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, hbool_t *isnull) +H5T__vlen_mem_seq_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, bool *isnull) { hvl_t vl; /* User's hvl_t information */ @@ -416,7 +416,7 @@ H5T__vlen_mem_seq_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, hb /* Copy to ensure correct alignment */ H5MM_memcpy(&vl, _vl, sizeof(hvl_t)); - *isnull = ((vl.len == 0 || vl.p == NULL) ? TRUE : FALSE); + *isnull = ((vl.len == 0 || vl.p == NULL) ? true : false); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__vlen_mem_seq_isnull() */ @@ -589,7 +589,7 @@ H5T__vlen_mem_str_getptr(void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T__vlen_mem_str_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, hbool_t *isnull) +H5T__vlen_mem_str_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, bool *isnull) { char *s = NULL; /* Pointer to the user's string information */ @@ -598,7 +598,7 @@ H5T__vlen_mem_str_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, hb /* Copy to ensure correct alignment */ H5MM_memcpy(&s, _vl, sizeof(char *)); - *isnull = (s == NULL ? TRUE : FALSE); + *isnull = (s == NULL ? true : false); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__vlen_mem_str_isnull() */ @@ -734,7 +734,7 @@ H5T__vlen_disk_getlen(H5VL_object_t H5_ATTR_UNUSED *file, const void *_vl, size_ *------------------------------------------------------------------------- */ static herr_t -H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull) +H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, bool *isnull) { H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */ uint8_t *vl = (uint8_t *)_vl; /* Pointer to the user's hvl_t information */ diff --git a/src/H5VL.c b/src/H5VL.c index 53c72f7..d9473dc 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -90,11 +90,11 @@ H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id) /* Check VOL initialization property list */ if (H5P_DEFAULT == vipl_id) vipl_id = H5P_VOL_INITIALIZE_DEFAULT; - else if (TRUE != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) + else if (true != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL initialize property list"); /* Register connector */ - if ((ret_value = H5VL__register_connector_by_class(cls, TRUE, vipl_id)) < 0) + if ((ret_value = H5VL__register_connector_by_class(cls, true, vipl_id)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector"); done: @@ -136,11 +136,11 @@ H5VLregister_connector_by_name(const char *name, hid_t vipl_id) /* Check VOL initialization property list */ if (H5P_DEFAULT == vipl_id) vipl_id = H5P_VOL_INITIALIZE_DEFAULT; - else if (TRUE != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) + else if (true != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL initialize property list"); /* Register connector */ - if ((ret_value = H5VL__register_connector_by_name(name, TRUE, vipl_id)) < 0) + if ((ret_value = H5VL__register_connector_by_name(name, true, vipl_id)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector"); done: @@ -180,11 +180,11 @@ H5VLregister_connector_by_value(H5VL_class_value_t value, hid_t vipl_id) /* Check VOL initialization property list */ if (H5P_DEFAULT == vipl_id) vipl_id = H5P_VOL_INITIALIZE_DEFAULT; - else if (TRUE != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) + else if (true != H5P_isa_class(vipl_id, H5P_VOL_INITIALIZE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL initialize property list"); /* Register connector */ - if ((ret_value = H5VL__register_connector_by_value(value, TRUE, vipl_id)) < 0) + if ((ret_value = H5VL__register_connector_by_value(value, true, vipl_id)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector"); done: @@ -206,7 +206,7 @@ done: htri_t H5VLis_connector_registered_by_name(const char *name) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "*s", name); @@ -234,7 +234,7 @@ done: htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value) { - htri_t ret_value = FALSE; + htri_t ret_value = false; FUNC_ENTER_API(FAIL) H5TRACE1("t", "VC", connector_value); @@ -268,7 +268,7 @@ H5VLget_connector_id(hid_t obj_id) H5TRACE1("i", "i", obj_id); /* Get connector ID */ - if ((ret_value = H5VL__get_connector_id(obj_id, TRUE)) < 0) + if ((ret_value = H5VL__get_connector_id(obj_id, true)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id"); done: @@ -298,7 +298,7 @@ H5VLget_connector_id_by_name(const char *name) H5TRACE1("i", "*s", name); /* Get connector ID with this name */ - if ((ret_value = H5VL__get_connector_id_by_name(name, TRUE)) < 0) + if ((ret_value = H5VL__get_connector_id_by_name(name, true)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id"); done: @@ -328,7 +328,7 @@ H5VLget_connector_id_by_value(H5VL_class_value_t connector_value) H5TRACE1("i", "VC", connector_value); /* Get connector ID with this value */ - if ((ret_value = H5VL__get_connector_id_by_value(connector_value, TRUE)) < 0) + if ((ret_value = H5VL__get_connector_id_by_value(connector_value, true)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL id"); done: @@ -494,7 +494,7 @@ H5VLunregister_connector(hid_t vol_id) HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector ID"); /* For the time being, we disallow unregistering the native VOL connector */ - if (H5I_INVALID_HID == (native_id = H5VL__get_connector_id_by_name(H5VL_NATIVE_NAME, FALSE))) + if (H5I_INVALID_HID == (native_id = H5VL__get_connector_id_by_name(H5VL_NATIVE_NAME, false))) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to find the native VOL connector ID"); if (vol_id == native_id) HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "unregistering the native VOL connector is not allowed"); @@ -609,7 +609,7 @@ H5VLwrap_register(void *obj, H5I_type_t type) HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "obj is NULL"); /* Wrap the object and register an ID for it */ - if ((ret_value = H5VL_wrap_register(type, obj, TRUE)) < 0) + if ((ret_value = H5VL_wrap_register(type, obj, true)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to wrap object"); done: @@ -707,7 +707,7 @@ H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id) if (NULL == (dtype = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - /* Create VOL object for file if necessary (force_conv will be TRUE if and + /* Create VOL object for file if necessary (force_conv will be true if and * only if file needs to be passed to H5T_set_loc) */ if (H5T_GET_FORCE_CONV(dtype) && (NULL == (file_vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file_obj, connector_id)))) @@ -718,7 +718,7 @@ H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id) HGOTO_ERROR(H5E_VOL, H5E_CANTCOPY, FAIL, "unable to copy datatype"); /* Register file type id */ - if ((file_type_id = H5I_register(H5I_DATATYPE, file_type, FALSE)) < 0) { + if ((file_type_id = H5I_register(H5I_DATATYPE, file_type, false)) < 0) { (void)H5T_close_real(file_type); HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "unable to register file datatype"); } /* end if */ diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index e1dda22..fe0f0aa 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -345,7 +345,7 @@ H5VL__common_optional_op(hid_t id, H5I_type_t id_type, H5VL_reg_opt_oper_t reg_o { H5VL_object_t *tmp_vol_obj = NULL; /* Object for id */ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for id */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -357,7 +357,7 @@ H5VL__common_optional_op(hid_t id, H5I_type_t id_type, H5VL_reg_opt_oper_t reg_o /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(*vol_obj_ptr) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -1018,15 +1018,15 @@ void * H5VL_attr_create(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__attr_create(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -1122,15 +1122,15 @@ void * H5VL_attr_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t aapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__attr_open(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -1221,15 +1221,15 @@ done: herr_t H5VL_attr_read(const H5VL_object_t *vol_obj, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__attr_read(vol_obj->data, vol_obj->connector->cls, mem_type_id, buf, dxpl_id, req) < 0) @@ -1319,15 +1319,15 @@ done: herr_t H5VL_attr_write(const H5VL_object_t *vol_obj, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__attr_write(vol_obj->data, vol_obj->connector->cls, mem_type_id, buf, dxpl_id, req) < 0) @@ -1417,15 +1417,15 @@ done: herr_t H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__attr_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -1519,15 +1519,15 @@ herr_t H5VL_attr_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -1621,15 +1621,15 @@ done: herr_t H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -1859,15 +1859,15 @@ H5VL_dataset_create(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_p hid_t lcpl_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == @@ -1964,15 +1964,15 @@ void * H5VL_dataset_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t dapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__dataset_open(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -2069,7 +2069,7 @@ herr_t H5VL_dataset_read_direct(size_t count, void *obj[], H5VL_t *connector, hid_t mem_type_id[], hid_t mem_space_id[], hid_t file_space_id[], hid_t dxpl_id, void *buf[], void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ H5VL_object_t tmp_vol_obj; /* Temporary VOL object for setting VOL wrapper */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2084,7 +2084,7 @@ H5VL_dataset_read_direct(size_t count, void *obj[], H5VL_t *connector, hid_t mem tmp_vol_obj.rc = 1; if (H5VL_set_vol_wrapper(&tmp_vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_read(count, obj, connector->cls, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, @@ -2113,11 +2113,11 @@ herr_t H5VL_dataset_read(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_id[], hid_t mem_space_id[], hid_t file_space_id[], hid_t dxpl_id, void *buf[], void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *obj_local; /* Local buffer for obj */ - void **obj = &obj_local; /* Array of object pointers */ - size_t i; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *obj_local; /* Local buffer for obj */ + void **obj = &obj_local; /* Array of object pointers */ + size_t i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2127,7 +2127,7 @@ H5VL_dataset_read(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_i /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj[0]) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Allocate obj array if necessary */ if (count > 1) @@ -2259,7 +2259,7 @@ H5VL_dataset_write_direct(size_t count, void *obj[], H5VL_t *connector, hid_t me hid_t mem_space_id[], hid_t file_space_id[], hid_t dxpl_id, const void *buf[], void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ H5VL_object_t tmp_vol_obj; /* Temporary VOL object for setting VOL wrapper */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2274,7 +2274,7 @@ H5VL_dataset_write_direct(size_t count, void *obj[], H5VL_t *connector, hid_t me tmp_vol_obj.rc = 1; if (H5VL_set_vol_wrapper(&tmp_vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_write(count, obj, connector->cls, mem_type_id, mem_space_id, file_space_id, dxpl_id, @@ -2303,11 +2303,11 @@ herr_t H5VL_dataset_write(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_id[], hid_t mem_space_id[], hid_t file_space_id[], hid_t dxpl_id, const void *buf[], void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *obj_local; /* Local buffer for obj */ - void **obj = &obj_local; /* Array of object pointers */ - size_t i; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *obj_local; /* Local buffer for obj */ + void **obj = &obj_local; /* Array of object pointers */ + size_t i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2317,7 +2317,7 @@ H5VL_dataset_write(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_ /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj[0]) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Allocate obj array if necessary */ if (count > 1) @@ -2443,15 +2443,15 @@ done: herr_t H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -2543,15 +2543,15 @@ herr_t H5VL_dataset_specific(const H5VL_object_t *vol_obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -2642,15 +2642,15 @@ done: herr_t H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -2787,8 +2787,8 @@ done: herr_t H5VL_dataset_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2801,7 +2801,7 @@ H5VL_dataset_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__dataset_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0) @@ -2894,15 +2894,15 @@ void * H5VL_datatype_commit(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__datatype_commit(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -2998,15 +2998,15 @@ void * H5VL_datatype_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__datatype_open(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -3098,15 +3098,15 @@ done: herr_t H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__datatype_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -3198,15 +3198,15 @@ herr_t H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__datatype_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -3297,15 +3297,15 @@ done: herr_t H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__datatype_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -3335,7 +3335,7 @@ H5VL_datatype_optional_op(H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hi { H5VL_object_t *tmp_vol_obj = NULL; /* Object for id */ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for id */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3349,7 +3349,7 @@ H5VL_datatype_optional_op(H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hi /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(*vol_obj_ptr) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__datatype_optional((*vol_obj_ptr)->data, (*vol_obj_ptr)->connector->cls, args, dxpl_id, req) < 0) @@ -3486,15 +3486,15 @@ done: herr_t H5VL_datatype_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__datatype_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0) @@ -3703,7 +3703,7 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in const H5VL_class_t *cls = (const H5VL_class_t *)plugin_info; H5P_genplist_t *fapl_plist; H5P_genplist_t *fapl_plist_copy; - hbool_t is_accessible = FALSE; /* Whether file is accessible */ + bool is_accessible = false; /* Whether file is accessible */ ssize_t num_errors = 0; herr_t status; hid_t connector_id = H5I_INVALID_HID; @@ -3724,13 +3724,13 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in udata->cls = cls; /* Attempt to register plugin as a VOL connector */ - if ((connector_id = H5VL__register_connector_by_class(cls, TRUE, H5P_VOL_INITIALIZE_DEFAULT)) < 0) + if ((connector_id = H5VL__register_connector_by_class(cls, true, H5P_VOL_INITIALIZE_DEFAULT)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5_ITER_ERROR, "unable to register VOL connector"); /* Setup FAPL with registered VOL connector */ if (NULL == (fapl_plist = (H5P_genplist_t *)H5I_object_verify(udata->fapl_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "not a property list"); - if ((fapl_id = H5P_copy_plist(fapl_plist, TRUE)) < 0) + if ((fapl_id = H5P_copy_plist(fapl_plist, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy fapl"); if (NULL == (fapl_plist_copy = (H5P_genplist_t *)H5I_object_verify(fapl_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "not a property list"); @@ -3821,7 +3821,7 @@ H5VL_file_open(H5VL_connector_prop_t *connector_prop, const char *name, unsigned /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__file_open(cls, name, flags, fapl_id, dxpl_id, req))) { - hbool_t is_default_conn = TRUE; + bool is_default_conn = true; /* Opening the file failed - Determine whether we should search * the plugin path to see if any other VOL connectors are available @@ -3951,15 +3951,15 @@ done: herr_t H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__file_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -4050,7 +4050,7 @@ herr_t H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req) { const H5VL_class_t *cls; /* VOL connector's class struct */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -4087,7 +4087,7 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Set the VOL connector class pointer */ cls = vol_obj->connector->cls; @@ -4181,15 +4181,15 @@ done: herr_t H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__file_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -4326,15 +4326,15 @@ done: herr_t H5VL_file_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__file_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0) @@ -4426,15 +4426,15 @@ void * H5VL_group_create(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__group_create(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -4529,15 +4529,15 @@ void * H5VL_group_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__group_open(vol_obj->data, loc_params, vol_obj->connector->cls, name, @@ -4628,15 +4628,15 @@ done: herr_t H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__group_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -4726,15 +4726,15 @@ done: herr_t H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__group_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -4826,15 +4826,15 @@ done: herr_t H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -4973,15 +4973,15 @@ done: herr_t H5VL_group_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__group_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0) @@ -5075,7 +5075,7 @@ H5VL_link_create(H5VL_link_create_args_t *args, const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req) { H5VL_object_t tmp_vol_obj; /* Temporary VOL object */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5092,7 +5092,7 @@ H5VL_link_create(H5VL_link_create_args_t *args, const H5VL_object_t *vol_obj, /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(&tmp_vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_create(args, vol_obj->data, loc_params, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id, @@ -5188,7 +5188,7 @@ H5VL_link_copy(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa hid_t lapl_id, hid_t dxpl_id, void **req) { const H5VL_object_t *vol_obj; /* VOL object for object with data */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5197,7 +5197,7 @@ H5VL_link_copy(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa vol_obj = (src_vol_obj->data ? src_vol_obj : dst_vol_obj); if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_copy(src_vol_obj->data, loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, @@ -5295,7 +5295,7 @@ H5VL_link_move(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa hid_t lapl_id, hid_t dxpl_id, void **req) { const H5VL_object_t *vol_obj; /* VOL object for object with data */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5304,7 +5304,7 @@ H5VL_link_move(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa vol_obj = (src_vol_obj->data ? src_vol_obj : dst_vol_obj); if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_move(src_vol_obj->data, loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, @@ -5399,15 +5399,15 @@ herr_t H5VL_link_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_get(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -5500,15 +5500,15 @@ herr_t H5VL_link_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -5603,15 +5603,15 @@ herr_t H5VL_link_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_optional(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -5677,7 +5677,7 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li H5VL_loc_params_t loc_params; /* Location parameters for object access */ void *token = NULL; /* Request token for async operation */ void **token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -5688,7 +5688,7 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li /* name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, &vol_obj, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, &vol_obj, &loc_params) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set link access arguments"); /* Set up request token pointer for asynchronous operation */ @@ -5698,7 +5698,7 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__link_optional(vol_obj->data, &loc_params, vol_obj->connector->cls, args, dxpl_id, token_ptr) < @@ -5764,15 +5764,15 @@ void * H5VL_object_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *params, H5I_type_t *opened_type, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - void *ret_value = NULL; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (NULL == (ret_value = H5VL__object_open(vol_obj->data, params, vol_obj->connector->cls, opened_type, @@ -5868,8 +5868,8 @@ H5VL_object_copy(const H5VL_object_t *src_obj, const H5VL_loc_params_t *src_loc_ const H5VL_object_t *dst_obj, const H5VL_loc_params_t *dst_loc_params, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5881,7 +5881,7 @@ H5VL_object_copy(const H5VL_object_t *src_obj, const H5VL_loc_params_t *src_loc_ /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(src_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__object_copy(src_obj->data, src_loc_params, src_name, dst_obj->data, dst_loc_params, dst_name, @@ -5977,15 +5977,15 @@ herr_t H5VL_object_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__object_get(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -6078,15 +6078,15 @@ herr_t H5VL_object_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ /* (Must return value from callback, for iterators) */ @@ -6181,15 +6181,15 @@ herr_t H5VL_object_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__object_optional(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0) @@ -6256,7 +6256,7 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ H5VL_loc_params_t loc_params; /* Location parameters for object access */ void *token = NULL; /* Request token for async operation */ void **token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -6267,7 +6267,7 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ /* name is verified in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, &vol_obj, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, false, lapl_id, &vol_obj, &loc_params) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set link access arguments"); /* Set up request token pointer for asynchronous operation */ @@ -6277,7 +6277,7 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__object_optional(vol_obj->data, &loc_params, vol_obj->connector->cls, args, dxpl_id, token_ptr) < @@ -6351,15 +6351,15 @@ herr_t H5VL_introspect_get_conn_cls(const H5VL_object_t *vol_obj, H5VL_get_conn_lvl_t lvl, const H5VL_class_t **conn_cls) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__introspect_get_conn_cls(vol_obj->data, vol_obj->connector->cls, lvl, conn_cls) < 0) @@ -6527,15 +6527,15 @@ done: herr_t H5VL_introspect_opt_query(const H5VL_object_t *vol_obj, H5VL_subclass_t subcls, int opt_type, uint64_t *flags) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__introspect_opt_query(vol_obj->data, vol_obj->connector->cls, subcls, opt_type, flags) < 0) @@ -6629,8 +6629,8 @@ done: herr_t H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout, H5VL_request_status_t *status) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -6640,7 +6640,7 @@ H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout, H5VL_request_s /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__request_wait(vol_obj->data, vol_obj->connector->cls, timeout, status) < 0) @@ -6733,8 +6733,8 @@ done: herr_t H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void *ctx) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -6744,7 +6744,7 @@ H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__request_notify(vol_obj->data, vol_obj->connector->cls, cb, ctx) < 0) @@ -6836,8 +6836,8 @@ done: herr_t H5VL_request_cancel(const H5VL_object_t *vol_obj, H5VL_request_status_t *status) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -6847,7 +6847,7 @@ H5VL_request_cancel(const H5VL_object_t *vol_obj, H5VL_request_status_t *status) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__request_cancel(vol_obj->data, vol_obj->connector->cls, status) < 0) @@ -6939,8 +6939,8 @@ done: herr_t H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_args_t *args) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -6950,7 +6950,7 @@ H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_args_t /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__request_specific(vol_obj->data, vol_obj->connector->cls, args) < 0) @@ -7044,8 +7044,8 @@ done: herr_t H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -7055,7 +7055,7 @@ H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if (H5VL__request_optional(vol_obj->data, vol_obj->connector->cls, args) < 0) @@ -7185,8 +7185,8 @@ done: herr_t H5VL_request_free(const H5VL_object_t *vol_obj) { - hbool_t vol_wrapper_set = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -7196,7 +7196,7 @@ H5VL_request_free(const H5VL_object_t *vol_obj) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding VOL callback */ if (H5VL__request_free(vol_obj->data, vol_obj->connector->cls) < 0) @@ -7999,15 +7999,15 @@ done: herr_t H5VL_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - herr_t ret_value = SUCCEED; /* Return value */ + bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info"); - vol_wrapper_set = TRUE; + vol_wrapper_set = true; /* Call the corresponding internal VOL routine */ if ((ret_value = H5VL__optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req)) < 0) diff --git a/src/H5VLint.c b/src/H5VLint.c index 9cf55c9..b7f6e5e 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -86,8 +86,7 @@ typedef struct { static herr_t H5VL__free_cls(H5VL_class_t *cls, void **request); static int H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data); static void *H5VL__wrap_obj(void *obj, H5I_type_t obj_type); -static H5VL_object_t *H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, - hbool_t wrap_obj); +static H5VL_object_t *H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, bool wrap_obj); static void *H5VL__object(hid_t id, H5I_type_t obj_type); static herr_t H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx); @@ -244,7 +243,7 @@ H5VL_term_package(void) else { if (H5I_nmembers(H5I_VOL) > 0) { /* Unregister all VOL connectors */ - (void)H5I_clear_type(H5I_VOL, TRUE, FALSE); + (void)H5I_clear_type(H5I_VOL, true, false); n++; } /* end if */ else { @@ -395,25 +394,25 @@ H5VL__set_def_conn(void) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check if VOL connector already registered"); else if (connector_is_registered) { /* Retrieve the ID of the already-registered VOL connector */ - if ((connector_id = H5VL__get_connector_id_by_name(tok, FALSE)) < 0) + if ((connector_id = H5VL__get_connector_id_by_name(tok, false)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector ID"); } /* end else-if */ else { /* Check for VOL connectors that ship with the library */ if (!HDstrcmp(tok, "native")) { connector_id = H5VL_NATIVE; - if (H5I_inc_ref(connector_id, FALSE) < 0) + if (H5I_inc_ref(connector_id, false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end if */ else if (!HDstrcmp(tok, "pass_through")) { connector_id = H5VL_PASSTHRU; - if (H5I_inc_ref(connector_id, FALSE) < 0) + if (H5I_inc_ref(connector_id, false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end else-if */ else { /* Register the VOL connector */ /* (NOTE: No provisions for vipl_id currently) */ - if ((connector_id = H5VL__register_connector_by_name(tok, TRUE, H5P_VOL_INITIALIZE_DEFAULT)) < + if ((connector_id = H5VL__register_connector_by_name(tok, true, H5P_VOL_INITIALIZE_DEFAULT)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register connector"); } /* end else */ @@ -434,7 +433,7 @@ H5VL__set_def_conn(void) H5VL_def_conn_s.connector_info = NULL; /* Increment the ref count on the default connector */ - if (H5I_inc_ref(H5VL_def_conn_s.connector_id, FALSE) < 0) + if (H5I_inc_ref(H5VL_def_conn_s.connector_id, false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end else */ @@ -524,10 +523,10 @@ done: *------------------------------------------------------------------------- */ static H5VL_object_t * -H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t wrap_obj) +H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, bool wrap_obj) { H5VL_object_t *new_vol_obj = NULL; /* Pointer to new VOL object */ - hbool_t conn_rc_incr = FALSE; /* Whether the VOL connector refcount has been incremented */ + bool conn_rc_incr = false; /* Whether the VOL connector refcount has been incremented */ H5VL_object_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -555,7 +554,7 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t /* Bump the reference count on the VOL connector */ H5VL_conn_inc_rc(vol_connector); - conn_rc_incr = TRUE; + conn_rc_incr = true; /* If this is a datatype, we have to hide the VOL object under the H5T_t pointer */ if (H5I_DATATYPE == type) { @@ -598,7 +597,7 @@ H5VL_conn_copy(H5VL_connector_prop_t *connector_prop) /* Copy the connector ID & info, if there is one */ if (connector_prop->connector_id > 0) { /* Increment the reference count on connector ID and copy connector info */ - if (H5I_inc_ref(connector_prop->connector_id, FALSE) < 0) + if (H5I_inc_ref(connector_prop->connector_id, false) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL connector ID"); @@ -676,7 +675,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref) +H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, bool app_ref) { H5VL_object_t *vol_obj = NULL; /* VOL object wrapper for library object */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -689,7 +688,7 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ /* Set up VOL object for the passed-in data */ /* (Does not wrap object, since it's from a VOL callback) */ - if (NULL == (vol_obj = H5VL__new_vol_obj(type, object, vol_connector, FALSE))) + if (NULL == (vol_obj = H5VL__new_vol_obj(type, object, vol_connector, false))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object"); /* Register VOL object as _object_ type, for future object API calls */ @@ -719,7 +718,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref, +H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector, bool app_ref, hid_t existing_id) { H5VL_object_t *new_vol_obj = NULL; /* Pointer to new VOL object */ @@ -733,7 +732,7 @@ H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_conne /* Set up VOL object for the passed-in data */ /* (Wraps object, since it's a library object) */ - if (NULL == (new_vol_obj = H5VL__new_vol_obj(type, object, vol_connector, TRUE))) + if (NULL == (new_vol_obj = H5VL__new_vol_obj(type, object, vol_connector, true))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object"); /* Call the underlying H5I function to complete the registration */ @@ -759,7 +758,7 @@ H5VL_new_connector(hid_t connector_id) { H5VL_class_t *cls = NULL; /* VOL connector class */ H5VL_t *connector = NULL; /* New VOL connector struct */ - hbool_t conn_id_incr = FALSE; /* Whether the VOL connector ID has been incremented */ + bool conn_id_incr = false; /* Whether the VOL connector ID has been incremented */ H5VL_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -773,9 +772,9 @@ H5VL_new_connector(hid_t connector_id) HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL connector struct"); connector->cls = cls; connector->id = connector_id; - if (H5I_inc_ref(connector->id, FALSE) < 0) + if (H5I_inc_ref(connector->id, false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector"); - conn_id_incr = TRUE; + conn_id_incr = true; /* Set return value */ ret_value = connector; @@ -808,7 +807,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref) +H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, bool app_ref) { H5VL_t *connector = NULL; /* VOL connector struct */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -891,7 +890,7 @@ H5VL_create_object_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id) { H5VL_class_t *cls = NULL; /* VOL connector class */ H5VL_t *connector = NULL; /* VOL connector struct */ - hbool_t conn_id_incr = FALSE; /* Whether the VOL connector ID has been incremented */ + bool conn_id_incr = false; /* Whether the VOL connector ID has been incremented */ H5VL_object_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -905,13 +904,13 @@ H5VL_create_object_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id) HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL info struct"); connector->cls = cls; connector->id = connector_id; - if (H5I_inc_ref(connector->id, FALSE) < 0) + if (H5I_inc_ref(connector->id, false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector"); - conn_id_incr = TRUE; + conn_id_incr = true; /* Set up VOL object for the passed-in data */ /* (Wraps object, since it's a library object) */ - if (NULL == (ret_value = H5VL__new_vol_obj(type, obj, connector, TRUE))) + if (NULL == (ret_value = H5VL__new_vol_obj(type, obj, connector, true))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't create VOL object"); done: @@ -1059,7 +1058,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_object_is_native(const H5VL_object_t *obj, hbool_t *is_native) +H5VL_object_is_native(const H5VL_object_t *obj, bool *is_native) { const H5VL_class_t *cls; /* VOL connector class structs for object */ const H5VL_class_t *native_cls; /* Native VOL connector class structs */ @@ -1102,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, hbool_t *same_file) +H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, bool *same_file) { const H5VL_class_t *cls1; /* VOL connector class struct for first object */ const H5VL_class_t *cls2; /* VOL connector class struct for second object */ @@ -1130,7 +1129,7 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, /* If the connector classes are different, the files are different */ if (cmp_value) - *same_file = FALSE; + *same_file = false; else { void *obj2; /* Terminal object for second file */ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */ @@ -1167,7 +1166,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id) +H5VL__register_connector(const void *_cls, bool app_ref, hid_t vipl_id) { const H5VL_class_t *cls = (const H5VL_class_t *)_cls; H5VL_class_t *saved = NULL; @@ -1221,7 +1220,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_t vipl_id) +H5VL__register_connector_by_class(const H5VL_class_t *cls, bool app_ref, hid_t vipl_id) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1255,7 +1254,7 @@ H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_ op_data.found_id = H5I_INVALID_HID; /* Check if connector is already registered */ - if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, true) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL IDs"); /* Increment the ref count on the existing VOL connector ID, if it's already registered */ @@ -1290,7 +1289,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_id) +H5VL__register_connector_by_name(const char *name, bool app_ref, hid_t vipl_id) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1347,7 +1346,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__register_connector_by_value(H5VL_class_value_t value, hbool_t app_ref, hid_t vipl_id) +H5VL__register_connector_by_value(H5VL_class_value_t value, bool app_ref, hid_t vipl_id) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1404,7 +1403,7 @@ htri_t H5VL__is_connector_registered_by_name(const char *name) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -1414,12 +1413,12 @@ H5VL__is_connector_registered_by_name(const char *name) op_data.found_id = H5I_INVALID_HID; /* Find connector with name */ - if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, true) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors"); /* Found a connector with that name */ if (op_data.found_id != H5I_INVALID_HID) - ret_value = TRUE; + ret_value = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1441,7 +1440,7 @@ htri_t H5VL__is_connector_registered_by_value(H5VL_class_value_t value) { H5VL_get_connector_ud_t op_data; /* Callback info for connector search */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -1451,12 +1450,12 @@ H5VL__is_connector_registered_by_value(H5VL_class_value_t value) op_data.found_id = H5I_INVALID_HID; /* Find connector with value */ - if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, true) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors"); /* Found a connector with that name */ if (op_data.found_id != H5I_INVALID_HID) - ret_value = TRUE; + ret_value = true; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1473,7 +1472,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__get_connector_id(hid_t obj_id, hbool_t is_api) +H5VL__get_connector_id(hid_t obj_id, bool is_api) { H5VL_object_t *vol_obj = NULL; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1504,7 +1503,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__get_connector_id_by_name(const char *name, hbool_t is_api) +H5VL__get_connector_id_by_name(const char *name, bool is_api) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1534,7 +1533,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL__get_connector_id_by_value(H5VL_class_value_t value, hbool_t is_api) +H5VL__get_connector_id_by_value(H5VL_class_value_t value, bool is_api) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -1578,7 +1577,7 @@ H5VL__peek_connector_id_by_name(const char *name) op_data.found_id = H5I_INVALID_HID; /* Find connector with name */ - if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, true) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors"); /* Set return value */ @@ -1614,7 +1613,7 @@ H5VL__peek_connector_id_by_value(H5VL_class_value_t value) op_data.found_id = H5I_INVALID_HID; /* Find connector with value */ - if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) + if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, true) < 0) HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors"); /* Set return value */ @@ -2118,7 +2117,7 @@ H5VL_finish_lib_state(void) FUNC_ENTER_NOAPI(FAIL) /* Pop the API context off the stack */ - if (H5CX_pop(FALSE) < 0) + if (H5CX_pop(false) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't pop API context"); done: @@ -2388,7 +2387,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) +H5VL_wrap_register(H5I_type_t type, void *obj, bool app_ref) { H5VL_wrap_ctx_t *vol_wrap_ctx = NULL; /* Object wrapping context */ void *new_obj; /* Newly wrapped object */ @@ -2411,7 +2410,7 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) */ if (type == H5I_DATATYPE) if (vol_wrap_ctx->connector->id == H5VL_NATIVE) - if (TRUE == H5T_already_vol_managed((const H5T_t *)obj)) + if (true == H5T_already_vol_managed((const H5T_t *)obj)) HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype"); /* Wrap the object with VOL connector info */ @@ -2435,7 +2434,7 @@ done: * Note: Matching the connector's name / value, but the connector * having an incompatible version is not an error, but means * that the connector isn't a "match". Setting the SUCCEED - * value to FALSE and not failing for that case allows the + * value to false and not failing for that case allows the * plugin framework to keep looking for other DLLs that match * and have a compatible version. * @@ -2444,7 +2443,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t *success) +H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, bool *success) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2459,7 +2458,7 @@ H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t * if (key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { /* Check if plugin name matches VOL connector class name */ if (cls->name && !HDstrcmp(cls->name, key->vol.u.name)) - *success = TRUE; + *success = true; } /* end if */ else { /* Sanity check */ @@ -2467,12 +2466,12 @@ H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t * /* Check if plugin value matches VOL connector class value */ if (cls->value == key->vol.u.value) - *success = TRUE; + *success = true; } /* end else */ /* Connector is a match, but might not be a compatible version */ if (*success && cls->version != H5VL_VERSION) - *success = FALSE; + *success = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_check_plugin_load() */ @@ -2487,7 +2486,7 @@ H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t * *------------------------------------------------------------------------- */ void -H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, hbool_t *is_default) +H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, bool *is_default) { FUNC_ENTER_PACKAGE_NOERR @@ -2581,7 +2580,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_setup_acc_args(hid_t loc_id, const H5P_libclass_t *libclass, hbool_t is_collective, hid_t *acspl_id, +H5VL_setup_acc_args(hid_t loc_id, const H5P_libclass_t *libclass, bool is_collective, hid_t *acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2652,7 +2651,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_t lapl_id, +H5VL_setup_name_args(hid_t loc_id, const char *name, bool is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2698,8 +2697,7 @@ done: */ herr_t H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - hbool_t is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, - H5VL_loc_params_t *loc_params) + bool is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h index 44b9af0..546b31e 100644 --- a/src/H5VLmodule.h +++ b/src/H5VLmodule.h @@ -454,7 +454,7 @@ * \code * typedef struct { * H5L_type_t type; // Type of link - * hbool_t corder_valid; // Indicate if creation order is valid + * bool corder_valid; // Indicate if creation order is valid * int64_t corder; // Creation order * H5T_cset_t cset; // Character set of link name * union { diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 907f020..b640cec 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -201,7 +201,7 @@ H5VL_native_register(void) /* Register the native VOL connector, if it isn't already */ if (H5I_INVALID_HID == H5VL_NATIVE_ID_g) if ((H5VL_NATIVE_ID_g = - H5VL__register_connector(&H5VL_native_cls_g, TRUE, H5P_VOL_INITIALIZE_DEFAULT)) < 0) + H5VL__register_connector(&H5VL_native_cls_g, true, H5P_VOL_INITIALIZE_DEFAULT)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL connector"); /* Set return value */ @@ -391,7 +391,7 @@ H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token) #ifndef NDEBUG { H5VL_object_t *vol_obj_container; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; /* Get the location object */ if (NULL == (vol_obj_container = (H5VL_object_t *)H5I_object(loc_id))) @@ -485,7 +485,7 @@ H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr) #ifndef NDEBUG { H5VL_object_t *vol_obj_container; - hbool_t is_native_vol_obj; + bool is_native_vol_obj; /* Get the location object */ if (NULL == (vol_obj_container = (H5VL_object_t *)H5I_object(loc_id))) diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c index c41496a..cc92403 100644 --- a/src/H5VLnative_attr.c +++ b/src/H5VLnative_attr.c @@ -79,7 +79,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c H5P_genplist_t *plist; H5G_loc_t loc; /* Object location */ H5G_loc_t obj_loc; /* Location used to open group */ - hbool_t loc_found = FALSE; + bool loc_found = false; H5T_t *type, *dt; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ H5A_t *attr = NULL; diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c index 6aebc01..718d548 100644 --- a/src/H5VLnative_blob.c +++ b/src/H5VLnative_blob.c @@ -156,7 +156,7 @@ H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t * H5F_addr_decode(f, &id, &addr); /* Check if heap address is 'nil' */ - *args->args.is_null.isnull = (addr == 0 ? TRUE : FALSE); + *args->args.is_null.isnull = (addr == 0 ? true : false); break; } diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index 92a2249..9054157 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -133,7 +133,7 @@ H5VL__native_dataset_io_setup(size_t count, void *obj[], hid_t mem_type_id[], hi dinfo[i].file_space = dinfo[i].dset->shared->space; /* Copy, but share, selection from property list to dataset's dataspace */ - if (H5S_SELECT_COPY(dinfo[i].file_space, space, TRUE) < 0) + if (H5S_SELECT_COPY(dinfo[i].file_space, space, true) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataset I/O selection"); } /* end else-if */ else { @@ -173,10 +173,10 @@ H5VL__native_dataset_io_setup(size_t count, void *obj[], hid_t mem_type_id[], hi } /* end else */ /* Check for valid selections */ - if (H5S_SELECT_VALID(dinfo[i].file_space) != TRUE) + if (H5S_SELECT_VALID(dinfo[i].file_space) != true) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection + offset not within extent for file dataspace"); - if (H5S_SELECT_VALID(dinfo[i].mem_space) != TRUE) + if (H5S_SELECT_VALID(dinfo[i].mem_space) != true) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection + offset not within extent for memory dataspace"); @@ -220,7 +220,7 @@ H5VL__native_dataset_io_cleanup(size_t count, hid_t mem_space_id[], hid_t file_s /* Reset file dataspace selection if it was copied from the property list */ if (H5S_PLIST == file_space_id[i] && dinfo[i].file_space) - if (H5S_select_all(dinfo[i].file_space, TRUE) < 0) + if (H5S_select_all(dinfo[i].file_space, true) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to release file dataspace selection for H5S_PLIST"); } diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index 56cfae2..45081f0 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -92,7 +92,7 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t /* Create the file */ if (NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file"); - new_file->id_exists = TRUE; + new_file->id_exists = true; ret_value = (void *)new_file; @@ -126,7 +126,7 @@ H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t H5 /* Open the file */ if (NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file"); - new_file->id_exists = TRUE; + new_file->id_exists = true; ret_value = (void *)new_file; @@ -166,7 +166,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_args_t *args, hid_t H5_ATTR_UNUSE /* H5Fget_access_plist */ case H5VL_FILE_GET_FAPL: { - if ((args->args.get_fapl.fapl_id = H5F_get_access_plist((H5F_t *)obj, TRUE)) < 0) + if ((args->args.get_fapl.fapl_id = H5F_get_access_plist((H5F_t *)obj, true)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file access property list"); break; @@ -181,7 +181,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_args_t *args, hid_t H5_ATTR_UNUSE HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Create the property list object to return */ - if ((args->args.get_fcpl.fcpl_id = H5P_copy_plist(plist, TRUE)) < 0) + if ((args->args.get_fcpl.fcpl_id = H5P_copy_plist(plist, true)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy file creation properties"); break; @@ -246,7 +246,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_args_t *args, hid_t H5_ATTR_UNUSE /* H5Fget_obj_count */ case H5VL_FILE_GET_OBJ_COUNT: { - if (H5F_get_obj_count((H5F_t *)obj, args->args.get_obj_count.types, TRUE, + if (H5F_get_obj_count((H5F_t *)obj, args->args.get_obj_count.types, true, args->args.get_obj_count.count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve object count"); @@ -258,7 +258,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_args_t *args, hid_t H5_ATTR_UNUSE H5VL_file_get_obj_ids_args_t *file_args = &args->args.get_obj_ids; if (H5F_get_obj_ids((H5F_t *)obj, file_args->types, file_args->max_objs, file_args->oid_list, - TRUE, file_args->count) < 0) + true, file_args->count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve object IDs"); break; @@ -329,7 +329,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_args_t *args, hid_t H5_ /* Reopen the file through the VOL connector */ if (NULL == (new_file = H5F__reopen((H5F_t *)obj))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file"); - new_file->id_exists = TRUE; + new_file->id_exists = true; /* Set 'out' value */ *args->args.reopen.file = new_file; @@ -346,7 +346,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_args_t *args, hid_t H5_ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "error in HDF5 file check"); /* Set 'out' value */ - *args->args.is_accessible.accessible = (hbool_t)result; + *args->args.is_accessible.accessible = (bool)result; break; } @@ -362,7 +362,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_args_t *args, hid_t H5_ /* Check if two files are the same */ case H5VL_FILE_IS_EQUAL: { if (!obj || !args->args.is_equal.obj2) - *args->args.is_equal.same_file = FALSE; + *args->args.is_equal.same_file = false; else *args->args.is_equal.same_file = (((H5F_t *)obj)->shared == ((H5F_t *)args->args.is_equal.obj2)->shared); @@ -771,7 +771,7 @@ H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_U HGOTO_ERROR(H5E_ID, H5E_CANTGET, FAIL, "invalid ID"); /* Get the number of references outstanding for this file ID */ - if ((nref = H5I_get_ref(file_id, FALSE)) < 0) + if ((nref = H5I_get_ref(file_id, false)) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTGET, FAIL, "can't get ID ref count"); if (nref == 1) if (H5F__flush(f) < 0) diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index 342d65d..5f4fa4d 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -184,7 +184,7 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void /* Copy the link */ if (H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, - loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) + loc_params2->loc_data.loc_by_name.name, true, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link"); done: @@ -226,7 +226,7 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void /* Move the link */ if (H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, - loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) + loc_params2->loc_data.loc_by_name.name, false, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link"); done: diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 82d267f..8c21e7f 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -187,11 +187,11 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj if (loc_params->type == H5VL_OBJECT_BY_SELF) { *args->args.get_file.file = (void *)loc.oloc->file; - /* TODO we currently need to set id_exists to TRUE because + /* TODO we currently need to set id_exists to true because * the upper layer will create an ID from the returned * object. In theory this should not be needed and id_exists * should be removed once the H5Fmount code gets fixed. */ - loc.oloc->file->id_exists = TRUE; + loc.oloc->file->id_exists = true; } else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get_file parameters"); diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 3867df2..09ac661 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -650,7 +650,7 @@ H5VL_pass_through_info_to_str(const void *_info, char **str) /* Allocate space for our info */ size_t strSize = 32 + under_vol_str_len; - *str = (char *)H5allocate_memory(strSize, (hbool_t)0); + *str = (char *)H5allocate_memory(strSize, (bool)0); assert(*str); /* Encode our info */ diff --git a/src/H5VLpkg.h b/src/H5VLpkg.h index 5a4ccc1..dae44ea 100644 --- a/src/H5VLpkg.h +++ b/src/H5VLpkg.h @@ -44,20 +44,20 @@ /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5VL__set_def_conn(void); -H5_DLL hid_t H5VL__register_connector(const void *cls, hbool_t app_ref, hid_t vipl_id); -H5_DLL hid_t H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_t vipl_id); -H5_DLL hid_t H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_id); -H5_DLL hid_t H5VL__register_connector_by_value(H5VL_class_value_t value, hbool_t app_ref, hid_t vipl_id); +H5_DLL hid_t H5VL__register_connector(const void *cls, bool app_ref, hid_t vipl_id); +H5_DLL hid_t H5VL__register_connector_by_class(const H5VL_class_t *cls, bool app_ref, hid_t vipl_id); +H5_DLL hid_t H5VL__register_connector_by_name(const char *name, bool app_ref, hid_t vipl_id); +H5_DLL hid_t H5VL__register_connector_by_value(H5VL_class_value_t value, bool app_ref, hid_t vipl_id); H5_DLL htri_t H5VL__is_connector_registered_by_name(const char *name); H5_DLL htri_t H5VL__is_connector_registered_by_value(H5VL_class_value_t value); -H5_DLL hid_t H5VL__get_connector_id(hid_t obj_id, hbool_t is_api); -H5_DLL hid_t H5VL__get_connector_id_by_name(const char *name, hbool_t is_api); -H5_DLL hid_t H5VL__get_connector_id_by_value(H5VL_class_value_t value, hbool_t is_api); +H5_DLL hid_t H5VL__get_connector_id(hid_t obj_id, bool is_api); +H5_DLL hid_t H5VL__get_connector_id_by_name(const char *name, bool is_api); +H5_DLL hid_t H5VL__get_connector_id_by_value(H5VL_class_value_t value, bool is_api); H5_DLL hid_t H5VL__peek_connector_id_by_name(const char *name); H5_DLL hid_t H5VL__peek_connector_id_by_value(H5VL_class_value_t value); H5_DLL herr_t H5VL__connector_str_to_info(const char *str, hid_t connector_id, void **info); H5_DLL ssize_t H5VL__get_connector_name(hid_t id, char *name /*out*/, size_t size); -H5_DLL void H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, hbool_t *is_default); +H5_DLL void H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, bool *is_default); H5_DLL herr_t H5VL__register_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val); H5_DLL size_t H5VL__num_opt_operation(void); H5_DLL herr_t H5VL__find_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val); diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index 5f73e74..d0c856b 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -78,7 +78,7 @@ H5_DLL herr_t H5VL_get_cap_flags(const H5VL_connector_prop_t *prop, uint64_t *c /* Functions that deal with VOL connectors */ union H5PL_key_t; -H5_DLL herr_t H5VL_check_plugin_load(const H5VL_class_t *cls, const union H5PL_key_t *key, hbool_t *success); +H5_DLL herr_t H5VL_check_plugin_load(const H5VL_class_t *cls, const union H5PL_key_t *key, bool *success); /* NOTE: The object and ID functions below deal in VOL objects (i.e.; * H5VL_object_t). Similar non-VOL calls exist in H5Iprivate.h. Use @@ -100,9 +100,9 @@ H5_DLL H5VL_object_t *H5VL_create_object(void *object, H5VL_t *vol_connector); H5_DLL H5VL_object_t *H5VL_create_object_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id); H5_DLL hsize_t H5VL_object_inc_rc(H5VL_object_t *obj); H5_DLL herr_t H5VL_free_object(H5VL_object_t *obj); -H5_DLL herr_t H5VL_object_is_native(const H5VL_object_t *obj, hbool_t *is_native); +H5_DLL herr_t H5VL_object_is_native(const H5VL_object_t *obj, bool *is_native); H5_DLL herr_t H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, - hbool_t *same_file); + bool *same_file); /* Functions that wrap / unwrap VOL objects */ H5_DLL herr_t H5VL_get_wrap_ctx(const H5VL_class_t *connector, void *obj, void **wrap_ctx); @@ -122,23 +122,23 @@ H5_DLL herr_t H5VL_finish_lib_state(void); H5_DLL herr_t H5VL_free_lib_state(void *state); /* ID registration functions */ -H5_DLL hid_t H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref); -H5_DLL hid_t H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref); -H5_DLL hid_t H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref); +H5_DLL hid_t H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, bool app_ref); +H5_DLL hid_t H5VL_wrap_register(H5I_type_t type, void *obj, bool app_ref); +H5_DLL hid_t H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, bool app_ref); H5_DLL herr_t H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector, - hbool_t app_ref, hid_t existing_id); + bool app_ref, hid_t existing_id); /* Object access functions */ struct H5P_libclass_t; H5_DLL herr_t H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj); H5_DLL herr_t H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); -H5_DLL herr_t H5VL_setup_acc_args(hid_t loc_id, const struct H5P_libclass_t *libclass, hbool_t is_collective, +H5_DLL herr_t H5VL_setup_acc_args(hid_t loc_id, const struct H5P_libclass_t *libclass, bool is_collective, hid_t *acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); H5_DLL herr_t H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); -H5_DLL herr_t H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_t lapl_id, +H5_DLL herr_t H5VL_setup_name_args(hid_t loc_id, const char *name, bool is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); H5_DLL herr_t H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, hbool_t is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, + hsize_t n, bool is_collective, hid_t lapl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); H5_DLL herr_t H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params); diff --git a/src/H5VM.c b/src/H5VM.c index abfde22..6bdf079 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -285,11 +285,11 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co * assumes that both hyperslabs are relative to the same array, * for if not, they could not possibly be equal. * - * Return: TRUE if the hyperslabs are equal (that is, + * Return: true if the hyperslabs are equal (that is, * both refer to exactly the same elements of an * array) * - * FALSE otherwise + * false otherwise * * Never returns FAIL * @@ -301,23 +301,23 @@ H5VM_hyper_eq(unsigned n, const hsize_t *offset1, const hsize_t *size1, const hs { hsize_t nelmts1 = 1, nelmts2 = 1; unsigned i; - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR if (n == 0) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); for (i = 0; i < n; i++) { if ((offset1 ? offset1[i] : 0) != (offset2 ? offset2[i] : 0)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if ((size1 ? size1[i] : 0) != (size2 ? size2[i] : 0)) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (0 == (nelmts1 *= (size1 ? size1[i] : 0))) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); if (0 == (nelmts2 *= (size2 ? size2[i] : 0))) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } done: @@ -569,7 +569,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize hsize_t nelmts; /*number of elements to fill */ hsize_t i; /*counter */ int j; /*counter */ - hbool_t carry; /*subtraction carray value */ + bool carry; /*subtraction carray value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -583,11 +583,11 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize memset(dst, (int)fill_value, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */ /* Decrement indices and advance pointer */ - for (j = (int)(n - 1), carry = TRUE; j >= 0 && carry; --j) { + for (j = (int)(n - 1), carry = true; j >= 0 && carry; --j) { dst += stride[j]; if (--idx[j]) - carry = FALSE; + carry = false; else { assert(size); idx[j] = size[j]; @@ -624,7 +624,7 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize hsize_t nelmts; /*num elements to copy */ hsize_t i; /*counter */ int j; /*counters */ - hbool_t carry; /*carray for subtraction*/ + bool carry; /*carray for subtraction*/ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -640,12 +640,12 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize H5MM_memcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */ /* Decrement indices and advance pointers */ - for (j = (int)(n - 1), carry = TRUE; j >= 0 && carry; --j) { + for (j = (int)(n - 1), carry = true; j >= 0 && carry; --j) { src += src_stride[j]; dst += dst_stride[j]; if (--idx[j]) - carry = FALSE; + carry = false; else { assert(size); idx[j] = size[j]; @@ -687,7 +687,7 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss hsize_t nelmts; /*num elements to copy */ hsize_t i; /*counter */ int j; /*counters */ - hbool_t carry; /*carray for subtraction*/ + bool carry; /*carray for subtraction*/ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -703,12 +703,12 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss H5MM_memcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */ /* Decrement indices and advance pointers */ - for (j = (int)(n - 1), carry = TRUE; j >= 0 && carry; --j) { + for (j = (int)(n - 1), carry = true; j >= 0 && carry; --j) { src += src_stride[j]; dst += dst_stride[j]; if (--idx[j]) - carry = FALSE; + carry = false; else { assert(size); idx[j] = size[j]; diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index aa1c0f1..d4e4273 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -159,23 +159,23 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: TRUE if all elements are zero, - * Failure: TRUE if N is zero + * Return: Success: true if all elements are zero, + * Failure: true if N is zero *------------------------------------------------------------------------- */ static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_u(int n, const hsize_t *v) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); while (n--) if (*v++) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); done: FUNC_LEAVE_NOAPI(ret_value) @@ -190,24 +190,24 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: TRUE if all elements are zero, - * FALSE otherwise - * Failure: TRUE if N is zero + * Return: Success: true if all elements are zero, + * false otherwise + * Failure: true if N is zero *------------------------------------------------------------------------- */ static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_s(int n, const hssize_t *v) { - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); while (n--) if (*v++) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); done: FUNC_LEAVE_NOAPI(ret_value) @@ -472,14 +472,14 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: TRUE/FALSE + * Return: true/false *------------------------------------------------------------------------- */ -static inline hbool_t H5_ATTR_UNUSED +static inline bool H5_ATTR_UNUSED H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ - return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); + return (bool)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? true : false); } /* end H5VM_bit_get() */ /*------------------------------------------------------------------------- @@ -502,7 +502,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static inline void H5_ATTR_UNUSED -H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM_bit_set(unsigned char *buf, size_t offset, bool val) { /* Set/reset the appropriate bit in the buffer */ if (val) diff --git a/src/H5Z.c b/src/H5Z.c index 111d71a..1101811 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -44,9 +44,8 @@ typedef struct H5Z_object_t { H5Z_filter_t filter_id; /* ID of the filter we're looking for */ htri_t found; /* Whether we find an object using the filter */ #ifdef H5_HAVE_PARALLEL - hbool_t - sanity_checked; /* Whether the sanity check for collectively calling H5Zunregister has been done */ -#endif /* H5_HAVE_PARALLEL */ + bool sanity_checked; /* Whether the sanity check for collectively calling H5Zunregister has been done */ +#endif /* H5_HAVE_PARALLEL */ } H5Z_object_t; /* Enumerated type for dataset creation prelude callbacks */ @@ -401,13 +400,13 @@ H5Z__unregister(H5Z_filter_t filter_id) /* Initialize the structure object for iteration */ object.filter_id = filter_id; - object.found = FALSE; + object.found = false; #ifdef H5_HAVE_PARALLEL - object.sanity_checked = FALSE; + object.sanity_checked = false; #endif /* H5_HAVE_PARALLEL */ /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed"); if (object.found) @@ -415,7 +414,7 @@ H5Z__unregister(H5Z_filter_t filter_id) "can't unregister filter because a dataset is still using it"); /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed"); if (object.found) @@ -423,7 +422,7 @@ H5Z__unregister(H5Z_filter_t filter_id) "can't unregister filter because a group is still using it"); /* Iterate through all opened files and flush them */ - if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, &object, false) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed"); /* Remove filter from table */ @@ -445,8 +444,8 @@ done: * * Purpose: Check if an object uses the filter to be unregistered. * - * Return: TRUE if the object uses the filter - * FALSE if not + * Return: true if the object uses the filter + * false if not * NEGATIVE on error * *------------------------------------------------------------------------- @@ -455,7 +454,7 @@ static htri_t H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) { H5P_genplist_t *plist; /* Property list */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -477,10 +476,10 @@ done: * Purpose: The callback function for H5Z__unregister. It iterates * through all opened objects. If the object is a dataset * or a group and it uses the filter to be unregistered, the - * function returns TRUE. + * function returns true. * - * Return: TRUE if the object uses the filter - * FALSE if not + * Return: true if the object uses the filter + * false if not * NEGATIVE on error * *------------------------------------------------------------------------- @@ -490,8 +489,8 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void { hid_t ocpl_id = -1; H5Z_object_t *object = (H5Z_object_t *)key; - htri_t filter_in_pline = FALSE; - int ret_value = FALSE; /* Return value */ + htri_t filter_in_pline = false; + int ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -505,12 +504,12 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline"); - /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + /* H5I_iterate expects true to stop the loop over objects. Stop the loop and * let H5Z__unregister return failure. */ if (filter_in_pline) { - object->found = TRUE; - ret_value = TRUE; + object->found = true; + ret_value = true; } done: @@ -527,10 +526,10 @@ done: * Purpose: The callback function for H5Z__unregister. It iterates * through all opened objects. If the object is a dataset * or a group and it uses the filter to be unregistered, the - * function returns TRUE. + * function returns true. * - * Return: TRUE if the object uses the filter - * FALSE if not + * Return: true if the object uses the filter + * false if not * NEGATIVE on error * *------------------------------------------------------------------------- @@ -540,8 +539,8 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * { hid_t ocpl_id = -1; H5Z_object_t *object = (H5Z_object_t *)key; - htri_t filter_in_pline = FALSE; - int ret_value = FALSE; /* Return value */ + htri_t filter_in_pline = false; + int ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -555,12 +554,12 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline"); - /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + /* H5I_iterate expects true to stop the loop over objects. Stop the loop and * let H5Z__unregister return failure. */ if (filter_in_pline) { - object->found = TRUE; - ret_value = TRUE; + object->found = true; + ret_value = true; } done: @@ -588,7 +587,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_PARA #ifdef H5_HAVE_PARALLEL H5Z_object_t *object = (H5Z_object_t *)key; #endif /* H5_HAVE_PARALLEL */ - int ret_value = FALSE; /* Return value */ + int ret_value = false; /* Return value */ FUNC_ENTER_PACKAGE @@ -619,7 +618,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_PARA MPI_Barrier(mpi_comm); /* Set the "sanity checked" flag */ - object->sanity_checked = TRUE; + object->sanity_checked = true; } /* end if */ } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -638,13 +637,13 @@ done: * * Purpose: Check if a filter is available * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (true/false) on success/Negative on failure *------------------------------------------------------------------------- */ htri_t H5Zfilter_avail(H5Z_filter_t id) { - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); @@ -665,7 +664,7 @@ done: * * Purpose: Private function to check if a filter is available * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (true/false) on success/Negative on failure *------------------------------------------------------------------------- */ htri_t @@ -674,20 +673,20 @@ H5Z_filter_avail(H5Z_filter_t id) H5PL_key_t key; /* Key for finding a plugin */ const H5Z_class2_t *filter_info; /* Filter information */ size_t i; /* Local index variable */ - htri_t ret_value = FALSE; /* Return value */ + htri_t ret_value = false; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE); + HGOTO_DONE(true); key.id = (int)id; if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, &key))) { if (H5Z_register(filter_info) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter"); - HGOTO_DONE(TRUE); + HGOTO_DONE(true); } /* end if */ done: @@ -713,7 +712,7 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -749,7 +748,7 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi /* Indicate filter can't apply to this combination of parameters. * If the filter is NOT optional, returns failure. */ - if (status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) + if (status == false && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate"); } /* end if */ break; @@ -837,7 +836,7 @@ H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_typ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); /* Get ID for dataspace to pass to filter routines */ - if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { + if ((space_id = H5I_register(H5I_DATASPACE, space, false)) < 0) { (void)H5S_close(space); HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); } @@ -992,7 +991,7 @@ done: * However, if any of these conditions exists and a filter is not * optional, the function will produce an error. * - * Return: Non-negative(TRUE/FALSE) on success + * Return: Non-negative(true/false) on success * Negative on failure * *------------------------------------------------------------------------- @@ -1004,8 +1003,8 @@ 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 */ - hbool_t bad_for_filters = FALSE; /* Suitable to have filters */ - htri_t ret_value = FALSE; /* TRUE for ignoring filters */ + bool bad_for_filters = false; /* Suitable to have filters */ + htri_t ret_value = false; /* true for ignoring filters */ FUNC_ENTER_NOAPI(FAIL) @@ -1018,11 +1017,11 @@ H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space) /* Get datatype and dataspace classes for quick access */ space_class = H5S_GET_EXTENT_TYPE(space); - type_class = H5T_get_class(type, FALSE); + type_class = H5T_get_class(type, false); /* These conditions are not suitable for filters */ bad_for_filters = (H5S_NULL == space_class || H5S_SCALAR == space_class || H5T_VLEN == type_class || - (H5T_STRING == type_class && TRUE == H5T_is_variable_str(type))); + (H5T_STRING == type_class && true == H5T_is_variable_str(type))); /* When these conditions occur, if there are required filters in pline, then report a failure, otherwise, set flag that they can be ignored */ @@ -1035,7 +1034,7 @@ H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space) } /* All filters are optional, we can ignore them */ - ret_value = TRUE; + ret_value = true; } } /* bad for filters */ @@ -1330,7 +1329,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { H5PL_key_t key; const H5Z_class2_t *filter_info; - hbool_t issue_error = FALSE; + bool issue_error = false; /* Try loading the filter */ key.id = (int)(pline->filter[idx].id); @@ -1342,10 +1341,10 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i /* Search in the table of registered filters again to find the dynamic filter just loaded * and registered */ if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) - issue_error = TRUE; + issue_error = true; } else - issue_error = TRUE; + issue_error = true; /* Check for error */ if (issue_error) { @@ -1500,8 +1499,8 @@ done: * Purpose: Check whether a filter is in the filter pipeline using the * filter ID. This function is very similar to H5Z_filter_info * - * Return: TRUE - found filter - * FALSE - not found + * Return: true - found filter + * false - not found * FAIL - error *------------------------------------------------------------------------- */ @@ -1509,7 +1508,7 @@ htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { size_t idx; /* Index of filter in pipeline */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -1523,7 +1522,7 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) /* Check if the filter was not already in the pipeline */ if (idx >= pline->nused) - ret_value = FALSE; + ret_value = false; FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_in_pline() */ @@ -1534,7 +1533,7 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) * Purpose: Verify that all the filters in a pipeline are currently * available (i.e. registered) * - * Return: Non-negative (TRUE/FALSE) on success + * Return: Non-negative (true/false) on success * Negative on failure *------------------------------------------------------------------------- */ @@ -1542,7 +1541,7 @@ htri_t H5Z_all_filters_avail(const H5O_pline_t *pline) { size_t i, j; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -1558,7 +1557,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) /* Check if we didn't find the filter */ if (j == H5Z_table_used_g) - HGOTO_DONE(FALSE); + HGOTO_DONE(false); } /* end for */ done: @@ -1597,13 +1596,13 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) } /* Delete filter */ else { - size_t idx; /* Index of filter in pipeline */ - hbool_t found = FALSE; /* Indicate filter was found in pipeline */ + size_t idx; /* Index of filter in pipeline */ + bool found = false; /* Indicate filter was found in pipeline */ /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) if (pline->filter[idx].id == filter) { - found = TRUE; + found = true; break; } diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 80878f6..65d09c7 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -45,11 +45,11 @@ static herr_t H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actu static herr_t H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]); static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress); + bool *need_not_compress); static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress); + bool *need_not_compress); static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress); + bool *need_not_compress); static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, @@ -121,7 +121,7 @@ static htri_t H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -130,7 +130,7 @@ H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_U HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Get datatype's class, for checking the "datatype class" */ - if (H5T_get_class(type, TRUE) == H5T_NO_CLASS) + if (H5T_get_class(type, true) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class"); /* Get datatype's size, for checking the "datatype size" */ @@ -220,7 +220,7 @@ H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad base datatype"); /* Get base datatype's class */ - if ((dtype_base_class = H5T_get_class(dtype_base, TRUE)) == H5T_NO_CLASS) + if ((dtype_base_class = H5T_get_class(dtype_base, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad base datatype class"); /* Calculate number of the rest parameters according to base datatype's class */ @@ -311,7 +311,7 @@ H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad member datatype"); /* Get member datatype's class */ - if ((dtype_member_class = H5T_get_class(dtype_member, TRUE)) == H5T_NO_CLASS) + if ((dtype_member_class = H5T_get_class(dtype_member, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad member datatype class"); /* Store member offset */ @@ -416,7 +416,7 @@ done: */ static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) + bool *need_not_compress) { H5T_order_t dtype_order; /* Atomic datatype's endianness order */ size_t dtype_size; /* Atomic datatype's size (in bytes) */ @@ -482,11 +482,11 @@ H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_ /* If before this point, there is no need to compress, check the need to * compress at this point. If current datatype is not full-precision, - * flag need_not_compress should be set to FALSE. + * flag need_not_compress should be set to false. */ if (*need_not_compress) /* so far no need to compress */ if (dtype_offset != 0 || dtype_precision != dtype_size * 8) - *need_not_compress = FALSE; + *need_not_compress = false; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__set_parms_atomic() */ @@ -504,7 +504,7 @@ done: */ static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) + bool *need_not_compress) { H5T_t *dtype_base = NULL; /* Array datatype's base datatype */ H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ @@ -530,7 +530,7 @@ H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_v HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad base datatype"); /* Get base datatype's class */ - if ((dtype_base_class = H5T_get_class(dtype_base, TRUE)) == H5T_NO_CLASS) + if ((dtype_base_class = H5T_get_class(dtype_base, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad base datatype class"); /* Call appropriate function according to base datatype's class */ @@ -604,7 +604,7 @@ done: */ static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) + bool *need_not_compress) { int snmembers; /* Compound datatype's number of members */ unsigned nmembers; /* Compound datatype's number of members */ @@ -645,7 +645,7 @@ H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned c HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad member datatype"); /* Get member datatype's class */ - if ((dtype_member_class = H5T_get_class(dtype_member, TRUE)) < 0) + if ((dtype_member_class = H5T_get_class(dtype_member, true)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad member datatype class"); /* Get member offset, success if H5T_get_class() success */ @@ -758,7 +758,7 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) unsigned *cd_values = NULL; /* Filter parameters */ hssize_t npoints; /* Number of points in the dataspace */ H5T_class_t dtype_class; /* Datatype's class */ - hbool_t need_not_compress; /* Flag if TRUE indicating no need to do nbit compression */ + bool need_not_compress; /* Flag if true indicating no need to do nbit compression */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -768,13 +768,13 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Get datatype's class */ - if ((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) + if ((dtype_class = H5T_get_class(type, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class"); /* Calculate how many parameters will fill the cd_values array * First three parameters reserved for: * 1. number of parameters in array cd_values - * 2. flag if TRUE indicating no need to do nbit compression + * 2. flag if true indicating no need to do nbit compression * 3. number of elements in the chunk */ cd_values_actual_nparms = 3; @@ -845,8 +845,8 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5_CHECK_OVERFLOW(npoints, hssize_t, unsigned); cd_values[cd_values_index++] = (unsigned)npoints; - /* Assume no need to compress now, will be changed to FALSE later if not */ - need_not_compress = TRUE; + /* Assume no need to compress now, will be changed to false later if not */ + need_not_compress = true; /* Call appropriate function according to the datatype class */ switch (dtype_class) { diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 1662738..82dcdea 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -99,7 +99,7 @@ H5_DLL herr_t H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop); H5_DLL herr_t H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop); H5_DLL herr_t H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size, const H5T_t *buf_type); -H5_DLL hbool_t H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop); +H5_DLL bool H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop); H5_DLL const char *H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop); #endif diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 6d9b991..d906e3c 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -286,7 +286,7 @@ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); * H5Z_FILTER_CONFIG_ENCODE_ENABLED & filter_config_flags * \endcode * is true, i.e., greater than 0 (zero), the queried filter - * is configured to encode data; if the value is \c FALSE, i.e., equal to + * is configured to encode data; if the value is \c false, i.e., equal to * 0 (zero), the filter is not so configured. * * If a filter is not encode-enabled, the corresponding \c H5Pset_* diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index c3de6a6..bfcbbb0 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -757,7 +757,7 @@ H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5 const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -766,7 +766,7 @@ H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5 HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Get datatype's class, for checking the "datatype class" */ - if ((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) + if ((dtype_class = H5T_get_class(type, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class"); /* Get datatype's size, for checking the "datatype size" */ @@ -780,10 +780,10 @@ H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5 /* Range check datatype's endianness order */ if (dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FALSE, "bad datatype endianness order"); + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, false, "bad datatype endianness order"); } else - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FALSE, "datatype class not supported by scaleoffset"); + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, false, "datatype class not supported by scaleoffset"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -966,7 +966,7 @@ H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5_CHECKED_ASSIGN(cd_values[H5Z_SCALEOFFSET_PARM_NELMTS], unsigned, npoints, hssize_t); /* Get datatype's class */ - if ((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) + if ((dtype_class = H5T_get_class(type, true)) == H5T_NO_CLASS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class"); /* Set "local" parameter for datatype's class */ @@ -1054,13 +1054,13 @@ H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) if (status == H5D_FILL_VALUE_UNDEFINED) cd_values[H5Z_SCALEOFFSET_PARM_FILAVAIL] = H5Z_SCALEOFFSET_FILL_UNDEFINED; else { - int need_convert = FALSE; /* Flag indicating conversion of byte order */ + int need_convert = false; /* Flag indicating conversion of byte order */ cd_values[H5Z_SCALEOFFSET_PARM_FILAVAIL] = H5Z_SCALEOFFSET_FILL_DEFINED; /* Check if memory byte order matches dataset datatype byte order */ if (H5T_native_order_g != dtype_order) - need_convert = TRUE; + need_convert = true; /* Before getting fill value, get its type */ if ((scale_type = H5Z__scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], @@ -1109,7 +1109,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu uint32_t minbits = 0; /* minimum number of bits to store values */ unsigned long long minval = 0; /* minimum value of input buffer */ enum H5Z_scaleoffset_t type; /* memory type corresponding to dataset datatype */ - int need_convert = FALSE; /* flag indicating conversion of byte order */ + int need_convert = false; /* flag indicating conversion of byte order */ unsigned char *outbuf = NULL; /* pointer to new output buffer */ unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ @@ -1125,12 +1125,12 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu switch (H5T_native_order_g) { case H5T_ORDER_LE: /* memory is little-endian byte order */ if (cd_values[H5Z_SCALEOFFSET_PARM_ORDER] == H5Z_SCALEOFFSET_ORDER_BE) - need_convert = TRUE; + need_convert = true; break; case H5T_ORDER_BE: /* memory is big-endian byte order */ if (cd_values[H5Z_SCALEOFFSET_PARM_ORDER] == H5Z_SCALEOFFSET_ORDER_LE) - need_convert = TRUE; + need_convert = true; break; case H5T_ORDER_ERROR: diff --git a/src/H5Zszip.c b/src/H5Zszip.c index d636afd..052efa8 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -71,7 +71,7 @@ H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_U const H5T_t *type; /* Datatype */ size_t dtype_size; /* Datatype's size (in bits) */ H5T_order_t dtype_order; /* Datatype's endianness order */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = true; /* Return value */ FUNC_ENTER_PACKAGE @@ -85,7 +85,7 @@ H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_U /* Range check datatype's size */ if (dtype_size > 32 && dtype_size != 64) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype size"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, false, "invalid datatype size"); /* Get datatype's endianness order */ if ((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) @@ -94,7 +94,7 @@ H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_U /* Range check datatype's endianness order */ /* (Note: this may not handle non-atomic datatypes well) */ if (dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype endianness order"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, false, "invalid datatype endianness order"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 8839897..3b0d79c 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -86,8 +86,8 @@ static H5Z_node *H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_p static H5Z_node *H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); static H5Z_node *H5Z__new_node(H5Z_token_type type); static void H5Z__do_op(H5Z_node *tree); -static hbool_t H5Z__op_is_numbs(H5Z_node *_tree); -static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree); +static bool H5Z__op_is_numbs(H5Z_node *_tree); +static bool H5Z__op_is_numbs2(H5Z_node *_tree); static hid_t H5Z__xform_find_type(const H5T_t *type); static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res); static void H5Z__xform_destroy_parse_tree(H5Z_node *tree); @@ -1130,46 +1130,46 @@ H5Z__xform_find_type(const H5T_t *type) assert(type); /* Check for SHORT type */ - if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) + if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_SHORT); /* Check for INT type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_INT); /* Check for LONG type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_LONG); /* Check for LONGLONG type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LLONG)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_LLONG); /* Check for UCHAR type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_UCHAR); /* Check for CHAR type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_CHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_CHAR)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_CHAR); /* Check for SCHAR type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_SCHAR); /* Check for USHORT type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_USHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_USHORT)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_USHORT); /* Check for UINT type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UINT)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UINT)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_UINT); /* Check for ULONG type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULONG)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULONG)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_ULONG); /* Check for ULONGLONG type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_ULLONG); /* Check for FLOAT type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_FLOAT); /* Check for DOUBLE type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_DOUBLE); /* Check for LONGDOUBLE type */ - else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) + else if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE)) && 0 == H5T_cmp(type, tmp, false)) HGOTO_DONE(H5T_NATIVE_LDOUBLE); else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not find matching type"); @@ -1250,14 +1250,14 @@ done: * Purpose: Internal function to facilitate the condition check in * H5Z__xform_reduce_tree to reduce the bulkiness of the code. * - * Return: TRUE or FALSE + * Return: true or false * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5Z__op_is_numbs(H5Z_node *_tree) { - hbool_t ret_value = FALSE; + bool ret_value = false; FUNC_ENTER_PACKAGE_NOERR @@ -1265,7 +1265,7 @@ H5Z__op_is_numbs(H5Z_node *_tree) if (((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } @@ -1278,14 +1278,14 @@ H5Z__op_is_numbs(H5Z_node *_tree) * The difference from H5Z__op_is_numbs is that the left child * can be empty, like -x or +x. * - * Return: TRUE or FALSE + * Return: true or false * *------------------------------------------------------------------------- */ -static hbool_t +static bool H5Z__op_is_numbs2(H5Z_node *_tree) { - hbool_t ret_value = FALSE; + bool ret_value = false; FUNC_ENTER_PACKAGE_NOERR @@ -1297,7 +1297,7 @@ H5Z__op_is_numbs2(H5Z_node *_tree) ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))))) - ret_value = TRUE; + ret_value = true; FUNC_LEAVE_NOAPI(ret_value) } @@ -1608,26 +1608,26 @@ done: * * Purpose: Checks if a data transform will be performed * - * Return: TRUE for no data transform, FALSE for a data transform + * Return: true for no data transform, false for a data transform * * Comments: Can't fail * *------------------------------------------------------------------------- */ -hbool_t +bool H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) { - hbool_t ret_value = TRUE; /* Return value */ + bool ret_value = true; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR if (data_xform_prop) { - ret_value = FALSE; + ret_value = false; /* Check for trivial data transformation: expression = "x" */ if ((HDstrlen(data_xform_prop->xform_exp) == 1) && data_xform_prop->dat_val_pointers && (data_xform_prop->dat_val_pointers->num_ptrs == 1)) { - ret_value = TRUE; + ret_value = true; } /* end if */ } /* end if */ diff --git a/src/H5checksum.c b/src/H5checksum.c index b9823d8..66a6c86 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -65,7 +65,7 @@ static uint32_t H5_crc_table[256]; /* Flag: has the table been computed? */ -static hbool_t H5_crc_table_computed = FALSE; +static bool H5_crc_table_computed = false; /*------------------------------------------------------------------------- * Function: H5_checksum_fletcher32 @@ -162,7 +162,7 @@ H5__checksum_crc_make_table(void) c = c >> 1; H5_crc_table[n] = c; } - H5_crc_table_computed = TRUE; + H5_crc_table_computed = true; FUNC_LEAVE_NOAPI_VOID } /* end H5__checksum_crc_make_table() */ diff --git a/src/H5mpi.c b/src/H5mpi.c index 8fd7252..29c9f39 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -335,11 +335,11 @@ done: herr_t H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result) { - hbool_t same = FALSE; - char *key = NULL; - char *value1 = NULL; - char *value2 = NULL; - herr_t ret_value = SUCCEED; + bool same = false; + char *key = NULL; + char *value1 = NULL; + char *value2 = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -350,12 +350,12 @@ H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result) /* Check for MPI_INFO_NULL */ if (MPI_INFO_NULL == info1 && MPI_INFO_NULL == info2) { /* Special case of both info objects being MPI_INFO_NULL */ - same = TRUE; + same = true; } else if (MPI_INFO_NULL == info1 || MPI_INFO_NULL == info2) { /* Special case of one info object being MPI_INFO_NULL */ - same = FALSE; + same = false; } else { int mpi_code; @@ -369,9 +369,9 @@ H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result) HMPI_GOTO_ERROR(FAIL, "MPI_Info_get_nkeys failed", mpi_code) if (nkeys_1 != nkeys_2) - same = FALSE; + same = false; else if (0 == nkeys_1 && 0 == nkeys_2) - same = TRUE; + same = true; else { int i; int flag1 = -1; @@ -388,7 +388,7 @@ H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result) /* Iterate over the keys, comparing them */ for (i = 0; i < nkeys_1; i++) { - same = TRUE; + same = true; /* Memset the buffers to zero */ memset(key, 0, MPI_MAX_INFO_KEY); @@ -407,7 +407,7 @@ H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result) /* Compare values and flags */ if (!flag1 || !flag2 || memcmp(value1, value2, MPI_MAX_INFO_VAL)) { - same = FALSE; + same = false; break; } @@ -576,8 +576,8 @@ done: * MPI_(All)gatherv's `recvtype` parameter. * * `allgather` - Specifies whether the gather operation to be - * performed should be MPI_Allgatherv (TRUE) or - * MPI_Gatherv (FALSE). + * performed should be MPI_Allgatherv (true) or + * MPI_Gatherv (false). * * `root` - For MPI_Gatherv operations, specifies the rank * that will receive the data sent by other ranks. @@ -616,7 +616,7 @@ done: */ herr_t H5_mpio_gatherv_alloc(void *send_buf, int send_count, MPI_Datatype send_type, const int recv_counts[], - const int displacements[], MPI_Datatype recv_type, hbool_t allgather, int root, + const int displacements[], MPI_Datatype recv_type, bool allgather, int root, MPI_Comm comm, int mpi_rank, int mpi_size, void **out_buf, size_t *out_buf_num_entries) { size_t recv_buf_num_entries = 0; @@ -710,7 +710,7 @@ done: */ herr_t H5_mpio_gatherv_alloc_simple(void *send_buf, int send_count, MPI_Datatype send_type, MPI_Datatype recv_type, - hbool_t allgather, int root, MPI_Comm comm, int mpi_rank, int mpi_size, + bool allgather, int root, MPI_Comm comm, int mpi_rank, int mpi_size, void **out_buf, size_t *out_buf_num_entries) { int *recv_counts_disps_array = NULL; @@ -791,7 +791,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required) +H5_mpio_get_file_sync_required(MPI_File fh, bool *file_sync_required) { MPI_Info info_used; int flag; @@ -803,7 +803,7 @@ H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required) assert(file_sync_required); - *file_sync_required = FALSE; + *file_sync_required = false; if (MPI_SUCCESS != MPI_File_get_info(fh, &info_used)) HGOTO_ERROR(H5E_LIB, H5E_CANTGET, FAIL, "can't get MPI info"); @@ -813,7 +813,7 @@ H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required) HGOTO_ERROR(H5E_LIB, H5E_CANTGET, FAIL, "can't get MPI info"); if (flag && !HDstrcmp(value, "false")) - *file_sync_required = TRUE; + *file_sync_required = true; if (MPI_SUCCESS != MPI_Info_free(&info_used)) HGOTO_ERROR(H5E_LIB, H5E_CANTFREE, FAIL, "can't free MPI info"); @@ -821,9 +821,9 @@ H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required) /* Force setting the flag via env variable (temp solution before the flag is implemented in MPI) */ sync_env_var = HDgetenv("HDF5_DO_MPI_FILE_SYNC"); if (sync_env_var && (!HDstrcmp(sync_env_var, "TRUE") || !HDstrcmp(sync_env_var, "1"))) - *file_sync_required = TRUE; + *file_sync_required = true; if (sync_env_var && (!HDstrcmp(sync_env_var, "FALSE") || !HDstrcmp(sync_env_var, "0"))) - *file_sync_required = FALSE; + *file_sync_required = false; done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5private.h b/src/H5private.h index 2a03e11..8157c8a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -334,7 +334,7 @@ * the entire library. */ #define H5_IS_KNOWN_BUFFER_OVERFLOW(skip, ptr, size, buffer_end) \ - (skip ? FALSE : ((ptr) + (size)-1) > (buffer_end)) + (skip ? false : ((ptr) + (size)-1) > (buffer_end)) /* * HDF Boolean type. @@ -550,7 +550,7 @@ typedef struct { H5_timevals_t initial; /* Current interval start time */ H5_timevals_t final_interval; /* Last interval elapsed time */ H5_timevals_t total; /* Total elapsed time for all intervals */ - hbool_t is_running; /* Whether timer is running */ + bool is_running; /* Whether timer is running */ } H5_timer_t; /* Returns library bandwidth as a pretty string */ @@ -1235,9 +1235,9 @@ typedef struct H5_debug_open_stream_t { } H5_debug_open_stream_t; typedef struct H5_debug_t { - FILE *trace; /*API trace output stream */ - hbool_t ttop; /*Show only top-level calls? */ - hbool_t ttimes; /*Show trace event times? */ + FILE *trace; /*API trace output stream */ + bool ttop; /*Show only top-level calls? */ + bool ttimes; /*Show trace event times? */ struct { const char *name; /*package name */ FILE *stream; /*output stream or NULL */ @@ -1255,7 +1255,7 @@ typedef struct H5_debug_t { ((MPI_VERSION > (mpi_version)) || \ ((MPI_VERSION == (mpi_version)) && (MPI_SUBVERSION >= (mpi_subversion)))) -extern hbool_t H5_coll_api_sanity_check_g; +extern bool H5_coll_api_sanity_check_g; #endif /* H5_HAVE_PARALLEL */ extern H5_debug_t H5_debug_g; @@ -1382,8 +1382,8 @@ H5_DLL herr_t H5_trace_args(struct H5RS_str_t *rs, const char *type, va_list ap) * profiling. * * Notes: Every file must have a file-scope variable called - * `initialize_interface_g' of type hbool_t which is initialized - * to FALSE. + * `initialize_interface_g' of type bool which is initialized + * to false. * * Don't use local variable initializers which contain * calls to other library functions since the initializer @@ -1444,8 +1444,8 @@ extern char H5_lib_vers_info_g[]; /* replacement structure for original global variable */ typedef struct H5_api_struct { H5TS_mutex_t init_lock; /* API entrance mutex */ - hbool_t H5_libinit_g; /* Has the library been initialized? */ - hbool_t H5_libterm_g; /* Is the library being shutdown? */ + bool H5_libinit_g; /* Has the library been initialized? */ + bool H5_libterm_g; /* Is the library being shutdown? */ } H5_api_t; /* Macros for accessing the global variables */ @@ -1484,8 +1484,8 @@ extern H5_api_t H5_g; #define H5_API_SET_CANCEL /* extern global variables */ -extern hbool_t H5_libinit_g; /* Has the library been initialized? */ -extern hbool_t H5_libterm_g; /* Is the library being shutdown? */ +extern bool H5_libinit_g; /* Has the library been initialized? */ +extern bool H5_libterm_g; /* Is the library being shutdown? */ /* Macros for accessing the global variables */ #define H5_INIT_GLOBAL (H5_libinit_g) @@ -1508,12 +1508,12 @@ extern hbool_t H5_libterm_g; /* Is the library being shutdown? */ /* Forward declaration of H5CXpush() / H5CXpop() */ /* (Including H5CXprivate.h creates bad circular dependencies - QAK, 3/18/2018) */ H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); +H5_DLL herr_t H5CX_pop(bool update_dxpl_props); #ifndef NDEBUG #define FUNC_ENTER_CHECK_NAME(asrt) \ { \ - static hbool_t func_check = FALSE; \ + static bool func_check = false; \ \ if (!func_check) { \ /* Check function naming status */ \ @@ -1522,7 +1522,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); "H5private.h (this is usually due to an incorrect number of underscores)"); \ \ /* Don't check again */ \ - func_check = TRUE; \ + func_check = true; \ } /* end if */ \ } /* end scope */ #else /* NDEBUG */ @@ -1530,7 +1530,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #endif /* NDEBUG */ #define FUNC_ENTER_COMMON(asrt) \ - hbool_t err_occurred = FALSE; \ + bool err_occurred = false; \ \ FUNC_ENTER_CHECK_NAME(asrt); @@ -1568,13 +1568,13 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); if (H5CX_push() < 0) \ HGOTO_ERROR(H5E_FUNC, H5E_CANTSET, err, "can't set API context"); \ else \ - api_ctx_pushed = TRUE; + api_ctx_pushed = true; /* Use this macro for all "normal" API functions */ #define FUNC_ENTER_API(err) \ { \ { \ - hbool_t api_ctx_pushed = FALSE; \ + bool api_ctx_pushed = false; \ \ FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_INIT(err); \ @@ -1590,7 +1590,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #define FUNC_ENTER_API_NOCLEAR(err) \ { \ { \ - hbool_t api_ctx_pushed = FALSE; \ + bool api_ctx_pushed = false; \ \ FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_INIT(err); \ @@ -1824,12 +1824,12 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); } /*end scope from end of FUNC_ENTER*/ \ FUNC_LEAVE_API_COMMON(ret_value); \ if (api_ctx_pushed) { \ - (void)H5CX_pop(TRUE); \ - api_ctx_pushed = FALSE; \ + (void)H5CX_pop(true); \ + api_ctx_pushed = false; \ } \ H5_POP_FUNC \ if (err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ + (void)H5E_dump_api_stack(true); \ FUNC_LEAVE_API_THREADSAFE \ return (ret_value); \ } \ @@ -1842,7 +1842,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); FUNC_LEAVE_API_COMMON(ret_value); \ H5_POP_FUNC \ if (err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ + (void)H5E_dump_api_stack(true); \ FUNC_LEAVE_API_THREADSAFE \ return (ret_value); \ } \ @@ -1866,7 +1866,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); ; \ } /*end scope from end of FUNC_ENTER*/ \ if (err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ + (void)H5E_dump_api_stack(true); \ FUNC_LEAVE_API_THREADSAFE \ return (ret_value); \ } \ @@ -2081,13 +2081,13 @@ H5_DLL herr_t H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_b MPI_Datatype *new_type); H5_DLL herr_t H5_mpio_gatherv_alloc(void *send_buf, int send_count, MPI_Datatype send_type, const int recv_counts[], const int displacements[], - MPI_Datatype recv_type, hbool_t allgather, int root, MPI_Comm comm, + MPI_Datatype recv_type, bool allgather, int root, MPI_Comm comm, int mpi_rank, int mpi_size, void **out_buf, size_t *out_buf_num_entries); H5_DLL herr_t H5_mpio_gatherv_alloc_simple(void *send_buf, int send_count, MPI_Datatype send_type, - MPI_Datatype recv_type, hbool_t allgather, int root, MPI_Comm comm, + MPI_Datatype recv_type, bool allgather, int root, MPI_Comm comm, int mpi_rank, int mpi_size, void **out_buf, size_t *out_buf_num_entries); -H5_DLL herr_t H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required); +H5_DLL herr_t H5_mpio_get_file_sync_required(MPI_File fh, bool *file_sync_required); #endif /* H5_HAVE_PARALLEL */ /* Functions for debugging */ diff --git a/src/H5public.h b/src/H5public.h index 08ef24d..8fce3f4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -237,6 +237,12 @@ typedef int herr_t; /** * C99-style Boolean type. Successful return values are zero (false) or positive * (true). The typical true value is 1 but don't bet on it. + * + * \deprecated Now that we require C99, hbool_t is typedef'd to C99's bool + * and hbool_t is considered deprecated. Due to its long-standing, + * widespread use, we have no plans to remove the hbool_t typedef + * from the public API, though we will probably switch to using + * bool in the public API starting in the next major release of HDF5. * \attention Boolean functions cannot fail. */ #include @@ -647,7 +653,7 @@ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) * * \details H5is_library_terminating() queries whether the HDF5 library is in * the process of shutting down. The \p is_terminating flag will only - * be set to TRUE after shutdown starts, it will be FALSE before the + * be set to true after shutdown starts, it will be false before the * library has been initialized, while the library is initialized, and * after it has been closed. The value of \p is_terminating is * undefined if this routine fails. @@ -723,8 +729,8 @@ H5_DLL herr_t H5free_memory(void *mem); * will later be freed internally by the HDF5 library. * * The boolean \p clear parameter specifies whether the buffer should - * be initialized. If clear is \c TRUE, all bits in the buffer are to be - * set to 0 (zero); if clear is \c FALSE, the buffer will not be + * be initialized. If clear is \c true, all bits in the buffer are to be + * set to 0 (zero); if clear is \c false, the buffer will not be * initialized. * * This function is intended to have the semantics of malloc() and diff --git a/src/H5system.c b/src/H5system.c index eb233bc..9e44e28 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -61,7 +61,7 @@ /*******************/ /* Track whether tzset routine was called */ -static hbool_t H5_ntzset = FALSE; +static bool H5_ntzset = false; #ifndef H5_HAVE_VASPRINTF /* HDvasprintf provides vasprintf-like function on targets where it is @@ -224,7 +224,7 @@ H5_make_time(struct tm *tm) /* Initialize timezone information */ if (!H5_ntzset) { HDtzset(); - H5_ntzset = TRUE; + H5_ntzset = true; } /* end if */ /* Perform base conversion */ @@ -378,7 +378,7 @@ H5_get_win32_times(H5_timevals_t *tvs /*in,out*/) FILETIME ExitTime; LARGE_INTEGER counts_start; static LARGE_INTEGER counts_freq; - static hbool_t is_initialized = FALSE; + static bool is_initialized = false; BOOL err; assert(tvs); @@ -389,7 +389,7 @@ H5_get_win32_times(H5_timevals_t *tvs /*in,out*/) err = QueryPerformanceFrequency(&counts_freq); if (0 == err) return -1; - is_initialized = TRUE; + is_initialized = true; } /* end if */ /************************* @@ -808,9 +808,9 @@ H5_nanosleep(uint64_t nanosec) /* Windows can't sleep at a ns resolution. Best we can do is ~1 ms. We * don't care about the return value since the second parameter - * (bAlertable) is FALSE, so it will always be zero. + * (bAlertable) is false, so it will always be zero. */ - ignore = SleepEx(dwMilliseconds, FALSE); + ignore = SleepEx(dwMilliseconds, false); #else diff --git a/src/H5timer.c b/src/H5timer.c index c0a945b..c1adf43 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -386,7 +386,7 @@ H5_timer_start(H5_timer_t *timer /*in,out*/) if (H5__timer_get_timevals(&(timer->initial)) < 0) return -1; - timer->is_running = TRUE; + timer->is_running = true; return 0; } /* end H5_timer_start() */ @@ -423,7 +423,7 @@ H5_timer_stop(H5_timer_t *timer /*in,out*/) timer->total.system += timer->final_interval.system; timer->total.user += timer->final_interval.user; - timer->is_running = FALSE; + timer->is_running = false; return 0; } /* end H5_timer_stop() */ diff --git a/src/H5trace.c b/src/H5trace.c index ba84f7a..fa81fb8 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -59,7 +59,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5_trace_args_bool(H5RS_str_t *rs, hbool_t val); +static herr_t H5_trace_args_bool(H5RS_str_t *rs, bool val); static herr_t H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset); static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree); @@ -78,7 +78,7 @@ static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degr /*------------------------------------------------------------------------- * Function: H5_trace_args_bool * - * Purpose: This routine formats an hbool_t and adds the output to + * Purpose: This routine formats an bool and adds the output to * the refcounted string (RS) argument. * * Return: SUCCEED / FAIL @@ -86,11 +86,11 @@ static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degr *------------------------------------------------------------------------- */ static herr_t -H5_trace_args_bool(H5RS_str_t *rs, hbool_t val) +H5_trace_args_bool(H5RS_str_t *rs, bool val) { /* FUNC_ENTER() should not be called */ - if (TRUE == val) + if (true == val) H5RS_acat(rs, "TRUE"); else if (!val) H5RS_acat(rs, "FALSE"); @@ -472,10 +472,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) } /* end switch */ break; - case 'b': /* hbool_t */ + case 'b': /* bool */ { - /* Can't pass hbool_t to va_arg() */ - hbool_t bool_var = (hbool_t)va_arg(ap, int); + /* Can't pass bool to va_arg() */ + bool bool_var = (bool)va_arg(ap, int); H5_trace_args_bool(rs, bool_var); } /* end block */ @@ -897,42 +897,42 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) { H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)va_arg(ap, int); - hbool_t flag_already_displayed = FALSE; + bool flag_already_displayed = false; /* Check for all bit-flags which might be set */ if (nocol_cause_mode & H5D_MPIO_COLLECTIVE) { H5RS_acat(rs, "H5D_MPIO_COLLECTIVE"); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; + flag_already_displayed = true; } /* end if */ /* Display '' if there's no flags set */ @@ -3961,8 +3961,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) H5RS_str_t *rs = NULL; hssize_t i; FILE *out = H5_debug_g.trace; - static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, FALSE}; + static bool is_first_invocation = true; + H5_timer_t function_timer = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, false}; H5_timevals_t function_times = {0.0, 0.0, 0.0}; static H5_timer_t running_timer; H5_timevals_t running_times; @@ -3997,7 +3997,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* Get time for event if the trace times flag is set */ if (is_first_invocation && H5_debug_g.ttimes) { /* Start the library-wide timer */ - is_first_invocation = FALSE; + is_first_invocation = false; H5_timer_init(&running_timer); H5_timer_start(&running_timer); } -- cgit v0.12