[gobject-introspection] scanner: Merge specifiers and qualifiers when merging basic types.



commit 6a11cde78591acc37fe9162bcaf26cde10413436
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Sat Jan 5 00:00:00 2019 +0000

    scanner: Merge specifiers and qualifiers when merging basic types.

 giscanner/scannerparser.y              | 5 +++++
 tests/scanner/Regress-1.0-expected.gir | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index ed4f24fd..29d98b41 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -218,6 +218,11 @@ set_or_merge_base_type (GISourceType *type,
       g_free (type->name);
       type->name = name;
 
+      type->storage_class_specifier |= base->storage_class_specifier;
+      type->type_qualifier |= base->type_qualifier;
+      type->function_specifier |= base->function_specifier;
+      type->is_bitfield |= base->is_bitfield;
+
       ctype_free (base);
     }
   else if (base->type == CTYPE_INVALID)
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 55a910b3..5f303a4e 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -5081,7 +5081,7 @@ the introspection client langage.</doc>
         <type name="gint" c:type="const gint* volatile"/>
       </field>
       <field name="data7" writable="1">
-        <type name="guint8" c:type="volatile unsigned char"/>
+        <type name="guint8" c:type="volatile const unsigned char"/>
       </field>
     </record>
     <record name="TestStructFixedArray" c:type="RegressTestStructFixedArray">


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