[vala/wip/attributes: 57/100] Drop Struct.has_copy_function and has_destroy_function



commit 4f7dfe39d02595031ff800c4d58cc058b0c6f56a
Author: Luca Bruno <lucabru src gnome org>
Date:   Wed Jun 29 20:00:00 2011 +0200

    Drop Struct.has_copy_function and has_destroy_function

 vala/valastruct.vala        |   10 ----------
 vapigen/valagidlparser.vala |    4 ++--
 2 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index 80a6a51..764726f 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -97,10 +97,6 @@ public class Vala.Struct : TypeSymbol {
 
 	public bool signed { get; set; default = true; }
 
-	public bool has_copy_function { get; set; default = true; }
-
-	public bool has_destroy_function { get; set; default = true; }
-
 	/**
 	 * Creates a new struct.
 	 *
@@ -463,15 +459,9 @@ public class Vala.Struct : TypeSymbol {
 		if (a.has_argument ("copy_function")) {
 			set_copy_function (a.get_string ("copy_function"));
 		}
-		if (a.has_argument ("has_copy_function")) {
-			has_copy_function = a.get_bool ("has_copy_function");
-		}
 		if (a.has_argument ("destroy_function")) {
 			set_destroy_function (a.get_string ("destroy_function"));
 		}
-		if (a.has_argument ("has_destroy_function")) {
-			has_destroy_function = a.get_bool ("has_destroy_function");
-		}
 	}
 
 	private void process_boolean_type_attribute (Attribute a) {
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 74d40f0..eac71ed 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -766,7 +766,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							st.set_attribute_string ("CCode", "type_id", eval (nv[1]));
 						} else if (nv[0] == "has_copy_function") {
 							if (eval (nv[1]) == "0") {
-								st.has_copy_function = false;
+								st.set_attribute_bool ("CCode", "has_copy_function", false);
 							}
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
@@ -778,7 +778,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							st.deprecated_since = eval (nv[1]);
 						} else if (nv[0] == "has_destroy_function") {
 							if (eval (nv[1]) == "0") {
-								st.has_destroy_function = false;
+								st.set_attribute_bool ("CCode", "has_destroy_function", false);
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]