[vala/staging] codegen: Clean up expression casts in CCodeAssignmentModule.visit_assignment()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Clean up expression casts in CCodeAssignmentModule.visit_assignment()
- Date: Sat, 23 Jan 2021 17:28:49 +0000 (UTC)
commit 38ff2a858e6e4e905533a9dc71fdc5e9e57e4c96
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Jan 23 17:29:44 2021 +0100
codegen: Clean up expression casts in CCodeAssignmentModule.visit_assignment()
codegen/valaccodeassignmentmodule.vala | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodeassignmentmodule.vala b/codegen/valaccodeassignmentmodule.vala
index fc7e8d6fc..c77a16894 100644
--- a/codegen/valaccodeassignmentmodule.vala
+++ b/codegen/valaccodeassignmentmodule.vala
@@ -29,8 +29,6 @@ using GLib;
*/
public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
TargetValue emit_simple_assignment (Assignment assignment) {
- Variable variable = (Variable) assignment.left.symbol_reference;
-
if (requires_destroy (assignment.left.value_type)) {
/* unref old value */
ccode.add_expression (destroy_value (assignment.left.target_value));
@@ -81,6 +79,7 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
}
if (assignment.left.value_type is ArrayType && (((ArrayType)
assignment.left.value_type).inline_allocated)) {
+ unowned Variable variable = (Variable) assignment.left.symbol_reference;
return load_variable (variable, assignment.left.target_value);
} else {
return assignment.left.target_value;
@@ -94,8 +93,8 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
}
if (assignment.left.symbol_reference is Property) {
- var ma = assignment.left as MemberAccess;
- var prop = (Property) assignment.left.symbol_reference;
+ unowned MemberAccess ma = (MemberAccess) assignment.left;
+ unowned Property prop = (Property) assignment.left.symbol_reference;
store_property (prop, ma.inner, assignment.right.target_value);
assignment.target_value = assignment.right.target_value;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]