From: Rico Tzschichholz Date: Thu, 14 Dec 2017 16:17:13 +0000 (+0100) Subject: codegen: Avoid silent casts if not needed X-Git-Tag: 0.34.14~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5954b8892f50eb5996c122c1c7020c4a190de91a;p=thirdparty%2Fvala.git codegen: Avoid silent casts if not needed --- 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);