Mercurial > gnulib
changeset 37185:32c233e31143
timespec: use the new TIMESPEC_RESOLUTION in a few more places
* lib/timespec-add.c (timespec_add): Also replace 999999999
with TIMESPEC_RESOLUTION - 1.
* lib/timespec-sub.c (timespec_sub): Likewise.
author | Jim Meyering <meyering@fb.com> |
---|---|
date | Sat, 21 Sep 2013 09:11:49 -0700 |
parents | 3f9fcbf929c7 |
children | ab8ac32fa330 |
files | ChangeLog lib/timespec-add.c lib/timespec-sub.c |
diffstat | 3 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Sep 23 10:16:13 2013 -0700 +++ b/ChangeLog Sat Sep 21 09:11:49 2013 -0700 @@ -1,3 +1,10 @@ +2013-09-21 Jim Meyering <meyering@fb.com> + + timespec: use the new TIMESPEC_RESOLUTION in a few more places + * lib/timespec-add.c (timespec_add): Also replace 999999999 + with TIMESPEC_RESOLUTION - 1. + * lib/timespec-sub.c (timespec_sub): Likewise. + 2013-09-23 Paul Eggert <eggert@cs.ucla.edu> warnings: port --enable-gcc-warnings to Solaris Studio 12.3
--- a/lib/timespec-add.c Mon Sep 23 10:16:13 2013 -0700 +++ b/lib/timespec-add.c Sat Sep 21 09:11:49 2013 -0700 @@ -18,7 +18,7 @@ /* Written by Paul Eggert. */ /* Return the sum of two timespec values A and B. On overflow, return - an extremal value. This assumes 0 <= tv_nsec <= 999999999. */ + an extremal value. This assumes 0 <= tv_nsec < TIMESPEC_RESOLUTION. */ #include <config.h> #include "timespec.h" @@ -58,7 +58,7 @@ { high_overflow: rs = TYPE_MAXIMUM (time_t); - rns = 999999999; + rns = TIMESPEC_RESOLUTION - 1; } } else
--- a/lib/timespec-sub.c Mon Sep 23 10:16:13 2013 -0700 +++ b/lib/timespec-sub.c Sat Sep 21 09:11:49 2013 -0700 @@ -18,8 +18,8 @@ /* Written by Paul Eggert. */ /* Return the difference between two timespec values A and B. On - overflow, return an extremal value. This assumes 0 <= tv_nsec <= - 999999999. */ + overflow, return an extremal value. This assumes 0 <= tv_nsec < + TIMESPEC_RESOLUTION. */ #include <config.h> #include "timespec.h" @@ -58,7 +58,7 @@ else { rs = TYPE_MAXIMUM (time_t); - rns = 999999999; + rns = TIMESPEC_RESOLUTION - 1; } } else