summaryrefslogtreecommitdiffstats
path: root/src/H5Tbit.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2011-10-21 23:05:15 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2011-10-21 23:05:15 (GMT)
commit69bdd6b90a9b087014aab2e1a9aa787ccf3b4af1 (patch)
treee114ebe00825fef067b2930da92b631cf247ec78 /src/H5Tbit.c
parent027735d9128f73147e8977c66c3249d00abd48ca (diff)
downloadhdf5-69bdd6b90a9b087014aab2e1a9aa787ccf3b4af1.zip
hdf5-69bdd6b90a9b087014aab2e1a9aa787ccf3b4af1.tar.gz
hdf5-69bdd6b90a9b087014aab2e1a9aa787ccf3b4af1.tar.bz2
[svn-r21650] Changed unsigned int to size_t in several places for agreement with the input parameter. Quiets warnings from Visual Studio 2008.
Trivial change but tested on 32-bit linux (jam), 64-bit linux (koala), 64-bit Solaris/Sun CC (linew), 64-bit Windows 7 (kituo) just to be safe.
Diffstat (limited to 'src/H5Tbit.c')
-rw-r--r--src/H5Tbit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index a52d538..3f8e5f9 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -46,9 +46,9 @@ void
H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src,
size_t src_offset, size_t size)
{
- unsigned shift;
- unsigned mask_lo, mask_hi;
- unsigned s_idx, d_idx;
+ size_t shift;
+ size_t mask_lo, mask_hi;
+ size_t s_idx, d_idx;
/*
* Normalize the offset to be a byte number and a bit offset within that
@@ -76,8 +76,8 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src,
* dst[d_idx+1] dst[d_idx]
*/
while(src_offset && size > 0) {
- unsigned nbits = MIN3(size, 8 - dst_offset, 8 - src_offset);
- unsigned mask = ((unsigned)1 << nbits) - 1;
+ size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset);
+ size_t mask = ((size_t)1 << nbits) - 1;
dst[d_idx] &= (uint8_t)~(mask << dst_offset);
dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset);
@@ -119,7 +119,7 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src,
* to line up with the destination.
*/
shift = dst_offset;
- mask_lo = ((unsigned)1 << (8 - shift)) - 1;
+ mask_lo = ((size_t)1 << (8 - shift)) - 1;
mask_hi = (~mask_lo) & 0xff;
for(/*void*/; size > 8; size -= 8, d_idx++, s_idx++) {
@@ -135,8 +135,8 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src,
/* Finish up */
while(size > 0) {
- unsigned nbits = (unsigned)MIN3 (size, 8 - dst_offset, 8 - src_offset);
- unsigned mask = ((unsigned)1 << nbits) - 1;
+ size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset);
+ size_t mask = ((size_t)1 << nbits) - 1;
dst[d_idx] &= (uint8_t)(~(mask << dst_offset));
dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset);