diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2019-01-06 00:00:00 +0000 |
---|---|---|
committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2019-01-06 21:05:25 +0100 |
commit | 58e97dc13e33fc4fdfe83090fbde8ecc40662386 (patch) | |
tree | 4908b5171e797ccf33c58ffee869711393d225c6 | |
parent | 1f0965e379035be51ae96d5761358ec088fb3421 (diff) | |
download | gobject-introspection-58e97dc13e33fc4fdfe83090fbde8ecc40662386.tar.gz |
scanner: Remove incorrect c:type generated for array of synthesized unions
This also reverts workaround introduced to support this use case in
f77cfc4275b1fba4f9fedea6e40b00e0ebbe142c, since it is no longer
necessary.
Fixes issue #141.
-rw-r--r-- | giscanner/transformer.py | 6 | ||||
-rw-r--r-- | tests/scanner/Regress-1.0-expected.gir | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 1b5c80eb..e2294a63 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -484,8 +484,6 @@ raise ValueError.""" CTYPE_UNION, CTYPE_ENUM]: value = source_type.name - if not value: - value = 'gpointer' if const: value = 'const ' + value if volatile: @@ -553,7 +551,6 @@ raise ValueError.""" # Special handling for fields; we don't have annotations on them # to apply later, yet. if source_type.type == CTYPE_ARRAY: - complete_ctype = self._create_complete_source_type(source_type) # If the array contains anonymous unions, like in the GValue # struct, we need to handle this specially. This is necessary # to be able to properly calculate the size of the compound @@ -562,9 +559,10 @@ raise ValueError.""" if (source_type.base_type.type == CTYPE_UNION and source_type.base_type.name is None): synthesized_type = self._synthesize_union_type(symbol, parent_symbol) - ftype = ast.Array(None, synthesized_type, complete_ctype=complete_ctype) + ftype = ast.Array(None, synthesized_type) else: ctype = self._create_source_type(source_type) + complete_ctype = self._create_complete_source_type(source_type) from_ctype = self.create_type_from_ctype_string(ctype, complete_ctype=complete_ctype) ftype = ast.Array(None, from_ctype) diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 0ee763f1..c10d50e4 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -5019,7 +5019,7 @@ the introspection client langage.</doc> <type name="GType" c:type="GType"/> </field> <field name="some_union" writable="1"> - <array zero-terminated="0" c:type="gpointer" fixed-size="2"> + <array zero-terminated="0" fixed-size="2"> <type name="TestStructE__some_union__union"/> </array> </field> |