, _ | |
/| | | | |
_/_\_ >_< | |
.-\-/. | | |
/ | | \_ | | |
\ \| |\__(/ | |
/(`---') | | |
/ / \ | | |
_.' \'-' / | | |
`----'`=-=' ' hjw | |
C Thaumaturgy Center | |
You like magic? | |
// Inserts the 'bitfield' from 'v' using a 'mask' and a 'shift'. | |
// shift 3 // shift = 3 - shift define… | |
// bitfield 00000110 | |
// x 10110101 | |
// mask 00011100 | |
// x & ~mask 10100001 | |
// (x & ~mask) | (bitfield << shift) 10111001 | |
static inline uint8_t insert_bitfield(const uint8_t x, const uint8_t bitfield, … | |
return (x & ~mask) | (bitfield << shift); | |
} | |
Get the full database. | |
Got some C magic? Send the spell source to [email protected] | |
Problems reading C? | |
<< back to bitreich.org |