generator: fix absname for fields with only iterator function
authorChristian Linhart <chris@demorecorder.com>
Wed, 3 Sep 2014 11:22:37 +0000 (13:22 +0200)
committerChristian Linhart <chris@demorecorder.com>
Tue, 9 Sep 2014 00:05:44 +0000 (02:05 +0200)
Fix _c_helper_absolute_name for fields which can only be
accessed with an iterator function.
These are lists with var-sized structs as members.

Message-ID: <1409743361-466-2-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ...
Patch-Set: ListInputDevices
Patch-Number: libxcb 2/6
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
src/c_client.py

index d3f0eec..a5b3a2c 100644 (file)
@@ -468,7 +468,12 @@ def _c_helper_absolute_name(prefix, field=None):
                 )
         )
     ):
-        prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")";
+        if field.type.is_list and not field.type.member.fixed_size():
+            # only accessible by iterator
+            prefix_str = field.c_iterator_name + "(" + prefix_str_without_lastsep + ")";
+        else:
+            # only accessible by access function
+            prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")";
 
     return prefix_str
 # _c_absolute_name