Commit 726c914e authored by Robert Maynard's avatar Robert Maynard
Browse files

Make sure we use ptrdiff_t for index into arrays.

This is a requirement since you can use negative indices into arrays.
parent 925d6865
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
VTKM_CONT_EXPORT VTKM_CONT_EXPORT
detail::IteratorFromArrayPortalValue<ArrayPortalType> detail::IteratorFromArrayPortalValue<ArrayPortalType>
operator[](std::size_t idx) const operator[](std::ptrdiff_t idx) const //NEEDS to be signed
{ {
return detail::IteratorFromArrayPortalValue<ArrayPortalType>(this->Portal, return detail::IteratorFromArrayPortalValue<ArrayPortalType>(this->Portal,
this->Index + static_cast<vtkm::Id>(idx) ); this->Index + static_cast<vtkm::Id>(idx) );
......
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
VTKM_EXEC_EXPORT VTKM_EXEC_EXPORT
PortalValue<ArrayPortalType> PortalValue<ArrayPortalType>
operator[](std::size_t idx) const operator[](std::ptrdiff_t idx) const //NEEDS to be signed
{ {
return PortalValue<ArrayPortalType>(this->Portal, return PortalValue<ArrayPortalType>(this->Portal,
this->Index + static_cast<vtkm::Id>(idx) ); this->Index + static_cast<vtkm::Id>(idx) );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment