Commit b82c1755 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Avoid compiler warnings in comparing time_t.

 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.
parent 049ec95b
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> 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in: Update dependencies. * makefile.w32-in: Update dependencies.
......
...@@ -5957,7 +5957,9 @@ additional wait period, in milliseconds; this is for backwards compatibility. ...@@ -5957,7 +5957,9 @@ additional wait period, in milliseconds; this is for backwards compatibility.
if (0 < duration) if (0 < duration)
{ {
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (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); EMACS_NSECS (t), 0, 0, Qnil, NULL, 0);
} }
...@@ -6005,7 +6007,8 @@ sit_for (Lisp_Object timeout, int reading, int do_display) ...@@ -6005,7 +6007,8 @@ sit_for (Lisp_Object timeout, int reading, int do_display)
else else
{ {
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (seconds); 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); nsec = EMACS_NSECS (t);
} }
} }
......
...@@ -3857,9 +3857,11 @@ kbd_buffer_get_event (KBOARD **kbp, ...@@ -3857,9 +3857,11 @@ kbd_buffer_get_event (KBOARD **kbp,
return Qnil; /* finished waiting */ return Qnil; /* finished waiting */
else else
{ {
intmax_t secs;
EMACS_SUB_TIME (duration, *end_time, duration); EMACS_SUB_TIME (duration, *end_time, duration);
wait_reading_process_output (min (EMACS_SECS (duration), secs = EMACS_SECS (duration);
INTMAX_MAX), wait_reading_process_output (min (secs, INTMAX_MAX),
EMACS_NSECS (duration), EMACS_NSECS (duration),
-1, 1, Qnil, NULL, 0); -1, 1, Qnil, NULL, 0);
} }
......
...@@ -3996,7 +3996,9 @@ Return non-nil if we received any output before the timeout expired. */) ...@@ -3996,7 +3996,9 @@ Return non-nil if we received any output before the timeout expired. */)
if (0 < XFLOAT_DATA (seconds)) if (0 < XFLOAT_DATA (seconds))
{ {
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (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); nsecs = EMACS_NSECS (t);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment