Commit cf2a6d04 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

don't create empty dispose functions, support virtual methods with

2006-10-26  Jürg Billeter  <j@bitron.ch>

	* vala/valacodegenerator.vala: don't create empty dispose functions,
	  support virtual methods with non-void return type
	* vapi/glib-2.0.vala: include glib/gstdio.h for GLib file functions

svn path=/trunk/; revision=156
parent f602430f
2006-10-26 Jürg Billeter <j@bitron.ch>
* vala/valacodegenerator.vala: don't create empty dispose functions,
support virtual methods with non-void return type
* vapi/glib-2.0.vala: include glib/gstdio.h for GLib file functions
2006-10-26 Jürg Billeter <j@bitron.ch>
* vala/valacodegenerator.vala: explicitly cast callbacks to reduce the
......
......@@ -410,7 +410,7 @@ public class Vala.CodeGenerator : CodeVisitor {
}
add_instance_init_function (cl);
if (memory_management) {
if (memory_management && cl.get_fields () != null) {
add_dispose_function (cl);
}
......@@ -1273,7 +1273,12 @@ public class Vala.CodeGenerator : CodeVisitor {
vcall.add_argument (new CCodeIdentifier (param.name));
}
vblock.add_statement (new CCodeExpressionStatement (vcall));
if (m.return_type.data_type == null) {
vblock.add_statement (new CCodeExpressionStatement (vcall));
} else {
/* pass method return value */
vblock.add_statement (new CCodeReturnStatement (vcall));
}
header_type_member_declaration.append (vfunc.copy ());
......
......@@ -757,7 +757,7 @@ namespace GLib {
}
[ReferenceType (free_function = "fclose")]
[CCode (cname = "FILE", cheader_filename = "stdio.h")]
[CCode (cname = "FILE", cheader_filename = "stdio.h,glib/gstdio.h")]
public struct File {
[CCode (cname = "fopen")]
public static ref File open (string path, string mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment