summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Regier <garrett.regier@riftio.com>2014-12-16 08:04:07 -0800
committerLuca Bruno <lucabru@src.gnome.org>2014-12-17 11:56:09 +0100
commitacdddbb12f1bc13474094f5e7888cc59fe80bef0 (patch)
tree949911508859e476cc802001662c67ec9f7d6ca3
parentba44ef5ecd9007e974c8dfa4fd4a49e7fdc4bd49 (diff)
downloadvala-acdddbb12f1bc13474094f5e7888cc59fe80bef0.tar.gz
girwriter: Fix writing type for out params
The extra '*' is required for g_type_info_is_pointer() to return TRUE. This fixes PyGObject marshaling for an interface vfunc with a Boxed out param. https://bugzilla.gnome.org/show_bug.cgi?id=741604 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
-rw-r--r--codegen/valagirwriter.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index e855e1e71..f0a75e292 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -1268,7 +1268,7 @@ public class Vala.GIRWriter : CodeVisitor {
if (has_array_length) {
length_param_index = is_parameter ? index + 1 : index;
}
- write_type (type, length_param_index);
+ write_type (type, length_param_index, direction);
indent--;
write_indent ();
@@ -1286,7 +1286,7 @@ public class Vala.GIRWriter : CodeVisitor {
buffer.append_printf (" glib:get-type=\"%sget_type\"", CCodeBaseModule.get_ccode_lower_case_prefix (symbol));
}
- private void write_type (DataType type, int index = -1) {
+ private void write_type (DataType type, int index = -1, ParameterDirection direction = ParameterDirection.IN) {
if (type is ArrayType) {
var array_type = (ArrayType) type;
@@ -1319,7 +1319,7 @@ public class Vala.GIRWriter : CodeVisitor {
if ((type_name == "GLib.Array") || (type_name == "GLib.PtrArray")) {
is_array = true;
}
- buffer.append_printf ("<%s name=\"%s\" c:type=\"%s\"", is_array ? "array" : "type", gi_type_name (type.data_type), CCodeBaseModule.get_ccode_name (type));
+ buffer.append_printf ("<%s name=\"%s\" c:type=\"%s%s\"", is_array ? "array" : "type", gi_type_name (type.data_type), CCodeBaseModule.get_ccode_name (type), direction == ParameterDirection.IN ? "" : "*");
List<DataType> type_arguments = type.get_type_arguments ();
if (type_arguments.size == 0) {