diff --git a/Lib/python/std_array.i b/Lib/python/std_array.i index bad818be7..a3de3125b 100644 --- a/Lib/python/std_array.i +++ b/Lib/python/std_array.i @@ -45,11 +45,11 @@ Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj); - if (step == 1 && ii == 0 && jj == size) { + if (step == 1 && ii == 0 && static_cast(jj) == size) { Sequence *sequence = new Sequence(); std::copy(self->begin(), self->end(), sequence->begin()); return sequence; - } else if (step == -1 && ii == (size - 1) && jj == -1) { + } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { Sequence *sequence = new Sequence(); std::copy(self->rbegin(), self->rend(), sequence->begin()); return sequence; @@ -67,9 +67,9 @@ Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step == 1 && ii == 0 && jj == size) { + if (step == 1 && ii == 0 && static_cast(jj) == size) { std::copy(is.begin(), is.end(), self->begin()); - } else if (step == -1 && ii == (size - 1) && jj == -1) { + } else if (step == -1 && static_cast(ii) == (size - 1) && jj == -1) { std::copy(is.rbegin(), is.rend(), self->begin()); } else { throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array");