From 16c6e2db05ead0faf3a56c914d5a1c3e0fcddb2a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 21 May 2021 21:06:48 +0200 Subject: [PATCH] - silence float truncation warnings for explicit casts. --- source/common/scripting/backend/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/scripting/backend/codegen.cpp b/source/common/scripting/backend/codegen.cpp index 2b4b1eab4..9eb887827 100644 --- a/source/common/scripting/backend/codegen.cpp +++ b/source/common/scripting/backend/codegen.cpp @@ -932,7 +932,7 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx) { ExpVal constval = static_cast(basex)->GetValue(); FxExpression *x = new FxConstant(constval.GetInt(), ScriptPosition); - if (constval.GetInt() != constval.GetFloat()) + if (constval.GetInt() != constval.GetFloat() && !Explicit) { ScriptPosition.Message(MSG_WARNING, "Truncation of floating point constant %f", constval.GetFloat()); }