]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
ccode: Minor API cleaning and additions
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 1 Feb 2021 13:54:55 +0000 (14:54 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 1 Feb 2021 13:54:55 +0000 (14:54 +0100)
ccode/valaccodecommaexpression.vala
ccode/valaccodedeclaration.vala
ccode/valaccodedeclarator.vala
ccode/valaccodefragment.vala
ccode/valaccodefunctioncall.vala
ccode/valaccodefunctiondeclarator.vala
ccode/valaccodevariabledeclarator.vala

index f72a9871348b152be7395a58662f7824b8033ba8..3221788edf0c276797263eb3eb020f5316479d29 100644 (file)
@@ -41,7 +41,7 @@ public class Vala.CCodeCommaExpression : CCodeExpression {
                inner[index] = expr;
        }
 
-       public List<CCodeExpression> get_inner () {
+       public unowned List<CCodeExpression> get_inner () {
                return inner;
        }
 
index 6295477b31424b8b1354928298375c3ecc0421d5..6da01cfa6d1d434fa82c6c1623ca92bb37bad70f 100644 (file)
@@ -46,6 +46,15 @@ public class Vala.CCodeDeclaration : CCodeStatement {
                declarators.add (decl);
        }
 
+       /**
+        * Returns the list of declarators.
+        *
+        * @return declarators list
+        */
+       public unowned List<CCodeDeclarator> get_declarators () {
+               return declarators;
+       }
+
        public override void write (CCodeWriter writer) {
                if ((modifiers & (CCodeModifiers.STATIC | CCodeModifiers.INTERNAL | CCodeModifiers.EXTERN)) == 0) {
                        foreach (CCodeDeclarator decl in declarators) {
index 5484694752c653be6b32d363fd4e5ad66666dcfe..634dbb8560ee11cb50806002ff16185fc91f4dda 100644 (file)
@@ -26,6 +26,11 @@ using GLib;
  * Represents a variable or function pointer declarator in the C code.
  */
 public abstract class Vala.CCodeDeclarator : CCodeNode {
+       /**
+        * The declarator name.
+        */
+       public string name { get; set; }
+
        /**
         * Writes initialization statements for this declarator with the
         * specified C code writer if necessary.
index 51538da6b91cc94cf5d67b768cdba173968ee01a..49d4153074c8f933052fe1136d3e1a421c320626 100644 (file)
@@ -38,11 +38,11 @@ public class Vala.CCodeFragment : CCodeNode {
        }
 
        /**
-        * Returns a copy of the list of children.
+        * Returns the list of children.
         *
         * @return children list
         */
-       public List<CCodeNode> get_children () {
+       public unowned List<CCodeNode> get_children () {
                return children;
        }
 
index e4a8ec16dc94bef3f5618616d52e3d3c889e7c75..1d2e364c0f335836013b805db2fcb8014438f1de 100644 (file)
@@ -51,11 +51,11 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
        }
 
        /**
-        * Returns a copy of the list of arguments.
+        * Returns the list of arguments.
         *
         * @return list of arguments
         */
-       public List<CCodeExpression> get_arguments () {
+       public unowned List<CCodeExpression> get_arguments () {
                return arguments;
        }
 
index e9d634411f0333a09f254b192f83d1550c88b4c2..2ba21e9579979180104b09dc0f44dc8079d457cc 100644 (file)
@@ -26,11 +26,6 @@ using GLib;
  * Represents a function pointer declarator in the C code.
  */
 public class Vala.CCodeFunctionDeclarator : CCodeDeclarator {
-       /**
-        * The declarator name.
-        */
-       public string name { get; set; }
-
        private List<CCodeParameter> parameters = new ArrayList<CCodeParameter> ();
 
        public CCodeFunctionDeclarator (string name) {
index 17fa478a3d0ae8f3b59baec5fbae8bd5b33bce0e..f39eff0ed518941bebb824f46dbf44b3ddfd214a 100644 (file)
@@ -26,11 +26,6 @@ using GLib;
  * Represents a variable declarator in the C code.
  */
 public class Vala.CCodeVariableDeclarator : CCodeDeclarator {
-       /**
-        * The variable name.
-        */
-       public string name { get; set; }
-
        /**
         * The optional initializer expression.
         */