From f417570735aac865eb6b576d1ea76b5bfcd8573b Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 2 Jun 2007 17:59:15 -0700 Subject: Xlib/XCB: inline wait_or_poll_for_event, which now had only one caller. Commit by Josh Triplett and Jamey Sharp. --- src/xcb_io.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'src/xcb_io.c') diff --git a/src/xcb_io.c b/src/xcb_io.c index dea6b3df..276c1b93 100644 --- a/src/xcb_io.c +++ b/src/xcb_io.c @@ -102,21 +102,6 @@ static void call_handlers(Display *dpy, xcb_generic_reply_t *buf) _XError(dpy, (xError *) buf); } -static xcb_generic_event_t * wait_or_poll_for_event(Display *dpy, int wait) -{ - xcb_connection_t *c = dpy->xcb->connection; - xcb_generic_event_t *event; - if(wait) - { - UnlockDisplay(dpy); - event = xcb_wait_for_event(c); - LockDisplay(dpy); - } - else - event = xcb_poll_for_event(c); - return event; -} - static void process_responses(Display *dpy, int wait_for_first_event, xcb_generic_error_t **current_error, unsigned int current_request) { void *reply; @@ -125,7 +110,16 @@ static void process_responses(Display *dpy, int wait_for_first_event, xcb_generi PendingRequest *req; xcb_connection_t *c = dpy->xcb->connection; if(!event && dpy->xcb->event_owner == XlibOwnsEventQueue) - event = wait_or_poll_for_event(dpy, wait_for_first_event); + { + if(wait_for_first_event) + { + UnlockDisplay(dpy); + event = xcb_wait_for_event(c); + LockDisplay(dpy); + } + else + event = xcb_poll_for_event(c); + } while(1) { -- cgit v1.2.3