]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix naming issue with abstract async methods
authorJürg Billeter <j@bitron.ch>
Tue, 13 Jul 2010 12:42:54 +0000 (14:42 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 13 Jul 2010 12:42:54 +0000 (14:42 +0200)
Fixes bug 623943.

codegen/valaccodemethodmodule.vala

index 180f417f57eb9ccd4f3fc87eaf5a2f18e4b6b1fd..aa786a5ebdf252ac2bfd3c22d1e82acc4235467b 100644 (file)
@@ -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);