mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[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.
This commit is contained in:
parent
027735d912
commit
69bdd6b90a
16
src/H5Tbit.c
16
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);
|
||||
|
Loading…
Reference in New Issue
Block a user