diff options
| author | Paul Eggert | 2011-05-12 13:30:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-12 13:30:05 -0700 |
| commit | f6a24d19906993b975e7be822abbb3cfce719751 (patch) | |
| tree | 65904cbfb3740b10318aeed84d41cde7a8e8ccdc /src/term.c | |
| parent | 08dc5ae68e9c699410256ca9052bd09f336ac87f (diff) | |
| download | emacs-f6a24d19906993b975e7be822abbb3cfce719751.tar.gz emacs-f6a24d19906993b975e7be822abbb3cfce719751.zip | |
* term.c (term_mouse_position): Don't assume time_t wraparound.
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c index 34320a1ad6d..5fe258caa29 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2701,6 +2701,7 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, | |||
| 2701 | Lisp_Object *y, Time *timeptr) | 2701 | Lisp_Object *y, Time *timeptr) |
| 2702 | { | 2702 | { |
| 2703 | struct timeval now; | 2703 | struct timeval now; |
| 2704 | Time sec, usec; | ||
| 2704 | 2705 | ||
| 2705 | *fp = SELECTED_FRAME (); | 2706 | *fp = SELECTED_FRAME (); |
| 2706 | (*fp)->mouse_moved = 0; | 2707 | (*fp)->mouse_moved = 0; |
| @@ -2711,7 +2712,9 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, | |||
| 2711 | XSETINT (*x, last_mouse_x); | 2712 | XSETINT (*x, last_mouse_x); |
| 2712 | XSETINT (*y, last_mouse_y); | 2713 | XSETINT (*y, last_mouse_y); |
| 2713 | gettimeofday(&now, 0); | 2714 | gettimeofday(&now, 0); |
| 2714 | *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000); | 2715 | sec = now.tv_sec; |
| 2716 | usec = now.tv_usec; | ||
| 2717 | *timeptr = (sec * 1000) + (usec / 1000); | ||
| 2715 | } | 2718 | } |
| 2716 | 2719 | ||
| 2717 | /* Prepare a mouse-event in *RESULT for placement in the input queue. | 2720 | /* Prepare a mouse-event in *RESULT for placement in the input queue. |