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

support mapping interface methods to abstract and virtual methods, fixes

2007-09-18  Juerg Billeter  <j@bitron.ch>

	* gobject/valaccodegeneratorclass.vala,
	  gobject/valaccodegeneratormethod.vala: support mapping interface
	  methods to abstract and virtual methods, fixes bug 477206

svn path=/trunk/; revision=618
parent 0c563506
2007-09-18 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegeneratorclass.vala,
gobject/valaccodegeneratormethod.vala: support mapping interface
methods to abstract and virtual methods, fixes bug 477206
2007-09-17 Jürg Billeter <j@bitron.ch>
* vala/Makefile.am, vala/valacodebinding.vala,
......
......@@ -372,7 +372,12 @@ public class Vala.CCodeGenerator {
}
var ciface = new CCodeIdentifier ("iface");
init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.base_interface_method.vfunc_name), new CCodeIdentifier (m.get_real_cname ()))));
var cname = m.get_real_cname ();
if (m.is_abstract || m.is_virtual) {
// FIXME results in C compiler warning
cname = m.get_cname ();
}
init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.base_interface_method.vfunc_name), new CCodeIdentifier (cname))));
}
source_type_member_definition.append (iface_init);
......
......@@ -102,7 +102,7 @@ public class Vala.CCodeGenerator {
if (m.instance || (m.parent_symbol is Struct && m is CreationMethod)) {
var this_type = new TypeReference ();
this_type.data_type = find_parent_type (m);
if (m.base_interface_method != null) {
if (m.base_interface_method != null && !m.is_abstract && !m.is_virtual) {
var base_type = new TypeReference ();
base_type.data_type = (DataType) m.base_interface_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
......
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