mirror of
https://github.com/microsoft/GSL.git
synced 2025-10-05 03:21:46 +02:00
Fixing size_t/int mismatch in loops.
This commit is contained in:
@@ -1067,7 +1067,7 @@ public:
|
|||||||
}
|
}
|
||||||
bounds_iterator& operator--() _NOEXCEPT
|
bounds_iterator& operator--() _NOEXCEPT
|
||||||
{
|
{
|
||||||
for (int i = rank; i-- > 0;)
|
for (size_t i = rank; i-- > 0;)
|
||||||
{
|
{
|
||||||
if (curr[i]-- > 0)
|
if (curr[i]-- > 0)
|
||||||
{
|
{
|
||||||
@@ -1335,7 +1335,7 @@ namespace details
|
|||||||
auto extents = bnd.index_bounds();
|
auto extents = bnd.index_bounds();
|
||||||
typename Bounds::index_type stride;
|
typename Bounds::index_type stride;
|
||||||
stride[Bounds::rank - 1] = 1;
|
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];
|
stride[i] = stride[i + 1] * extents[i + 1];
|
||||||
return stride;
|
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 - 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");
|
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");
|
fail_fast_assert((strides[i] >= strides[i + 1]) && (strides[i] % strides[i + 1] == 0), "Only strided arrays with regular strides can be resized");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user