summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2010-05-06 11:57:37 +0200
committerJohan Dahlin <johan@gnome.org>2010-05-19 13:01:37 -0300
commit2cfb5774d7ae8aa32d7a3f722adaf8a9ff6fcd6d (patch)
treea928e2dfc8f34dbe59c6694ba42bb9d4fb37cf7a
parentd6eab71ca6e1c6eadccf7ad5dc2316728a18ed4d (diff)
downloadgobject-introspection-2cfb5774d7ae8aa32d7a3f722adaf8a9ff6fcd6d.tar.gz
Take into account the underscore after the type name when checking if a function is a method
https://bugzilla.gnome.org/show_bug.cgi?id=617876
-rw-r--r--gir/Everything-1.0-expected.gir27
-rw-r--r--gir/everything.c18
-rw-r--r--gir/everything.h3
-rw-r--r--giscanner/glibtransformer.py2
4 files changed, 49 insertions, 1 deletions
diff --git a/gir/Everything-1.0-expected.gir b/gir/Everything-1.0-expected.gir
index 168c8b24..4a157878 100644
--- a/gir/Everything-1.0-expected.gir
+++ b/gir/Everything-1.0-expected.gir
@@ -1612,6 +1612,33 @@ call and can be released on return.">
</parameter>
</parameters>
</function>
+ <function name="test_object_null_in" c:identifier="test_object_null_in">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="obj"
+ transfer-ownership="none"
+ allow-none="1"
+ doc="A #TestObj">
+ <type name="TestObj" c:type="TestObj*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="test_object_null_out" c:identifier="test_object_null_out">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="obj"
+ direction="out"
+ transfer-ownership="full"
+ allow-none="1"
+ doc="A #TestObj">
+ <type name="TestObj" c:type="TestObj**"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="test_short" c:identifier="test_short">
<return-value transfer-ownership="none">
<type name="short" c:type="gshort"/>
diff --git a/gir/everything.c b/gir/everything.c
index cee6a2bf..08a8992d 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -1777,6 +1777,24 @@ test_obj_do_matrix (TestObj *obj, const char *somestr)
return TEST_OBJ_GET_CLASS (obj)->matrix (obj, somestr);
}
+/**
+ * test_object_null_in:
+ * @obj: (allow-none) A #TestObj
+ */
+void
+test_object_null_in (TestObj *obj)
+{
+}
+
+/**
+ * test_object_null_out:
+ * @obj: (allow-none) (out) A #TestObj
+ */
+void
+test_object_null_out (TestObj **obj)
+{
+}
+
typedef struct _CallbackInfo CallbackInfo;
struct _CallbackInfo
diff --git a/gir/everything.h b/gir/everything.h
index 395d1427..3b9e2648 100644
--- a/gir/everything.h
+++ b/gir/everything.h
@@ -305,6 +305,9 @@ gboolean test_obj_torture_signature_1 (TestObj *obj,
/* virtual */
int test_obj_do_matrix (TestObj *obj, const char *somestr);
+void test_object_null_in (TestObj *obj);
+void test_object_null_out (TestObj **obj);
+
/* inheritance */
#define TEST_TYPE_SUB_OBJ (test_sub_obj_get_type ())
#define TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_SUB_OBJ, TestSubObj))
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index cfde94b3..ca43eb09 100644
--- a/giscanner/glibtransformer.py
+++ b/giscanner/glibtransformer.py
@@ -511,7 +511,7 @@ class GLibTransformer(object):
name_uscore = GET_TYPE_OVERRIDES.get(node.get_type,
node.get_type)
name_uscore = name_uscore[:-len('_get_type')]
- name_offset = func.symbol.find(name_uscore)
+ name_offset = func.symbol.find(name_uscore + '_')
if name_offset < 0:
return None
prefix = func.symbol[:name_offset+len(name_uscore)]