diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-23 15:26:25 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-23 15:26:25 (GMT) |
commit | 9c30e7bba121b63c62b2d76c1c0353a5145bdd73 (patch) | |
tree | 7dcc5f620076d83997058f311e0dd019339b9609 /src/H5B2pkg.h | |
parent | 2c7ce93f85905bb31e594f55ab2cd0c125fb36be (diff) | |
download | hdf5-9c30e7bba121b63c62b2d76c1c0353a5145bdd73.zip hdf5-9c30e7bba121b63c62b2d76c1c0353a5145bdd73.tar.gz hdf5-9c30e7bba121b63c62b2d76c1c0353a5145bdd73.tar.bz2 |
[svn-r12619] Description:
Fix off-by-one error in computing the size of metadata prefixes for v2
B-tree internal & leaf nodes.
General code cleanup and reformating.
Tested On:
Mac OS X.4/PPC (amazon)
Too minor to require h5committest
Diffstat (limited to 'src/H5B2pkg.h')
-rw-r--r-- | src/H5B2pkg.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 1ab7129..1b25ce7 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -63,7 +63,7 @@ + H5B2_SIZEOF_CHKSUM /* Metadata checksum */ \ ) -/* Size of the B-tree header on disk */ +/* Size of the v2 B-tree header on disk */ #define H5B2_HEADER_SIZE(f) ( \ /* General metadata fields */ \ H5B2_METADATA_PREFIX_SIZE \ @@ -71,21 +71,39 @@ /* Header specific fields */ \ + 1 /* Tree type */ \ + 4 /* Node size, in bytes */ \ - + 2 /* Key size, in bytes */ \ + + 2 /* Record size, in bytes */ \ + 2 /* Depth of tree */ \ - + 2 /* Split % of full (as integer, ie. "98" means 98%) */ \ - + 2 /* Merge % of full (as integer, ie. "98" means 98%) */ \ + + 1 /* Split % of full (as integer, ie. "98" means 98%) */ \ + + 1 /* Merge % of full (as integer, ie. "98" means 98%) */ \ + H5B2_NODE_POINTER_SIZE(f) /* Node pointer to root node in tree */ \ ) +/* Size of the v2 B-tree internal node prefix */ +#define H5B2_INT_PREFIX_SIZE ( \ + /* General metadata fields */ \ + H5B2_METADATA_PREFIX_SIZE \ + \ + /* Header specific fields */ \ + + 1 /* Tree type */ \ + ) + +/* Size of the v2 B-tree leaf node prefix */ +#define H5B2_LEAF_PREFIX_SIZE ( \ + /* General metadata fields */ \ + H5B2_METADATA_PREFIX_SIZE \ + \ + /* Header specific fields */ \ + + 1 /* Tree type */ \ + ) + /* Macro to retrieve pointer to i'th native record for native record buffer */ -#define H5B2_NAT_NREC(b,shared,idx) (b+(shared)->nat_off[(idx)]) +#define H5B2_NAT_NREC(b, shared, idx) ((b) + (shared)->nat_off[(idx)]) /* Macro to retrieve pointer to i'th native record for internal node */ -#define H5B2_INT_NREC(i,shared,idx) ((i)->int_native+(shared)->nat_off[(idx)]) +#define H5B2_INT_NREC(i, shared, idx) H5B2_NAT_NREC((i)->int_native, (shared), (idx)) /* Macro to retrieve pointer to i'th native record for leaf node */ -#define H5B2_LEAF_NREC(l,shared,idx) ((l)->leaf_native+(shared)->nat_off[(idx)]) +#define H5B2_LEAF_NREC(l, shared, idx) H5B2_NAT_NREC((l)->leaf_native, (shared), (idx)) /****************************/ |