Fix type conversion warnings
Make the types consistent in an std::accumulate call. Previously it was taking vtkm::Id values, multiplying them as std::size_t, and then storing them in an int. Now, the std::accumulate does everything as a vtkm::Id and at the end converts the result to an std::size_t.
This commit is contained in:
parent
5608615970
commit
cd8b41f478
@ -246,9 +246,8 @@ int main(int argc, char* argv[])
|
||||
|
||||
// Compute the number of vertices, i.e., xdim * ydim * zdim
|
||||
auto nDims = dims.size();
|
||||
std::vector<vtkm::Float32>::size_type nVertices =
|
||||
std::vector<vtkm::Float32>::size_type(std::accumulate(
|
||||
dims.begin(), dims.end(), 1, std::multiplies<std::vector<vtkm::Float32>::size_type>()));
|
||||
std::vector<vtkm::Float32>::size_type nVertices = std::vector<vtkm::Float32>::size_type(
|
||||
std::accumulate(dims.begin(), dims.end(), vtkm::Id(1), std::multiplies<vtkm::Id>()));
|
||||
|
||||
// Print the mesh metadata
|
||||
std::cout << "Number of dimensions: " << nDims << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user