diff options
Diffstat (limited to 'src/H5Tbit.c')
-rw-r--r-- | src/H5Tbit.c | 16 |
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); |