[Xcb] XCB parsing and valueparam
Barton C Massey
bart at cs.pdx.edu
Fri Aug 29 09:58:43 PDT 2008
In message <200808290918.m7T9IiRa024012 at adara.cs.pdx.edu> I wrote:
> The fundamental bug, then, is in the XCB definition of
> valueparam. Sometimes there should be a pad between the
> mask and the list of values, as in ConfigureWindow.
> Sometimes there should not, as in CreateWindow. The
> "obvious" thing to do is to add an optional value-mask-pad
> field to valueparam somewhere in proto/xcbgen/xtypes.py, and
> then go through all the valueparam fields in the various
> requests adding value-mask-pad="2" where needed. I count
> six of these in the core protocol and another nine
> elsewhere, so this should be doable.
>
> I'd do it tonight, but my Python and XML hacking skills
> aren't quite up to trying it without a few hours in front of
> me.
Uh, looking at this again in the cold light of day, all but
one of those 15 occurrences of valueparam have a 32-bit
mask. None of these can possibly need the internal padding,
since they need to be aligned properly anyway.
In other words, ConfigureWindow is a freakshow. (And no, we
can't just change its mask to be CARD32 and ignore the high
16 bits, because that won't do the right thing on big-endian
machines.)
I think we still need the fix I recommended above, since
some future request could have a short value-mask with less
or no padding because it came out aligned better. But I
sure hate to do it for this one stupid request. Why isn't
the mask just 32 bits like in every other request?
Sigh.
Bart
More information about the Xcb
mailing list