vala r1367 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1367 - in trunk: . gobject
- Date: Sun, 11 May 2008 13:40:08 +0100 (BST)
Author: juergbi
Date: Sun May 11 12:40:08 2008
New Revision: 1367
URL: http://svn.gnome.org/viewvc/vala?rev=1367&view=rev
Log:
2008-05-11 Juerg Billeter <j bitron ch>
* gobject/valaccodegeneratorsignal.vala:
Use correct marshaller for string arrays,
patch by Ali Sabil, fixes bug 531251
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegeneratorsignal.vala
Modified: trunk/gobject/valaccodegeneratorsignal.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorsignal.vala (original)
+++ trunk/gobject/valaccodegeneratorsignal.vala Sun May 11 12:40:08 2008
@@ -30,7 +30,11 @@
} else if (t is ErrorType) {
return ("POINTER");
} else if (t is ArrayType) {
- return ("POINTER");
+ if (((ArrayType) t).element_type.data_type == string_type.data_type) {
+ return ("BOXED");
+ } else {
+ return ("POINTER");
+ }
} else if (t is VoidType) {
return ("VOID");
} else {
@@ -195,7 +199,7 @@
CCodeFunctionCall fc;
- if (return_type.data_type != null) {
+ if (return_type.data_type != null || return_type.is_array ()) {
var_decl = new CCodeDeclaration (get_value_type_name_from_type_reference (return_type));
var_decl.add_declarator (new CCodeVariableDeclarator ("v_return"));
marshaller_body.add_statement (var_decl);
@@ -243,11 +247,17 @@
}
fc.add_argument (new CCodeIdentifier ("data2"));
- if (return_type.data_type != null) {
+ if (return_type.data_type != null || return_type.is_array ()) {
marshaller_body.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("v_return"), fc)));
CCodeFunctionCall set_fc;
- if (return_type.type_parameter != null) {
+ if (return_type.is_array ()) {
+ if (((ArrayType)return_type).element_type.data_type == string_type.data_type) {
+ set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_boxed"));
+ } else {
+ set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
+ }
+ } else if (return_type.type_parameter != null) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
} else if (return_type is ErrorType) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]