)
{
EMACS_TIME next_time = timer_check (), *ntp;
- long secs = EMACS_SECS (next_time);
- long usecs = EMACS_USECS (next_time);
SELECT_TYPE read_fds;
struct x_display_info *dpyinfo;
int n = 0;
XFlush (dpyinfo->display);
}
- if (secs < 0 && usecs < 0)
+ if (! EMACS_TIME_VALID_P (next_time))
ntp = 0;
else
ntp = &next_time;
#ifdef HAVE_GTK3
- /* Gtk3 have arrows on menus when they don't fit. When the pointer is
- over an arrow, a timeout scrolls it a bit. Use xg_select so that
- timeout gets triggered. */
-
- xg_select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+ /* Gtk3 have arrows on menus when they don't fit. When the
+ pointer is over an arrow, a timeout scrolls it a bit. Use
+ xg_select so that timeout gets triggered. */
+ xg_select (n + 1, &read_fds, NULL, NULL, ntp, NULL);
#else
- select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+ pselect (n + 1, &read_fds, NULL, NULL, ntp, NULL);
#endif
}
}
else if (!f->output_data.x->saved_menu_event && !deep_p)
{
deep_p = 1;
- f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent));
+ f->output_data.x->saved_menu_event = xmalloc (sizeof (XEvent));
f->output_data.x->saved_menu_event->type = 0;
}
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
int previous_menu_items_used = f->menu_bar_items_used;
Lisp_Object *previous_items
- = (Lisp_Object *) alloca (previous_menu_items_used
- * sizeof (Lisp_Object));
+ = alloca (previous_menu_items_used * sizeof *previous_items);
int subitems;
/* If we are making a new widget, its contents are empty,
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
subitems = ASIZE (items) / 4;
- submenu_start = (int *) alloca ((subitems + 1) * sizeof (int));
- submenu_end = (int *) alloca (subitems * sizeof (int));
- submenu_n_panes = (int *) alloca (subitems * sizeof (int));
- submenu_top_level_items = (int *) alloca (subitems * sizeof (int));
+ submenu_start = alloca ((subitems + 1) * sizeof *submenu_start);
+ submenu_end = alloca (subitems * sizeof *submenu_end);
+ submenu_n_panes = alloca (subitems * sizeof *submenu_n_panes);
+ submenu_top_level_items = alloca (subitems
+ * sizeof *submenu_top_level_items);
init_menu_items ();
for (i = 0; i < subitems; i++)
{
int i;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
widget_value **submenu_stack
- = (widget_value **) alloca (menu_items_used * sizeof (widget_value *));
+ = alloca (menu_items_used * sizeof *submenu_stack);
Lisp_Object *subprefix_stack
- = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object));
+ = alloca (menu_items_used * sizeof *subprefix_stack);
int submenu_depth = 0;
int first_pane;
save_wv->next = wv;
else
first_wv->contents = wv;
- wv->name = pane_string;
+ wv->name = (char *) pane_string;
if (keymaps && !NILP (prefix))
wv->name++;
wv->value = 0;
pane_string = (NILP (pane_name)
? "" : SSDATA (pane_name));
prev_wv = xmalloc_widget_value ();
- prev_wv->value = pane_string;
+ prev_wv->value = (char *) pane_string;
if (keymaps && !NILP (prefix))
prev_wv->name++;
prev_wv->enabled = 1;
{
/* if alloca is fast, use that to make the space,
to reduce gc needs. */
- item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1);
+ item_data = alloca (maxwidth + SBYTES (descrip) + 1);
memcpy (item_data, SSDATA (item_name), SBYTES (item_name));
for (j = SCHARS (item_name); j < maxwidth; j++)
item_data[j] = ' ';