From: Jürg Billeter Date: Wed, 7 Jun 2006 12:30:21 +0000 (+0000) Subject: fix cname of constants, casts of self X-Git-Tag: VALA_0_0_1~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7a863fe4bbe54f92424ab02d50a7d14c6608886;p=platform%2Fupstream%2Fvala.git fix cname of constants, casts of self 2006-06-07 Jürg Billeter * vala/valacodegenerator.vala: fix cname of constants, casts of self svn path=/trunk/; revision=41 --- diff --git a/vala/ChangeLog b/vala/ChangeLog index 1b65e94..910cf9d 100644 --- a/vala/ChangeLog +++ b/vala/ChangeLog @@ -1,5 +1,9 @@ 2006-06-07 Jürg Billeter + * vala/valacodegenerator.vala: fix cname of constants, casts of self + +2006-06-07 Jürg Billeter + * vala/valasemanticanalyzer.vala: add missing source dependencies * vala/valacodegenerator.vala: check parameter types at runtime diff --git a/vala/vala/valacodegenerator.vala b/vala/vala/valacodegenerator.vala index ad1f565..527e233 100644 --- a/vala/vala/valacodegenerator.vala +++ b/vala/vala/valacodegenerator.vala @@ -519,7 +519,7 @@ namespace Vala { if (c.type_reference.array) { arr = "[]"; } - cdecl.add_declarator (new CCodeVariableDeclarator (name = "%s_%s%s".printf (t.get_lower_case_cname (null), c.name, arr), initializer = c.initializer.ccodenode)); + cdecl.add_declarator (new CCodeVariableDeclarator (name = "%s%s".printf (c.get_cname (), arr), initializer = c.initializer.ccodenode)); cdecl.modifiers = CCodeModifiers.STATIC; source_type_member_declaration.append (cdecl); } @@ -1116,12 +1116,13 @@ namespace Vala { var req_cast = false; if (expr.call is SimpleName) { instance = new CCodeIdentifier (name = "self"); - /* require casts for override methods */ - req_cast = m.is_override; + /* require casts for overriden and inherited methods */ + req_cast = m.is_override || (m.symbol.parent_symbol != current_symbol); } else if (expr.call is MemberAccess) { var ma = (MemberAccess) expr.call; instance = ma.inner.ccodenode; - /* reqiure casts if the type of the used instance is different than the type which declared the method */ + /* reqiure casts if the type of the used instance is + * different than the type which declared the method */ req_cast = base_method.symbol.parent_symbol.node != ma.inner.static_type.type; } else { Report.error (expr.source_reference, "unsupported method invocation");