Qualify cmath function calls

Use the C++-style stdlib headers, add `std::` prefix, in order to avoid implicit casts to double.

Bug: None
Change-Id: I78d9caaee715be341d2480c6d5e769068966d577
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133625
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27905}
This commit is contained in:
Oleh Prypin
2019-04-23 08:50:04 +02:00
committed by Commit Bot
parent fb0878197e
commit 199295882d
6 changed files with 18 additions and 17 deletions

View File

@ -10,8 +10,8 @@
#include "modules/audio_processing/rms_level.h"
#include <math.h>
#include <algorithm>
#include <cmath>
#include <numeric>
#include "rtc_base/checks.h"
@ -36,7 +36,7 @@ int ComputeRms(float mean_square) {
const float mean_square_norm = mean_square / kMaxSquaredLevel;
RTC_DCHECK_GT(mean_square_norm, kMinLevel);
// 20log_10(x^0.5) = 10log_10(x)
const float rms = 10.f * log10(mean_square_norm);
const float rms = 10.f * std::log10(mean_square_norm);
RTC_DCHECK_LE(rms, 0.f);
RTC_DCHECK_GT(rms, -RmsLevel::kMinLevelDb);
// Return the negated value.