summaryrefslogtreecommitdiff
path: root/libvaladoc
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-10-10 18:01:22 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-10-10 18:15:00 +0200
commitc3b972e14a71fecb5a8ebd01193f559931ee174e (patch)
treeadc86b6745ab0bc4e099163bf08329278515e935 /libvaladoc
parent278797ab7ac06d71548fb699678e6f727bc5673e (diff)
downloadvala-c3b972e14a71fecb5a8ebd01193f559931ee174e.tar.gz
libvaladoc: Drop unused code
Diffstat (limited to 'libvaladoc')
-rw-r--r--libvaladoc/api/typereference.vala82
1 files changed, 0 insertions, 82 deletions
diff --git a/libvaladoc/api/typereference.vala b/libvaladoc/api/typereference.vala
index 669c05423..b2cafb5b7 100644
--- a/libvaladoc/api/typereference.vala
+++ b/libvaladoc/api/typereference.vala
@@ -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) {