[Xcb] Question about XML spec, and QueryExtension

Peter Harris peter.harris at hummingbird.com
Thu Aug 28 09:43:29 PDT 2008


Julien Danjou wrote:
> 
> But some are properly aligned (sizeof(struct) % 4 = 0) so I don't get
> any warning. But comparing these against Xlib header files show that the
> Xlib struct has a lot of padding.
> 
> Example:
> 
> sizeof(xcb_shm_get_image_reply_t) = 16
> #define sz_xShmGetImageReply    32 
> 
> So I don't get any warning and this can be fixed without comparing each
> file. But I'm neither sure it's a big problem.

Events, errors and replies are a special case, in that the spec says
that they are always 32 bytes long. So unlike the other structures
(where you previously had to know and re-implement the C padding
convention and check each item internally), each binding generator
should be able to pad these structures relatively easily.

That said, explicit padding would be even better. But I wouldn't lose
any sleep over tail-padding events and replies.

Peter Harris
-- 
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866


More information about the Xcb mailing list