From: Paul Eggert Date: Tue, 11 Oct 2022 01:26:05 +0000 (-0700) Subject: stat-time: prefer stdckdint to intprops X-Git-Tag: v1.0~1989 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=fdc66e18fbda0d351c1e9ebafc315176b28653a2;p=gnulib.git 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. * modules/stat-time (Depends-on): Depend on stdckdint, not intprops. --- diff --git a/ChangeLog b/ChangeLog index c918d0e45e..0827f5c772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2022-10-10 Paul Eggert + 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. + * modules/stat-time (Depends-on): Depend on stdckdint, not intprops. + xalloc: remove stray includes + dependencies These used to be needed, but are not needed now. * lib/xalloc.h: Do not include stdlib.h. diff --git a/lib/stat-time.h b/lib/stat-time.h index 6b0088e328..b661196ea5 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -20,9 +20,8 @@ #ifndef STAT_TIME_H #define STAT_TIME_H 1 -#include "intprops.h" - #include +#include #include #include #include @@ -232,7 +231,7 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st) /* Overflow is possible, as Solaris 11 stat can yield tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000. INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */ - if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec)) + if (ckd_add (&ts->tv_sec, q, ts->tv_sec)) { errno = EOVERFLOW; return -1; diff --git a/modules/stat-time b/modules/stat-time index 2f137fc25d..92120ace8c 100644 --- a/modules/stat-time +++ b/modules/stat-time @@ -11,7 +11,7 @@ time errno extensions extern-inline -intprops +stdckdint configure.ac: gl_STAT_TIME