QuadOptions &= ~(0x3 << (2 * opt));  QuadOptions |= (flag & 0x3) << (2 * opt);
int n = opt/4; int b = (opt % 4) * 2;  QuadOptions[n] &= ~(0x3 << b); QuadOptions[n] |= (flag & 0x3) << b;
void set_quadoption (int opt, int flag){  QuadOptions &= ~(0x3 << (2 * opt)); /* first clear the bits */  QuadOptions |= (flag & 0x3) << (2 * opt); /* now set them */}