mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
[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:
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user