basic/logarithm: add popcount() wrapper
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 3 Apr 2023 12:32:39 +0000 (14:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Apr 2023 08:02:30 +0000 (10:02 +0200)
commita12bc99ef0fc04fa48767c891f7a6db6404e51d5
treef5840c3081c8aea6cddd557635313a2ab2d426a4
parent6eccc3cfa9dcfea3c8b508a66d2d592e6b9fcb93
basic/logarithm: add popcount() wrapper

__builtin_popcount() is a bit of a mouthful, so let's provide a helper.
Using _Generic has the advantage that if a type other then the ones on
the list is given, compilation will fail. This is nice, because if by any
change we pass a wider type, it is rejected immediately instead of being
truncated.

log.h is also needed. It is included transitively, but let's include it
directly.

macro.h is *not* needed.
src/basic/logarithm.h [deleted file]
src/boot/efi/splash.c
src/fundamental/logarithm.h [new file with mode: 0644]
src/shared/tpm2-util.c
src/test/test-logarithm.c