* lib/stat-time.h: Include <stdcountof.h>.
(stat_time_normalize): Use countof.
* modules/stat-time (Depends-on): Add stdcountof-h.
* modules/relocatable-prog-wrapper (Depends-on): Likewise.
2026-05-11 Bruno Haible <bruno@clisp.org>
+ stat-time: Use countof.
+ * lib/stat-time.h: Include <stdcountof.h>.
+ (stat_time_normalize): Use countof.
+ * modules/stat-time (Depends-on): Add stdcountof-h.
+ * modules/relocatable-prog-wrapper (Depends-on): Likewise.
+
setlocale: Use countof.
* lib/setlocale.c: Include <stdcountof.h>.
(setlocale_unixlike, get_main_locale_with_same_language,
#include <errno.h>
#include <stdckdint.h>
+#include <stdcountof.h>
#include <stddef.h>
#include <sys/stat.h>
#include <time.h>
short int const ts_off[] = { STAT_TIMESPEC_OFFSETOF (st_atim),
STAT_TIMESPEC_OFFSETOF (st_mtim),
STAT_TIMESPEC_OFFSETOF (st_ctim) };
- for (int i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
+ for (int i = 0; i < countof (ts_off); i++)
{
struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
long int q = ts->tv_nsec / timespec_hz;
bool
stddef-h
stdckdint-h
+stdcountof-h
stdint-h
stdlib-h
string-h
extensions
extern-inline
stdckdint-h
+stdcountof-h
configure.ac:
gl_STAT_TIME