Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
syncsynchalt
11y ago
0 comments
Share
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;
0 comments
No comments yet.