From 1bc5ec61d8d960e1679b42f55c8f96992ced34ef Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 23 Sep 2025 19:17:14 -0700 Subject: maint: prefer countof over ARRAY_CARDINALITY * bootstrap.conf (gnulib_modules): Add stdcountof-h. * src/system.h: Include stdcountof.h. (ARRAY_CARDINALITY): Remove definition. * .gitignore (/lib/stdcountof.h): Ignore Gnulib generated file. * src/csplit.c: Use countof instead of ARRAY_CARDINALITY. * src/df.c: Likewise. * src/digest.c: Likewise. * src/dircolors.c: Likewise. * src/factor.c: Likewise. * src/join.c: Likewise. * src/ls.c: Likewise. * src/od.c: Likewise. * src/sort.c: Likewise. * src/stdbuf.c: Likewise. * src/tr.c: Likewise. --- src/factor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/factor.c') diff --git a/src/factor.c b/src/factor.c index 534490e9b..02b02a977 100644 --- a/src/factor.c +++ b/src/factor.c @@ -720,7 +720,7 @@ static int_least16_t const primes_ptab[] = { }; #undef P -enum { PRIMES_PTAB_ENTRIES = ARRAY_CARDINALITY (primes_ptab) - 8 + 1 }; +enum { PRIMES_PTAB_ENTRIES = countof (primes_ptab) - 8 + 1 }; struct primes_dtab { -- cgit v1.2.3