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/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp | |
| 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/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp')
| -rw-r--r-- | libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp index e000363f321..621fdc1bfe8 100644 --- a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp @@ -20,6 +20,7 @@ #include <cassert> #include <vector> #include <numeric> +#include <cstddef> template <class T> inline @@ -49,7 +50,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -89,7 +90,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -129,7 +130,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -169,7 +170,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -209,7 +210,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -249,7 +250,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -289,7 +290,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -329,7 +330,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -369,7 +370,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -409,7 +410,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); @@ -449,7 +450,7 @@ int main() D::result_type var = 0; D::result_type skew = 0; D::result_type kurtosis = 0; - for (int i = 0; i < u.size(); ++i) + for (std::size_t i = 0; i < u.size(); ++i) { D::result_type dbl = (u[i] - mean); D::result_type d2 = sqr(dbl); |

