[Xcb] [PATCH 2/3] Do not block when calling reply() multiple times.

Julien Danjou julien at danjou.info
Wed Feb 3 00:31:07 PST 2010


At 1265147453 time_t, Peter Harris wrote:
> Yeah, but xcb_wait_for_reply is an implementation detail. None of the
> documented API take a sequence number. The cookie is opaque, publicly.

It's not *that* opaque, and xcb_wait_for_reply() is exported. Maybe it's
part of a sub-API (xcbext), I don't know. :)

> That said, we could document the contents of cookies and ask for the
> sequence number. But that doesn't feel any less bad than the horrible
> typecast gymnastics. Or maybe I'm over-thinking things.

No, you're not, that's a common problem IMHO when you implements things
which feels like struct inheritance in C. You play with casts.

So you rather add a macro XCB_VOID_COOKIE(cookie) which cast a cookie to
a void, or you ask for the sequence. Documenting and asking for the
sequence seems a good compromise and smarter than hiding things in ugly
casts. :-)

-- 
Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info
// There is nothing under this line.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20100203/b9ad8a08/attachment.pgp 


More information about the Xcb mailing list