bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl
We had two copies of a ffs function for longs with subtly different semantics and, for the one in bitops.h, a confusing name: the result was off-by-one compared to the library function ffsl. Unify the functions into one, and solve the name problem by calling the 0-based functions "bitops_ctzl" and "bitops_ctol" respectively. This also fixes the build on platforms with ffsl, including Mac OS X and Windows. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Tested-by:
Andreas Färber <afaerber@suse.de> Tested-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
Showing
- include/qemu/bitops.h 22 additions, 33 deletionsinclude/qemu/bitops.h
- include/qemu/hbitmap.h 1 addition, 1 deletioninclude/qemu/hbitmap.h
- include/qemu/host-utils.h 0 additions, 26 deletionsinclude/qemu/host-utils.h
- memory.c 2 additions, 2 deletionsmemory.c
- util/bitops.c 2 additions, 2 deletionsutil/bitops.c
- util/hbitmap.c 1 addition, 1 deletionutil/hbitmap.c
Loading
Please register or sign in to comment