From: Rico Tzschichholz Date: Tue, 12 Mar 2019 09:06:11 +0000 (+0100) Subject: Mark defined constructors of abstract classes as protected X-Git-Tag: 0.42.7~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b151427c61e25ed655cc79262d250a2c93dc5ecc;p=thirdparty%2Fvala.git Mark defined constructors of abstract classes as protected --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 33731c8c6..f2c2fc61f 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -349,7 +349,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public static int ccode_attribute_cache_index = CodeNode.get_attribute_cache_index (); - public CCodeBaseModule () { + protected CCodeBaseModule () { predefined_marshal_set = new HashSet (str_hash, str_equal); predefined_marshal_set.add ("VOID:VOID"); predefined_marshal_set.add ("VOID:BOOLEAN"); diff --git a/libvaladoc/api/item.vala b/libvaladoc/api/item.vala index 69bec622a..5b344bbf8 100644 --- a/libvaladoc/api/item.vala +++ b/libvaladoc/api/item.vala @@ -42,7 +42,7 @@ public abstract class Valadoc.Api.Item : Object { get; } - public Item (Vala.CodeNode? data) { + protected Item (Vala.CodeNode? data) { this.data = data; } diff --git a/libvaladoc/api/node.vala b/libvaladoc/api/node.vala index 7e92206f5..5ccdf74b1 100644 --- a/libvaladoc/api/node.vala +++ b/libvaladoc/api/node.vala @@ -50,7 +50,7 @@ public abstract class Valadoc.Api.Node : Item, Browsable, Documentation { private Vala.Map> per_type_children; - public Node (Node? parent, SourceFile? file, string? name, Vala.CodeNode? data) { + protected Node (Node? parent, SourceFile? file, string? name, Vala.CodeNode? data) { base (data); per_name_children = new Vala.HashMap (str_hash, str_equal); diff --git a/libvaladoc/api/symbol.vala b/libvaladoc/api/symbol.vala index 3b375a330..22bcefb67 100644 --- a/libvaladoc/api/symbol.vala +++ b/libvaladoc/api/symbol.vala @@ -34,7 +34,7 @@ public abstract class Valadoc.Api.Symbol : Node { get; } - public Symbol (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, + protected Symbol (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, Vala.Symbol data) { base (parent, file, name, data); diff --git a/libvaladoc/api/typesymbol.vala b/libvaladoc/api/typesymbol.vala index 17c3501c8..aa952f0e8 100644 --- a/libvaladoc/api/typesymbol.vala +++ b/libvaladoc/api/typesymbol.vala @@ -32,7 +32,7 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol { private string? type_cast_macro_name; private string? type_function_name; - public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, + protected TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, bool is_basic_type, Vala.TypeSymbol data) diff --git a/libvaladoc/content/inlinetaglet.vala b/libvaladoc/content/inlinetaglet.vala index ad6c7a719..b28c7597c 100644 --- a/libvaladoc/content/inlinetaglet.vala +++ b/libvaladoc/content/inlinetaglet.vala @@ -27,7 +27,7 @@ public abstract class Valadoc.Content.InlineTaglet : ContentElement, Taglet, Inl protected ResourceLocator locator; private ContentElement _content; - public InlineTaglet () { + protected InlineTaglet () { base (); } diff --git a/libvaladoc/importer/documentationimporter.vala b/libvaladoc/importer/documentationimporter.vala index 2701571d7..92737dc73 100644 --- a/libvaladoc/importer/documentationimporter.vala +++ b/libvaladoc/importer/documentationimporter.vala @@ -28,7 +28,7 @@ public abstract class Valadoc.Importer.DocumentationImporter : Object, ResourceL public abstract string file_extension { get; } - public DocumentationImporter (Api.Tree tree, ModuleLoader modules, Settings settings) { + protected DocumentationImporter (Api.Tree tree, ModuleLoader modules, Settings settings) { this.settings = settings; this.modules = null; this.tree = tree; diff --git a/tests/asynchronous/generator.vala b/tests/asynchronous/generator.vala index f31e12a42..2c3654b56 100644 --- a/tests/asynchronous/generator.vala +++ b/tests/asynchronous/generator.vala @@ -7,7 +7,7 @@ abstract class Generator { unowned G value; SourceFunc callback; - public Generator () { + protected Generator () { helper.begin (); } diff --git a/tests/chainup/bug791785.vala b/tests/chainup/bug791785.vala index eb46b0141..608de6b0e 100644 --- a/tests/chainup/bug791785.vala +++ b/tests/chainup/bug791785.vala @@ -5,7 +5,7 @@ struct Foo { abstract class AbstractBar { public Foo foo; - public AbstractBar (Foo foo) { + protected AbstractBar (Foo foo) { this.foo = foo; } } diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala index eab81c425..b17261469 100644 --- a/vala/valaobjecttypesymbol.vala +++ b/vala/valaobjecttypesymbol.vala @@ -47,7 +47,7 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol { private List constants = new ArrayList (); - public ObjectTypeSymbol (string name, SourceReference? source_reference = null, Comment? comment = null) { + protected ObjectTypeSymbol (string name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala index 59e75a577..c41f6a0e2 100644 --- a/vala/valasymbol.vala +++ b/vala/valasymbol.vala @@ -197,7 +197,7 @@ public abstract class Vala.Symbol : CodeNode { private weak Scope _owner; private Scope _scope; - public Symbol (string? name, SourceReference? source_reference, Comment? comment = null) { + protected Symbol (string? name, SourceReference? source_reference, Comment? comment = null) { this.name = name; this.source_reference = source_reference; this.comment = comment; diff --git a/vala/valatypesymbol.vala b/vala/valatypesymbol.vala index ce1d4ea30..3198ca046 100644 --- a/vala/valatypesymbol.vala +++ b/vala/valatypesymbol.vala @@ -29,7 +29,7 @@ using GLib; * code or imported from an external library with a Vala API file. */ public abstract class Vala.TypeSymbol : Symbol { - public TypeSymbol (string? name, SourceReference? source_reference = null, Comment? comment = null) { + protected TypeSymbol (string? name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } diff --git a/vala/valavaluetype.vala b/vala/valavaluetype.vala index d78af9960..ed1225d6d 100644 --- a/vala/valavaluetype.vala +++ b/vala/valavaluetype.vala @@ -31,7 +31,7 @@ public abstract class Vala.ValueType : DataType { */ public weak TypeSymbol type_symbol { get; set; } - public ValueType (TypeSymbol type_symbol) { + protected ValueType (TypeSymbol type_symbol) { this.type_symbol = type_symbol; data_type = type_symbol; }