* keyboard.c (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Apr 2011 07:21:52 +0000 (00:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Apr 2011 07:21:52 +0000 (00:21 -0700)
src/ChangeLog
src/keyboard.c

index 925a722..269ab7c 100644 (file)
@@ -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.
 
index 679d99b..8f3db9a 100644 (file)
@@ -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);