From 0b10cfd582591d8eddd22f3b0500edd8bf9c2d6d Mon Sep 17 00:00:00 2001 From: kosak Date: Tue, 28 Jul 2015 00:15:20 +0000 Subject: [PATCH] Prevent MSVC from issuing warnings about possible value truncations. --- include/gtest/internal/gtest-param-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h index 5ffeaa4b..82cab9b0 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 { return base_; } virtual void Advance() { - value_ = value_ + step_; + value_ = static_cast(value_ + step_); index_++; } virtual ParamIteratorInterface* Clone() const { @@ -267,7 +267,7 @@ class RangeGenerator : public ParamGeneratorInterface { 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(i + step)) end_index++; return end_index; }