summaryrefslogtreecommitdiff
path: root/codegen/valaccodeassignmentmodule.vala
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2011-05-15 14:30:12 +0200
committerLuca Bruno <lucabru@src.gnome.org>2011-05-15 14:47:45 +0200
commit814880a84a42a7dec933d10ec86e56346a26fa41 (patch)
tree5a32d1e32daed4f83a43c1b814ff4e94a8298e47 /codegen/valaccodeassignmentmodule.vala
parent39a7aa5ba21a240d32febdb3c702dc882484bb6f (diff)
downloadvala-814880a84a42a7dec933d10ec86e56346a26fa41.tar.gz
codegen: Add GLibValue.ctype to be used with lvalues
Cast the assigned rvalue to the ctype of the lvalue.
Diffstat (limited to 'codegen/valaccodeassignmentmodule.vala')
-rw-r--r--codegen/valaccodeassignmentmodule.vala12
1 files changed, 2 insertions, 10 deletions
diff --git a/codegen/valaccodeassignmentmodule.vala b/codegen/valaccodeassignmentmodule.vala
index 9ff063568..01af22a23 100644
--- a/codegen/valaccodeassignmentmodule.vala
+++ b/codegen/valaccodeassignmentmodule.vala
@@ -208,17 +208,9 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
return;
}
- string ctype;
- if (variable is Field) {
- ctype = ((Field) variable).get_ctype ();
- } else if (variable is Parameter) {
- ctype = ((Parameter) variable).ctype;
- } else {
- ctype = null;
- }
var cexpr = get_cvalue_ (value);
- if (ctype != null) {
- cexpr = new CCodeCastExpression (cexpr, ctype);
+ if (get_ctype (lvalue) != null) {
+ cexpr = new CCodeCastExpression (cexpr, get_ctype (lvalue));
}
ccode.add_assignment (get_cvalue_ (lvalue), cexpr);