summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTommi Komulainen <tommi.komulainen@iki.fi>2008-10-23 17:42:25 +0000
committerTommi Komulainen <tko@src.gnome.org>2008-10-23 17:42:25 +0000
commit1842570d3329e47beb6aef836a7e7fdd0bc680c2 (patch)
treeb4190fccea95a8f9e280185614483eace5234a0f /tools
parentb9713056e7bd9777c5b92e3ba0078effd301b157 (diff)
downloadgobject-introspection-1842570d3329e47beb6aef836a7e7fdd0bc680c2.tar.gz
Bug 556739 – transfer-ownership attribute should be mandatory in .gir
2008-10-23 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer): * giscanner/transformer.py (_create_parameter, _create_return): * giscanner/girwriter.py (_write_return, _write_parameter): * tools/generate.c (write_callable_info): always write and require "transfer-ownership" for return-values and parameters * tests/boxed.gir: * tests/invoke/testfns-1.0.gir: * tests/object.gir: * tests/scanner/DrawableAdditions.xml: * tests/scanner/GtkFrob-1.0-expected.tgir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/drawable-1.0-expected.tgir: * tests/scanner/drawable-injected-1.0-expected.gir: * tests/scanner/drawable-injected-1.0-expected.tgir: * tests/scanner/foo-1.0-expected.tgir: Updated svn path=/trunk/; revision=797
Diffstat (limited to 'tools')
-rw-r--r--tools/generate.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/generate.c b/tools/generate.c
index 8a3b1d86..fad680f5 100644
--- a/tools/generate.c
+++ b/tools/generate.c
@@ -382,21 +382,19 @@ write_callable_info (const gchar *namespace,
xml_start_element (file, "return-value");
- if (g_type_info_is_pointer (type))
+ switch (g_callable_info_get_caller_owns (info))
{
- switch (g_callable_info_get_caller_owns (info))
- {
- case GI_TRANSFER_NOTHING:
- break;
- case GI_TRANSFER_CONTAINER:
- xml_printf (file, " transfer-ownership=\"container\"");
- break;
- case GI_TRANSFER_EVERYTHING:
- xml_printf (file, " transfer-ownership=\"full\"");
- break;
- default:
- g_assert_not_reached ();
- }
+ case GI_TRANSFER_NOTHING:
+ xml_printf (file, " transfer-ownership=\"none\"");
+ break;
+ case GI_TRANSFER_CONTAINER:
+ xml_printf (file, " transfer-ownership=\"container\"");
+ break;
+ case GI_TRANSFER_EVERYTHING:
+ xml_printf (file, " transfer-ownership=\"full\"");
+ break;
+ default:
+ g_assert_not_reached ();
}
if (g_callable_info_may_return_null (info))
@@ -421,6 +419,7 @@ write_callable_info (const gchar *namespace,
switch (g_arg_info_get_ownership_transfer (arg))
{
case GI_TRANSFER_NOTHING:
+ xml_printf (file, " transfer-ownership=\"none\"");
break;
case GI_TRANSFER_CONTAINER:
xml_printf (file, " transfer-ownership=\"container\"");