[vala/wip/transform: 72/106] Copy types in transformer
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 72/106] Copy types in transformer
- Date: Mon, 4 Feb 2019 09:26:02 +0000 (UTC)
commit 0467d161427d4466aea54b51e334816907ca34ae
Author: Luca Bruno <lucabru src gnome org>
Date: Sat May 18 12:39:22 2013 +0200
Copy types in transformer
codegen/valaccodetransformer.vala | 6 +++---
codegen/valagdbusclienttransformer.vala | 6 +++---
codegen/valagdbusservertransformer.vala | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index bd64fb030..6473a99ca 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -374,10 +374,10 @@ public class Vala.CCodeTransformer : CodeTransformer {
push_builder (new CodeBuilder (context, expr.parent_statement,
expr.source_reference));
// FIXME: use create_temp_access behavior
- var replacement = expression (b.add_temp_declaration (expr.value_type, expr,
true));
+ var replacement = expression (b.add_temp_declaration (expr.value_type.copy
(), expr, true));
- replacement.target_type = target_type;
- replacement.formal_target_type = formal_target_type;
+ replacement.target_type = target_type.copy ();
+ replacement.formal_target_type = formal_target_type.copy ();
context.analyzer.replaced_nodes.add (expr);
old_parent_node.replace_expression (expr, replacement);
b.check (this);
diff --git a/codegen/valagdbusclienttransformer.vala b/codegen/valagdbusclienttransformer.vala
index 180e80e95..93ce6dff8 100644
--- a/codegen/valagdbusclienttransformer.vala
+++ b/codegen/valagdbusclienttransformer.vala
@@ -145,7 +145,7 @@ public class Vala.GDBusClientTransformer : GVariantTransformer {
}
void generate_dbus_proxy_method (Class proxy_class, Interface iface, Method m) {
- var proxy = new Method (m.name, m.return_type, m.source_reference);
+ var proxy = new Method (m.name, m.return_type.copy(), m.source_reference);
foreach (var param in m.get_parameters ()) {
proxy.add_parameter (param.copy ());
}
@@ -208,7 +208,7 @@ public class Vala.GDBusClientTransformer : GVariantTransformer {
void generate_dbus_proxy_signals (Class proxy_class, ObjectTypeSymbol sym) {
var g_signal = (Signal) symbol_from_string ("GLib.DBusProxy.g_signal");
- var m = new Method ("g_signal", g_signal.return_type, sym.source_reference);
+ var m = new Method ("g_signal", g_signal.return_type.copy(), sym.source_reference);
m.overrides = true;
m.access = SymbolAccessibility.PUBLIC;
foreach (var param in g_signal.get_parameters ()) {
@@ -359,7 +359,7 @@ public class Vala.GDBusClientTransformer : GVariantTransformer {
foreach (var param in m.get_parameters ()) {
cache_key = "%s %s".printf (cache_key, param.variable_type.to_string ());
}
- if (!wrapper_method (m.return_type, cache_key, out wrapper, symbol_from_string
("GLib.DBusProxy"))) {
+ if (!wrapper_method (m.return_type.copy(), cache_key, out wrapper, symbol_from_string
("GLib.DBusProxy"))) {
foreach (var param in m.get_parameters ()) {
wrapper.add_parameter (param.copy ());
}
diff --git a/codegen/valagdbusservertransformer.vala b/codegen/valagdbusservertransformer.vala
index 223663eb5..570c744e1 100644
--- a/codegen/valagdbusservertransformer.vala
+++ b/codegen/valagdbusservertransformer.vala
@@ -94,7 +94,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
}
var arg = b.add_temp_declaration (copy_type (param.variable_type, true));
out_args += arg;
- out_types += param.variable_type;
+ out_types += param.variable_type.copy ();
finish_call.add_argument (new UnaryExpression (UnaryOperator.OUT, expression
(arg), m.source_reference));
if (m.coroutine) {
pop_builder ();
@@ -128,7 +128,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
write_dbus_value (out_types[i], builder, out_args[i], ref fd_list);
}
if (result != null) {
- write_dbus_value (m.return_type, builder, result, ref fd_list);
+ write_dbus_value (m.return_type.copy (), builder, result, ref fd_list);
}
b.add_expression (expression (@"$reply.set_body ($builder.end ())"));
if (fd_list != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]