]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Update syntax to use owned and unowned where appropriate
authorJürg Billeter <j@bitron.ch>
Fri, 19 Dec 2008 12:37:24 +0000 (12:37 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 19 Dec 2008 12:37:24 +0000 (12:37 +0000)
2008-12-19  Jürg Billeter  <j@bitron.ch>

* vala/valacodewriter.vala:

Update syntax to use owned and unowned where appropriate

svn path=/trunk/; revision=2217

ChangeLog
vala/valacodewriter.vala

index 93da3c0ae8689a0487ae2839cf9713ab5d99ef31..e424949ed4fc8e96921a9c1201ed3e76f086e066 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-19  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valacodewriter.vala:
+
+       Update syntax to use owned and unowned where appropriate
+
 2008-12-19  Jürg Billeter  <j@bitron.ch>
 
        * vala/valaparser.vala:
index cfaeca197ed40d6b8b7c3af4219c5eec6c2fab0b..ed54f3abff931f3a6d0a4d43dcf18c5423795bc2 100644 (file)
@@ -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);