[Xcb] XCB parsing and valueparam

Julien Danjou julien at danjou.info
Thu Aug 28 08:09:14 PDT 2008


Hi,

I'm trying to fix the padding stuff, and I encounter a problem in
c_client.py with XML parsing in a request from xproto.xml:

 833   <request name="ConfigureWindow" opcode="12"> 
 834     <pad bytes="1" /> 
 835     <field type="WINDOW" name="window" /> 
 836     <valueparam value-mask-type="CARD16" 
 837                 value-mask-name="value_mask" 
 838                 value-list-name="value_list" /> 
 839     <pad bytes="2" /> 
 840   </request> 
 841  

The two padding bytes are generated in the C code but not in the header
file.
I've tracked down the problem to be at:

 638     for field in self.fields:  
 639         if not field.type.fixed_size():  
 640             break  
 641         if field.wire:  
 642             struct_fields.append(field)  

So it seems that the valueparam is recognized as not having a
fixed_size. Or, as far as I understand this stuff, it has.

If I dig a bit I found that this field.type is a ListType.
A ListType has fixed_size if: self.member.fixed_size() and self.expr.fixed_size() 
I found that self.expr.fixed_size() is wrong.
An expression has a fixed_size if its nmemb is != None (expr.py:88).
Or nmemb is never set to any value if the tag is valueparam.

Is this a bug or I just miss the whole thing? Hint?

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/20080828/480825de/attachment.pgp 


More information about the Xcb mailing list