summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Martin <consume.noise@gmail.com>2012-12-28 23:25:16 +0100
committerDaniel Martin <consume.noise@gmail.com>2013-08-15 00:34:26 +0200
commit0289348f2c4ed3b1b286c51df19d82c6787c2b36 (patch)
treee050551279cefcb4ab53789ef9b6598ff3e72151
parentb9efd2a09a45616f6238e4da49b8f2127b6ec6d9 (diff)
c_client.py: Do not create pointers in unions
Do not create pointers in unions for fields of variadic length. Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Ran Benita <ran234@gmail.com>
-rw-r--r--src/c_client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/c_client.py b/src/c_client.py
index 2aba741..a6f8edd 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1787,12 +1787,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)):