diff options
| author | Paul Eggert | 2011-05-12 13:23:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-12 13:23:33 -0700 |
| commit | 08dc5ae68e9c699410256ca9052bd09f336ac87f (patch) | |
| tree | 6572186aea70cb9f3f736743271c4d0b500650b6 /src/xterm.c | |
| parent | 86db42d22397effbb6e9edc5ae11d806847f0d3e (diff) | |
| download | emacs-08dc5ae68e9c699410256ca9052bd09f336ac87f.tar.gz emacs-08dc5ae68e9c699410256ca9052bd09f336ac87f.zip | |
Be more systematic about user-interface timestamps.
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps. This
change causes it to use 'Time' uniformly, as that's what X uses.
This makes the code easier to follow, and makes it easier to catch
integer overflow bugs such as Bug#8664.
* frame.c (Fmouse_position, Fmouse_pixel_position):
Use Time, not unsigned long, for user-interface timestamps.
* keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
(button_down_time, make_lispy_position, make_lispy_movement): Likewise.
* keyboard.h (last_event_timestamp): Likewise.
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
* xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
* systime.h (Time): New decl. Pull it in from <X11/X.h> if
HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
what it was before.
* menu.h, termhooks.h: Include "systime.h", for Time.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index f5886ab9628..71dc6f16858 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -342,7 +342,7 @@ static struct scroll_bar *x_window_to_scroll_bar (Display *, Window); | |||
| 342 | static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, | 342 | static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, |
| 343 | enum scroll_bar_part *, | 343 | enum scroll_bar_part *, |
| 344 | Lisp_Object *, Lisp_Object *, | 344 | Lisp_Object *, Lisp_Object *, |
| 345 | unsigned long *); | 345 | Time *); |
| 346 | static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); | 346 | static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); |
| 347 | static void x_check_fullscreen (struct frame *); | 347 | static void x_check_fullscreen (struct frame *); |
| 348 | static void x_check_expected_move (struct frame *, int, int); | 348 | static void x_check_expected_move (struct frame *, int, int); |
| @@ -3799,7 +3799,7 @@ redo_mouse_highlight (void) | |||
| 3799 | static void | 3799 | static void |
| 3800 | XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, | 3800 | XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, |
| 3801 | enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, | 3801 | enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, |
| 3802 | long unsigned int *timestamp) | 3802 | Time *timestamp) |
| 3803 | { | 3803 | { |
| 3804 | FRAME_PTR f1; | 3804 | FRAME_PTR f1; |
| 3805 | 3805 | ||
| @@ -5534,7 +5534,7 @@ x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) | |||
| 5534 | static void | 5534 | static void |
| 5535 | x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, | 5535 | x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, |
| 5536 | enum scroll_bar_part *part, Lisp_Object *x, | 5536 | enum scroll_bar_part *part, Lisp_Object *x, |
| 5537 | Lisp_Object *y, long unsigned int *timestamp) | 5537 | Lisp_Object *y, Time *timestamp) |
| 5538 | { | 5538 | { |
| 5539 | struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); | 5539 | struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); |
| 5540 | Window w = bar->x_window; | 5540 | Window w = bar->x_window; |