Fixes MSVC warnings in 64-bit mode.


git-svn-id: http://googletest.googlecode.com/svn/trunk@379 861a406c-534a-0410-8894-cb66d6ee9925
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h
index d14fb6a..269798a 100644
--- a/src/gtest-internal-inl.h
+++ b/src/gtest-internal-inl.h
@@ -251,7 +251,7 @@
 // the given predicate.
 template <class Container, typename Predicate>
 inline int CountIf(const Container& c, Predicate predicate) {
-  return std::count_if(c.begin(), c.end(), predicate);
+  return static_cast<int>(std::count_if(c.begin(), c.end(), predicate));
 }
 
 // Applies a function/functor to each element in the container.
@@ -294,7 +294,7 @@
 // Performs an in-place shuffle of the vector's elements.
 template <typename E>
 inline void Shuffle(internal::Random* random, std::vector<E>* v) {
-  ShuffleRange(random, 0, v->size(), v);
+  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
 }
 
 // A function for deleting an object.  Handy for being used as a
diff --git a/src/gtest-test-part.cc b/src/gtest-test-part.cc
index 7d9adef..5d183a4 100644
--- a/src/gtest-test-part.cc
+++ b/src/gtest-test-part.cc
@@ -81,7 +81,7 @@
 
 // Returns the number of TestPartResult objects in the array.
 int TestPartResultArray::size() const {
-  return array_.size();
+  return static_cast<int>(array_.size());
 }
 
 namespace internal {
diff --git a/src/gtest.cc b/src/gtest.cc
index 2a49012..987e690 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -690,7 +690,7 @@
 
 // Gets the number of all test cases.
 int UnitTestImpl::total_test_case_count() const {
-  return test_cases_.size();
+  return static_cast<int>(test_cases_.size());
 }
 
 // Gets the number of all test cases that contain at least one test
@@ -1898,12 +1898,12 @@
 // Gets the number of all test parts.  This is the sum of the number
 // of successful test parts and the number of failed test parts.
 int TestResult::total_part_count() const {
-  return test_part_results_.size();
+  return static_cast<int>(test_part_results_.size());
 }
 
 // Returns the number of the test properties.
 int TestResult::test_property_count() const {
-  return test_properties_.size();
+  return static_cast<int>(test_properties_.size());
 }
 
 // class Test
@@ -2350,7 +2350,7 @@
 
 // Gets the number of all tests.
 int TestCase::total_test_count() const {
-  return test_info_list_.size();
+  return static_cast<int>(test_info_list_.size());
 }
 
 // Creates a TestCase with the given name.
@@ -2395,7 +2395,7 @@
 // destruction of the TestCase object.
 void TestCase::AddTestInfo(TestInfo * test_info) {
   test_info_list_.push_back(test_info);
-  test_indices_.push_back(test_indices_.size());
+  test_indices_.push_back(static_cast<int>(test_indices_.size()));
 }
 
 // Runs every test in this TestCase.
@@ -2458,7 +2458,7 @@
 // Restores the test order to before the first shuffle.
 void TestCase::UnshuffleTests() {
   for (size_t i = 0; i < test_indices_.size(); i++) {
-    test_indices_[i] = i;
+    test_indices_[i] = static_cast<int>(i);
   }
 }
 
@@ -3567,7 +3567,8 @@
   if (impl_->gtest_trace_stack().size() > 0) {
     msg << "\n" << GTEST_NAME_ << " trace:";
 
-    for (int i = impl_->gtest_trace_stack().size(); i > 0; --i) {
+    for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
+         i > 0; --i) {
       const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
       msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
           << " " << trace.message;
@@ -3907,7 +3908,7 @@
     test_cases_.push_back(new_test_case);
   }
 
-  test_case_indices_.push_back(test_case_indices_.size());
+  test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
   return new_test_case;
 }
 
@@ -4270,7 +4271,7 @@
 
   // Shuffles the non-death test cases.
   ShuffleRange(random(), last_death_test_case_ + 1,
-               test_cases_.size(), &test_case_indices_);
+               static_cast<int>(test_cases_.size()), &test_case_indices_);
 
   // Shuffles the tests inside each test case.
   for (size_t i = 0; i < test_cases_.size(); i++) {
@@ -4284,7 +4285,7 @@
     // Unshuffles the tests in each test case.
     test_cases_[i]->UnshuffleTests();
     // Resets the index of each test case.
-    test_case_indices_[i] = i;
+    test_case_indices_[i] = static_cast<int>(i);
   }
 }
 
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
index 0551503..bc190e1 100644
--- a/test/gtest_unittest.cc
+++ b/test/gtest_unittest.cc
@@ -683,7 +683,7 @@
   }
 
   static bool VectorIsShuffled(const TestingVector& vector) {
-    return RangeIsShuffled(vector, 0, vector.size());
+    return RangeIsShuffled(vector, 0, static_cast<int>(vector.size()));
   }
 
   static bool VectorIsUnshuffled(const TestingVector& vector) {