[Xcb-commit] xcb/proto: xcbgen

Christian Linhart clinhart at kemper.freedesktop.org
Tue Jan 5 17:38:42 PST 2016


 xcbgen/xtypes.py |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 811e038c9501dfe95301d5f148be1f2b1bafbc1e
Author: Jaya Tiwari <tiwari.jaya18 at gmail.com>
Date:   Wed Nov 11 01:01:32 2015 +0100

    calculate lengthless list
    
    Some rework done by Christian Linhart
    
    Signed-off-by: Jaya Tiwari <tiwari.jaya18 at gmail.com>
    Signed-off-by: Christian Linhart <chris at demorecorder.com>

diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
index f5302be..1f604de 100644
--- a/xcbgen/xtypes.py
+++ b/xcbgen/xtypes.py
@@ -268,10 +268,17 @@ class ListType(Type):
         self.is_list = True
         self.member = member
         self.parents = list(parent)
+        lenfield_name = False
 
         if elt.tag == 'list':
             elts = list(elt)
             self.expr = Expression(elts[0] if len(elts) else elt, self)
+            is_list_in_parent = self.parents[0].elt.tag in ('request', 'event', 'reply', 'error')
+            if not len(elts) and is_list_in_parent:
+                self.expr = Expression(elt,self)
+                self.expr.op = 'calculate_len'
+            else:
+                self.expr = Expression(elts[0] if len(elts) else elt, self)
 
         self.size = member.size if member.fixed_size() else None
         self.nmemb = self.expr.nmemb if self.expr.fixed_size() else None


More information about the xcb-commit mailing list