[vala/wip/attributes: 84/121] Drop no_array_length



commit ec83c7236f48bfdf8386f2163c94cc76c403ae52
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jun 30 12:05:11 2011 +0200

    Drop no_array_length

 codegen/valaccodebasemodule.vala |    4 ++++
 vala/valadelegate.vala           |    9 ---------
 vala/valagirparser.vala          |    2 +-
 vala/valalambdaexpression.vala   |    2 +-
 vala/valamethod.vala             |   12 ------------
 vala/valaparameter.vala          |    2 +-
 vala/valaproperty.vala           |    5 -----
 vala/valavariable.vala           |    9 ---------
 8 files changed, 7 insertions(+), 38 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index abffc85..bb3e1ca 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -6557,6 +6557,10 @@ public class Vala.CCodeAttribute : AttributeCache {
 				_real_name = attr.get_string ("construct_function");
 			}
 		}
+		if (node.get_attribute ("NoArrayLength") != null) {
+			Report.deprecated (node.source_reference, "NoArrayLength attribute is deprecated, use [CCode (array_length = false)] instead.");
+			no_array_length = true;
+		}
 	}
 
 	private string get_default_name () {
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index d1270ab..c89a78e 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -70,12 +70,6 @@ public class Vala.Delegate : TypeSymbol {
 	public double cdelegate_target_parameter_position { get; set; }
 
 	/**
-	 * Specifies whether the array length should be returned implicitly
-	 * if the return type is an array.
-	 */
-	public bool no_array_length { get; set; }
-
-	/**
 	 * Specifies whether the array is null terminated.
 	 */
 	public bool array_null_terminated { get; set; }
@@ -258,9 +252,6 @@ public class Vala.Delegate : TypeSymbol {
 	}
 
 	private void process_ccode_attribute (Attribute a) {
-		if (a.has_argument ("array_length")) {
-			no_array_length = !a.get_bool ("array_length");
-		}
 		if (a.has_argument ("array_length_type")) {
 			array_length_type = a.get_string ("array_length_type");
 		}
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index c79d29f..c5c2229 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -632,7 +632,7 @@ public class Vala.GirParser : CodeVisitor {
 		public string get_finish_cname () {
 			var finish_cname = symbol.get_attribute_string ("CCode", "finish_name");
 			if (finish_cname != null) {
-				returnf finish_cname;
+				return finish_cname;
 			}
 			var result = get_cname ();
 			if (result.has_suffix ("_async")) {
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index ecfe251..bebcbaf 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -135,7 +135,7 @@ public class Vala.LambdaExpression : Expression {
 		var cb = (Delegate) ((DelegateType) target_type).delegate_symbol;
 		var return_type = cb.return_type.get_actual_type (target_type, null, this);
 		method = new Method (get_lambda_name (context), return_type, source_reference);
-		method.no_array_length = cb.no_array_length;
+		method.attributes = attributes;
 		method.array_null_terminated = cb.array_null_terminated;
 		method.array_length_type = cb.array_length_type;
 		// track usage for flow analyzer
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index b13d9df..70a38b5 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -145,12 +145,6 @@ public class Vala.Method : Subroutine {
 	public double cdelegate_target_parameter_position { get; set; }
 
 	/**
-	 * Specifies whether the array length should be returned implicitly
-	 * if the return type is an array.
-	 */
-	public bool no_array_length { get; set; }
-
-	/**
 	 * Specifies whether the array is null terminated.
 	 */
 	public bool array_null_terminated { get; set; }
@@ -317,9 +311,6 @@ public class Vala.Method : Subroutine {
 		if (a.has_argument ("sentinel")) {
 			this.sentinel = a.get_string ("sentinel");
 		}
-		if (a.has_argument ("array_length")) {
-			no_array_length = !a.get_bool ("array_length");
-		}
 		if (a.has_argument ("array_length_type")) {
 			array_length_type = a.get_string ("array_length_type");
 		}
@@ -368,9 +359,6 @@ public class Vala.Method : Subroutine {
 				printf_format = true;
 			} else if (a.name == "ScanfFormat") {
 				scanf_format = true;
-			} else if (a.name == "NoArrayLength") {
-				Report.warning (source_reference, "NoArrayLength attribute is deprecated, use [CCode (array_length = false)] instead.");
-				no_array_length = true;
 			} else if (a.name == "Deprecated") {
 				process_deprecated_attribute (a);
 			} else if (a.name == "NoThrow") {
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index ab4d4a3..256c0fd 100644
--- a/vala/valaparameter.vala
+++ b/vala/valaparameter.vala
@@ -156,7 +156,7 @@ public class Vala.Parameter : Variable {
 			result.params_array = params_array;
 			result.direction = this.direction;
 			result.initializer = this.initializer;
-			result.no_array_length = this.no_array_length;
+			result.attributes = this.attributes.copy ();
 			result.no_delegate_target = this.no_delegate_target;
 			result.array_null_terminated = this.array_null_terminated;
 			return result;
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 4d7a1a3..802a835 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -140,8 +140,6 @@ public class Vala.Property : Symbol, Lockable {
 	 */
 	public Expression initializer { get; set; }
 
-	public bool no_array_length { get; set; }
-
 	public bool array_null_terminated { get; set; }
 
 	/**
@@ -251,9 +249,6 @@ public class Vala.Property : Symbol, Lockable {
 		if (a.has_argument ("notify")) {
 			notify = a.get_bool ("notify");
 		}
-		if (a.has_argument ("array_length")) {
-			no_array_length = !a.get_bool ("array_length");
-		}
 		if (a.has_argument ("array_null_terminated")) {
 			array_null_terminated = a.get_bool ("array_null_terminated");
 		}
diff --git a/vala/valavariable.vala b/vala/valavariable.vala
index 56cb1ae..646cd91 100644
--- a/vala/valavariable.vala
+++ b/vala/valavariable.vala
@@ -50,12 +50,6 @@ public class Vala.Variable : Symbol {
 	}
 
 	/**
-	 * Specifies whether an array length field should implicitly be created
-	 * if the field type is an array.
-	 */
-	public bool no_array_length { get; set; }
-
-	/**
 	 * Specifies whether a delegate target field should implicitly be created
 	 * if the field type is a delegate.
 	 */
@@ -138,9 +132,6 @@ public class Vala.Variable : Symbol {
 	}
 
 	void process_ccode_attribute (Attribute a) {
-		if (a.has_argument ("array_length")) {
-			no_array_length = !a.get_bool ("array_length");
-		}
 		if (a.has_argument ("array_null_terminated")) {
 			array_null_terminated = a.get_bool ("array_null_terminated");
 		}



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