Fix a few more warnings

These warnings were detected on my local machine.
This commit is contained in:
Sujin Philip 2018-05-09 17:49:45 -04:00
parent 48d298e0af
commit 0c1634bbc3
4 changed files with 13 additions and 10 deletions

@ -94,10 +94,10 @@ struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood3x3x3
// Any live cell with two or three live neighbors lives on to the next generation.
// Any live cell with more than three live neighbors dies, as if by overcrowding.
// Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
vtkm::UInt8 current = prevstate.Get(0, 0, 0);
vtkm::UInt8 count = prevstate.Get(-1, -1, 0) + prevstate.Get(-1, 0, 0) +
prevstate.Get(-1, 1, 0) + prevstate.Get(0, -1, 0) + prevstate.Get(0, 1, 0) +
prevstate.Get(1, -1, 0) + prevstate.Get(1, 0, 0) + prevstate.Get(1, 1, 0);
auto current = prevstate.Get(0, 0, 0);
auto count = prevstate.Get(-1, -1, 0) + prevstate.Get(-1, 0, 0) + prevstate.Get(-1, 1, 0) +
prevstate.Get(0, -1, 0) + prevstate.Get(0, 1, 0) + prevstate.Get(1, -1, 0) +
prevstate.Get(1, 0, 0) + prevstate.Get(1, 1, 0);
if (current == 1 && (count == 2 || count == 3))
{
@ -113,8 +113,8 @@ struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood3x3x3
}
color[0] = 0;
color[1] = state * (100 + (count * 32));
color[2] = (state && !current) ? (100 + (count * 32)) : 0;
color[1] = static_cast<vtkm::UInt8>(state * (100 + (count * 32)));
color[2] = (state && !current) ? static_cast<vtkm::UInt8>(100 + (count * 32)) : 0;
color[3] = 255; //alpha channel
}
};

@ -84,12 +84,12 @@ public:
// now reduce across ranks using MPI.
// converting to std::vector
std::vector<vtkm::Id> send_buf(numBins);
std::vector<vtkm::Id> send_buf(static_cast<std::size_t>(numBins));
std::copy(vtkm::cont::ArrayPortalToIteratorBegin(local.GetPortalConstControl()),
vtkm::cont::ArrayPortalToIteratorEnd(local.GetPortalConstControl()),
send_buf.begin());
std::vector<vtkm::Id> recv_buf(numBins);
std::vector<vtkm::Id> recv_buf(static_cast<std::size_t>(numBins));
MPI_Reduce(&send_buf[0],
&recv_buf[0],
static_cast<int>(numBins),

@ -129,7 +129,10 @@ public:
typedef _2 ExecutionSignature(_1, WorkIndex);
VTKM_EXEC
vtkm::Float32 operator()(vtkm::Int64 x, vtkm::Id& index) const { return (vtkm::Sin(1.0 * x)); }
vtkm::Float32 operator()(vtkm::Int64 x, vtkm::Id&) const
{
return (vtkm::Sin(static_cast<vtkm::Float32>(x)));
}
};
}
}

@ -75,7 +75,7 @@ private:
if (stream.fail())
throw vtkm::io::ErrorIO("Failed to open file: " + this->FileName);
DataFormat dataFormat;
DataFormat dataFormat = ByteData;
std::string bovFile, line, token, options, variableName;
vtkm::Id numComponents = 1;
vtkm::Id3 dim;