]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix delegate target C name for static fields
authorJürg Billeter <j@bitron.ch>
Wed, 21 Mar 2012 16:31:04 +0000 (17:31 +0100)
committerJürg Billeter <j@bitron.ch>
Wed, 21 Mar 2012 16:31:04 +0000 (17:31 +0100)
Fixes bug 671110.

codegen/valaccodeattribute.vala

index d019ce71dcf7284dd24820880e1222aa4d91ac17..49900dc61fc19461c539a9c8349c07e662729aef 100644 (file)
@@ -461,7 +461,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                                        _delegate_target_name = ccode.get_string ("delegate_target_cname");
                                }
                                if (_delegate_target_name == null) {
-                                       _delegate_target_name = "%s_target".printf (sym.name);
+                                       _delegate_target_name = "%s_target".printf (name);
                                }
                        }
                        return _delegate_target_name;
@@ -610,6 +610,8 @@ public class Vala.CCodeAttribute : AttributeCache {
                                } else {
                                        return "%s%s".printf (CCodeBaseModule.get_ccode_prefix (sym.parent_symbol), sym.name);
                                }
+                       } else if (sym is LocalVariable || sym is Parameter) {
+                               return sym.name;
                        } else {
                                return "%s%s".printf (CCodeBaseModule.get_ccode_prefix (sym.parent_symbol), sym.name);
                        }