aboutsummaryrefslogtreecommitdiff
path: root/libxcb/xcb-proto/xcbgen
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-26 20:19:23 +0100
committermarha <marha@users.sourceforge.net>2014-01-26 20:19:23 +0100
commit5f455179ae4b279a82d99a7a3dabe61f58c42ad6 (patch)
treefdecec022cf1b8b782b90a64c14e374fa6d400cb /libxcb/xcb-proto/xcbgen
parent78d84bd03c744b0ed420c450dd2807904ccaef21 (diff)
parent30af30b78075159fce477ae99cc72540133714d0 (diff)
downloadvcxsrv-5f455179ae4b279a82d99a7a3dabe61f58c42ad6.tar.gz
vcxsrv-5f455179ae4b279a82d99a7a3dabe61f58c42ad6.tar.bz2
vcxsrv-5f455179ae4b279a82d99a7a3dabe61f58c42ad6.zip
Merge remote-tracking branch 'origin/released'
* origin/released: xserver randrproto libxtrans fontconfig libxcb xcb-proto mesa git update 26 Jan 2014 Conflicts: X11/xtrans/Xtrans.c xorg-server/dix/dispatch.c xorg-server/os/xdmcp.c
Diffstat (limited to 'libxcb/xcb-proto/xcbgen')
-rw-r--r--libxcb/xcb-proto/xcbgen/state.py1
-rw-r--r--libxcb/xcb-proto/xcbgen/xtypes.py16
2 files changed, 11 insertions, 6 deletions
diff --git a/libxcb/xcb-proto/xcbgen/state.py b/libxcb/xcb-proto/xcbgen/state.py
index 10a8722ea..52b8d8da7 100644
--- a/libxcb/xcb-proto/xcbgen/state.py
+++ b/libxcb/xcb-proto/xcbgen/state.py
@@ -93,6 +93,7 @@ class Module(object):
# Recursively resolve all types
def resolve(self):
for (name, item) in self.all:
+ self.pads = 0
item.resolve(self)
# Call all the output methods
diff --git a/libxcb/xcb-proto/xcbgen/xtypes.py b/libxcb/xcb-proto/xcbgen/xtypes.py
index 5f45723ce..3cd90320e 100644
--- a/libxcb/xcb-proto/xcbgen/xtypes.py
+++ b/libxcb/xcb-proto/xcbgen/xtypes.py
@@ -267,13 +267,17 @@ class PadType(Type):
Type.__init__(self, tcard8.name)
self.is_pad = True
self.size = 1
- self.nmemb = 1 if (elt == None) else int(elt.get('bytes'), 0)
+ self.nmemb = 1
+ self.align = 1
+ if elt != None:
+ self.nmemb = int(elt.get('bytes', "1"), 0)
+ self.align = int(elt.get('align', "1"), 0)
def resolve(self, module):
self.resolved = True
def fixed_size(self):
- return True
+ return self.align <= 1
class ComplexType(Type):
@@ -296,16 +300,15 @@ class ComplexType(Type):
def resolve(self, module):
if self.resolved:
return
- pads = 0
enum = None
# Resolve all of our field datatypes.
for child in list(self.elt):
if child.tag == 'pad':
- field_name = 'pad' + str(pads)
+ field_name = 'pad' + str(module.pads)
fkey = 'CARD8'
type = PadType(child)
- pads = pads + 1
+ module.pads = module.pads + 1
visible = False
elif child.tag == 'field':
field_name = child.get('name')
@@ -397,7 +400,6 @@ class SwitchType(ComplexType):
def resolve(self, module):
if self.resolved:
return
-# pads = 0
parents = list(self.parents) + [self]
@@ -560,6 +562,8 @@ class Reply(ComplexType):
def resolve(self, module):
if self.resolved:
return
+ # Reset pads count
+ module.pads = 0
# Add the automatic protocol fields
self.fields.append(Field(tcard8, tcard8.name, 'response_type', False, True, True))
self.fields.append(_placeholder_byte)