[vala/staging] codegen: Avoid silent casts if not needed
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Avoid silent casts if not needed
- Date: Thu, 14 Dec 2017 19:44:24 +0000 (UTC)
commit 0c07d0338d5ea6cd430101acd3be1e35ded1870e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Dec 14 17:17:13 2017 +0100
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 e50aea6..add71ce 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 4a0c59c..1580c9e 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]