aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/c_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'libxcb/src/c_client.py')
-rw-r--r--libxcb/src/c_client.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py
index 078037650..411760264 100644
--- a/libxcb/src/c_client.py
+++ b/libxcb/src/c_client.py
@@ -1133,11 +1133,11 @@ def _c_serialize(context, self):
_c(' %s *xcb_out = *_buffer;', self.c_type)
_c(' unsigned int xcb_out_pad = -sizeof(%s) & 3;', self.c_type)
_c(' unsigned int xcb_buffer_len = sizeof(%s) + xcb_out_pad;', self.c_type)
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
else:
_c(' char *xcb_out = *_buffer;')
_c(' unsigned int xcb_buffer_len = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
prefix = [('_aux', '->', self)]
aux_ptr = 'xcb_out'
@@ -1160,7 +1160,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_buffer_len = 0;')
_c(' unsigned int xcb_block_len = 0;')
_c(' unsigned int xcb_pad = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
elif 'sizeof' == context:
param_names = [p[2] for p in params]
@@ -1205,7 +1205,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_buffer_len = 0;')
_c(' unsigned int xcb_block_len = 0;')
_c(' unsigned int xcb_pad = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
_c('')
for t in temp_vars:
@@ -1788,12 +1788,12 @@ def _c_complex(self):
for field in struct_fields:
length = len(field.c_field_type)
# account for '*' pointer_spec
- if not field.type.fixed_size():
+ if not field.type.fixed_size() and not self.is_union:
length += 1
maxtypelen = max(maxtypelen, length)
def _c_complex_field(self, field, space=''):
- if (field.type.fixed_size() or
+ if (field.type.fixed_size() or self.is_union or
# in case of switch with switch children, don't make the field a pointer
# necessary for unserialize to work
(self.is_switch and field.type.is_switch)):