diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-11 19:30:41 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-11 19:30:41 +0100 |
commit | cccf2ad9f2c6d3bb96af755bbb325bc27f232c10 (patch) | |
tree | cf117b7097a33c0dc6d67f8a0c3da64142e38d2a /ccode | |
parent | e8dbc1e1cfb501ac5f21f6d32643eb32f734b9af (diff) | |
download | vala-cccf2ad9f2c6d3bb96af755bbb325bc27f232c10.tar.gz |
Transform CCode*'s "deprecated" into using CCodeNode's "modifiers"
Diffstat (limited to 'ccode')
-rw-r--r-- | ccode/valaccodeenum.vala | 7 | ||||
-rw-r--r-- | ccode/valaccodeenumvalue.vala | 8 | ||||
-rw-r--r-- | ccode/valaccodestruct.vala | 7 | ||||
-rw-r--r-- | ccode/valaccodetypedefinition.vala | 7 |
4 files changed, 6 insertions, 23 deletions
diff --git a/ccode/valaccodeenum.vala b/ccode/valaccodeenum.vala index 2288456cb..f2a378879 100644 --- a/ccode/valaccodeenum.vala +++ b/ccode/valaccodeenum.vala @@ -31,11 +31,6 @@ public class Vala.CCodeEnum : CCodeNode { */ public string name { get; set; } - /** - * Whether the enum is deprecated. - */ - public bool deprecated { get; set; default = false; } - private List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> (); public CCodeEnum (string? name = null) { @@ -75,7 +70,7 @@ public class Vala.CCodeEnum : CCodeNode { writer.write_string (" "); writer.write_string (name); } - if (deprecated) { + if (CCodeModifiers.DEPRECATED in modifiers) { writer.write_string (" G_GNUC_DEPRECATED"); } writer.write_string (";"); diff --git a/ccode/valaccodeenumvalue.vala b/ccode/valaccodeenumvalue.vala index e1c02513b..e952f4b90 100644 --- a/ccode/valaccodeenumvalue.vala +++ b/ccode/valaccodeenumvalue.vala @@ -32,11 +32,6 @@ public class Vala.CCodeEnumValue : CCodeNode { public string name { get; set; } /** - * Whether this enum value is deprecated. - */ - public bool deprecated { get; set; default = false; } - - /** * The numerical representation of this enum value. */ public CCodeExpression? value { get; set; } @@ -52,5 +47,8 @@ public class Vala.CCodeEnumValue : CCodeNode { writer.write_string (" = "); value.write (writer); } + if (CCodeModifiers.DEPRECATED in modifiers) { + writer.write_string (" G_GNUC_DEPRECATED"); + } } } diff --git a/ccode/valaccodestruct.vala b/ccode/valaccodestruct.vala index 1eadd025c..fce7fcba8 100644 --- a/ccode/valaccodestruct.vala +++ b/ccode/valaccodestruct.vala @@ -31,11 +31,6 @@ public class Vala.CCodeStruct : CCodeNode { */ public string name { get; set; } - /** - * Whether the struct is deprecated. - */ - public bool deprecated { get; set; default = false; } - public bool is_empty { get { return declarations.size == 0; } } private List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> (); @@ -75,7 +70,7 @@ public class Vala.CCodeStruct : CCodeNode { } writer.write_end_block (); - if (deprecated) { + if (CCodeModifiers.DEPRECATED in modifiers) { writer.write_string (" G_GNUC_DEPRECATED"); } writer.write_string (";"); diff --git a/ccode/valaccodetypedefinition.vala b/ccode/valaccodetypedefinition.vala index 84d6ce293..797c3baf0 100644 --- a/ccode/valaccodetypedefinition.vala +++ b/ccode/valaccodetypedefinition.vala @@ -36,11 +36,6 @@ public class Vala.CCodeTypeDefinition : CCodeNode { */ public CCodeDeclarator declarator { get; set; } - /** - * Whether the type is deprecated. - */ - public bool deprecated { get; set; default = false; } - public CCodeTypeDefinition (string type, CCodeDeclarator decl) { type_name = type; declarator = decl; @@ -59,7 +54,7 @@ public class Vala.CCodeTypeDefinition : CCodeNode { declarator.write_declaration (writer); - if (deprecated) { + if (CCodeModifiers.DEPRECATED in modifiers) { writer.write_string (" G_GNUC_DEPRECATED"); } |