chiark / gitweb /
shared: add ALIGN_POWER2 macro
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 13 May 2014 17:47:58 +0000 (19:47 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 13 May 2014 20:05:32 +0000 (22:05 +0200)
commit625e870b4fb7ff4caf4d8a4614e9bda7c174b291
tree733373c564bac30ae2c0f4e2a38ae6f44431e19c
parentead349509e325aad720bb0349521a9e56e2ac7c0
shared: add ALIGN_POWER2 macro

Sounds easy, turns out to be horrible to implement: ALIGN_POWER2 returns
the next higher power of 2. clz(0) is undefined, same is true for
left-shift-overflows, yey, C rocks!
src/shared/macro.h
src/test/test-util.c