2011-05-12 Paul Eggert <eggert@cs.ucla.edu>
+ * term.c (term_mouse_position): Don't assume time_t wraparound.
+
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
* 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.
Lisp_Object *y, Time *timeptr)
{
struct timeval now;
+ Time sec, usec;
*fp = SELECTED_FRAME ();
(*fp)->mouse_moved = 0;
XSETINT (*x, last_mouse_x);
XSETINT (*y, last_mouse_y);
gettimeofday(&now, 0);
- *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000);
+ sec = now.tv_sec;
+ usec = now.tv_usec;
+ *timeptr = (sec * 1000) + (usec / 1000);
}
/* Prepare a mouse-event in *RESULT for placement in the input queue.