From f8fd0ce31616a807cc593bd1e9a8d6930d23567c Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 6 Feb 2020 20:41:10 -0600 Subject: [PATCH] Silence warning about cast losing precision When using math operators on small integers, the numbers are promoted to 32-bit ints. If that is set back to the same type, then some compilers give a warning. This is annoying and pointless when dealing with templated types, but we have to deal with it. --- vtkm/filter/testing/UnitTestMapFieldMergeAverage.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vtkm/filter/testing/UnitTestMapFieldMergeAverage.cxx b/vtkm/filter/testing/UnitTestMapFieldMergeAverage.cxx index b034f107a..eac7f8ba2 100644 --- a/vtkm/filter/testing/UnitTestMapFieldMergeAverage.cxx +++ b/vtkm/filter/testing/UnitTestMapFieldMergeAverage.cxx @@ -59,8 +59,8 @@ vtkm::cont::ArrayHandle MakeExpectedOutput(const vtkm::cont::ArrayHandle(sum + inputPortal.Get(fullI)); + num = static_cast(num + ComponentType(1)); } outputPortal.Set(reducedI, sum / T(num)); }