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.
This commit is contained in:
Eli Zaretskii 2012-06-23 22:40:50 +03:00
parent 049ec95ba5
commit b82c175521
4 changed files with 19 additions and 5 deletions

View 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.

View 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);
}
}

View 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);
}

View 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);
}
}