[vala/0.10] glib-2.0: Deprecate string.len () in favor of string.length



commit efbc947f212db3b9a3576a734de9615b73480494
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 20 20:04:59 2010 +0200

    glib-2.0: Deprecate string.len () in favor of string.length

 codegen/valaccodebasemodule.vala |    2 +-
 codegen/valadovabasemodule.vala  |    2 +-
 codegen/valagtypemodule.vala     |    4 ++--
 compiler/valacompiler.vala       |   12 ++++++------
 vala/valacharacterliteral.vala   |    2 +-
 vala/valaclass.vala              |    6 +++---
 vala/valaenumvalue.vala          |    2 +-
 vala/valagenieparser.vala        |    2 +-
 vala/valageniescanner.vala       |    2 +-
 vala/valagirparser.vala          |    8 ++++----
 vala/valainterface.vala          |    6 +++---
 vala/valaparser.vala             |    2 +-
 vala/valaproperty.vala           |    2 +-
 vala/valascanner.vala            |    2 +-
 vala/valasignal.vala             |    2 +-
 vala/valasourcefile.vala         |    2 +-
 vala/valastringliteral.vala      |    2 +-
 vala/valasymbol.vala             |    8 ++++----
 vapi/glib-2.0.vapi               |   12 ++++++++----
 vapigen/valagidlparser.vala      |   34 +++++++++++++++++-----------------
 vapigen/valavapigen.vala         |    2 +-
 21 files changed, 60 insertions(+), 56 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 6a17886..2b9a9ab 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -719,7 +719,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
 		var define = new StringBuilder ("__");
 		
 		var i = filename;
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			var c = i.get_char ();
 			if (c.isalnum  () && c < 0x80) {
 				define.append_unichar (c.toupper ());
diff --git a/codegen/valadovabasemodule.vala b/codegen/valadovabasemodule.vala
index 2a45d28..5feabfd 100644
--- a/codegen/valadovabasemodule.vala
+++ b/codegen/valadovabasemodule.vala
@@ -398,7 +398,7 @@ public class Vala.DovaBaseModule : CodeGenerator {
 		var define = new StringBuilder ("__");
 
 		var i = filename;
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			var c = i.get_char ();
 			if (c.isalnum  () && c < 0x80) {
 				define.append_unichar (c.toupper ());
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index b2310e7..7e45efe 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -526,7 +526,7 @@ public class Vala.GTypeModule : GErrorModule {
 		bool is_gtypeinstance = !cl.is_compact;
 		bool is_fundamental = is_gtypeinstance && cl.base_class == null;
 
-		if (cl.get_cname().len () < 3) {
+		if (cl.get_cname().length < 3) {
 			cl.error = true;
 			Report.error (cl.source_reference, "Class name `%s' is too short".printf (cl.get_cname ()));
 			return;
@@ -1937,7 +1937,7 @@ public class Vala.GTypeModule : GErrorModule {
 	public override void visit_interface (Interface iface) {
 		push_context (new EmitContext (iface));
 
-		if (iface.get_cname().len () < 3) {
+		if (iface.get_cname().length < 3) {
 			iface.error = true;
 			Report.error (iface.source_reference, "Interface name `%s' is too short".printf (iface.get_cname ()));
 			return;
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 4c52866..9536ba7 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -460,7 +460,7 @@ class Vala.Compiler {
 		if (library != null) {
 			if (gir != null) {
 				if (context.profile == Profile.GOBJECT) {
-					long gir_len = gir.len ();
+					long gir_len = gir.length;
 					unowned string? last_hyphen = gir.rchr (gir_len, '-');
 
 					if (last_hyphen == null || !gir.has_suffix (".gir")) {
@@ -541,7 +541,7 @@ class Vala.Compiler {
 	}
 
 	private static bool ends_with_dir_separator (string s) {
-		return Path.is_dir_separator (s.offset (s.len () - 1).get_char ());
+		return Path.is_dir_separator (s.offset (s.length - 1).get_char ());
 	}
 
 	/* ported from glibc */
@@ -586,9 +586,9 @@ class Vala.Compiler {
 				// do nothing
 			} else if (len == 2 && start.has_prefix ("..")) {
 				// back up to previous component, ignore if at root already
-				if (rpath.len () > root_len) {
+				if (rpath.length > root_len) {
 					do {
-						rpath = rpath.substring (0, rpath.len () - 1);
+						rpath = rpath.substring (0, rpath.length - 1);
 					} while (!ends_with_dir_separator (rpath));
 				}
 			} else {
@@ -600,8 +600,8 @@ class Vala.Compiler {
 			}
 		}
 
-		if (rpath.len () > root_len && ends_with_dir_separator (rpath)) {
-			rpath = rpath.substring (0, rpath.len () - 1);
+		if (rpath.length > root_len && ends_with_dir_separator (rpath)) {
+			rpath = rpath.substring (0, rpath.length - 1);
 		}
 
 		if (Path.DIR_SEPARATOR != '/') {
diff --git a/vala/valacharacterliteral.vala b/vala/valacharacterliteral.vala
index 0de9918..d368d7d 100644
--- a/vala/valacharacterliteral.vala
+++ b/vala/valacharacterliteral.vala
@@ -38,7 +38,7 @@ public class Vala.CharacterLiteral : Literal {
 		set {
 			_value = value;
 			
-			if (!value.validate () || (value.len () != 3 && value.next_char ().get_char () != '\\')) {
+			if (!value.validate () || (value.length != 3 && value.next_char ().get_char () != '\\')) {
 				error = true;
 			}
 		}
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 1fb5798..0380acb 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -595,12 +595,12 @@ public class Vala.Class : ObjectTypeSymbol {
 
 			// remove underscores in some cases to avoid conflicts of type macros
 			if (lower_case_csuffix.has_prefix ("type_")) {
-				lower_case_csuffix = "type" + lower_case_csuffix.offset ("type_".len ());
+				lower_case_csuffix = "type" + lower_case_csuffix.offset ("type_".length);
 			} else if (lower_case_csuffix.has_prefix ("is_")) {
-				lower_case_csuffix = "is" + lower_case_csuffix.offset ("is_".len ());
+				lower_case_csuffix = "is" + lower_case_csuffix.offset ("is_".length);
 			}
 			if (lower_case_csuffix.has_suffix ("_class")) {
-				lower_case_csuffix = lower_case_csuffix.substring (0, lower_case_csuffix.len () - "_class".len ()) + "class";
+				lower_case_csuffix = lower_case_csuffix.substring (0, lower_case_csuffix.length - "_class".length) + "class";
 			}
 		}
 		return lower_case_csuffix;
diff --git a/vala/valaenumvalue.vala b/vala/valaenumvalue.vala
index 2ade411..973bc55 100644
--- a/vala/valaenumvalue.vala
+++ b/vala/valaenumvalue.vala
@@ -48,7 +48,7 @@ public class Vala.EnumValue : Constant {
 
 		string i = name;
 
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c == '_') {
 				str.append_c ('-');
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 20e2263..415a9fe 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -363,7 +363,7 @@ public class Vala.Genie.Parser : CodeVisitor {
 		case TokenType.VERBATIM_STRING_LITERAL:
 			next ();
 			string raw_string = get_last_string ();
-			string escaped_string = raw_string.substring (3, raw_string.len () - 6).escape ("");
+			string escaped_string = raw_string.substring (3, raw_string.length - 6).escape ("");
 			return new StringLiteral ("\"%s\"".printf (escaped_string), get_src (begin));	
 		case TokenType.NULL:
 			next ();
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index 87e9b45..a590dad 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -1391,7 +1391,7 @@ public class Vala.Genie.Scanner {
 
 	bool matches (char* begin, string keyword) {
 		char* keyword_array = (char *) keyword;
-		long len = keyword.len ();
+		long len = keyword.length;
 		for (int i = 0; i < len; i++) {
 			if (begin[i] != keyword_array[i]) {
 				return false;
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index b996596..2ea8ee4 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -307,7 +307,7 @@ public class Vala.GirParser : CodeVisitor {
 	private void calculate_common_prefix (ref string common_prefix, string cname) {
 		if (common_prefix == null) {
 			common_prefix = cname;
-			while (common_prefix.len () > 0 && !common_prefix.has_suffix ("_")) {
+			while (common_prefix.length > 0 && !common_prefix.has_suffix ("_")) {
 				// FIXME: could easily be made faster
 				common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 			}
@@ -316,8 +316,8 @@ public class Vala.GirParser : CodeVisitor {
 				common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 			}
 		}
-		while (common_prefix.len () > 0 && (!common_prefix.has_suffix ("_") ||
-		       (cname.offset (common_prefix.length).get_char ().isdigit ()) && (cname.len () - common_prefix.len ()) <= 1)) {
+		while (common_prefix.length > 0 && (!common_prefix.has_suffix ("_") ||
+		       (cname.offset (common_prefix.length).get_char ().isdigit ()) && (cname.length - common_prefix.length) <= 1)) {
 			// enum values may not consist solely of digits
 			common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 		}
@@ -1018,7 +1018,7 @@ public class Vala.GirParser : CodeVisitor {
 		if (m.name == "new") {
 			m.name = null;
 		} else if (m.name.has_prefix ("new_")) {
-			m.name = m.name.offset ("new_".len ());
+			m.name = m.name.offset ("new_".length);
 		}
 		if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "parameters") {
 			start_element ("parameters");
diff --git a/vala/valainterface.vala b/vala/valainterface.vala
index 02c63a8..f233954 100644
--- a/vala/valainterface.vala
+++ b/vala/valainterface.vala
@@ -321,12 +321,12 @@ public class Vala.Interface : ObjectTypeSymbol {
 
 		// remove underscores in some cases to avoid conflicts of type macros
 		if (result.has_prefix ("type_")) {
-			result = "type" + result.offset ("type_".len ());
+			result = "type" + result.offset ("type_".length);
 		} else if (result.has_prefix ("is_")) {
-			result = "is" + result.offset ("is_".len ());
+			result = "is" + result.offset ("is_".length);
 		}
 		if (result.has_suffix ("_class")) {
-			result = result.substring (0, result.len () - "_class".len ()) + "class";
+			result = result.substring (0, result.length - "_class".length) + "class";
 		}
 
 		return result;
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 8d375cc..f7dc50b 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -308,7 +308,7 @@ public class Vala.Parser : CodeVisitor {
 		case TokenType.VERBATIM_STRING_LITERAL:
 			next ();
 			string raw_string = get_last_string ();
-			string escaped_string = raw_string.substring (3, raw_string.len () - 6).escape ("");
+			string escaped_string = raw_string.substring (3, raw_string.length - 6).escape ("");
 			return new StringLiteral ("\"%s\"".printf (escaped_string), get_src (begin));
 		case TokenType.NULL:
 			next ();
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 7621099..f202444 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -250,7 +250,7 @@ public class Vala.Property : Symbol, Lockable {
 		
 		string i = name;
 		
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c == '_') {
 				str.append_c ('-');
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index e5fd0db..d5dc063 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -1193,7 +1193,7 @@ public class Vala.Scanner {
 
 	static bool matches (char* begin, string keyword) {
 		char* keyword_array = (char*) keyword;
-		long len = keyword.len ();
+		long len = keyword.length;
 		for (int i = 0; i < len; i++) {
 			if (begin[i] != keyword_array[i]) {
 				return false;
diff --git a/vala/valasignal.vala b/vala/valasignal.vala
index 926c75f..2bd1d3f 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -174,7 +174,7 @@ public class Vala.Signal : Symbol, Lockable {
 		
 		string i = get_cname ();
 		
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c == '_') {
 				str.append_c ('-');
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 464c93e..e58e009 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -170,7 +170,7 @@ public class Vala.SourceFile {
 		// filename and basedir are already canonicalized
 		if (filename.has_prefix (context.basedir + "/")) {
 			var basename = Path.get_basename (filename);
-			var subdir = filename.substring (context.basedir.len (), filename.len () - context.basedir.len () - basename.len ());
+			var subdir = filename.substring (context.basedir.length, filename.length - context.basedir.length - basename.length);
 			while (subdir[0] == '/') {
 				subdir = subdir.offset (1);
 			}
diff --git a/vala/valastringliteral.vala b/vala/valastringliteral.vala
index 2a1cbc7..e0234bd 100644
--- a/vala/valastringliteral.vala
+++ b/vala/valastringliteral.vala
@@ -54,7 +54,7 @@ public class Vala.StringLiteral : Literal {
 		}
 		
 		/* remove quotes */
-		var noquotes = value.substring (1, (uint) (value.len () - 2));
+		var noquotes = value.substring (1, (uint) (value.length - 2));
 		/* unescape string */
 		return noquotes.compress ();
 	}
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 57a0e9e..a935bcb 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -282,7 +282,7 @@ public abstract class Vala.Symbol : CodeNode {
 		weak string i = camel_case;
 
 		bool first = true;
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c.isupper () && !first) {
 				/* current character is upper case and
@@ -291,10 +291,10 @@ public abstract class Vala.Symbol : CodeNode {
 				bool prev_upper = t.get_char ().isupper ();
 				t = i.next_char ();
 				bool next_upper = t.get_char ().isupper ();
-				if (!prev_upper || (i.len () >= 2 && !next_upper)) {
+				if (!prev_upper || (i.length >= 2 && !next_upper)) {
 					/* previous character wasn't upper case or
 					 * next character isn't upper case*/
-					long len = result_builder.str.len ();
+					long len = result_builder.str.length;
 					if (len != 1 && result_builder.str.offset (len - 2).get_char () != '_') {
 						/* we're not creating 1 character words */
 						result_builder.append_c ('_');
@@ -323,7 +323,7 @@ public abstract class Vala.Symbol : CodeNode {
 		weak string i = lower_case;
 
 		bool last_underscore = true;
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c == '_') {
 				last_underscore = true;
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 1703194..de52041 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -976,6 +976,7 @@ public class string {
 	public long pointer_to_offset (string pos);
 	[CCode (cname = "g_utf8_prev_char")]
 	public unowned string prev_char ();
+	[Deprecated (replacement = "string.length")]
 	[CCode (cname = "g_utf8_strlen")]
 	public long len (ssize_t max = -1);
 	[CCode (cname = "g_utf8_strchr")]
@@ -1083,7 +1084,7 @@ public class string {
 	public string ndup (size_t n);
 
 	public string substring (long offset, long len = -1) {
-		long string_length = this.len ();
+		long string_length = this.length;
 		if (offset < 0) {
 			offset = string_length + offset;
 			GLib.return_val_if_fail (offset >= 0, null);
@@ -1099,7 +1100,7 @@ public class string {
 	}
 
 	public string slice (long start, long end) {
-		long string_length = this.len ();
+		long string_length = this.length;
 		if (start < 0) {
 			start = string_length + start;
 		}
@@ -1114,7 +1115,7 @@ public class string {
 	}
 
 	public string splice (long start, long end, string? str = null) {
-		long string_length = this.len ();
+		long string_length = this.length;
 		if (start < 0) {
 			start = string_length + start;
 		}
@@ -1162,8 +1163,11 @@ public class string {
 		}
 	}
 
+	[CCode (cname = "g_utf8_strlen")]
+	long utf8_strlen (ssize_t max);
+
 	public long length {
-		get { return this.len (); }
+		get { return this.utf8_strlen (-1); }
 	}
 
 	public uint8[] data {
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 62ba63c..e9b518d 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -162,20 +162,20 @@ public class Vala.GIdlParser : CodeVisitor {
 		}
 
 		if (type_name.has_prefix (ns.name)) {
-			return type_name.offset (ns.name.len ());
+			return type_name.offset (ns.name.length);
 		} else if (ns.name == "GLib" && type_name.has_prefix ("G")) {
 			return type_name.offset (1);
 		} else  {
 			string best_match = null;
 			foreach (string cprefix in ns.get_cprefixes ()) {
 				if (type_name.has_prefix (cprefix)) {
-					if (best_match == null || cprefix.len () > best_match.len ())
+					if (best_match == null || cprefix.length > best_match.length)
 						best_match = cprefix;
 				}
 			}
 
 			if (best_match != null) {
-				return type_name.offset (best_match.len ());;
+				return type_name.offset (best_match.length);;
 			}
 		}
 
@@ -184,7 +184,7 @@ public class Vala.GIdlParser : CodeVisitor {
 
 	private string fix_const_name (string const_name, Namespace ns) {
 		if (const_name.has_prefix (ns.name.up () + "_")) {
-			return const_name.offset (ns.name.len () + 1);
+			return const_name.offset (ns.name.length + 1);
 		} else if (ns.name == "GLib" && const_name.has_prefix ("G_")) {
 			return const_name.offset (2);
 		}
@@ -1010,7 +1010,7 @@ public class Vala.GIdlParser : CodeVisitor {
 
 			if (common_prefix == null) {
 				common_prefix = value.name;
-				while (common_prefix.len () > 0 && !common_prefix.has_suffix ("_")) {
+				while (common_prefix.length > 0 && !common_prefix.has_suffix ("_")) {
 					// FIXME: could easily be made faster
 					common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 				}
@@ -1019,8 +1019,8 @@ public class Vala.GIdlParser : CodeVisitor {
 					common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 				}
 			}
-			while (common_prefix.len () > 0 && (!common_prefix.has_suffix ("_") ||
-			       (value.name.offset (common_prefix.length).get_char ().isdigit ()) && (value.name.len () - common_prefix.len ()) <= 1)) {
+			while (common_prefix.length > 0 && (!common_prefix.has_suffix ("_") ||
+			       (value.name.offset (common_prefix.length).get_char ().isdigit ()) && (value.name.length - common_prefix.length) <= 1)) {
 				// enum values may not consist solely of digits
 				common_prefix = common_prefix.ndup (common_prefix.size () - 1);
 			}
@@ -1084,7 +1084,7 @@ public class Vala.GIdlParser : CodeVisitor {
 			}
 
 			if (!is_hidden) {
-				var ev = new EnumValue (value2.name.offset (common_prefix.len ()), null);
+				var ev = new EnumValue (value2.name.offset (common_prefix.length), null);
 				en.add_value (ev);
 			}
 		}
@@ -1456,7 +1456,7 @@ public class Vala.GIdlParser : CodeVisitor {
 			}
 			
 			if (n.has_prefix ("const-")) {
-				n = n.offset ("const-".len ());
+				n = n.offset ("const-".length);
 			}
 
 			if (type_node.is_pointer &&
@@ -1567,7 +1567,7 @@ public class Vala.GIdlParser : CodeVisitor {
 				var nv = attr.split ("=", 2);
 
 				if (nv[0] == "cprefix") {
-					type.unresolved_symbol = new UnresolvedSymbol (null, n.offset (eval (nv[1]).len ()));
+					type.unresolved_symbol = new UnresolvedSymbol (null, n.offset (eval (nv[1]).length));
 				} else if (nv[0] == "name") {
 					type.unresolved_symbol = new UnresolvedSymbol (null, eval (nv[1]));
 				} else if (nv[0] == "namespace") {
@@ -1589,7 +1589,7 @@ public class Vala.GIdlParser : CodeVisitor {
 		}
 
 		if (n.has_prefix (current_namespace.name)) {
-			type.unresolved_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, current_namespace.name), n.offset (current_namespace.name.len ()));
+			type.unresolved_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, current_namespace.name), n.offset (current_namespace.name.length));
 		} else if (n.has_prefix ("G")) {
 			type.unresolved_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, "GLib"), n.offset (1));
 		} else {
@@ -1622,7 +1622,7 @@ public class Vala.GIdlParser : CodeVisitor {
 		}
 
 		if (type_arg.has_prefix ("unowned ")) {
-			type_arg = type_arg.offset ("unowned ".len ());
+			type_arg = type_arg.offset ("unowned ".length);
 			is_unowned = true;
 		}
 
@@ -1649,7 +1649,7 @@ public class Vala.GIdlParser : CodeVisitor {
 			if (m.name == "new") {
 				m.name = null;
 			} else if (m.name.has_prefix ("new_")) {
-				m.name = m.name.offset ("new_".len ());
+				m.name = m.name.offset ("new_".length);
 			}
 			// For classes, check whether a creation method return type equals to the
 			// type of the class created. If the types do not match (e.g. in most
@@ -1806,7 +1806,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					// class method
 					m.binding = MemberBinding.CLASS;
 					if (m.name.has_prefix ("class_")) {
-						m.name = m.name.substring ("class_".len (), m.name.len () - "class_".len ());
+						m.name = m.name.substring ("class_".length, m.name.length - "class_".length);
 					}
 					continue;
 				} else {
@@ -1949,7 +1949,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							p.initializer = new StringLiteral ("\"\"", param_type.source_reference);
 						} else {
 							unowned string endptr;
-							unowned string val_end = val.offset (val.len ());
+							unowned string val_end = val.offset (val.length);
 
 							val.to_long (out endptr);
 							if ((long)endptr == (long)val_end) {
@@ -2086,7 +2086,7 @@ public class Vala.GIdlParser : CodeVisitor {
 		
 		string i = name;
 		
-		while (i.len () > 0) {
+		while (i.length > 0) {
 			unichar c = i.get_char ();
 			if (c == '-') {
 				str.append_c ('_');
@@ -2378,7 +2378,7 @@ public class Vala.GIdlParser : CodeVisitor {
 
 		GLib.SList<string> attr_list = new GLib.SList<string> ();
 		var attr = new GLib.StringBuilder.sized (attributes.size ());
-		var attributes_len = attributes.len ();
+		var attributes_len = attributes.length;
 		unowned string remaining = attributes;
 		bool quoted = false, escaped = false;
 		for (int b = 0 ; b < attributes_len ; b++) {
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala
index 686102a..403fa89 100644
--- a/vapigen/valavapigen.vala
+++ b/vapigen/valavapigen.vala
@@ -131,7 +131,7 @@ class Vala.VAPIGen : Object {
 				continue;
 			}
 
-			var depsfile = source.substring (0, source.len () - "gi".len ()) + "deps";
+			var depsfile = source.substring (0, source.length - "gi".length) + "deps";
 
 			if (!FileUtils.test (depsfile, FileTest.EXISTS)) continue;
 			



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