gobject-introspection r750 - in trunk: giscanner tests/scanner



Author: walters
Date: Sat Oct 18 01:07:16 2008
New Revision: 750
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=750&view=rev

Log:
Bug 556795 - Fix char ** regression


Modified:
   trunk/giscanner/transformer.py
   trunk/tests/scanner/foo-1.0-expected.gir
   trunk/tests/scanner/foo.c
   trunk/tests/scanner/foo.h

Modified: trunk/giscanner/transformer.py
==============================================================================
--- trunk/giscanner/transformer.py	(original)
+++ trunk/giscanner/transformer.py	Sat Oct 18 01:07:16 2008
@@ -337,7 +337,18 @@
         return node
 
     def _parse_ctype(self, ctype):
-        derefed = ctype.replace('*', '')
+        # First look up the ctype including any pointers;
+        # a few type names like 'char*' have their own aliases
+        # and we need pointer information for those.
+        firstpass = type_name_from_ctype(ctype)
+
+        # Remove all pointers - we require standard calling
+        # conventions.  For example, an 'int' is always passed by
+        # value (unless it's out or inout).
+        derefed = firstpass.replace('*', '')
+
+        # Canonicalize our type again, this time without the pointer;
+        # this ensures we turn e.g. plain "guint" => "int"
         return type_name_from_ctype(derefed)
 
     def _create_type(self, source_type, options):

Modified: trunk/tests/scanner/foo-1.0-expected.gir
==============================================================================
--- trunk/tests/scanner/foo-1.0-expected.gir	(original)
+++ trunk/tests/scanner/foo-1.0-expected.gir	Sat Oct 18 01:07:16 2008
@@ -500,6 +500,18 @@
         </parameter>
       </parameters>
     </function>
+    <function name="test_string_array" c:identifier="foo_test_string_array">
+      <return-value>
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="array">
+          <array c:type="char**">
+            <type name="utf8"/>
+          </array>
+        </parameter>
+      </parameters>
+    </function>
     <constant name="SUCCESS_INT" value="4408">
       <type name="int"/>
     </constant>

Modified: trunk/tests/scanner/foo.c
==============================================================================
--- trunk/tests/scanner/foo.c	(original)
+++ trunk/tests/scanner/foo.c	Sat Oct 18 01:07:16 2008
@@ -335,3 +335,7 @@
 {
 }
 
+void
+foo_test_string_array (char **array)
+{
+}

Modified: trunk/tests/scanner/foo.h
==============================================================================
--- trunk/tests/scanner/foo.h	(original)
+++ trunk/tests/scanner/foo.h	Sat Oct 18 01:07:16 2008
@@ -241,4 +241,6 @@
 void foo_test_unsigned_qualifier (unsigned int unsigned_param);
 void foo_test_unsigned_type (unsigned unsigned_param);
 
+void foo_test_string_array (char **array);
+
 #endif /* __FOO_OBJECT_H__ */



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