diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2011-07-06 09:56:18 +0200 |
---|---|---|
committer | Luca Bruno <lucabru@src.gnome.org> | 2011-08-01 19:09:01 +0200 |
commit | fec66bf087618263c57cdc34eb92aef6a79b86b6 (patch) | |
tree | 5b244b13f5f8708303ef0e63cb5b131a21998d18 /vala/valafield.vala | |
parent | 21fa2ed25337b21f7108a65f8942d27bd3335372 (diff) | |
download | vala-fec66bf087618263c57cdc34eb92aef6a79b86b6.tar.gz |
Drop C specific methods from the code tree
Diffstat (limited to 'vala/valafield.vala')
-rw-r--r-- | vala/valafield.vala | 76 |
1 files changed, 2 insertions, 74 deletions
diff --git a/vala/valafield.vala b/vala/valafield.vala index 5926a3179..8b932a5df 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -38,8 +38,6 @@ public class Vala.Field : Variable, Lockable { */ public bool is_volatile { get; set; } - private string cname; - private bool lock_used = false; /** @@ -67,65 +65,6 @@ public class Vala.Field : Variable, Lockable { } } - /** - * Returns the name of this field as it is used in C code. - * - * @return the name to be used in C code - */ - public string get_cname () { - if (cname == null) { - cname = get_default_cname (); - } - return cname; - } - - /** - * Sets the name of this field as it is used in C code. - * - * @param cname the name to be used in C code - */ - public void set_cname (string cname) { - this.cname = cname; - } - - /** - * Returns the default name of this field as it is used in C code. - * - * @return the name to be used in C code by default - */ - public string get_default_cname () { - if (binding == MemberBinding.STATIC) { - return parent_symbol.get_lower_case_cprefix () + name; - } else { - return name; - } - } - - private void process_ccode_attribute (Attribute a) { - if (a.has_argument ("cname")) { - set_cname (a.get_string ("cname")); - } - if (a.has_argument ("cheader_filename")) { - var val = a.get_string ("cheader_filename"); - foreach (string filename in val.split (",")) { - add_cheader_filename (filename); - } - } - } - - /** - * Process all associated attributes. - */ - public override void process_attributes () { - base.process_attributes (); - - foreach (Attribute a in attributes) { - if (a.name == "CCode") { - process_ccode_attribute (a); - } - } - } - public bool get_lock_used () { return lock_used; } @@ -147,20 +86,11 @@ public class Vala.Field : Variable, Lockable { } public string? get_ctype () { - var attr = get_attribute ("CCode"); - if (attr == null) { - return null; - } - return attr.get_string ("type"); + return get_attribute_string ("CCode", "type"); } public void set_ctype (string ctype) { - var attr = get_attribute ("CCode"); - if (attr == null) { - attr = new Attribute ("CCode"); - attributes.append (attr); - } - attr.add_argument ("type", "\"%s\"".printf (ctype)); + set_attribute_string ("CCode", "type", ctype); } public override bool check (CodeContext context) { @@ -193,8 +123,6 @@ public class Vala.Field : Variable, Lockable { return false; } - process_attributes (); - if (initializer != null) { initializer.target_type = variable_type; |