Skip to content

Commit

Permalink
Fixing warnings about conversions in GCC 7+ (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored and wjakob committed Apr 7, 2019
1 parent 73b840d commit 9bb3313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,14 +855,14 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public

// Reference to element at a given index
template<typename... Ix> const T& at(Ix... index) const {
if (sizeof...(index) != ndim())
if ((ssize_t) sizeof...(index) != ndim())
fail_dim_check(sizeof...(index), "index dimension mismatch");
return *(static_cast<const T*>(array::data()) + byte_offset(ssize_t(index)...) / itemsize());
}

// Mutable reference to element at a given index
template<typename... Ix> T& mutable_at(Ix... index) {
if (sizeof...(index) != ndim())
if ((ssize_t) sizeof...(index) != ndim())
fail_dim_check(sizeof...(index), "index dimension mismatch");
return *(static_cast<T*>(array::mutable_data()) + byte_offset(ssize_t(index)...) / itemsize());
}
Expand Down

0 comments on commit 9bb3313

Please sign in to comment.