]> git.ipfire.org Git - thirdparty/shadow.git/commit
Add WIDTHOF() to get the width in bits
authorAlejandro Colomar <alx@kernel.org>
Wed, 18 Jan 2023 11:38:18 +0000 (12:38 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 28 Jan 2023 03:48:37 +0000 (21:48 -0600)
commit3f90eff4947ffeb7022696ab9861ed3d80bb61d8
tree889834358fe8768770baca5842271d1c90a7dab4
parent1db190cb66339cd2c052ab2f868410455e215b8a
Add WIDTHOF() to get the width in bits

It is common to use the expression 'sizeof(x) * CHAR_BIT' to mean the
width in bits of a type or object.  Now that there are _WIDTH macros for
some types, indicating the number of bits that they use, it makes sense
to wrap this calculation in a macro of a similar name.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/defines.h