generator: fix absname for fields with only accessor function
authorChristian Linhart <chris@DemoRecorder.com>
Mon, 20 Oct 2014 10:18:37 +0000 (12:18 +0200)
committerChristian Linhart <chris@demorecorder.com>
Mon, 20 Oct 2014 10:21:21 +0000 (12:21 +0200)
commit9be2806c6e7969fb281ee2be537f4b19a98e4001
tree23af425c38a80b517a641667b26180e501ab5798
parentfdb291b414a7afc2c2326124b8ca11d6846cd7b9
generator: fix absname for fields with only accessor function

Fix _c_helper_absolute_name for fields which cannot be accessed
as a struct/union member but which can be accessed by an
accessor function.

The fix calls the accessor function in these cases.

Example:
<struct name="AbsnameTest">
   <field type="CARD32" name="len" />
   <list type="CARD8" name="mylist1">
       <fieldref>len</fieldref>
   </list>
   <list type="CARD8" name="mylist2">
       <sumof ref="mylist1"/>
   </list>
</struct>

The sumof-expression ( <sumof ref="mylist1"/> ) refers to mylist1
which is only acessible by an accessor function.

Previously, sumof was only used inside bitcases,
where such lists are accessible by members of the
deserialized parent struct.
(there is a difference between deserialization of switches
and structs.)

V2 of this patch:
* replaced "!= None" with "is not None" because that's more pythonic.
  (according to suggestion from Ran Benita)

Message-ID: <5444E17D.3040206@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ...
Patch-Set: ListInputDevices
Patch-Number: libxcb 1/6
Patch-Version: V2
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
src/c_client.py