mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 10:35:42 +00:00
Correct a bad memcpy in ColorTable that gcc 7 found
This commit is contained in:
parent
c6726644b9
commit
dac7ab987a
@ -132,7 +132,7 @@ inline bool rangeAlmostEqual(const vtkm::Range& r)
|
|||||||
// needs to be a memcpy to avoid strict aliasing issues, doing a count
|
// needs to be a memcpy to avoid strict aliasing issues, doing a count
|
||||||
// of 2*sizeof(T) to couple both values at the same time
|
// of 2*sizeof(T) to couple both values at the same time
|
||||||
std::memcpy(irange, &r.Min, sizeof(vtkm::Int64));
|
std::memcpy(irange, &r.Min, sizeof(vtkm::Int64));
|
||||||
std::memcpy(irange, &r.Max, sizeof(vtkm::Int64));
|
std::memcpy(irange + 1, &r.Max, sizeof(vtkm::Int64));
|
||||||
// determine the absolute delta between these two numbers.
|
// determine the absolute delta between these two numbers.
|
||||||
const vtkm::Int64 delta = std::abs(irange[1] - irange[0]);
|
const vtkm::Int64 delta = std::abs(irange[1] - irange[0]);
|
||||||
// If the numbers are not nearly equal, we don't touch them. This avoids running into
|
// If the numbers are not nearly equal, we don't touch them. This avoids running into
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
"Unexpected scalar field range.");
|
"Unexpected scalar field range.");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, vtkm::Id NumberOfComponents>
|
template <typename T, vtkm::IdComponent NumberOfComponents>
|
||||||
static void TestVecField()
|
static void TestVecField()
|
||||||
{
|
{
|
||||||
const vtkm::Id nvals = 11;
|
const vtkm::Id nvals = 11;
|
||||||
|
Loading…
Reference in New Issue
Block a user