[vala] Fix naming issue with abstract async methods



commit 295973bd5df0a0b71819c61b49b2d72bb78a1cfe
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jul 13 14:42:54 2010 +0200

    Fix naming issue with abstract async methods
    
    Fixes bug 623943.

 codegen/valaccodemethodmodule.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 180f417..aa786a5 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -977,7 +977,11 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
 	}
 
 	public void generate_vfunc (Method m, DataType return_type, Map<int,CCodeFormalParameter> cparam_map, Map<int,CCodeExpression> carg_map, string suffix = "", int direction = 3) {
-		var vfunc = new CCodeFunction (m.get_cname () + suffix);
+		string cname = m.get_cname ();
+		if (suffix == "_finish" && cname.has_suffix ("_async")) {
+			cname = cname.substring (0, cname.length - "_async".length);
+		}
+		var vfunc = new CCodeFunction (cname + suffix);
 		if (function != null) {
 			vfunc.line = function.line;
 		}
@@ -1003,7 +1007,11 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
 		}
 		vcast.add_argument (new CCodeIdentifier ("self"));
 	
-		var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.vfunc_name + suffix));
+		cname = m.vfunc_name;
+		if (suffix == "_finish" && cname.has_suffix ("_async")) {
+			cname = cname.substring (0, cname.length - "_async".length);
+		}
+		var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, cname + suffix));
 		carg_map.set (get_param_pos (m.cinstance_parameter_position), new CCodeIdentifier ("self"));
 
 		generate_cparameters (m, source_declarations, cparam_map, vfunc, null, carg_map, vcall, direction);



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