From c72c8888a7db79e8e126629aada87eea82cb8d6e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 10 Oct 2022 18:45:03 -0700 Subject: [PATCH] tests: prefer stdckdint to intprops * modules/chown-tests, modules/fchownat-tests: * modules/fdutimensat-tests, modules/futimens-tests: * modules/lchown-tests, modules/stat-time-tests: * modules/utime-tests, modules/utimens-tests: * modules/utimensat-tests: (Depends on): Depend on stdckint, not intprops. * tests/nap.h: Include stdckdint.h, not intprops.h. All macro uses changed. --- ChangeLog | 10 ++++++++++ modules/chown-tests | 2 +- modules/fchownat-tests | 2 +- modules/fdutimensat-tests | 2 +- modules/futimens-tests | 2 +- modules/lchown-tests | 2 +- modules/stat-time-tests | 2 +- modules/utime-tests | 2 +- modules/utimens-tests | 2 +- modules/utimensat-tests | 2 +- tests/nap.h | 8 ++++---- 11 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0827f5c772..8abee26d10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2022-10-10 Paul Eggert + tests: prefer stdckdint to intprops + * modules/chown-tests, modules/fchownat-tests: + * modules/fdutimensat-tests, modules/futimens-tests: + * modules/lchown-tests, modules/stat-time-tests: + * modules/utime-tests, modules/utimens-tests: + * modules/utimensat-tests: + (Depends on): Depend on stdckint, not intprops. + * tests/nap.h: Include stdckdint.h, not intprops.h. + All macro uses changed. + stat-time: prefer stdckdint to intprops * lib/stat-time.h: Include stdckdint.h instead of intprops.h. (stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV. diff --git a/modules/chown-tests b/modules/chown-tests index 13138f438b..1bd6744067 100644 --- a/modules/chown-tests +++ b/modules/chown-tests @@ -7,12 +7,12 @@ tests/macros.h Depends-on: ignore-value -intprops lstat mgetgroups nanosleep stat-time stdbool +stdckdint symlink configure.ac: diff --git a/modules/fchownat-tests b/modules/fchownat-tests index e5fb7833f4..f0e4cea78c 100644 --- a/modules/fchownat-tests +++ b/modules/fchownat-tests @@ -9,11 +9,11 @@ tests/macros.h Depends-on: errno ignore-value -intprops mgetgroups nanosleep openat-h stat-time +stdckdint symlink configure.ac: diff --git a/modules/fdutimensat-tests b/modules/fdutimensat-tests index 37f70c6528..1f492a6989 100644 --- a/modules/fdutimensat-tests +++ b/modules/fdutimensat-tests @@ -10,9 +10,9 @@ tests/macros.h Depends-on: fcntl-h ignore-value -intprops nanosleep openat +stdckdint timespec dup utimecmp diff --git a/modules/futimens-tests b/modules/futimens-tests index 5191413007..636f8426b6 100644 --- a/modules/futimens-tests +++ b/modules/futimens-tests @@ -10,8 +10,8 @@ Depends-on: gettext-h fcntl-h ignore-value -intprops nanosleep +stdckdint timespec dup utimecmp diff --git a/modules/lchown-tests b/modules/lchown-tests index 42b946014c..edd0cc7c21 100644 --- a/modules/lchown-tests +++ b/modules/lchown-tests @@ -8,9 +8,9 @@ tests/macros.h Depends-on: errno ignore-value -intprops mgetgroups nanosleep +stdckdint stat-time stdbool symlink diff --git a/modules/stat-time-tests b/modules/stat-time-tests index 8db2369513..9fafb9fb9a 100644 --- a/modules/stat-time-tests +++ b/modules/stat-time-tests @@ -4,8 +4,8 @@ tests/macros.h tests/nap.h Depends-on: -intprops nanosleep +stdckdint time unistd diff --git a/modules/utime-tests b/modules/utime-tests index a64d0a0069..3f30f92925 100644 --- a/modules/utime-tests +++ b/modules/utime-tests @@ -8,8 +8,8 @@ Depends-on: dup gettext-h ignore-value -intprops nanosleep +stdckdint symlink timespec utimecmp diff --git a/modules/utimens-tests b/modules/utimens-tests index 2a95346a0d..b3e066f95f 100644 --- a/modules/utimens-tests +++ b/modules/utimens-tests @@ -11,8 +11,8 @@ Depends-on: dup gettext-h ignore-value -intprops nanosleep +stdckdint symlink timespec utimecmp diff --git a/modules/utimensat-tests b/modules/utimensat-tests index 15c79407e8..d713b7052c 100644 --- a/modules/utimensat-tests +++ b/modules/utimensat-tests @@ -9,8 +9,8 @@ tests/macros.h Depends-on: ignore-value -intprops nanosleep +stdckdint timespec utimecmp diff --git a/tests/nap.h b/tests/nap.h index 1320d2f8f8..37f8009c6d 100644 --- a/tests/nap.h +++ b/tests/nap.h @@ -21,7 +21,7 @@ # include -# include +# include /* Avoid a conflict with a function called nap() on UnixWare. */ # if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer, UnixWare */ @@ -54,9 +54,9 @@ diff_timespec (struct timespec a, struct timespec b) if (! (bs < as || (bs == as && bns < ans))) return 0; - if (INT_SUBTRACT_WRAPV (as, bs, &sdiff) - || INT_MULTIPLY_WRAPV (sdiff, 1000000000, &sdiff) - || INT_ADD_WRAPV (sdiff, ans - bns, &sdiff)) + if (ckd_sub (&sdiff, as, bs) + || ckd_mul (&sdiff, sdiff, 1000000000) + || ckd_add (&sdiff, sdiff, ans - bns)) return INT_MAX; return sdiff; -- 2.39.5