[vala] girparser: Fix owned and unowned metadata arguments



commit 93b08e4466f93131fa3aa0239dc96f823b03dfab
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jul 16 18:42:52 2011 +0200

    girparser: Fix owned and unowned metadata arguments

 vala/valagirparser.vala            |   10 +++-------
 vapi/metadata/Clutter-1.0.metadata |   16 ++++++++--------
 vapi/metadata/Peas-1.0.metadata    |    2 +-
 vapi/metadata/Soup-2.4.metadata    |    6 +++---
 4 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 335a203..044f2d4 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1391,14 +1391,10 @@ public class Vala.GirParser : CodeVisitor {
 				changed = true;
 			}
 
-			if (type.value_owned) {
-				if (metadata.has_argument (ArgumentType.UNOWNED)) {
-					type.value_owned = !metadata.get_bool (ArgumentType.UNOWNED);
-				}
+			if (owned_by_default) {
+				type.value_owned = !metadata.get_bool (ArgumentType.UNOWNED, !type.value_owned);
 			} else {
-				if (metadata.has_argument (ArgumentType.OWNED)) {
-					type.value_owned = metadata.get_bool (ArgumentType.OWNED);
-				}
+				type.value_owned = metadata.get_bool (ArgumentType.OWNED, type.value_owned);
 			}
 			type.nullable = metadata.get_bool (ArgumentType.NULLABLE, type.nullable);
 		}
diff --git a/vapi/metadata/Clutter-1.0.metadata b/vapi/metadata/Clutter-1.0.metadata
index 71de949..6a5ea4a 100644
--- a/vapi/metadata/Clutter-1.0.metadata
+++ b/vapi/metadata/Clutter-1.0.metadata
@@ -19,7 +19,7 @@ feature_available skip
 feature_get_all skip
 frame_source_* name="frame_source_(.+)" parent="Clutter.FrameSource" skip=false
 InitError errordomain=false
-Stage.read_pixels owned
+Stage.read_pixels unowned=false
 	.width default=-1
 	.height default=-1
 threads_* name="threads_(.+)" parent="Clutter.Threads" skip=false
@@ -34,7 +34,7 @@ value_get_color nullable
 value_get_fixed nullable
 value_get_shader_float array array_length_idx=1
 value_get_shader_int array array_length_idx=1
-value_get_units owned
+value_get_units unowned=false
 value_set_shader_float.floats array array_length_idx=1
 value_set_shader_int.ints array array_length_idx=1
 value_set_shader_matrix.matrix array array_length_idx=1
@@ -67,14 +67,14 @@ PRIORITY_REDRAW skip=false
 // Forward upstream
 Actor
 	.animate* skip=false
-	.apply_relative_transform_to_point.vertex out owned
+	.apply_relative_transform_to_point.vertex out unowned=false
 	.apply_transform.matrix ref
-	.apply_transform_to_point.vertex out owned
+	.apply_transform_to_point.vertex out unowned=false
 	.button_*.event type="Clutter.ButtonEvent"
-	.get_abs_allocation_vertices.verts owned
-	.get_allocation_box.box owned
-	.get_allocation_geometry.geom owned
-	.get_allocation_vertices.verts owned
+	.get_abs_allocation_vertices.verts unowned=false
+	.get_allocation_box.box unowned=false
+	.get_allocation_geometry.geom unowned=false
+	.get_allocation_vertices.verts unowned=false
 	.get_parent nullable
 	.get_stage type="unowned Clutter.Stage"
 	.enter_event.event type="Clutter.CrossingEvent"
diff --git a/vapi/metadata/Peas-1.0.metadata b/vapi/metadata/Peas-1.0.metadata
index 5be1b8b..4bd41f8 100644
--- a/vapi/metadata/Peas-1.0.metadata
+++ b/vapi/metadata/Peas-1.0.metadata
@@ -1,5 +1,5 @@
 Engine
-	.create_extension skip=false owned=true
+	.create_extension skip=false unowned=false
 	.get_plugin_info unowned=true
 ExtensionBase
 	.get_plugin_info unowned=true
diff --git a/vapi/metadata/Soup-2.4.metadata b/vapi/metadata/Soup-2.4.metadata
index 6e857a3..cbd0832 100644
--- a/vapi/metadata/Soup-2.4.metadata
+++ b/vapi/metadata/Soup-2.4.metadata
@@ -32,7 +32,7 @@ Buffer.new_with_owner.data type="uint8[]" array_length_idx=1
 Buffer.new_subbuffer skip
 Buffer.new_with_owner.owner_dnotify nullable
 CookieJar.all_cookies type_arguments="Cookie"
-ContentSniffer.sniff.params type_arguments="string,string" nullable out owned
+ContentSniffer.sniff.params type_arguments="string,string" nullable out unowned=false
 form_* skip=false
 header_parse_list type_arguments="string"
 header_parse_quality_list type_arguments="string"
@@ -45,8 +45,8 @@ Message
 	.set_request.req_body type="uint8[]" array_length_idx=3
 	.set_response.resp_body type="uint8[]" array_length_idx=3
 MessageHeaders
-	.get_content_disposition.* out owned
-	.get_content_type.* out owned
+	.get_content_disposition.* out unowned=false
+	.get_content_type.* out unowned=false
 	.get_content_*.params type_arguments="string,string"
 	.get_ranges.ranges out
 	.set_content_disposition.params type_arguments="string,string" nullable



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