clean up warnings.

In clang and vc++
This commit is contained in:
Mark Kim 2019-06-24 22:10:32 -04:00
parent a941f0aea3
commit a5027d74d2
8 changed files with 40 additions and 31 deletions

@ -39,7 +39,7 @@ public:
{
}
vtkm::Int32 GetNumberOfPointsPerPlane() const { return (this->GetStorage().GetLength() / 2); }
vtkm::Id GetNumberOfPointsPerPlane() const { return (this->GetStorage().GetLength() / 2); }
vtkm::Int32 GetNumberOfPlanes() const { return this->GetStorage().GetNumberOfPlanes(); }
};

@ -38,7 +38,8 @@ CellSetExtrude::CellSetExtrude(const vtkm::cont::ArrayHandle<vtkm::Int32>& conn,
: vtkm::cont::CellSet(name)
, IsPeriodic(periodic)
, NumberOfPointsPerPlane(numberOfPointsPerPlane)
, NumberOfCellsPerPlane(conn.GetNumberOfValues() / static_cast<vtkm::Id>(3))
, NumberOfCellsPerPlane(
static_cast<vtkm::Int32>(conn.GetNumberOfValues() / static_cast<vtkm::Id>(3)))
, NumberOfPlanes(numberOfPlanes)
, Connectivity(conn)
, NextNode(nextNode)

@ -132,7 +132,7 @@ CellSetExtrude make_CellSetExtrude(const std::vector<vtkm::Int32>& conn,
const std::string name = "extrude")
{
return CellSetExtrude{ vtkm::cont::make_ArrayHandle(conn),
coords.GetNumberOfPointsPerPlane(),
static_cast<vtkm::Int32>(coords.GetNumberOfPointsPerPlane()),
coords.GetNumberOfPlanes(),
vtkm::cont::make_ArrayHandle(nextNode),
periodic,

@ -21,9 +21,9 @@ struct ComputeReverseMapping : public vtkm::worklet::WorkletMapField
{
//3 as we are building the connectivity for triangles
const vtkm::Id offset = 3 * cellId;
pointIdValue.Set(offset, cellId);
pointIdValue.Set(offset + 1, cellId);
pointIdValue.Set(offset + 2, cellId);
pointIdValue.Set(offset, static_cast<vtkm::Int32>(cellId));
pointIdValue.Set(offset + 1, static_cast<vtkm::Int32>(cellId));
pointIdValue.Set(offset + 2, static_cast<vtkm::Int32>(cellId));
}
};

@ -421,7 +421,7 @@ public:
{
VTKM_ASSERT(this->Array.GetNumberOfValues() >= 0);
return PortalConstType(this->Array.GetPortalConstControl(),
this->Array.GetNumberOfValues(),
static_cast<vtkm::Int32>(this->Array.GetNumberOfValues()),
this->NumberOfPlanes,
this->UseCylindrical);
}
@ -489,10 +489,11 @@ public:
VTKM_CONT
PortalConstExecution PrepareForInput(bool vtkmNotUsed(updateData))
{
return PortalConstExecution(this->ControlData->Array.PrepareForInput(Device()),
this->ControlData->Array.GetNumberOfValues(),
this->ControlData->GetNumberOfPlanes(),
this->ControlData->GetUseCylindrical());
return PortalConstExecution(
this->ControlData->Array.PrepareForInput(Device()),
static_cast<vtkm::Int32>(this->ControlData->Array.GetNumberOfValues()),
this->ControlData->GetNumberOfPlanes(),
this->ControlData->GetUseCylindrical());
}
VTKM_CONT

@ -66,25 +66,31 @@ void verify_topo(vtkm::cont::ArrayHandle<vtkm::Vec<T, 6>, S> const& handle, vtkm
for (vtkm::Id i = 0; i < expectedLen - 1; ++i)
{
auto v = portal.Get(i);
vtkm::Vec<int, 6> e;
e[0] = (topology[0] + (i * topology.size()));
e[1] = (topology[1] + (i * topology.size()));
e[2] = (topology[2] + (i * topology.size()));
e[3] = (topology[0] + ((i + 1) * topology.size()));
e[4] = (topology[1] + ((i + 1) * topology.size()));
e[5] = (topology[2] + ((i + 1) * topology.size()));
vtkm::Vec<vtkm::Id, 6> e;
e[0] = (static_cast<vtkm::Id>(topology[0]) + (i * static_cast<vtkm::Id>(topology.size())));
e[1] = (static_cast<vtkm::Id>(topology[1]) + (i * static_cast<vtkm::Id>(topology.size())));
e[2] = (static_cast<vtkm::Id>(topology[2]) + (i * static_cast<vtkm::Id>(topology.size())));
e[3] =
(static_cast<vtkm::Id>(topology[0]) + ((i + 1) * static_cast<vtkm::Id>(topology.size())));
e[4] =
(static_cast<vtkm::Id>(topology[1]) + ((i + 1) * static_cast<vtkm::Id>(topology.size())));
e[5] =
(static_cast<vtkm::Id>(topology[2]) + ((i + 1) * static_cast<vtkm::Id>(topology.size())));
std::cout << "v, e: " << v << ", " << e << "\n";
VTKM_TEST_ASSERT(test_equal(v, e), "incorrect conversion of topology to Cartesian space");
}
auto v = portal.Get(expectedLen - 1);
vtkm::Vec<int, 6> e;
e[0] = (topology[0] + ((expectedLen - 1) * topology.size()));
e[1] = (topology[1] + ((expectedLen - 1) * topology.size()));
e[2] = (topology[2] + ((expectedLen - 1) * topology.size()));
e[3] = (topology[0]);
e[4] = (topology[1]);
e[5] = (topology[2]);
vtkm::Vec<vtkm::Id, 6> e;
e[0] = (static_cast<vtkm::Id>(topology[0]) +
((expectedLen - 1) * static_cast<vtkm::Id>(topology.size())));
e[1] = (static_cast<vtkm::Id>(topology[1]) +
((expectedLen - 1) * static_cast<vtkm::Id>(topology.size())));
e[2] = (static_cast<vtkm::Id>(topology[2]) +
((expectedLen - 1) * static_cast<vtkm::Id>(topology.size())));
e[3] = (static_cast<vtkm::Id>(topology[0]));
e[4] = (static_cast<vtkm::Id>(topology[1]));
e[5] = (static_cast<vtkm::Id>(topology[2]));
VTKM_TEST_ASSERT(test_equal(v, e), "incorrect conversion of topology to Cartesian space");
}
@ -122,13 +128,13 @@ int TestCellSetExtrude()
dataset.AddCellSet(cells);
// verify that a constant value point field can be accessed
std::vector<float> pvalues(coords.GetNumberOfValues(), 42.0f);
std::vector<float> pvalues(static_cast<size_t>(coords.GetNumberOfValues()), 42.0f);
vtkm::cont::Field pfield(
"pfield", vtkm::cont::Field::Association::POINTS, vtkm::cont::make_ArrayHandle(pvalues));
dataset.AddField(pfield);
// verify that a constant cell value can be accessed
std::vector<float> cvalues(cells.GetNumberOfCells(), 42.0f);
std::vector<float> cvalues(static_cast<size_t>(cells.GetNumberOfCells()), 42.0f);
vtkm::cont::Field cfield("cfield",
vtkm::cont::Field::Association::CELL_SET,
cells.GetName(),

@ -248,8 +248,8 @@ ReverseConnectivityExtrude<Device>::GetIndices(const vtkm::Id2& index) const
this->Counts.Get(ptPre),
this->Offsets.Get(ptCur),
this->Counts.Get(ptCur),
plPre,
plCur,
static_cast<vtkm::IdComponent>(plPre),
static_cast<vtkm::IdComponent>(plCur),
this->NumberOfCellsPerPlane);
}
}

@ -102,8 +102,9 @@ public:
}
};
template <typename CellSetType>
vtkm::cont::CellSetSingleType<> Run(const CellSetType& cellSet,
vtkm::cont::ArrayHandle<vtkm::IdComponent>& outCellsPerCell)
vtkm::cont::CellSetSingleType<> Run(
const CellSetType& cellSet,
vtkm::cont::ArrayHandle<vtkm::IdComponent>& vtkmNotUsed(outCellsPerCell))
{
vtkm::cont::CellSetSingleType<> outCellSet(cellSet.GetName());
return outCellSet;