Fix: power of 2 size check should apply to size_t type, not uint32_t
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Mar 2012 15:54:13 +0000 (10:54 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Mar 2012 15:54:13 +0000 (10:54 -0500)
commit12bcbbdbd7eb6b3cb111ab91b316b14ac210ceb2
treeafd372ec13bad56059a48eca8acc2e8dda61372c
parent7e3cfcbe9ccfef8837c42efcf5332035814415fc
Fix: power of 2 size check should apply to size_t type, not uint32_t

Fix this by using the much simpler x & (x - 1) check (rather than
hweight(x) == 1).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libringbuffer/backend_internal.h
libringbuffer/ring_buffer_backend.c
This page took 0.024153 seconds and 4 git commands to generate.