Fix conversion warnings when using double precision.

There were some conversion warnings issued when the default float was set
to 64-bit. Fixed these (on clang).
This commit is contained in:
Kenneth Moreland 2015-11-07 06:34:57 -07:00
parent bf03243516
commit 0d394db0ce
2 changed files with 5 additions and 3 deletions

@ -279,7 +279,8 @@ void JacobianFor2DCell(const WorldCoordType &wCoords,
vtkm::Matrix<JacobianType,2,2> &jacobian,
vtkm::CellShapeTagQuad)
{
vtkm::Vec<JacobianType,2> pc(pcoords[0], pcoords[1]);
vtkm::Vec<JacobianType,2> pc(static_cast<JacobianType>(pcoords[0]),
static_cast<JacobianType>(pcoords[1]));
vtkm::Vec<JacobianType,2> rc = vtkm::Vec<JacobianType,2>(1) - pc;
vtkm::Vec<JacobianType,2> wcoords2d;
@ -434,7 +435,8 @@ ParametricDerivative(const FieldVecType &field,
typedef typename FieldVecType::ComponentType FieldType;
typedef vtkm::Vec<FieldType,2> GradientType;
GradientType pc(pcoords[0], pcoords[1]);
GradientType pc(static_cast<FieldType>(pcoords[0]),
static_cast<FieldType>(pcoords[1]));
GradientType rc = GradientType(1) - pc;
GradientType parametricDerivative(0);

@ -113,7 +113,7 @@ struct TestDerivativeFunctor
for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++)
{
vtkm::Vec<vtkm::FloatDefault,3> wcoords = worldCoordinates[pointIndex];
FieldType value = field.GetValue(wcoords);
FieldType value = static_cast<FieldType>(field.GetValue(wcoords));
fieldValues.Append(value);
}