]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid compiler warnings in comparing time_t.
authorEli Zaretskii <eliz@gnu.org>
Sat, 23 Jun 2012 19:40:50 +0000 (22:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 23 Jun 2012 19:40:50 +0000 (22:40 +0300)
 src/dispnew.c (sit_for, Fsleep_for):
 src/keyboard.c (kbd_buffer_get_event):
 src/process.c (Faccept_process_output): Avoid compiler warnings when
 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.

src/ChangeLog
src/dispnew.c
src/keyboard.c
src/process.c

index d0b6f14522761b57d2c46b2bf07f1f0c91ac793e..40073d328345631bf688afcd2c513d4d9262f47d 100644 (file)
@@ -1,3 +1,10 @@
+2012-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * dispnew.c (sit_for, Fsleep_for):
+       * keyboard.c (kbd_buffer_get_event):
+       * process.c (Faccept_process_output): Avoid compiler warnings when
+       comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
+
 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in: Update dependencies.
index 5582607ff6a45b8e9527078833ae114436889d1b..e18fca6f12222c1ba8529b7d54575706a48b2e9e 100644 (file)
@@ -5957,7 +5957,9 @@ additional wait period, in milliseconds; this is for backwards compatibility.
   if (0 < duration)
     {
       EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (duration);
-      wait_reading_process_output (min (EMACS_SECS (t), INTMAX_MAX),
+      intmax_t secs = EMACS_SECS (t);
+
+      wait_reading_process_output (min (secs, INTMAX_MAX),
                                   EMACS_NSECS (t), 0, 0, Qnil, NULL, 0);
     }
 
@@ -6005,7 +6007,8 @@ sit_for (Lisp_Object timeout, int reading, int do_display)
       else
        {
          EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (seconds);
-         sec = min (EMACS_SECS (t), INTMAX_MAX);
+         sec = EMACS_SECS (t);
+         sec = min (sec, INTMAX_MAX);
          nsec = EMACS_NSECS (t);
        }
     }
index 0e8d22c2b1cdb7020ca13fc20d3619f12c382dfb..38b05c220639594767e46a8956106f45cb70f31f 100644 (file)
@@ -3857,9 +3857,11 @@ kbd_buffer_get_event (KBOARD **kbp,
            return Qnil;        /* finished waiting */
          else
            {
+             intmax_t secs;
+
              EMACS_SUB_TIME (duration, *end_time, duration);
-             wait_reading_process_output (min (EMACS_SECS (duration),
-                                               INTMAX_MAX),
+             secs = EMACS_SECS (duration);
+             wait_reading_process_output (min (secs, INTMAX_MAX),
                                           EMACS_NSECS (duration),
                                           -1, 1, Qnil, NULL, 0);
            }
index 0ee0e499d6e8e4a48a1aaf28ed808655808fc5a9..b41a77f58fd6a7b1d25cc28fddcce34dbc9ae100 100644 (file)
@@ -3996,7 +3996,9 @@ Return non-nil if we received any output before the timeout expired.  */)
          if (0 < XFLOAT_DATA (seconds))
            {
              EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (XFLOAT_DATA (seconds));
-             secs = min (EMACS_SECS (t), INTMAX_MAX);
+
+             secs = EMACS_SECS (t);
+             secs = min (secs, INTMAX_MAX);
              nsecs = EMACS_NSECS (t);
            }
        }