summaryrefslogtreecommitdiffstats
path: root/src/H5Vprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-03-13 22:12:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-03-13 22:12:13 (GMT)
commitafd5021ef9dafc99fda0e47774152f4dc2e57a6f (patch)
tree8f1aec9a3037862e13a8325c5e9db3fb999bb38e /src/H5Vprivate.h
parent6763f7c8824fb415493cfdb88155449c4d22d16f (diff)
downloadhdf5-afd5021ef9dafc99fda0e47774152f4dc2e57a6f.zip
hdf5-afd5021ef9dafc99fda0e47774152f4dc2e57a6f.tar.gz
hdf5-afd5021ef9dafc99fda0e47774152f4dc2e57a6f.tar.bz2
[svn-r14738] Description:
Bring r14737 back from the 1.8 branch: Fix bug which would incorrectly encode the member offsets for compound datatypes whose size was between 256 & 511 bytes, when the "use the latest format" feature was enabled. Tested on: Mac OS X/32 10.5.2 (amazon) w/debug FreeBSD/32 6.2 (duty) w/production
Diffstat (limited to 'src/H5Vprivate.h')
-rw-r--r--src/H5Vprivate.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index 94b3699..b92266c 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -410,5 +410,25 @@ H5V_log2_of2(uint32_t n)
return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]);
} /* H5V_log2_of2() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5V_limit_enc_size
+ *
+ * Purpose: Determine the # of bytes needed to encode values within a
+ * range from 0 to a given limit
+ *
+ * Return: Number of bytes needed
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, March 13, 2008
+ *
+ *-------------------------------------------------------------------------
+ */
+static H5_inline unsigned UNUSED
+H5V_limit_enc_size(uint64_t limit)
+{
+ return (H5V_log2_gen(limit) / 8) + 1;
+} /* end H5V_limit_enc_size() */
+
#endif /* H5Vprivate_H */