From 8d84a6ebe09bb9e7850f471054cafeeceee55e3c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Apr 2011 00:21:52 -0700 Subject: [PATCH] * keyboard.c (timer_check_2): Don't assume timer-list and idle-timer-list are lists. --- src/ChangeLog | 1 + src/keyboard.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 925a7223231..269ab7cf785 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,7 @@ * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt): Remove vars that are set but not used. + (timer_check_2): Don't assume timer-list and idle-timer-list are lists. * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized. diff --git a/src/keyboard.c b/src/keyboard.c index 679d99b0117..8f3db9a8c4f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4273,7 +4273,7 @@ timer_check_2 (void) EMACS_TIME difference, timer_difference, idle_timer_difference; /* Skip past invalid timers and timers already handled. */ - if (!NILP (timers)) + if (CONSP (timers)) { timer = XCAR (timers); if (!VECTORP (timer) || XVECTOR (timer)->size != 8) @@ -4291,7 +4291,7 @@ timer_check_2 (void) continue; } } - if (!NILP (idle_timers)) + if (CONSP (idle_timers)) { timer = XCAR (idle_timers); if (!VECTORP (timer) || XVECTOR (timer)->size != 8) @@ -4314,7 +4314,7 @@ timer_check_2 (void) based on the next ordinary timer. TIMER_DIFFERENCE is the distance in time from NOW to when this timer becomes ripe (negative if it's already ripe). */ - if (!NILP (timers)) + if (CONSP (timers)) { timer = XCAR (timers); vector = XVECTOR (timer)->contents; @@ -4326,7 +4326,7 @@ timer_check_2 (void) /* Set IDLE_TIMER, IDLE_TIMER_TIME and IDLE_TIMER_DIFFERENCE based on the next idle timer. */ - if (!NILP (idle_timers)) + if (CONSP (idle_timers)) { idle_timer = XCAR (idle_timers); vector = XVECTOR (idle_timer)->contents; @@ -4340,7 +4340,7 @@ timer_check_2 (void) and set CHOSEN_TIMER, VECTOR and DIFFERENCE accordingly. Also step down the list where we found that timer. */ - if (! NILP (timers) && ! NILP (idle_timers)) + if (CONSP (timers) && CONSP (idle_timers)) { EMACS_TIME temp; EMACS_SUB_TIME (temp, timer_difference, idle_timer_difference); @@ -4357,7 +4357,7 @@ timer_check_2 (void) difference = idle_timer_difference; } } - else if (! NILP (timers)) + else if (CONSP (timers)) { chosen_timer = timer; timers = XCDR (timers); -- 2.39.2