From fb91393bb205ea6a19cda4c92db5899519be9bdc Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Sun, 27 Sep 2015 16:25:43 -0700 Subject: [PATCH] Fixing size_t/int mismatch in loops. --- include/array_view.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/array_view.h b/include/array_view.h index e40918d..68a3cf0 100644 --- a/include/array_view.h +++ b/include/array_view.h @@ -1067,7 +1067,7 @@ public: } bounds_iterator& operator--() _NOEXCEPT { - for (int i = rank; i-- > 0;) + for (size_t i = rank; i-- > 0;) { if (curr[i]-- > 0) { @@ -1335,7 +1335,7 @@ namespace details auto extents = bnd.index_bounds(); typename Bounds::index_type stride; stride[Bounds::rank - 1] = 1; - for (int i = Bounds::rank - 2; i >= 0; --i) + for (size_t i = Bounds::rank - 2; i >= 0; --i) stride[i] = stride[i + 1] * extents[i + 1]; return stride; } @@ -2035,7 +2035,7 @@ private: fail_fast_assert(strides[rank - 1] == 1, "Only strided arrays with regular strides can be resized"); fail_fast_assert(strides[rank - 2] >= d && (strides[rank - 2] % d == 0), "The strides must have contiguous chunks of memory that can contain a multiple of new type elements"); - for (int i = rank - 2; i >= 0; --i) + for (size_t i = rank - 2; i >= 0; --i) { fail_fast_assert((strides[i] >= strides[i + 1]) && (strides[i] % strides[i + 1] == 0), "Only strided arrays with regular strides can be resized"); }