From 5954b8892f50eb5996c122c1c7020c4a190de91a Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Thu, 14 Dec 2017 17:17:13 +0100 Subject: [PATCH] codegen: Avoid silent casts if not needed --- codegen/valagerrormodule.vala | 4 ++-- codegen/valatyperegisterfunction.vala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala index 47056f17b..e4f199cbe 100644 --- a/codegen/valagerrormodule.vala +++ b/codegen/valagerrormodule.vala @@ -372,9 +372,9 @@ public class Vala.GErrorModule : CCodeDelegateModule { if (!(stop_at is TryStatement || stop_at is CatchClause)) { var finally_block = (Block) null; if (sym.parent_node is TryStatement) { - finally_block = (sym.parent_node as TryStatement).finally_body; + finally_block = ((TryStatement) sym.parent_node).finally_body; } else if (sym.parent_node is CatchClause) { - finally_block = (sym.parent_node.parent_node as TryStatement).finally_body; + finally_block = ((TryStatement) sym.parent_node.parent_node).finally_body; } if (finally_block != null && finally_block != sym) { diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index dde8456a6..e41cb21c1 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -238,7 +238,7 @@ public abstract class Vala.TypeRegisterFunction { cond = condition; } else { cond = new CCodeFunctionCall (new CCodeIdentifier ("G_UNLIKELY")); - (cond as CCodeFunctionCall).add_argument (condition); + ((CCodeFunctionCall) cond).add_argument (condition); } var cif = new CCodeIfStatement (cond, type_init); type_block.add_statement (cif); -- 2.47.2