aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-05-12 13:23:33 -0700
committerPaul Eggert <[email protected]>2011-05-12 13:23:33 -0700
commit08dc5ae68e9c699410256ca9052bd09f336ac87f (patch)
tree6572186aea70cb9f3f736743271c4d0b500650b6 /src/xmenu.c
parent86db42d22397effbb6e9edc5ae11d806847f0d3e (diff)
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/xmenu.c')
-rw-r--r--src/xmenu.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index ccb60d2dcb..7d7515a8f2 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -240,7 +240,7 @@ for instance using the window manager, then this produces a quit and
FRAME_PTR new_f = SELECTED_FRAME ();
Lisp_Object bar_window;
enum scroll_bar_part part;
- unsigned long time;
+ Time time;
Lisp_Object x, y;
(*mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time);
@@ -1420,7 +1420,8 @@ pop_down_menu (Lisp_Object arg)
menu pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, int for_click, EMACS_UINT timestamp)
+create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
+ int for_click, Time timestamp)
{
int i;
GtkWidget *menu;
@@ -1464,7 +1465,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, i
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i,
- timestamp > 0 ? timestamp : gtk_get_current_event_time());
+ timestamp ? timestamp : gtk_get_current_event_time ());
record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
@@ -1524,7 +1525,7 @@ pop_down_menu (Lisp_Object arg)
menu_item_selection will be set to the selection. */
static void
create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
- int x, int y, int for_click, EMACS_UINT timestamp)
+ int x, int y, int for_click, Time timestamp)
{
int i;
Arg av[2];
@@ -1598,7 +1599,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
- Lisp_Object title, const char **error_name, EMACS_UINT timestamp)
+ Lisp_Object title, const char **error_name, Time timestamp)
{
int i;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
@@ -2241,7 +2242,7 @@ pop_down_menu (Lisp_Object arg)
Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
- Lisp_Object title, const char **error_name, EMACS_UINT timestamp)
+ Lisp_Object title, const char **error_name, Time timestamp)
{
Window root;
XMenu *menu;