From dac7ab987a30f13842d73bec8659724697415b9e Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 1 May 2018 17:35:26 -0400 Subject: [PATCH] Correct a bad memcpy in ColorTable that gcc 7 found --- vtkm/cont/ColorTablePrivate.hxx | 2 +- vtkm/cont/testing/TestingComputeRange.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vtkm/cont/ColorTablePrivate.hxx b/vtkm/cont/ColorTablePrivate.hxx index 9080b55ff..70ec8d826 100644 --- a/vtkm/cont/ColorTablePrivate.hxx +++ b/vtkm/cont/ColorTablePrivate.hxx @@ -132,7 +132,7 @@ inline bool rangeAlmostEqual(const vtkm::Range& r) // 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 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. 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 diff --git a/vtkm/cont/testing/TestingComputeRange.h b/vtkm/cont/testing/TestingComputeRange.h index 5a869a8d7..3d3a132f0 100644 --- a/vtkm/cont/testing/TestingComputeRange.h +++ b/vtkm/cont/testing/TestingComputeRange.h @@ -70,7 +70,7 @@ private: "Unexpected scalar field range."); } - template + template static void TestVecField() { const vtkm::Id nvals = 11;