]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Clean up Api.Struct constructor
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 14 Nov 2018 14:47:24 +0000 (15:47 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 25 Nov 2018 12:38:45 +0000 (13:38 +0100)
libvaladoc/api/struct.vala
valadoc/treebuilder.vala

index a05544a420a9d16b248a110c07883c8494f06c12..983eb2a841804ac96ce1884d1f4232a7b61d3045 100644 (file)
@@ -35,21 +35,24 @@ public class Valadoc.Api.Struct : TypeSymbol {
        private string? cname;
 
        public Struct (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
-                                  SourceComment? comment, string? cname, string? type_macro_name,
-                                  string? type_function_name, string? type_id, string? dup_function_cname,
-                                  string? copy_function_cname, string? destroy_function_cname,
-                                  string? free_function_cname, bool is_basic_type, Vala.Struct data)
+                                  SourceComment? comment, string? type_macro_name,
+                                  string? type_function_name, Vala.Struct data)
        {
+               bool is_basic_type = data.base_type == null
+                       && (data.is_boolean_type ()
+                       || data.is_floating_type ()
+                       || data.is_integer_type ());
+
                base (parent, file, name, accessibility, comment, type_macro_name, null, null,
                        type_function_name, is_basic_type, data);
 
-               this.dup_function_cname = dup_function_cname;
-               this.copy_function_cname = copy_function_cname;
-               this.free_function_cname = free_function_cname;
-               this.destroy_function_cname = destroy_function_cname;
+               this.dup_function_cname = Vala.get_ccode_dup_function (data);
+               this.copy_function_cname = Vala.get_ccode_copy_function (data);
+               this.free_function_cname = Vala.get_ccode_free_function (data);
+               this.destroy_function_cname = Vala.get_ccode_destroy_function (data);
 
-               this.cname = cname;
-               this.type_id = type_id;
+               this.cname = Vala.get_ccode_name (data);
+               this.type_id = Vala.get_ccode_type_id (data);
        }
 
        /**
index 1c1250f745fafd667c2850c907d825127d8ed2d0..99ca31ffaabce119cf737540749f4fbc512fed9a 100644 (file)
@@ -716,25 +716,13 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                SourceFile? file = get_source_file (element);
                SourceComment? comment = create_comment (element.comment);
 
-               bool is_basic_type = element.base_type == null
-                       && (element.is_boolean_type ()
-                       || element.is_floating_type ()
-                       || element.is_integer_type ());
-
                Struct node = new Struct (parent,
                                                                  file,
                                                                  element.name,
                                                                  element.access,
                                                                  comment,
-                                                                 Vala.get_ccode_name (element),
                                                                  get_type_macro_name (element),
                                                                  get_type_function_name (element),
-                                                                 Vala.get_ccode_type_id (element),
-                                                                 Vala.get_ccode_dup_function (element),
-                                                                 Vala.get_ccode_copy_function (element),
-                                                                 Vala.get_ccode_destroy_function (element),
-                                                                 Vala.get_ccode_free_function (element),
-                                                                 is_basic_type,
                                                                  element);
                symbol_map.set (element, node);
                parent.add_child (node);