[libcxx] r287824 - [libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 23 14:02:27 PST 2016
Author: stl_msft
Date: Wed Nov 23 16:02:27 2016
New Revision: 287824
URL: http://llvm.org/viewvc/llvm-project?rev=287824&view=rev
Log:
[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Change "int j;" indices to "std::size_t j;".
Also, include <cstddef> when it wasn't already being included.
Modified:
libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp Wed Nov 23 16:02:27 2016
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
#include "min_allocator.h"
@@ -28,7 +29,7 @@ int main()
input_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
@@ -62,7 +63,7 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
@@ -81,7 +82,7 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
@@ -98,7 +99,7 @@ int main()
input_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
@@ -114,7 +115,7 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp Wed Nov 23 16:02:27 2016
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -24,7 +25,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -39,7 +40,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -55,7 +56,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -69,7 +70,7 @@ int main()
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp Wed Nov 23 16:02:27 2016
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -24,7 +25,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -38,7 +39,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -53,7 +54,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -66,7 +67,7 @@ int main()
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp Wed Nov 23 16:02:27 2016
@@ -18,6 +18,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_allocator.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -69,7 +70,7 @@ int main()
forward_iterator<const int*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
@@ -87,7 +88,7 @@ int main()
forward_iterator<const int*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (int k = 0; k < N; ++j, ++k)
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp Wed Nov 23 16:02:27 2016
@@ -17,6 +17,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -45,7 +46,7 @@ int main()
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -61,7 +62,7 @@ int main()
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp?rev=287824&r1=287823&r2=287824&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp Wed Nov 23 16:02:27 2016
@@ -17,6 +17,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -44,7 +45,7 @@ int main()
assert(v.size() == sz + 1);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -60,7 +61,7 @@ int main()
assert(v.size() == sz + 1);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
More information about the cfe-commits
mailing list