working with stricter compiler flags
This commit is contained in:
parent
a15accf4eb
commit
12ad949df8
2 changed files with 14 additions and 10 deletions
|
|
@ -329,10 +329,12 @@ CAPN_INLINE int capn_write1(capn_ptr p, int off, int val) {
|
|||
if (off >= p.datasz*8) {
|
||||
return -1;
|
||||
} else if (val) {
|
||||
((uint8_t*)p.data)[off/8] |= (uint8_t)(1 << (off%8));
|
||||
uint8_t tmp = (uint8_t)(1 << ( off & 7));
|
||||
( (uint8_t*)p.data )[off>>3] |= tmp;
|
||||
return 0;
|
||||
} else {
|
||||
((uint8_t*)p.data)[off/8] &= (uint8_t)~(1 << (off%8));
|
||||
uint8_t tmp = (uint8_t)(~(1 << ( off & 7)));
|
||||
((uint8_t*)p.data)[off>>3] &= tmp;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue