summaryrefslogtreecommitdiffstats
path: root/src/H5B2cache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-17 22:21:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-17 22:21:08 (GMT)
commit1bc07c6aaeadd03d73216af25db0cb46db2391e0 (patch)
tree79cfb25eaad5e610b1c10f9a21b27ec9c07685b0 /src/H5B2cache.c
parentdf2fef9759940bf5d80e8aa5a8dcd1251d58d490 (diff)
parent77038a81755bd6c853323ba261c9c671800d7be7 (diff)
downloadhdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.zip
hdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.tar.gz
hdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.tar.bz2
[svn-r18031] Description:
Bring r18030 from merge_metadata_journaling branch to trunk: Bring "brush clearing" changes (whitespace & style issues, mostly) from metadata_journaling branch to the "merging" branch, to converge the trunk and the metadata_journaling branch. Also, some other minor cleanups along the way. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r--src/H5B2cache.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 15dcb26..1d795ec 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -160,10 +160,10 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *ud
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */
uint8_t *buf; /* Pointer to header buffer */
- uint8_t *p; /* Pointer into raw data buffer */
+ const uint8_t *p; /* Pointer into raw data buffer */
H5B2_hdr_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_hdr_load, NULL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_load)
/* Check arguments */
HDassert(f);
@@ -227,7 +227,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *ud
UINT32DECODE(p, stored_chksum);
/* Sanity check */
- HDassert((size_t)(p - buf) == size);
+ HDassert((size_t)(p - (const uint8_t *)buf) == size);
/* Compute checksum on entire header */
computed_chksum = H5_checksum_metadata(buf, (size - H5B2_SIZEOF_CHKSUM), 0);
@@ -280,7 +280,7 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_hdr_flush, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_flush)
/* check arguments */
HDassert(f);
@@ -487,7 +487,7 @@ H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_p
* Purpose: Loads a B-tree internal node from the disk.
*
* Return: Success: Pointer to a new B-tree internal node.
- * Failure: NULL
+ * Failure: NULL
*
* Programmer: Quincey Koziol
* koziol@ncsa.uiuc.edu
@@ -500,7 +500,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda
{
const H5B2_int_load_ud1_t *udata = (const H5B2_int_load_ud1_t *)_udata; /* Pointer to user data */
H5B2_internal_t *internal = NULL; /* Internal node read */
- uint8_t *p; /* Pointer into raw data buffer */
+ const uint8_t *p; /* Pointer into raw data buffer */
uint8_t *native; /* Pointer to native record info */
H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */
uint32_t stored_chksum; /* Stored metadata checksum value */
@@ -508,7 +508,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda
unsigned u; /* Local index variable */
H5B2_internal_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_internal_load, NULL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_load)
/* Check arguments */
HDassert(f);
@@ -589,13 +589,13 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda
} /* end for */
/* Compute checksum on internal node */
- computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - udata->hdr->page), 0);
+ computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - (const uint8_t *)udata->hdr->page), 0);
/* Metadata checksum */
UINT32DECODE(p, stored_chksum);
/* Sanity check parsing */
- HDassert((size_t)(p - udata->hdr->page) <= udata->hdr->node_size);
+ HDassert((size_t)(p - (const uint8_t *)udata->hdr->page) <= udata->hdr->node_size);
/* Verify checksum */
if(stored_chksum != computed_chksum)
@@ -607,6 +607,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda
done:
if(!ret_value && internal)
(void)H5B2_cache_internal_dest(f, internal);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2_cache_internal_load() */ /*lint !e818 Can't make udata a pointer to const */
@@ -629,7 +630,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_internal_flush, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_flush)
/* check arguments */
HDassert(f);
@@ -858,14 +859,14 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v
const uint16_t *nrec = (const uint16_t *)_nrec;
H5B2_hdr_t *hdr = (H5B2_hdr_t *)_hdr; /* B-tree header information */
H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */
- uint8_t *p; /* Pointer into raw data buffer */
+ const uint8_t *p; /* Pointer into raw data buffer */
uint8_t *native; /* Pointer to native keys */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
unsigned u; /* Local index variable */
H5B2_leaf_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_leaf_load, NULL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_load)
/* Check arguments */
HDassert(f);
@@ -926,13 +927,13 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v
} /* end for */
/* Compute checksum on internal node */
- computed_chksum = H5_checksum_metadata(hdr->page, (size_t)(p - hdr->page), 0);
+ computed_chksum = H5_checksum_metadata(hdr->page, (size_t)(p - (const uint8_t *)hdr->page), 0);
/* Metadata checksum */
UINT32DECODE(p, stored_chksum);
/* Sanity check parsing */
- HDassert((size_t)(p - hdr->page) <= hdr->node_size);
+ HDassert((size_t)(p - (const uint8_t *)hdr->page) <= hdr->node_size);
/* Verify checksum */
if(stored_chksum != computed_chksum)
@@ -944,6 +945,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v
done:
if(!ret_value && leaf)
(void)H5B2_cache_leaf_dest(f, leaf);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2_cache_leaf_load() */ /*lint !e818 Can't make udata a pointer to const */
@@ -966,7 +968,7 @@ H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5B2_cache_leaf_flush, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_flush)
/* check arguments */
HDassert(f);