
26 Apr
2018
26 Apr
'18
3:43 a.m.
On Wed, 2018-04-25 at 15:25 +0200, Martin Kletzander wrote:
/* Round up to the next closest power of 2. It will return rounded number or 0 * for 0 or number more than 2^31 (for 32bit unsigned int). */ # define VIR_ROUND_UP_POWER_OF_TWO(value) \ - ((value) > 0 && (value) <= 1U << (sizeof(unsigned int) * 8 - 1) ? \ - 1U << (sizeof(unsigned int) * 8 - count_leading_zeros((value) - 1)) : 0) + ((value) > 0 && (value) <= 1U << (sizeof(unsigned int)* 8 - 1) ? \ + 1U << (sizeof(unsigned int)* 8 - count_leading_zeros((value) - 1)) : 0)
These are clearly wrong. You're going to have to tune your regex so that it doesn't mistake sizeof() invocations for casts. -- Andrea Bolognani / Red Hat / Virtualization