[gobject-introspection] scanner: Remove incorrect c:type generated for array of synthesized unions



commit 58e97dc13e33fc4fdfe83090fbde8ecc40662386
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Sun Jan 6 00:00:00 2019 +0000

    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.

 giscanner/transformer.py               | 6 ++----
 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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]