From: Rico Tzschichholz Date: Tue, 28 Feb 2017 17:40:59 +0000 (+0100) Subject: codegen: Default to void-return for vfunc pointer cast of *_async methods X-Git-Tag: 0.35.7~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4913cff5e059582c18d376ac19756aedf303db73;p=thirdparty%2Fvala.git codegen: Default to void-return for vfunc pointer cast of *_async methods This make it match vala's generated code of async-module. To properly account for non-void *_async methods we require some additional metadata since only the return-type of *_finish method is known. --- diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index 8945d0766..11d2f6d48 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -1502,7 +1502,7 @@ public class Vala.GTypeModule : GErrorModule { CCodeExpression cast_method_pointer (Method m, CCodeExpression cfunc, ObjectTypeSymbol base_type, int direction = 3) { // Cast the function pointer to match the interface string cast; - if (m.return_type.is_real_non_null_struct_type ()) { + if (direction == 1 || m.return_type.is_real_non_null_struct_type ()) { cast = "void (*)"; } else { cast = "%s (*)".printf (get_ccode_name (m.return_type));