[vala] codegen: Set TargetValue.value_type
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Set TargetValue.value_type
- Date: Thu, 21 Oct 2010 18:04:21 +0000 (UTC)
commit 0e73d5bb3b780c59ebd61b01a3f54d219a71e79a
Author: Jürg Billeter <j bitron ch>
Date: Thu Oct 21 12:15:20 2010 +0200
codegen: Set TargetValue.value_type
codegen/valaccodebasemodule.vala | 15 ++++++++++-----
codegen/valadovabasemodule.vala | 7 ++++++-
vala/valatargetvalue.vala | 6 +++++-
3 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 51a145a..0d07ae5 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5815,7 +5815,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
public void set_cvalue (Expression expr, CCodeExpression? cvalue) {
var glib_value = (GLibValue) expr.target_value;
if (glib_value == null) {
- glib_value = new GLibValue ();
+ glib_value = new GLibValue (expr.value_type);
expr.target_value = glib_value;
}
glib_value.ccodenode = cvalue;
@@ -5832,7 +5832,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
public void set_delegate_target (Expression expr, CCodeExpression? delegate_target) {
var glib_value = (GLibValue) expr.target_value;
if (glib_value == null) {
- glib_value = new GLibValue ();
+ glib_value = new GLibValue (expr.value_type);
expr.target_value = glib_value;
}
glib_value.delegate_target = delegate_target;
@@ -5849,7 +5849,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
public void set_delegate_target_destroy_notify (Expression expr, CCodeExpression destroy_notify) {
var glib_value = (GLibValue) expr.target_value;
if (glib_value == null) {
- glib_value = new GLibValue ();
+ glib_value = new GLibValue (expr.value_type);
expr.target_value = glib_value;
}
glib_value.delegate_target_destroy_notify = destroy_notify;
@@ -5858,7 +5858,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
public void append_array_size (Expression expr, CCodeExpression size) {
var glib_value = (GLibValue) expr.target_value;
if (glib_value == null) {
- glib_value = new GLibValue ();
+ glib_value = new GLibValue (expr.value_type);
expr.target_value = glib_value;
}
if (glib_value.array_sizes == null) {
@@ -5870,7 +5870,7 @@ public class Vala.CCodeBaseModule : CodeGenerator {
public List<CCodeExpression>? get_array_sizes (Expression expr) {
var glib_value = (GLibValue) expr.target_value;
if (glib_value == null) {
- glib_value = new GLibValue ();
+ glib_value = new GLibValue (expr.value_type);
expr.target_value = glib_value;
}
return glib_value.array_sizes;
@@ -5884,4 +5884,9 @@ public class Vala.GLibValue : TargetValue {
public CCodeExpression? delegate_target;
public CCodeExpression? delegate_target_destroy_notify;
+
+ public GLibValue (DataType? value_type = null, CCodeExpression? cvalue = null) {
+ base (value_type);
+ this.ccodenode = cvalue;
+ }
}
diff --git a/codegen/valadovabasemodule.vala b/codegen/valadovabasemodule.vala
index 14b4282..c421cbe 100644
--- a/codegen/valadovabasemodule.vala
+++ b/codegen/valadovabasemodule.vala
@@ -2277,7 +2277,7 @@ public class Vala.DovaBaseModule : CodeGenerator {
public void set_cvalue (Expression expr, CCodeExpression? cvalue) {
var dova_value = (DovaValue) expr.target_value;
if (dova_value == null) {
- dova_value = new DovaValue ();
+ dova_value = new DovaValue (expr.value_type);
expr.target_value = dova_value;
}
dova_value.ccodenode = cvalue;
@@ -2286,4 +2286,9 @@ public class Vala.DovaBaseModule : CodeGenerator {
public class Vala.DovaValue : TargetValue {
public CCodeExpression ccodenode;
+
+ public DovaValue (DataType? value_type = null, CCodeExpression? cvalue = null) {
+ base (value_type);
+ this.ccodenode = cvalue;
+ }
}
diff --git a/vala/valatargetvalue.vala b/vala/valatargetvalue.vala
index e84913a..b21483e 100644
--- a/vala/valatargetvalue.vala
+++ b/vala/valatargetvalue.vala
@@ -21,5 +21,9 @@
*/
public abstract class Vala.TargetValue {
- public DataType value_type { get; set; }
+ public DataType? value_type { get; set; }
+
+ protected TargetValue (DataType? value_type) {
+ this.value_type = value_type;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]