From: Jim Meyering Date: Sat, 21 Sep 2013 16:11:49 +0000 (-0700) Subject: timespec: use the new TIMESPEC_RESOLUTION in a few more places X-Git-Tag: v0.1~35 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=aa20227c9f103f44a2a05229aa1bdbd41d387d1e 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. --- diff --git a/ChangeLog b/ChangeLog index a9630987e..4b6cbdcc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-09-21 Jim Meyering + + 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 warnings: port --enable-gcc-warnings to Solaris Studio 12.3 diff --git a/lib/timespec-add.c b/lib/timespec-add.c index 51323a632..d628237fe 100644 --- a/lib/timespec-add.c +++ b/lib/timespec-add.c @@ -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 #include "timespec.h" @@ -58,7 +58,7 @@ timespec_add (struct timespec a, struct timespec b) { high_overflow: rs = TYPE_MAXIMUM (time_t); - rns = 999999999; + rns = TIMESPEC_RESOLUTION - 1; } } else diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c index b164a8380..3f3adea28 100644 --- a/lib/timespec-sub.c +++ b/lib/timespec-sub.c @@ -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 #include "timespec.h" @@ -58,7 +58,7 @@ timespec_sub (struct timespec a, struct timespec b) else { rs = TYPE_MAXIMUM (time_t); - rns = 999999999; + rns = TIMESPEC_RESOLUTION - 1; } } else