mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fixing size_t/int mismatch in loops.
This commit is contained in:
parent
bad8545eee
commit
fb91393bb2
@ -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");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user