ROUNDUP(9) | NetBSD Kernel Developer's Manual | ROUNDUP(9) |
size
howmany(x, size);
size
roundup(x, size);
size
rounddown(x, size);
size
roundup2(x, size);
int
powerof2(x);
The roundup2() macro also rounds up, but with the assumption that size is a power of two. If x is indeed a power of two, powerof2() return 1.
uint16_t rx; ... rx = roundup2(rx, sizeof(uint32_t));
June 1, 2011 | NetBSD 5.99 |