summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2008-10-11 21:16:57 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-10-11 21:16:57 +0000
commit7b1e139cd77b60b37d2b1dadfe45855e7bf122e1 (patch)
treed9b67de55369591a343b5d4f6f8e5cf4a093dc1f /giscanner/girwriter.py
parent59011ffa9f2d12cb0c087f451b5918be98d6022e (diff)
downloadgobject-introspection-7b1e139cd77b60b37d2b1dadfe45855e7bf122e1.tar.gz
Bug 555712: Struct and union issues
2008-10-09 Andreas Rottmann <a.rottmann@gmx.at> Bug 555712: Struct and union issues * giscanner/scannerparser.y (struct_declarator): Use information provided about the bit width of a field. * giscanner/transformer.py (Transformer._create_member): Pass the symbol's const_int member to the created field (it represents the bit width). * giscanner/girwriter.py (GIRWriter._write_field): Output 'bits' field attribute, if present. * giscanner/ast.py (Field): Add 'bits' member, specifying the width in bits of the field (only relevant for bitfields). * tests/*: Updated. * giscanner/transformer.py (Transformer._create_typedef_struct) (Transformer._create_typedef_union): Add calls to _create_struct() and _create_union(), respectively. This causes the scanner to generate output for fields of struct and union typedefs. * tests/*: Updated. svn path=/trunk/; revision=667
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 43678581..e8faa5de 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -316,6 +316,8 @@ class GIRWriter(XMLWriter):
return
attrs = [('name', field.name)]
+ if field.bits:
+ attrs.append(('bits', str(field.bits)))
with self.tagcontext('field', attrs):
self._write_type(field.type)