[Xcb] XCB parsing and valueparam
Julien Danjou
julien at danjou.info
Fri Aug 29 01:35:55 PDT 2008
At 1219993454 time_t, Barton C Massey wrote:
> The specific problem here is that there is not supposed to
> be any padding on the end of the ConfigureWindow request
> (see the protocol spec p. 125). The LISTofVALUE on the end
> should have a 2-byte pad between the bitmask and the (zero
> or more) values, but that's presumably taken care of by
> valueparam. The current code generator is doing the right
> thing here. :-)
I don't think so. The C struct generated by the code is:
typedef struct xcb_configure_window_request_t {
uint8_t major_opcode; /**< */
uint8_t pad0; /**< */
uint16_t length; /**< */
xcb_window_t window; /**< */
uint16_t value_mask; /**< */
} xcb_configure_window_request_t;
and does not include the value_param (which is ok since it's only used
in the function xcb_configure_window() later:
xcb_void_cookie_t
xcb_configure_window (xcb_connection_t *c /**< */,
xcb_window_t window /**< */,
uint16_t value_mask /**< */,
const uint32_t *value_list /**< */);
which fill a xcb_configure_window_request_t automagically and then send
it.
But here, I think again the XML is bad since it does not include the
2 bytes padding which are between the value_mask and the value_padding
as you saw on specs.
So currently the struct generated as above is anyway mis-aligned (its
size is 10) and the compiler add… 2 bytes to align it and set its size
to 12.
Sorry if I'm wrong, I just try to really understand this stuff. :)
Cheers,
--
Julien Danjou
// ᐰ <julien at danjou.info> http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20080829/be0c1986/attachment.pgp
More information about the Xcb
mailing list