[vala/switch-to-gir: 16/24] girparser: Fix parsing arrays in metadata types



commit 965ff4c989cbbd2c62216745cedc551ffdddcf05
Author: Luca Bruno <lucabru src gnome org>
Date:   Wed Nov 17 21:59:46 2010 +0100

    girparser: Fix parsing arrays in metadata types

 vala/valagirparser.vala                |    4 ++--
 vapi/packages/gio-2.0/Gio-2.0.metadata |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 8d848d0..78a09cc 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1064,7 +1064,7 @@ public class Vala.GirParser : CodeVisitor {
 	DataType? parse_type_from_string (string type_string, bool owned_by_default, SourceReference? source_reference = null) {
 		if (type_from_string_regex == null) {
 			try {
-				type_from_string_regex = new GLib.Regex ("^(?:(owned|unowned|weak) +)?([0-9a-zA-Z_\\.]+)(?:<(.+)>)?(\\*+)?(\\[(,*)?\\])?(\\?)?$", GLib.RegexCompileFlags.ANCHORED | GLib.RegexCompileFlags.DOLLAR_ENDONLY | GLib.RegexCompileFlags.OPTIMIZE);
+				type_from_string_regex = new GLib.Regex ("^(?:(owned|unowned|weak) +)?([0-9a-zA-Z_\\.]+)(?:<(.+)>)?(\\*+)?(\\[,*\\])?(\\?)?$", GLib.RegexCompileFlags.ANCHORED | GLib.RegexCompileFlags.DOLLAR_ENDONLY | GLib.RegexCompileFlags.OPTIMIZE);
 			} catch (GLib.RegexError e) {
 				GLib.error ("Unable to compile regex: %s", e.message);
 			}
@@ -1138,7 +1138,7 @@ public class Vala.GirParser : CodeVisitor {
 		}
 
 		if (array_data != null) {
-			type = new ArrayType (type, (int) array_data.length + 1, source_reference);
+			type = new ArrayType (type, (int) array_data.length - 1, source_reference);
 		}
 
 		type.nullable = nullable;
diff --git a/vapi/packages/gio-2.0/Gio-2.0.metadata b/vapi/packages/gio-2.0/Gio-2.0.metadata
index a960578..322f733 100644
--- a/vapi/packages/gio-2.0/Gio-2.0.metadata
+++ b/vapi/packages/gio-2.0/Gio-2.0.metadata
@@ -17,6 +17,9 @@ AppLaunchContext
 	.get_display.files type_arguments="File"
 	.get_startup_notify_id.files type_arguments="File"
 ApplicationCommandLine.get_platform_data nullable
+BufferedInputStream.peek.buffer type="uint8[]" array_length_pos=2
+BufferedInputStream.peek_buffer type="unowned uint8[]"
+	.count skip
 
 /* OLD METADATA FOR REFERENCE
 GLib cprefix="G" lower_case_cprefix="g_" cheader_filename="gio/gio.h" gir_namespace="Gio" gir_version="2.0"



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