mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user