diff options
| author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:01:19 +0000 |
|---|---|---|
| committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:01:19 +0000 |
| commit | e898b484f646a10e0bcf90315b417bf32cfbd659 (patch) | |
| tree | 61b9e0771f1af896331adcd5e8f1f88698fd6dd8 /libcxx/test/std/algorithms/alg.sorting | |
| parent | 4ff1c3983d8f8ec15f6f457d7c0662825f7bdb6c (diff) | |
| download | bcm5719-llvm-e898b484f646a10e0bcf90315b417bf32cfbd659.tar.gz bcm5719-llvm-e898b484f646a10e0bcf90315b417bf32cfbd659.zip | |
[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Change loop indices from int to std::size_t.
Also, include <cstddef> when it wasn't already being included.
llvm-svn: 287820
Diffstat (limited to 'libcxx/test/std/algorithms/alg.sorting')
8 files changed, 16 insertions, 8 deletions
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp index 253e0e38690..1f74a9a1b2b 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp @@ -18,6 +18,7 @@ #include <algorithm> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -36,7 +37,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp index 1d2840921e8..802d897670c 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp @@ -19,6 +19,7 @@ #include <vector> #include <functional> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -37,7 +38,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp index ce659c1b50f..8c2b60819b0 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp @@ -18,6 +18,7 @@ #include <algorithm> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -44,7 +45,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp index 2b29e2c8435..c2d92d92081 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp @@ -19,6 +19,7 @@ #include <functional> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -45,7 +46,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp index ce4f7ced5e6..2608104fca7 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp @@ -17,6 +17,7 @@ #include <algorithm> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -39,7 +40,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp index ae65c59e315..6a5463246c7 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp @@ -18,6 +18,7 @@ #include <functional> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -40,7 +41,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp index 3659e08fb28..106f1499e99 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp @@ -17,6 +17,7 @@ #include <algorithm> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -39,7 +40,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp index dd5fcfc2852..3fa346131ac 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp @@ -18,6 +18,7 @@ #include <functional> #include <vector> #include <cassert> +#include <cstddef> #include "test_iterators.h" @@ -40,7 +41,7 @@ test() const unsigned M = 10; std::vector<int> v(N); int x = 0; - for (int i = 0; i < v.size(); ++i) + for (std::size_t i = 0; i < v.size(); ++i) { v[i] = x; if (++x == M) |

