vala r2379 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2379 - in trunk: . gobject
- Date: Sat, 17 Jan 2009 22:18:43 +0000 (UTC)
Author: juergbi
Date: Sat Jan 17 22:18:43 2009
New Revision: 2379
URL: http://svn.gnome.org/viewvc/vala?rev=2379&view=rev
Log:
2009-01-17 JÃrg Billeter <j bitron ch>
* gobject/valaccodedelegatemodule.vala:
Fix wrapper for delegates returning arrays, fixes bug 564474
Modified:
trunk/ChangeLog
trunk/gobject/valaccodedelegatemodule.vala
Modified: trunk/gobject/valaccodedelegatemodule.vala
==============================================================================
--- trunk/gobject/valaccodedelegatemodule.vala (original)
+++ trunk/gobject/valaccodedelegatemodule.vala Sat Jan 17 22:18:43 2009
@@ -54,6 +54,15 @@
}
}
}
+ if (!d.no_array_length && d.return_type is ArrayType) {
+ // return array length if appropriate
+ var array_type = (ArrayType) d.return_type;
+
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ var cparam = new CCodeFormalParameter (head.get_array_length_cname ("result", dim), "int*");
+ cfundecl.add_parameter (cparam);
+ }
+ }
if (d.has_target) {
var cparam = new CCodeFormalParameter ("user_data", "void*");
cfundecl.add_parameter (cparam);
@@ -244,6 +253,15 @@
}
}
+ if (!d.no_array_length && d.return_type is ArrayType) {
+ // return array length if appropriate
+ var array_type = (ArrayType) d.return_type;
+
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ var cparam = new CCodeFormalParameter (head.get_array_length_cname ("result", dim), "int*");
+ cparam_map.set (get_param_pos (d.carray_length_parameter_position + 0.01 * dim), cparam);
+ }
+ }
if (m.get_error_types ().size > 0) {
var cparam = new CCodeFormalParameter ("error", "GError**");
@@ -311,6 +329,18 @@
i++;
}
+ if (!m.no_array_length && m.return_type is ArrayType) {
+ var array_type = (ArrayType) m.return_type;
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ CCodeExpression clength;
+ if (d.no_array_length) {
+ clength = new CCodeConstant ("NULL");
+ } else {
+ clength = new CCodeIdentifier (head.get_array_length_cname ("result", dim));
+ }
+ carg_map.set (get_param_pos (m.carray_length_parameter_position + 0.01 * dim), clength);
+ }
+ }
if (m.get_error_types ().size > 0) {
carg_map.set (get_param_pos (-1), new CCodeIdentifier ("error"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]