Skip to content

Commit

Permalink
convert_index returns Py_ssize_t
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Jun 28, 2019
1 parent 2b28d90 commit ce886b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PyIlmBase/PyImath/PyImathFixedMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class FixedMatrix
unref();
}

int convert_index(int index) const
Py_ssize_t convert_index(int index) const
{
if (index < 0) index += _rows;
if (index >= _rows || index < 0) {
Expand All @@ -141,10 +141,10 @@ class FixedMatrix
}
#if PY_MAJOR_VERSION > 2
} else if (PyLong_Check(index)) {
ssize_t i = convert_index(PyLong_AsSsize_t(index));
Py_ssize_t i = convert_index(PyLong_AsSsize_t(index));
#else
} else if (PyInt_Check(index)) {
int i = convert_index(PyInt_AS_LONG(index));
Py_ssize_t i = convert_index(PyInt_AS_LONG(index));
#endif
start = i; end = i+1; step = 1; slicelength = 1;
} else {
Expand Down

0 comments on commit ce886b8

Please sign in to comment.