summaryrefslogtreecommitdiffstats
path: root/src/H5FAcache.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-06-01 16:05:56 (GMT)
committerGitHub <noreply@github.com>2021-06-01 16:05:56 (GMT)
commit7dded355b89ea66451955ee188841dcd14860c82 (patch)
tree561792e0e3af7529c8a5e6a9782bc7ddfbf8eb94 /src/H5FAcache.c
parent62868dabe1010a7b73a37fc7020ab19ced7571a7 (diff)
downloadhdf5-7dded355b89ea66451955ee188841dcd14860c82.zip
hdf5-7dded355b89ea66451955ee188841dcd14860c82.tar.gz
hdf5-7dded355b89ea66451955ee188841dcd14860c82.tar.bz2
VFD SWMR: Sync with develop (#711)
* Brings CMake updates from develop * Brings reduction in pedantic casts from develop * Purges UFAIL from the library (#637) * Committing clang-format changes * Purges UFAIL from the library * H5HL_insert change requested in PR Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes gratuitous (double)x.yF casts (#632) * Committing clang-format changes * Removes gratuitous (double)x.yF casts * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Committing clang-format changes * Cleans up a const warning left over from previous constification (#633) * Committing clang-format changes * Adds consts to a few global variables * Cleans up a const warning left over from previous constification Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Formatted source * Bring over some VOL registration changes * VOL cleanup * H5VL_request_status_t substitutions * H5F.c cleanup * Minor API tweaks from develop * Moves H5G package init/teardown to H5Gint.c * H5G cleanup * H5M cleanup * H5SM cleanup * H5T cleanup * H5R cleanup * H5Lpublic.h cleanup * H5L cleanup * H5O cleanup * H5A, H5CS, and H5AC cleanup * Moved H5A init/teardown code to H5Aint.c * Moves H5D I/O functions to H5D.c * H5D cleanup * Misc minor cleanup * H5P close cleanup * H5Tpublic.h cleanup * Fixes err_compat test * H5PLpublic.h cleanup * Updates H5Ppublic.h * H5Fpublic.h updates * H5A.c cleanup * Brings over H5Aexists and related changes * Brings CMake shell testing changes from develop * Close callback changes * H5R and H5Tcommit normalization * err_compat test works now * H5O tweaks * Updates VOL registration code * Brings over H5VL_create_object * H5Tconv.c reformatting * H5T.c tweaks * Brings datatype and reference updates from develop * Brings VOL plugin loading changes from develop * Brings event sets from develop * Brings async functions over * Tools changes * Brings over many tools changes from develop * Brings VOL flags from develop * Fixes h5dump double/float tests * Updates h5repack tests * Brings h5diff test changes from develop * Last h5dump changes * Brings test changes from develop * Committing clang-format changes * Tidied h5_testing() * Brings chunk iteration code + misc from develop * Updates vds test * Enables external link parallel test * Brings updated property lists from develop * H5G changes from develop * H5MF cleanup * Brings vfd_swmr test back into CMake * Updates threadsafe test * Updates plist test * Brings recent changes from develop * Require a C++11 compiler to build the C++ wrappers (#693) * Committing clang-format changes * Requires a C++11 compiler to build the C++ wrappers Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix H5FD_mpio_Debug="rw" can report MPI_count instead of bytes (#699) * Removes pre-C99 build and header cruft (#700) * Assumes ANSI C headers exist * Assumes stdbool.h, stdint.h, and inttypes.h are present * Assumes the C++ compiler can handle stdint.h * Removes all work-arounds for missing functionality, especially stdbool.h Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Updates release documents * Brings parallel changes from develop * Adds a VFD/parallel check program for the VFD SWMR shell test * Updates MANIFEST * Disable building VFD SWMR acceptance tests on CMake * Removes err.h from genall5.c * Partial cleanup of H5Cpkg.h * Fixes printf specifiers in H5Cdbg.c * Java and fortran cmake changes (#694) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string * Some Javadoc warning fixes * Updated javadoc fixes * # WARNING: head commit changed in the meantime HDFFV-11229 Fix long double usage in tools and java Changed h5dump and h5ls to just print 128-bit for long double type. Added test and file for dataset and attributes with all three float types. * Committing clang-format changes * HDFFV-11229 Add release note * HDFFV-11229 windows testfile needed * fix typo * Remove non supported message text * HDFFV-11229 - change ldouble test to check both native and general * HDFFV-11229 add second file compare * HDFFV-11229 fix reference file * HDFFV-11229 autotools check two refs * HDFFV-11229 revert back to removal of NATIVE_LDOUBLE in tools output * Committing clang-format changes * Update release note * Update attribute type of ref file * Change source of ninja for macs * try port instead of brew * Recommended is to use brew. * Undo non long double changes * remove unneeded file * Fix perl and doxygen CMake code * Add "option" command for clang options * Rework CMake add_custom to use the BYPRODUCTS argument * Add stamp files to BYPRODUCTS * Only one copy of file exists * Fix custom cmmand depends targets * Fix fortran custom command DEPENDS * Add LD_LIBRARY_PATH to tests * Add custom target for DEPENDS * Add h5detect conditionaly to generated target DEPENDS * Correct DEPENDS targets * Parallel builds need the mpi compiler for pkgconfig scripts. * install only if MPI build * Fortran target depends * Remove incorrect source attribute * doxygen adjustments * doxygen build updates * Correct version * Correct function version - function has been merged to 1.12 * Correct version string for map functions * Cleanup warnings for tools debug builds * TRILAB-227 - fix indexing for h5diff selections * Correct location of pos to index function call * TRILAB-227 Enable test * Quote subset args * Use MATCHES because of AppleClang * if blocks needed for build modes * Update list of DT platforms * VS2019 correctly displays float values * revert VS2019 change * Issue #669 remove version from pkgcfg filename * remove version from h5cc script * Java reference functions updated enabled fortran in cmake gcc action yaml file java reference test changed to correctly test refs jni reference functions that create ids changed to use jni id logging * Correct BYPRODUCTS argument * Correct more genereated files BYPRODUCTS * BYPRODUCTS must have unique locations * Fix typo Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes alternative function enter/leave macro scheme (#678) * Committing clang-format changes * Converted BEGIN_FUNC, etc. macros to FUNC_ENTER * Rips out the BEGIN_FUNC, etc. macros * Removes 'end if', etc. comments from H5HL package * Committing clang-format changes * Fixes an H5EA iterate issue * Fixes an issue in the H5FA iterator code * Further cleanup in bin/trace after macro removal * Iterator changes in H5EA and H5FA Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Split H5L.c internal code to H5Lint.c (#691) * Committing clang-format changes * Splits internal parts of H5L.c to H5Lint.c Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Clean up type size checks in configure.ac (#702) * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5FAcache.c')
-rw-r--r--src/H5FAcache.c398
1 files changed, 228 insertions, 170 deletions
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 171f4e8..6975d3d 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -170,12 +170,13 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_hdr_cache_ud_t *udata = (H5FA_hdr_cache_ud_t *)_udata; /* User data for callback */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->f);
@@ -184,7 +185,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5FA_HEADER_SIZE_FILE(udata->f);
-END_FUNC(STATIC) /* end H5FA__cache_hdr_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_verify_chksum
@@ -199,13 +201,15 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
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;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -216,7 +220,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_deserialize
@@ -231,16 +236,18 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t 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 */
H5FA_hdr_cache_ud_t *udata = (H5FA_hdr_cache_ud_t *)_udata;
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(udata);
@@ -249,24 +256,24 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate space for the fixed array data structure */
if (NULL == (hdr = H5FA__hdr_alloc(udata->f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array shared header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array shared header")
/* Set the fixed array header's address */
hdr->addr = udata->addr;
/* Magic number */
if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5FA_HDR_VERSION)
- H5E_THROW(H5E_VERSION, "wrong fixed array header version")
+ HGOTO_ERROR(H5E_FARRAY, H5E_VERSION, NULL, "wrong fixed array header version")
/* Fixed array class */
id = (H5FA_cls_id_t)*image++;
if (id >= H5FA_NUM_CLS_ID)
- H5E_THROW(H5E_BADTYPE, "incorrect fixed array class")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADTYPE, NULL, "incorrect fixed array class")
hdr->cparam.cls = H5FA_client_class_g[id];
/* General array creation/configuration information */
@@ -314,20 +321,20 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Finish initializing fixed array header */
if (H5FA__hdr_init(hdr, udata->ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "initialization failed for fixed array header")
HDassert(hdr->size == len);
/* Set return value */
ret_value = hdr;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (hdr && H5FA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array header")
-END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_image_len
@@ -341,12 +348,13 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_hdr_t *hdr = (const H5FA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -354,7 +362,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = hdr->size;
-END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_serialize
@@ -368,15 +377,16 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the fixed array header */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
- /* check arguments */
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Check arguments */
HDassert(f);
HDassert(image);
HDassert(hdr);
@@ -413,7 +423,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5FA__cache_hdr_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_notify
@@ -427,11 +438,13 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(hdr);
@@ -463,16 +476,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on object header proxy */
if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent,
(void *)hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between fixed array and proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between fixed array and proxy")
hdr->parent = NULL;
} /* end if */
/* Detach from 'top' proxy for fixed array */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_remove_child(hdr->top_proxy, hdr) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between header and fixed array 'top' proxy")
/* Don't reset hdr->top_proxy here, it's destroyed when the header is freed -QAK */
} /* end if */
@@ -480,7 +493,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
@@ -489,9 +502,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
else
HDassert(NULL == hdr->parent);
- CATCH
+done:
-END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_free_icr
@@ -506,18 +520,23 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_hdr_free_icr(void *thing))
+static herr_t
+H5FA__cache_hdr_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array header */
if (H5FA__hdr_dest((H5FA_hdr_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array header")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array header")
-END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_get_initial_load_size
@@ -531,14 +550,15 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_dblock_cache_ud_t *udata = (H5FA_dblock_cache_ud_t *)_udata; /* User data */
H5FA_dblock_t dblock; /* Fake data block for computing size */
size_t dblk_page_nelmts; /* # of elements per data block page */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -567,7 +587,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = (size_t)H5FA_DBLOCK_PREFIX_SIZE(&dblock);
-END_FUNC(STATIC) /* end H5FA__cache_dblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_verify_chksum
@@ -582,13 +603,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
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;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -599,7 +622,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_deserialize
@@ -614,16 +638,18 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t 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 */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -631,7 +657,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the fixed array data block */
if (NULL == (dblock = H5FA__dblock_alloc(udata->hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array data block")
HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) ||
(len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock)));
@@ -641,27 +667,27 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Magic number */
if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5FA_DBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong fixed array data block version")
+ HGOTO_ERROR(H5E_FARRAY, H5E_VERSION, NULL, "wrong fixed array data block version")
/* Fixed array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect fixed array class")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADTYPE, NULL, "incorrect fixed array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong fixed array header address")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header address")
/* Page initialization flags */
if (dblock->npages > 0) {
H5MM_memcpy(dblock->dblk_page_init, image, dblock->dblk_page_init_size);
image += dblock->dblk_page_init_size;
- } /* end if */
+ }
/* Only decode elements if the data block is not paged */
if (!dblock->npages) {
@@ -669,9 +695,9 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblock->elmts, (size_t)udata->hdr->cparam.nelmts,
udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDECODE, NULL, "can't decode fixed array data elements")
image += (udata->hdr->cparam.nelmts * udata->hdr->cparam.raw_elmt_size);
- } /* end if */
+ }
/* Sanity check */
/* (allow for checksum not decoded yet) */
@@ -691,14 +717,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (dblock && H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block")
-END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_image_len
@@ -712,12 +738,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(image_len);
@@ -728,7 +755,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = H5FA_DBLOCK_PREFIX_SIZE(dblock);
-END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_serialize
@@ -742,14 +770,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(f);
@@ -776,7 +805,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Store the 'page init' bitmasks */
H5MM_memcpy(image, dblock->dblk_page_init, dblock->dblk_page_init_size);
image += dblock->dblk_page_init_size;
- } /* end if */
+ }
/* Only encode elements if the data block is not paged */
if (!dblock->npages) {
@@ -786,9 +815,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
H5_CHECK_OVERFLOW(dblock->hdr->cparam.nelmts, /* From: */ hsize_t, /* To: */ size_t);
if ((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, (size_t)dblock->hdr->cparam.nelmts,
dblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTENCODE, FAIL, "can't encode fixed array data elements")
image += (dblock->hdr->cparam.nelmts * dblock->hdr->cparam.raw_elmt_size);
- } /* end if */
+ }
/* Compute metadata checksum */
metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0);
@@ -799,9 +828,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_notify
@@ -815,11 +844,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing;
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing;
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblock);
@@ -832,8 +863,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5FA__create_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_FARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between data block and header, address = %llu",
(unsigned long long)dblock->addr)
break;
@@ -845,35 +876,35 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_CHILD_CLEANED:
case H5AC_NOTIFY_ACTION_CHILD_UNSERIALIZED:
case H5AC_NOTIFY_ACTION_CHILD_SERIALIZED:
- /* do nothing */
break;
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5FA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
/* Detach from 'top' proxy for fixed array */
if (dblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblock->top_proxy, dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block "
- "and fixed array 'top' proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block "
+ "and fixed array 'top' proxy")
dblock->top_proxy = NULL;
- } /* end if */
+ }
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
-#else /* NDEBUG */
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
+#else
HDassert(0 && "Unknown action?!?");
-#endif /* NDEBUG */
+#endif
} /* end switch */
} /* end if */
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_free_icr
@@ -888,20 +919,24 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblock_free_icr(void *_thing))
+static herr_t
+H5FA__cache_dblock_free_icr(void *_thing)
+{
+ H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(dblock);
/* Release the fixed array data block */
if (H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array data block")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array data block")
-END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_fsf_size
@@ -932,11 +967,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size))
-
+static herr_t
+H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)
+{
const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
@@ -945,7 +982,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
*fsf_size = dblock->size;
-END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_fsf_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_get_initial_load_size
@@ -959,12 +997,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_dblk_page_cache_ud_t *udata = (H5FA_dblk_page_cache_ud_t *)_udata; /* User data */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -974,7 +1013,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts);
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblk_page_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_verify_chksum
@@ -989,13 +1029,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
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;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1006,7 +1048,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_deserialize
@@ -1021,18 +1064,19 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5FA_dblk_page_t * dblk_page = NULL; /* Data block page info */
H5FA_dblk_page_cache_ud_t *udata =
(H5FA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
/* Sanity check */
+ FUNC_ENTER_STATIC
+
HDassert(udata);
HDassert(udata->hdr);
HDassert(udata->nelmts > 0);
@@ -1040,7 +1084,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the fixed array data block page */
if (NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for fixed array data block page")
/* Set the fixed array data block's information */
dblk_page->addr = udata->dblk_page_addr;
@@ -1050,7 +1095,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Decode elements in data block page */
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDECODE, NULL, "can't decode fixed array data elements")
image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size);
/* Sanity check */
@@ -1071,14 +1116,15 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblk_page;
- CATCH
+done:
/* Release resources */
if (!ret_value)
if (dblk_page && H5FA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block page")
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_image_len
@@ -1092,12 +1138,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_dblk_page_t *dblk_page = (const H5FA_dblk_page_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblk_page);
HDassert(image_len);
@@ -1105,7 +1152,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = dblk_page->size;
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblk_page_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_serialize
@@ -1119,14 +1167,16 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image,
- size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
+ void *_thing)
+{
H5FA_dblk_page_t *dblk_page = (H5FA_dblk_page_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -1141,7 +1191,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->nelmts,
dblk_page->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTENCODE, FAIL, "can't encode fixed array data elements")
image += (dblk_page->nelmts * dblk_page->hdr->cparam.raw_elmt_size);
/* Compute metadata checksum */
@@ -1153,9 +1203,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_notify
@@ -1169,11 +1219,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing)
+{
H5FA_dblk_page_t *dblk_page = (H5FA_dblk_page_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblk_page);
@@ -1190,8 +1242,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for fixed array */
if (dblk_page->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblk_page->top_proxy, dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block page "
- "and fixed array 'top' proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page "
+ "and fixed array 'top' proxy")
dblk_page->top_proxy = NULL;
} /* end if */
break;
@@ -1207,15 +1260,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_free_icr
@@ -1230,15 +1283,20 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblk_page_free_icr(void *thing))
+static herr_t
+H5FA__cache_dblk_page_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the fixed array data block page */
if (H5FA__dblk_page_dest((H5FA_dblk_page_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array data block page")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array data block page")
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_free_icr() */