]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Drop unused code
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 10 Oct 2019 16:01:22 +0000 (18:01 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 10 Oct 2019 16:15:00 +0000 (18:15 +0200)
libvaladoc/api/typereference.vala

index 669c05423da9c8255270ee816203eeda20554db8..b2cafb5b7baf42e2916beebdadb4234a780589da 100644 (file)
@@ -37,94 +37,12 @@ public class Valadoc.Api.TypeReference : Item {
                base (data);
 
                this.dbus_type_signature = dbus_type_signature;
-               this.pass_ownership = type_reference_pass_ownership (data);
                this.is_nullable = is_nullable;
                this.is_dynamic = is_dynamic;
                this.ownership = get_type_reference_ownership (data);
                this.parent = parent;
        }
 
-       bool is_reference_counting (Vala.TypeSymbol sym) {
-               return Vala.is_reference_counting (sym);
-       }
-
-       bool type_reference_pass_ownership (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               weak Vala.CodeNode? node = element.parent_node;
-               if (node == null) {
-                       return false;
-               }
-               if (node is Vala.Parameter) {
-                       return (((Vala.Parameter)node).direction == Vala.ParameterDirection.IN &&
-                               ((Vala.Parameter)node).variable_type.value_owned);
-               }
-               if (node is Vala.Property) {
-                       return ((Vala.Property)node).property_type.value_owned;
-               }
-
-               return false;
-       }
-
-       bool is_type_reference_unowned (Vala.DataType? element) {
-                       if (element == null) {
-                               return false;
-                       }
-
-                       // non ref counted types are weak, not unowned
-                       if (element.type_symbol is Vala.TypeSymbol
-                               && is_reference_counting ((Vala.TypeSymbol) element.type_symbol) == true)
-                       {
-                               return false;
-                       }
-
-                       // FormalParameters are weak by default
-                       return (element.parent_node is Vala.Parameter == false)
-                               ? element.is_weak ()
-                               : false;
-       }
-
-       bool is_type_reference_owned (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               weak Vala.CodeNode parent = element.parent_node;
-
-               // parameter:
-               if (parent is Vala.Parameter) {
-                       if (((Vala.Parameter)parent).direction != Vala.ParameterDirection.IN) {
-                               return false;
-                       }
-                       return ((Vala.Parameter)parent).variable_type.value_owned;
-               }
-
-               return false;
-       }
-
-       bool is_type_reference_weak (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               // non ref counted types are unowned, not weak
-               if (element.type_symbol is Vala.TypeSymbol
-                       && is_reference_counting ((Vala.TypeSymbol) element.type_symbol) == false)
-               {
-                       return false;
-               }
-
-               // arrays are unowned, not weak
-               if (element is Vala.ArrayType) {
-                       return false;
-               }
-
-               // FormalParameters are weak by default
-               return (element.parent_node is Vala.Parameter == false)? element.is_weak () : false;
-       }
-
        Ownership get_type_reference_ownership (Vala.DataType? element) {
                unowned Vala.DataType? type = element;
                if (type != null) {