[Xcb] using enums as type in sync.xml

Thomas Hunger hto at arcor.de
Wed Sep 5 08:56:02 PDT 2007


sync.xml uses enums as types. This is readable, but a problem because

1) enums can have different binary sizes on different 
   platforms and depending on the range they cover. 

2) The size required in the X protocoll might not be the same 
   as the native platform enum size (this is very prominent in
   XKB which uses 1, 2 and 4 byte enumerations in X).

  <struct name="TRIGGER">
    <field type="COUNTER" name="counter" />
    <field type="VALUETYPE" name="wait_type" />
    <field type="INT64" name="wait_value" />
    <field type="TESTTYPE" name="test_type" />

An easy workaround is to define 

  <typedef newname="VALUETYPE" oldname="CARD32"/>
  <typedef newname="TESTTYPE" oldname="CARD32"/>

A patch is attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Let-types-point-to-typedefs-instead-of-enums-to-ensu.patch
Type: text/x-diff
Size: 1269 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xcb/attachments/20070905/27588020/attachment.patch 

More information about the Xcb mailing list