X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_in.c;h=3bf54f3b8f27c40a0a38a2335b5902ebd94e7a5a;hb=2a18842f0f93516ff726a2dfa44348410bb55626;hp=15bc9158c9fd8ca0d336263adeab026e3a776f7a;hpb=d5347485a55e58381781d803e19bfdd982a4685b;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_in.c b/src/xcb_in.c index 15bc915..3bf54f3 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "xcb.h" @@ -312,9 +313,7 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** reader_list **prev_reader; for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) - if((*prev_reader)->request == request) - goto done; /* error */ - + /* empty */; reader.request = request; reader.data = &cond; reader.next = *prev_reader; @@ -324,7 +323,6 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** if(!_xcb_conn_wait(c, &cond, 0, 0)) break; -done: for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) if(*prev_reader == &reader) { @@ -445,18 +443,16 @@ void _xcb_in_destroy(_xcb_in *in) int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround, int flags) { - if(workaround != WORKAROUND_NONE || flags != 0) - { - pending_reply *pend = malloc(sizeof(pending_reply)); - if(!pend) - return 0; - pend->request = request; - pend->workaround = workaround; - pend->flags = flags; - pend->next = 0; - *c->in.pending_replies_tail = pend; - c->in.pending_replies_tail = &pend->next; - } + pending_reply *pend = malloc(sizeof(pending_reply)); + assert(workaround != WORKAROUND_NONE || flags != 0); + if(!pend) + return 0; + pend->request = request; + pend->workaround = workaround; + pend->flags = flags; + pend->next = 0; + *c->in.pending_replies_tail = pend; + c->in.pending_replies_tail = &pend->next; return 1; }