[vala/staging: 2/2] Transform CCodeParameter's "format_arg" into CCodeNode's "modifiers"



commit 63f77e32bddba8966f0c412cad341f976d5d04c8
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Nov 8 12:09:25 2016 +0100

    Transform CCodeParameter's "format_arg" into CCodeNode's "modifiers"

 ccode/valaccodefunction.vala           |    2 +-
 ccode/valaccodefunctiondeclarator.vala |    2 +-
 ccode/valaccodemodifiers.vala          |    3 ++-
 ccode/valaccodeparameter.vala          |    2 --
 codegen/valaccodemethodmodule.vala     |    4 +++-
 codegen/valagtypemodule.vala           |    4 +++-
 6 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/ccode/valaccodefunction.vala b/ccode/valaccodefunction.vala
index 43bfb6c..6cf6c0b 100644
--- a/ccode/valaccodefunction.vala
+++ b/ccode/valaccodefunction.vala
@@ -125,7 +125,7 @@ public class Vala.CCodeFunction : CCodeNode {
                                writer.write_string (", ");
                        }
                        param.write (writer);
-                       if (param.format_arg) {
+                       if (CCodeModifiers.FORMAT in param.modifiers) {
                                format_arg_index = i;
                        }
                        i++;
diff --git a/ccode/valaccodefunctiondeclarator.vala b/ccode/valaccodefunctiondeclarator.vala
index 08aea1d..8796eaa 100644
--- a/ccode/valaccodefunctiondeclarator.vala
+++ b/ccode/valaccodefunctiondeclarator.vala
@@ -62,7 +62,7 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator {
                                writer.write_string (", ");
                        }
                        param.write (writer);
-                       if (param.format_arg) {
+                       if (CCodeModifiers.FORMAT in param.modifiers) {
                                format_arg_index = i;
                        }
                        i++;
diff --git a/ccode/valaccodemodifiers.vala b/ccode/valaccodemodifiers.vala
index 086056f..cd1783c 100644
--- a/ccode/valaccodemodifiers.vala
+++ b/ccode/valaccodemodifiers.vala
@@ -38,5 +38,6 @@ public enum Vala.CCodeModifiers {
        CONST = 1 << 8,
        UNUSED = 1 << 9,
        CONSTRUCTOR = 1 << 10,
-       DESTRUCTOR = 1 << 11
+       DESTRUCTOR = 1 << 11,
+       FORMAT = 1 << 12
 }
diff --git a/ccode/valaccodeparameter.vala b/ccode/valaccodeparameter.vala
index 9404f47..9f1c2e1 100644
--- a/ccode/valaccodeparameter.vala
+++ b/ccode/valaccodeparameter.vala
@@ -42,8 +42,6 @@ public class Vala.CCodeParameter : CCodeNode {
         */
        public bool ellipsis { get; set; }
 
-       public bool format_arg { get; set; }
-
        public CCodeParameter (string n, string type) {
                name = n;
                type_name = type;
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 195592f..35aca92 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -879,7 +879,9 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        }
 
                        cparam = new CCodeParameter (get_variable_cname (param.name), ctypename);
-                       cparam.format_arg = param.format_arg;
+                       if (param.format_arg) {
+                               cparam.modifiers = CCodeModifiers.FORMAT;
+                       }
                } else if (ellipses_to_valist) {
                        cparam = new CCodeParameter ("_vala_va_list", "va_list");
                } else {
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index d4313d1..01570ca 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -38,7 +38,9 @@ public class Vala.GTypeModule : GErrorModule {
                }
 
                var cparam = new CCodeParameter (get_variable_cname (param.name), ctypename);
-               cparam.format_arg = param.format_arg;
+               if (param.format_arg) {
+                       cparam.modifiers = CCodeModifiers.FORMAT;
+               }
 
                cparam_map.set (get_param_pos (get_ccode_pos (param)), cparam);
                if (carg_map != null) {


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