4 ms·
Same, I'd write it out using modulo and would assume the compiler would figure it out. void *p = x; p += 7; p -= (p%8); Now that I've written it o
by syncsynchalt 12y ago
Same, I'd write it out using modulo and would assume the compiler would figure it out.
void *p = x;
p += 7;
p -= (p%8);
Now that I've written it out I suppose it's not any clearer than the mask method:
void *p = x;
p += 7;
p &= ~7;
- deleted 12y ago[deleted]