summaryrefslogtreecommitdiffstats
path: root/src/H5HFcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-22 20:00:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-22 20:00:43 (GMT)
commit06ae330cd842f7e8cf573cbde5917fc42d93beb0 (patch)
tree69198b55af920b756e5e98efa4860498e5e017f6 /src/H5HFcache.c
parent952c60946cc4a91f30b456519568184bed6ce75b (diff)
downloadhdf5-06ae330cd842f7e8cf573cbde5917fc42d93beb0.zip
hdf5-06ae330cd842f7e8cf573cbde5917fc42d93beb0.tar.gz
hdf5-06ae330cd842f7e8cf573cbde5917fc42d93beb0.tar.bz2
[svn-r12614] Description:
Various minor reformatting & code cleanups. Tested On: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5HFcache.c')
-rw-r--r--src/H5HFcache.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 5da8197..4908d4b 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -388,19 +388,19 @@ HDfprintf(stderr, "%s: Load heap header, addr = %a\n", FUNC, addr);
/* Set the heap header's size */
hdr->heap_size = size;
+ /* Compute checksum on entire header */
+ /* (including the filter information, if present) */
+ computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf));
+
/* Metadata checksum */
UINT32DECODE(p, stored_chksum);
/* Sanity check */
HDassert((size_t)(p - buf) == hdr->heap_size);
- /* Compute checksum on entire header */
- /* (including the filter information, if present) */
- computed_chksum = H5_checksum_metadata(buf, (hdr->heap_size - H5HF_SIZEOF_CHKSUM));
-
/* Verify checksum */
if(stored_chksum != computed_chksum)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect metadata checksum for fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap header")
/* Finish initialization of heap header */
if(H5HF_hdr_finish_init(hdr) < 0)
@@ -525,7 +525,7 @@ HDfprintf(stderr, "%s: Flushing heap header, addr = %a, destroy = %u\n", FUNC, a
} /* end if */
/* Compute metadata checksum */
- metadata_chksum = H5_checksum_metadata(buf, hdr->heap_size - H5HF_SIZEOF_CHKSUM);
+ metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf));
/* Metadata checksum */
UINT32ENCODE(p, metadata_chksum);
@@ -819,18 +819,18 @@ HDfprintf(stderr, "%s: iblock->ents[%Zu] = {%a}\n", FUNC, u, iblock->ents[u].add
/* Sanity check */
HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */
+ /* Compute checksum on indirect block */
+ computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf));
+
/* Metadata checksum */
UINT32DECODE(p, stored_chksum);
/* Sanity check */
HDassert((size_t)(p - buf) == iblock->size);
- /* Compute checksum on indirect block */
- computed_chksum = H5_checksum_metadata(buf, (iblock->size - H5HF_SIZEOF_CHKSUM));
-
/* Verify checksum */
if(stored_chksum != computed_chksum)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect metadata checksum for fractal heap indirect block")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block")
/* Check if we have any indirect block children */
if(iblock->nrows > hdr->man_dtable.max_direct_rows) {
@@ -973,7 +973,7 @@ HDfprintf(stderr, "%s: iblock->filt_ents[%Zu] = {%Zu, %x}\n", FUNC, u, iblock->f
} /* end for */
/* Compute checksum */
- metadata_chksum = H5_checksum_metadata(buf, iblock->size - H5HF_SIZEOF_CHKSUM);
+ metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf));
/* Metadata checksum */
UINT32ENCODE(p, metadata_chksum);
@@ -1239,7 +1239,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, NULL, "I/O filters not supported yet")
/* Verify checksum */
if(stored_chksum != computed_chksum)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "incorrect metadata checksum for fractal heap direct block")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap direct block")
} /* end if */
/* Sanity check */