]> git.ipfire.org Git - thirdparty/gnulib.git/commit
stdcountof-h: always return size_t
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jun 2025 01:58:24 +0000 (18:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jun 2025 01:58:24 +0000 (18:58 -0700)
commita11064bb7c2e8a5d77cc4fdc9316ad2b2810e477
treedc8bc9bfcb3b8f90537674cac8ddef0d2411bcfe
parent073f99896898b757c7c2cdcff82cfedb440346f6
stdcountof-h: always return size_t

* lib/stdcountof.in.h (__SIZE_TYPE__): Define to size_t,
including stddef.h to get it, if not already defined.
This avoids a bit of namespace pollution.
All uses of size_t changed to use __SIZE_TYPE__.
(countof): Return size_t, even if size_t is narrower than int (!).
While we’re at it, simplify ‘sizeof ((a)[0])’ to ‘sizeof *(a)’
as it’s simpler and later code uses the ‘*(a)’ notation already.
ChangeLog
lib/stdcountof.in.h