vala r1066 - in trunk: . gobject



Author: juergbi
Date: Fri Feb 29 20:58:14 2008
New Revision: 1066
URL: http://svn.gnome.org/viewvc/vala?rev=1066&view=rev

Log:
2008-02-29  Juerg Billeter  <j bitron ch>

	* gobject/valaccodegeneratorinterface.vala,
	  gobject/valaccodegeneratorsignal.vala: support GLib.Error as
	  signal parameter type, fixes bug 519415


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodegeneratorinterface.vala
   trunk/gobject/valaccodegeneratorsignal.vala

Modified: trunk/gobject/valaccodegeneratorinterface.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorinterface.vala	(original)
+++ trunk/gobject/valaccodegeneratorinterface.vala	Fri Feb 29 20:58:14 2008
@@ -214,6 +214,8 @@
 		var params_len = params.size;
 		if (sig.return_type is PointerType || sig.return_type.type_parameter != null) {
 			csignew.add_argument (new CCodeConstant ("G_TYPE_POINTER"));
+		} else if (sig.return_type is ErrorType) {
+			csignew.add_argument (new CCodeConstant ("G_TYPE_POINTER"));
 		} else if (sig.return_type.data_type == null) {
 			csignew.add_argument (new CCodeConstant ("G_TYPE_NONE"));
 		} else {
@@ -223,6 +225,8 @@
 		foreach (FormalParameter param in params) {
 			if (param.type_reference is PointerType || param.type_reference.type_parameter != null || param.type_reference.is_ref || param.type_reference.is_out) {
 				csignew.add_argument (new CCodeConstant ("G_TYPE_POINTER"));
+			} else if (param.type_reference is ErrorType) {
+				csignew.add_argument (new CCodeConstant ("G_TYPE_POINTER"));
 			} else {
 				csignew.add_argument (new CCodeConstant (param.type_reference.data_type.get_type_id ()));
 			}

Modified: trunk/gobject/valaccodegeneratorsignal.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorsignal.vala	(original)
+++ trunk/gobject/valaccodegeneratorsignal.vala	Fri Feb 29 20:58:14 2008
@@ -27,6 +27,8 @@
 	private string get_marshaller_type_name (DataType t) {
 		if (t is PointerType || t.type_parameter != null || t.is_ref || t.is_out) {
 			return ("POINTER");
+		} else if (t is ErrorType) {
+			return ("POINTER");
 		} else if (t is VoidType) {
 			return ("VOID");
 		} else {
@@ -80,6 +82,8 @@
 			return "gint";
 		} else if (t is ArrayType) {
 			return "gpointer";
+		} else if (t is ErrorType) {
+			return "gpointer";
 		}
 		
 		return null;
@@ -208,6 +212,8 @@
 			string get_value_function;
 			if (p.type_reference is PointerType || p.type_reference.type_parameter != null || p.type_reference.is_ref || p.type_reference.is_out) {
 				get_value_function = "g_value_get_pointer";
+			} else if (p.type_reference is ErrorType) {
+				get_value_function = "g_value_get_pointer";
 			} else {
 				get_value_function = p.type_reference.data_type.get_get_value_function ();
 			}
@@ -224,6 +230,8 @@
 			CCodeFunctionCall set_fc;
 			if (sig.return_type.type_parameter != null) {
 				set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
+			} else if (sig.return_type is ErrorType) {
+				set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
 			} else if (sig.return_type.data_type is Class || sig.return_type.data_type is Interface) {
 				set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_object"));
 			} else if (sig.return_type.data_type == string_type.data_type) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]