From: Jürg Billeter Date: Fri, 19 Dec 2008 12:37:24 +0000 (+0000) Subject: Update syntax to use owned and unowned where appropriate X-Git-Tag: VALA_0_5_4~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d98c28f22e4da2a2f3ccb1c5ea23e41d273c11d3;p=thirdparty%2Fvala.git Update syntax to use owned and unowned where appropriate 2008-12-19 Jürg Billeter * vala/valacodewriter.vala: Update syntax to use owned and unowned where appropriate svn path=/trunk/; revision=2217 --- diff --git a/ChangeLog b/ChangeLog index 93da3c0ae..e424949ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-19 Jürg Billeter + + * vala/valacodewriter.vala: + + Update syntax to use owned and unowned where appropriate + 2008-12-19 Jürg Billeter * vala/valaparser.vala: diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index cfaeca197..ed54f3abf 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -730,23 +730,23 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("params "); } - if (param.direction != ParameterDirection.IN) { + if (param.direction == ParameterDirection.IN) { + if (param.parameter_type.value_owned) { + write_string ("owned "); + } + } else { if (param.direction == ParameterDirection.REF) { write_string ("ref "); } else if (param.direction == ParameterDirection.OUT) { write_string ("out "); } if (is_weak (param.parameter_type)) { - write_string ("weak "); + write_string ("unowned "); } } write_type (param.parameter_type); - if (param.direction == ParameterDirection.IN && param.parameter_type.value_owned) { - write_string ("#"); - } - write_string (" "); write_identifier (param.name); @@ -953,12 +953,12 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("virtual "); } - write_type (prop.property_type); - if (prop.property_type.value_owned) { - write_string ("#"); + write_string ("owned "); } + write_type (prop.property_type); + write_string (" "); write_identifier (prop.name); write_string (" {"); @@ -1393,7 +1393,7 @@ public class Vala.CodeWriter : CodeVisitor { } public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) { - write_string ("#"); + write_string ("(owned) "); expr.inner.accept (this); } @@ -1516,7 +1516,7 @@ public class Vala.CodeWriter : CodeVisitor { private void write_return_type (DataType type) { if (is_weak (type)) { - write_string ("weak "); + write_string ("unowned "); } write_type (type);