summaryrefslogtreecommitdiffstats
path: root/src/H5HFdtable.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-21 14:51:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-21 14:51:16 (GMT)
commit143cfe24b447f7470c8e25852bfec5705f6b7f47 (patch)
treee6e5de769a7248cc13a655cd63e157e7c76c917c /src/H5HFdtable.c
parentfc409b2cd0ef53cb6dea21a2f3b8398e9f4f804e (diff)
downloadhdf5-143cfe24b447f7470c8e25852bfec5705f6b7f47.zip
hdf5-143cfe24b447f7470c8e25852bfec5705f6b7f47.tar.gz
hdf5-143cfe24b447f7470c8e25852bfec5705f6b7f47.tar.bz2
[svn-r12602] Description:
Correct bug in doubling table algorithm which was generating incorrect row & column for offset larger than could be represented in 32 bits. Also, beef up the error checking in direct block code a bit Tested On: FreeBSD/32 4.11 (sleipnir) Linux/32 2.4 (heping) Linux/64 2.4 (mir) Solaris/64 2.9 (shanti)
Diffstat (limited to 'src/H5HFdtable.c')
-rw-r--r--src/H5HFdtable.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c
index 700ae9e..80ec8b1 100644
--- a/src/H5HFdtable.c
+++ b/src/H5HFdtable.c
@@ -160,6 +160,9 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
HDassert(dtable);
HDassert(row);
HDassert(col);
+#ifdef QAK
+HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off);
+#endif /* QAK */
/* Check for offset in first row */
if(off < dtable->num_id_first_row) {
@@ -168,8 +171,11 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
} /* end if */
else {
unsigned high_bit = H5V_log2_gen(off); /* Determine the high bit in the offset */
- hsize_t off_mask = 1 << high_bit; /* Compute mask for determining column */
+ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */
+#ifdef QAK
+HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask);
+#endif /* QAK */
*row = (high_bit - dtable->first_row_bits) + 1;
*col = (off - off_mask) / dtable->row_block_size[*row];
} /* end else */