diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-06-17 11:48:34 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-06-17 11:48:34 (GMT) |
commit | fb27787c2abb889a2184bb39eead626a144117d0 (patch) | |
tree | 7ad16361ac8b2382f0ccf72ce47aae020fed688c /src/H5Tbit.c | |
parent | 984ecb72c2fa62d233383b24047e04061754ae34 (diff) | |
parent | 6e9e9e0dd200979642de8d2a2bce2f66f9728237 (diff) | |
download | hdf5-fb27787c2abb889a2184bb39eead626a144117d0.zip hdf5-fb27787c2abb889a2184bb39eead626a144117d0.tar.gz hdf5-fb27787c2abb889a2184bb39eead626a144117d0.tar.bz2 |
[svn-r27222] Merge of r27035-27221 from the trunk.
Tested on 64-bit linux VM:
Serial: C++ and Fortran 2003
Parallel: Fortran
Diffstat (limited to 'src/H5Tbit.c')
-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++; |