emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0406443 2/2: Merge from gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master 0406443 2/2: Merge from gnulib
Date: Sun, 5 Mar 2017 16:31:39 -0500 (EST)

branch: master
commit 040644302120bfb11f28461aadb96c14e39f8630
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from gnulib
    
    This incorporates:
    2017-03-04 dtotimespec: simplify
    * lib/dtotimespec.c: Copy from gnulib.
---
 lib/dtotimespec.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c
index 9d81b68..3ca5a9c 100644
--- a/lib/dtotimespec.c
+++ b/lib/dtotimespec.c
@@ -29,15 +29,9 @@
 struct timespec
 dtotimespec (double sec)
 {
-  double min_representable = TYPE_MINIMUM (time_t);
-  double max_representable =
-    ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION
-      + (TIMESPEC_RESOLUTION - 1))
-     / TIMESPEC_RESOLUTION);
-
-  if (! (min_representable < sec))
+  if (! (TYPE_MINIMUM (time_t) < sec))
     return make_timespec (TYPE_MINIMUM (time_t), 0);
-  else if (! (sec < max_representable))
+  else if (! (sec < 1.0 + TYPE_MAXIMUM (time_t)))
     return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);
   else
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]