]> Savannah Git Hosting - gnulib.git/commitdiff
stat-time: prefer stdckdint to intprops
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Oct 2022 01:26:05 +0000 (18:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Oct 2022 01:45:24 +0000 (18:45 -0700)
* 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.

ChangeLog
lib/stat-time.h
modules/stat-time

index c918d0e45e77bf1760edb272ebc03fa306215ccb..0827f5c77275183fe809d770b47b52da54745694 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2022-10-10  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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.
index 6b0088e3285863ecb12f0033bb575830cb161368..b661196ea58ca6a3ee1c9da6775fb432e9700f6e 100644 (file)
@@ -20,9 +20,8 @@
 #ifndef STAT_TIME_H
 #define STAT_TIME_H 1
 
-#include "intprops.h"
-
 #include <errno.h>
+#include <stdckdint.h>
 #include <stddef.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -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;
index 2f137fc25dedb51d895514a9f7ac231db66a8a75..92120ace8c9d9dc1cd6bab30d40e843b8ec44fc7 100644 (file)
@@ -11,7 +11,7 @@ time
 errno
 extensions
 extern-inline
-intprops
+stdckdint
 
 configure.ac:
 gl_STAT_TIME