diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-06-01 15:43:13 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-06-01 15:43:13 (GMT) |
commit | 1ac9bcaaa60c0a01c1d9bfa21baea47cbdc663e1 (patch) | |
tree | db43c36c515a9c1f16077c7fdc34c353d1e34d0e /src | |
parent | 9ff455820324f2f39f69a12c9bb0be38b011a688 (diff) | |
download | hdf5-1ac9bcaaa60c0a01c1d9bfa21baea47cbdc663e1.zip hdf5-1ac9bcaaa60c0a01c1d9bfa21baea47cbdc663e1.tar.gz hdf5-1ac9bcaaa60c0a01c1d9bfa21baea47cbdc663e1.tar.bz2 |
[svn-r27129] Fix warnings in H5Tbit
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Tbit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 79cf3a6..5322959 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -82,7 +82,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, 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); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); src_offset += nbits; if(src_offset >= 8) { @@ -141,7 +141,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, 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); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); src_offset += nbits; if(src_offset >= 8) { @@ -376,9 +376,11 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) unsigned mask = ((unsigned)1 << nbits) - 1; if(value) - buf[idx++] |= (uint8_t)(mask << offset); + buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); else - buf[idx++] &= (uint8_t)(~(mask << offset)); + buf[idx] &= (uint8_t)(~(mask << offset)); + + idx++; size -= nbits; } /* end if */ @@ -551,7 +553,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) acc++; carry = acc & ((unsigned)1 << MIN(size, 8 - start)); buf[idx] &= (uint8_t)(~(mask << start)); - buf[idx] |= (uint8_t)((acc & mask) << start); + buf[idx] = (uint8_t)(buf[idx] | ((acc & mask) << start)); size -= MIN(size, 8 - start); start = 0; idx++; |