[libcxx] [test] D27023: Fix MSVC warning C4389 "signed/unsigned mismatch", part 10/12.

Add static_cast<int>. In these cases, the values are guaranteed to be small-ish,
and they're being compared to int elements.

test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
Use int instead of unsigned to iterate from 0 to 10.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2016-12-06 01:13:29 +00:00
parent 21208822a8
commit 3bea61851a
6 changed files with 15 additions and 15 deletions

View File

@@ -40,7 +40,7 @@ test()
InIter2(ib), InIter2(ib+N), OutIter(ic));
assert(base(r) == ic+2*N);
assert(ic[0] == 0);
assert(ic[2*N-1] == 2*N-1);
assert(ic[2*N-1] == static_cast<int>(2*N-1));
assert(std::is_sorted(ic, ic+2*N));
delete [] ic;
delete [] ib;
@@ -62,7 +62,7 @@ test()
InIter2(ib), InIter2(ib+N), OutIter(ic));
assert(base(r) == ic+2*N);
assert(ic[0] == 0);
assert(ic[2*N-1] == 2*N-1);
assert(ic[2*N-1] == static_cast<int>(2*N-1));
assert(std::is_sorted(ic, ic+2*N));
delete [] ic;
delete [] ib;

View File

@@ -46,7 +46,7 @@ test()
OutIter r = std::merge(InIter1(ia), InIter1(ia+N),
InIter2(ib), InIter2(ib+N), OutIter(ic), pred);
assert(base(r) == ic+2*N);
assert(ic[0] == 2*N-1);
assert(ic[0] == static_cast<int>(2*N-1));
assert(ic[2*N-1] == 0);
assert(std::is_sorted(ic, ic+2*N, std::greater<int>()));
assert(pred.count() <= (N + N - 1));
@@ -70,7 +70,7 @@ test()
OutIter r = std::merge(InIter1(ia), InIter1(ia+N),
InIter2(ib), InIter2(ib+N), OutIter(ic), pred);
assert(base(r) == ic+2*N);
assert(ic[0] == 2*N-1);
assert(ic[0] == static_cast<int>(2*N-1));
assert(ic[2*N-1] == 0);
assert(std::is_sorted(ic, ic+2*N, std::greater<int>()));
assert(pred.count() <= (N + N - 1));