diff options
| author | Paul Eggert | 2011-04-02 00:21:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-02 00:21:52 -0700 |
| commit | 8d84a6ebe09bb9e7850f471054cafeeceee55e3c (patch) | |
| tree | e4d023fb443cee7c3324a2223fc029f4eb6f6799 /src | |
| parent | 03733ee7289ec298309cbfdd9e917d23fce099cf (diff) | |
| download | emacs-8d84a6ebe09bb9e7850f471054cafeeceee55e3c.tar.gz emacs-8d84a6ebe09bb9e7850f471054cafeeceee55e3c.zip | |
* keyboard.c (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 1 | ||||
| -rw-r--r-- | 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 @@ | |||
| 2 | 2 | ||
| 3 | * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt): | 3 | * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt): |
| 4 | Remove vars that are set but not used. | 4 | Remove vars that are set but not used. |
| 5 | (timer_check_2): Don't assume timer-list and idle-timer-list are lists. | ||
| 5 | 6 | ||
| 6 | * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized. | 7 | * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized. |
| 7 | 8 | ||
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) | |||
| 4273 | EMACS_TIME difference, timer_difference, idle_timer_difference; | 4273 | EMACS_TIME difference, timer_difference, idle_timer_difference; |
| 4274 | 4274 | ||
| 4275 | /* Skip past invalid timers and timers already handled. */ | 4275 | /* Skip past invalid timers and timers already handled. */ |
| 4276 | if (!NILP (timers)) | 4276 | if (CONSP (timers)) |
| 4277 | { | 4277 | { |
| 4278 | timer = XCAR (timers); | 4278 | timer = XCAR (timers); |
| 4279 | if (!VECTORP (timer) || XVECTOR (timer)->size != 8) | 4279 | if (!VECTORP (timer) || XVECTOR (timer)->size != 8) |
| @@ -4291,7 +4291,7 @@ timer_check_2 (void) | |||
| 4291 | continue; | 4291 | continue; |
| 4292 | } | 4292 | } |
| 4293 | } | 4293 | } |
| 4294 | if (!NILP (idle_timers)) | 4294 | if (CONSP (idle_timers)) |
| 4295 | { | 4295 | { |
| 4296 | timer = XCAR (idle_timers); | 4296 | timer = XCAR (idle_timers); |
| 4297 | if (!VECTORP (timer) || XVECTOR (timer)->size != 8) | 4297 | if (!VECTORP (timer) || XVECTOR (timer)->size != 8) |
| @@ -4314,7 +4314,7 @@ timer_check_2 (void) | |||
| 4314 | based on the next ordinary timer. | 4314 | based on the next ordinary timer. |
| 4315 | TIMER_DIFFERENCE is the distance in time from NOW to when | 4315 | TIMER_DIFFERENCE is the distance in time from NOW to when |
| 4316 | this timer becomes ripe (negative if it's already ripe). */ | 4316 | this timer becomes ripe (negative if it's already ripe). */ |
| 4317 | if (!NILP (timers)) | 4317 | if (CONSP (timers)) |
| 4318 | { | 4318 | { |
| 4319 | timer = XCAR (timers); | 4319 | timer = XCAR (timers); |
| 4320 | vector = XVECTOR (timer)->contents; | 4320 | vector = XVECTOR (timer)->contents; |
| @@ -4326,7 +4326,7 @@ timer_check_2 (void) | |||
| 4326 | 4326 | ||
| 4327 | /* Set IDLE_TIMER, IDLE_TIMER_TIME and IDLE_TIMER_DIFFERENCE | 4327 | /* Set IDLE_TIMER, IDLE_TIMER_TIME and IDLE_TIMER_DIFFERENCE |
| 4328 | based on the next idle timer. */ | 4328 | based on the next idle timer. */ |
| 4329 | if (!NILP (idle_timers)) | 4329 | if (CONSP (idle_timers)) |
| 4330 | { | 4330 | { |
| 4331 | idle_timer = XCAR (idle_timers); | 4331 | idle_timer = XCAR (idle_timers); |
| 4332 | vector = XVECTOR (idle_timer)->contents; | 4332 | vector = XVECTOR (idle_timer)->contents; |
| @@ -4340,7 +4340,7 @@ timer_check_2 (void) | |||
| 4340 | and set CHOSEN_TIMER, VECTOR and DIFFERENCE accordingly. | 4340 | and set CHOSEN_TIMER, VECTOR and DIFFERENCE accordingly. |
| 4341 | Also step down the list where we found that timer. */ | 4341 | Also step down the list where we found that timer. */ |
| 4342 | 4342 | ||
| 4343 | if (! NILP (timers) && ! NILP (idle_timers)) | 4343 | if (CONSP (timers) && CONSP (idle_timers)) |
| 4344 | { | 4344 | { |
| 4345 | EMACS_TIME temp; | 4345 | EMACS_TIME temp; |
| 4346 | EMACS_SUB_TIME (temp, timer_difference, idle_timer_difference); | 4346 | EMACS_SUB_TIME (temp, timer_difference, idle_timer_difference); |
| @@ -4357,7 +4357,7 @@ timer_check_2 (void) | |||
| 4357 | difference = idle_timer_difference; | 4357 | difference = idle_timer_difference; |
| 4358 | } | 4358 | } |
| 4359 | } | 4359 | } |
| 4360 | else if (! NILP (timers)) | 4360 | else if (CONSP (timers)) |
| 4361 | { | 4361 | { |
| 4362 | chosen_timer = timer; | 4362 | chosen_timer = timer; |
| 4363 | timers = XCDR (timers); | 4363 | timers = XCDR (timers); |