]>
git.ipfire.org Git - thirdparty/shadow.git/commit
lib/, src/, tests/: Use the standard countof() instead of our NITEMS()
countof() is the name blessed by the C Committee for ISO C2y.
Use it if available, and define it if not.
countof() will be provided by GCC 16 and Clang 21.
This is mostly a scripted change:
$ grep -rl NITEMS | xargs sed -i s/NITEMS/countof/;
Apart from the scripted changes, I've adjusted white-space alignment,
and of course the definition at "lib/sizeof.h".
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#subsubsection.0.6.5.4.5>
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#section.0.7.21>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
19 files changed: