[Xcb] [PATCH libxcb 2/6] generator: fix absname for fields with only iterator function

Christian Linhart chris at demorecorder.com
Wed Sep 3 04:22:37 PDT 2014


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.
---
 src/c_client.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/c_client.py b/src/c_client.py
index 488f0e6..35c975f 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -464,15 +464,20 @@ def _c_helper_absolute_name(prefix, field=None):
                 ( field.type.is_list and not field.type.fixed_size() )
                 or
                 ( field.prev_varsized_field is not None
                   or not field.type.fixed_size()
                 )
         )
     ):
-        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
 
 def _c_helper_field_mapping(complex_type, prefix, flat=False):
     """
     generate absolute names, based on prefix, for all fields starting from complex_type
-- 
2.0.1



More information about the Xcb mailing list