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.
This commit is contained in:
Kenneth Moreland 2020-02-06 20:41:10 -06:00
parent 3c4e8a2ea5
commit f8fd0ce316

@ -59,8 +59,8 @@ vtkm::cont::ArrayHandle<T> MakeExpectedOutput(const vtkm::cont::ArrayHandle<T, S
ComponentType num = 0;
for (vtkm::Id fullI = reducedI; fullI < inputArray.GetNumberOfValues(); fullI += REDUCED_SIZE)
{
sum = sum + inputPortal.Get(fullI);
num = num + ComponentType(1);
sum = static_cast<T>(sum + inputPortal.Get(fullI));
num = static_cast<ComponentType>(num + ComponentType(1));
}
outputPortal.Set(reducedI, sum / T(num));
}