[Xcb] [PATCH] XCB-XML: Proposal for alignment padding

Evgeny M. Zubok evgeny.zubok at tochka.ru
Thu Nov 11 03:10:33 PST 2010


Julien Cristau <jcristau at debian.org>
writes:

> That does look like a bug in the code generator.  There's no padding
> between those fields.

No, the code generator does the right thing from the context of current
XML rules -- it inserts padding after each list because it has no
explicit information from XML when the padding has to be added or
considered. This is a flaw in XML description. The present topic and
proposed patch are just about that. For example, QueryFilters reply from
Render extension requires padding after the list of CARD16. OTOH,
GetCrtcGamma reply from RandR doesn't require an alignment after the
list of the same type. The descriptions have no hints about padding for
code generation procedures:

  <request name="QueryFilters" opcode="29">
    <field type="DRAWABLE" name="drawable" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="num_aliases" />
      <field type="CARD32" name="num_filters" />
      <pad bytes="16" />
      <list type="CARD16" name="aliases">
        <fieldref>num_aliases</fieldref>
      </list>
      <list type="STR" name="filters">
        <fieldref>num_filters</fieldref>
      </list>
    </reply>
  </request>



More information about the Xcb mailing list