diff options
| author | Paul Eggert | 2011-09-21 13:20:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-21 13:20:36 -0700 |
| commit | 1ab7b8ac177e323b0c82b9ccdb42ba47229f4e9e (patch) | |
| tree | 496e67c30c650267add0cdf077ed6a149ad808de /src | |
| parent | 3b11691a6e0607221ea6a4eb23415442e90417b0 (diff) | |
| download | emacs-1ab7b8ac177e323b0c82b9ccdb42ba47229f4e9e.tar.gz emacs-1ab7b8ac177e323b0c82b9ccdb42ba47229f4e9e.zip | |
* lread.c (read_filtered_event): Use duration_to_sec_usec.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/lread.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index cc0918e6030..f67d1b72bf2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -459,6 +459,8 @@ | |||
| 459 | (openp): Check for out-of-range argument to 'access'. | 459 | (openp): Check for out-of-range argument to 'access'. |
| 460 | (read1): Use int, not EMACS_INT, where int is wide enough. | 460 | (read1): Use int, not EMACS_INT, where int is wide enough. |
| 461 | Don't assume fixnum fits into int. | 461 | Don't assume fixnum fits into int. |
| 462 | (read_filtered_event): Use duration_to_sec_usec | ||
| 463 | to do proper overflow checking on durations. | ||
| 462 | * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow | 464 | * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow |
| 463 | in size calculation. | 465 | in size calculation. |
| 464 | (Fexecute_kbd_macro): | 466 | (Fexecute_kbd_macro): |
diff --git a/src/lread.c b/src/lread.c index 7b3e0df5e8a..e427688fdc7 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -608,8 +608,11 @@ read_filtered_event (int no_switch_frame, int ascii_required, | |||
| 608 | int sec, usec; | 608 | int sec, usec; |
| 609 | double duration = extract_float (seconds); | 609 | double duration = extract_float (seconds); |
| 610 | 610 | ||
| 611 | sec = (int) duration; | 611 | if (0 < duration) |
| 612 | usec = (duration - sec) * 1000000; | 612 | duration_to_sec_usec (duration, &sec, &usec); |
| 613 | else | ||
| 614 | sec = usec = 0; | ||
| 615 | |||
| 613 | EMACS_GET_TIME (end_time); | 616 | EMACS_GET_TIME (end_time); |
| 614 | EMACS_SET_SECS_USECS (wait_time, sec, usec); | 617 | EMACS_SET_SECS_USECS (wait_time, sec, usec); |
| 615 | EMACS_ADD_TIME (end_time, end_time, wait_time); | 618 | EMACS_ADD_TIME (end_time, end_time, wait_time); |