return XSCROLL_BAR (bar);
}
- return 0;
+ return NULL;
}
x_send_scroll_bar_event and x_scroll_bar_to_input_event. */
static struct window **scroll_bar_windows;
-static int scroll_bar_windows_size;
+static size_t scroll_bar_windows_size;
/* Send a client message with message type Xatom_Scrollbar for a
XClientMessageEvent *ev = (XClientMessageEvent *) &event;
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
- int i;
+ size_t i;
BLOCK_INPUT;
if (i == scroll_bar_windows_size)
{
- int new_size = max (10, 2 * scroll_bar_windows_size);
+ size_t new_size = max (10, 2 * scroll_bar_windows_size);
size_t nbytes = new_size * sizeof *scroll_bar_windows;
size_t old_nbytes = scroll_bar_windows_size * sizeof *scroll_bar_windows;
+ if ((size_t) -1 / sizeof *scroll_bar_windows < new_size)
+ memory_full ();
scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows,
nbytes);
memset (&scroll_bar_windows[i], 0, nbytes - old_nbytes);
{
XClientMessageEvent *ev = (XClientMessageEvent *) event;
Lisp_Object window;
- struct frame *f;
struct window *w;
w = scroll_bar_windows[ev->data.l[0]];
scroll_bar_windows[ev->data.l[0]] = NULL;
XSETWINDOW (window, w);
- f = XFRAME (w->frame);
ievent->kind = SCROLL_BAR_CLICK_EVENT;
ievent->frame_or_window = window;
#ifdef USE_GTK
ievent->timestamp = CurrentTime;
#else
- ievent->timestamp = XtLastTimestampProcessed (FRAME_X_DISPLAY (f));
+ ievent->timestamp =
+ XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
#endif
ievent->part = ev->data.l[1];
ievent->code = ev->data.l[2];
goto OTHER;
#endif /* USE_X_TOOLKIT */
{
- XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
+ XSelectionClearEvent *eventp = &(event.xselectionclear);
inev.ie.kind = SELECTION_CLEAR_EVENT;
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
goto OTHER;
#endif /* USE_X_TOOLKIT */
{
- XSelectionRequestEvent *eventp
- = (XSelectionRequestEvent *) &event;
+ XSelectionRequestEvent *eventp = &(event.xselectionrequest);
inev.ie.kind = SELECTION_REQUEST_EVENT;
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
Calling x_uncatch_errors resumes the normal error handling. */
-void x_check_errors (Display *dpy, const char *format);
-
void
x_catch_errors (Display *dpy)
{
unknown reason, the call to XtMapWidget is completely ignored.
Mapping the widget a second time works. */
- if (!FRAME_VISIBLE_P (f) && --retry_count > 0)
+ if (!FRAME_VISIBLE_P (f) && --retry_count != 0)
goto retry;
}
}
for (; *name1 != '\0' && *name1 == *name2; name1++, name2++)
{
if (*name1 == ':')
- seen_colon++;
+ seen_colon = 1;
if (seen_colon && *name1 == '.')
return 1;
}