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/termhooks.h | |
| 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/termhooks.h')
| -rw-r--r-- | src/termhooks.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/termhooks.h b/src/termhooks.h index 3a49b49aede..34e1364effd 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -20,6 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 20 | 20 | ||
| 21 | /* Miscellanea. */ | 21 | /* Miscellanea. */ |
| 22 | 22 | ||
| 23 | #include "systime.h" /* for Time */ | ||
| 24 | |||
| 23 | struct glyph; | 25 | struct glyph; |
| 24 | struct frame; | 26 | struct frame; |
| 25 | 27 | ||
| @@ -233,7 +235,7 @@ struct input_event | |||
| 233 | int modifiers; /* See enum below for interpretation. */ | 235 | int modifiers; /* See enum below for interpretation. */ |
| 234 | 236 | ||
| 235 | Lisp_Object x, y; | 237 | Lisp_Object x, y; |
| 236 | unsigned long timestamp; | 238 | Time timestamp; |
| 237 | 239 | ||
| 238 | /* This is padding just to put the frame_or_window field | 240 | /* This is padding just to put the frame_or_window field |
| 239 | past the size of struct selection_input_event. */ | 241 | past the size of struct selection_input_event. */ |
| @@ -463,7 +465,7 @@ struct terminal | |||
| 463 | enum scroll_bar_part *part, | 465 | enum scroll_bar_part *part, |
| 464 | Lisp_Object *x, | 466 | Lisp_Object *x, |
| 465 | Lisp_Object *y, | 467 | Lisp_Object *y, |
| 466 | unsigned long *); | 468 | Time *); |
| 467 | 469 | ||
| 468 | /* The window system handling code should set this if the mouse has | 470 | /* The window system handling code should set this if the mouse has |
| 469 | moved since the last call to the mouse_position_hook. Calling that | 471 | moved since the last call to the mouse_position_hook. Calling that |