]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Avoid silent casts if not needed
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 14 Dec 2017 16:17:13 +0000 (17:17 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Jan 2018 17:24:39 +0000 (18:24 +0100)
codegen/valagerrormodule.vala
codegen/valatyperegisterfunction.vala

index 47056f17b387d7988f76a5397da7331ee9cf3cb1..e4f199cbe0136a18456d8d4c1db42293c62a6209 100644 (file)
@@ -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) {
index dde8456a619d05d63338085938405a7ed6c545f2..e41cb21c1de6e7d4e4464967284b7cb7e92e33a2 100644 (file)
@@ -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);