]> git.ipfire.org Git - thirdparty/libvirt.git/commit
internal: add macro to round value to the next closest power of 2
authorPavel Hrdina <phrdina@redhat.com>
Tue, 18 Nov 2014 16:13:38 +0000 (17:13 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 24 Nov 2014 21:05:55 +0000 (22:05 +0100)
commitff28ebf13622ec3667f63fc0c0c22698331ced4b
tree05e37e4e4bd8665133f68846d3875b84dad8dff9
parent3a04f7399766649dd4107df28c5226273ee61198
internal: add macro to round value to the next closest power of 2

There are two special cases, if the input number is 0 or the number is
larger then 2^31 (for 32bit unsigned int). For the special cases the
return value is 0 because they cannot be rounded.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
bootstrap.conf
src/internal.h
tests/utiltest.c