[vala/staging: 2/3] Transform CCodeParameter's "format_arg" into CCodeNode's "modifiers"
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/3] Transform CCodeParameter's "format_arg" into CCodeNode's "modifiers"
- Date: Tue, 8 Nov 2016 16:49:38 +0000 (UTC)
commit 8629814fad411c2d0bd9f801cda8864f324ab271
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..cd3e385 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_ARG in param.modifiers) {
format_arg_index = i;
}
i++;
diff --git a/ccode/valaccodefunctiondeclarator.vala b/ccode/valaccodefunctiondeclarator.vala
index 08aea1d..1378662 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_ARG in param.modifiers) {
format_arg_index = i;
}
i++;
diff --git a/ccode/valaccodemodifiers.vala b/ccode/valaccodemodifiers.vala
index 086056f..75c5a99 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_ARG = 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..ce127f5 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_ARG;
+ }
} 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..a9073e3 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_ARG;
+ }
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]