summaryrefslogtreecommitdiffstats
path: root/src/H5Odbg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-12-04 17:32:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-12-04 17:32:43 (GMT)
commita21800d2f25ecd848285ddb00391219fe3b764d3 (patch)
treee1267b801d4da408d0bf70c758bf12808cbfdf3a /src/H5Odbg.c
parentc76724db391db20392c19feed3430da2a8059340 (diff)
downloadhdf5-a21800d2f25ecd848285ddb00391219fe3b764d3.zip
hdf5-a21800d2f25ecd848285ddb00391219fe3b764d3.tar.gz
hdf5-a21800d2f25ecd848285ddb00391219fe3b764d3.tar.bz2
[svn-r13020] Description:
Make number of attributes tracking in object header prefix "live" Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Odbg.c')
-rw-r--r--src/H5Odbg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index 88178a1..a016ec3 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -93,6 +93,7 @@ H5O_assert(const H5O_t *oh)
{
H5O_mesg_t *curr_msg; /* Pointer to current message to examine */
H5O_mesg_t *tmp_msg; /* Pointer to temporary message to examine */
+ hsize_t num_attrs; /* Number of attributes on object */
size_t meta_space; /* Size of header metadata */
size_t mesg_space; /* Size of message raw data */
size_t free_space; /* Size of free space in header */
@@ -101,11 +102,12 @@ H5O_assert(const H5O_t *oh)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_assert)
- /* Initialize the space tracking variables */
+ /* Initialize the tracking variables */
hdr_size = 0;
meta_space = H5O_SIZEOF_HDR_OH(oh) + (H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1));
mesg_space = 0;
free_space = 0;
+ num_attrs = 0;
/* Loop over all chunks in object header */
for(u = 0; u < oh->nchunks; u++) {
@@ -137,6 +139,10 @@ H5O_assert(const H5O_t *oh)
/* Loop over all messages in object header */
for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) {
+ /* Check for attribute message */
+ if(H5O_ATTR_ID == curr_msg->type->id)
+ num_attrs++;
+
/* Accumulate information, based on the type of message */
if(H5O_NULL_ID == curr_msg->type->id)
free_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size;
@@ -168,6 +174,8 @@ H5O_assert(const H5O_t *oh)
HDassert(!(tmp_msg->raw >= curr_msg->raw && tmp_msg->raw < (curr_msg->raw + curr_msg->raw_size)));
} /* end for */
} /* end for */
+ if(oh->version > H5O_VERSION_1)
+ HDassert(oh->nattrs == num_attrs);
/* Sanity check that all the bytes are accounted for */
HDassert(hdr_size == (free_space + meta_space + mesg_space + oh->skipped_mesg_size));