diff options
author | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2015-07-28 00:15:20 +0000 |
---|---|---|
committer | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2015-07-28 00:15:20 +0000 |
commit | dc9a70576686e0b1f50ecfffd7e2a6b8b2d0811c (patch) | |
tree | e0cf01af6b5123857ac17c88de85114cd207165a | |
parent | da647c1c8f00e4b9fa59bb9e9e38905b185172cc (diff) | |
download | googletest-dc9a70576686e0b1f50ecfffd7e2a6b8b2d0811c.tar.gz |
Prevent MSVC from issuing warnings about possible value truncations.
git-svn-id: http://googletest.googlecode.com/svn/trunk@745 861a406c-534a-0410-8894-cb66d6ee9925
-rw-r--r-- | include/gtest/internal/gtest-param-util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h index 5ffeaa4..82cab9b 100644 --- a/include/gtest/internal/gtest-param-util.h +++ b/include/gtest/internal/gtest-param-util.h @@ -230,7 +230,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> { return base_; } virtual void Advance() { - value_ = value_ + step_; + value_ = static_cast<T>(value_ + step_); index_++; } virtual ParamIteratorInterface<T>* Clone() const { @@ -267,7 +267,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> { const T& end, const IncrementT& step) { int end_index = 0; - for (T i = begin; i < end; i = i + step) + for (T i = begin; i < end; i = static_cast<T>(i + step)) end_index++; return end_index; } |