Index: webrtc/base/rollingaccumulator.h |
diff --git a/webrtc/base/rollingaccumulator.h b/webrtc/base/rollingaccumulator.h |
index e1053801917955215b6f04d3b404f4ee3cc9b1fa..0c8e5fb8bdc0aee469b97ffd96374f5ef073cca4 100644 |
--- a/webrtc/base/rollingaccumulator.h |
+++ b/webrtc/base/rollingaccumulator.h |
@@ -56,7 +56,7 @@ class RollingAccumulator { |
// Remove oldest sample. |
T sample_to_remove = samples_[next_index_]; |
sum_ -= sample_to_remove; |
- sum_2_ -= sample_to_remove * sample_to_remove; |
+ sum_2_ -= static_cast<double>(sample_to_remove) * sample_to_remove; |
if (sample_to_remove >= max_) { |
max_stale_ = true; |
} |
@@ -70,7 +70,7 @@ class RollingAccumulator { |
// Add new sample. |
samples_[next_index_] = sample; |
sum_ += sample; |
- sum_2_ += sample * sample; |
+ sum_2_ += static_cast<double>(sample) * sample; |
if (count_ == 1 || sample >= max_) { |
max_ = sample; |
max_stale_ = false; |