by codeflo · 4y ago · 0 comments
*reg &= ~(uint64_t)x;
or, and there’s no elegant way to even write this in C, I might want: *reg &=(uint64_t)(uint8_t)~x;
The fact that I have to write two casts here to undo the damage of the auto-promotion is evidence of how broken this is. *reg &= (uint8_t)~x;
Or: *reg &= ~x & 0xFF;