From ee63ee9d93e4a044069446d71cbd666300784b5a Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 25 Aug 2021 18:34:42 +0200 Subject: [PATCH] Fix coverity warning CID 332936 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions size and 2, and then converting the integer quotient to type float. Any remainder, or fractional part of the quotient, is ignored. --- components/detournavigator/recastmeshbuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/detournavigator/recastmeshbuilder.cpp b/components/detournavigator/recastmeshbuilder.cpp index 6ee16cdc6c..19125e0a9b 100644 --- a/components/detournavigator/recastmeshbuilder.cpp +++ b/components/detournavigator/recastmeshbuilder.cpp @@ -36,7 +36,7 @@ namespace DetourNavigator TileBounds maxCellTileBounds(int size, const osg::Vec3f& shift) { - const float halfCellSize = size / 2; + const float halfCellSize = static_cast(size) / 2; return TileBounds { osg::Vec2f(shift.x() - halfCellSize, shift.y() - halfCellSize), osg::Vec2f(shift.x() + halfCellSize, shift.y() + halfCellSize)