From 9f9b64d280d50b39c92e8e12c6f45ef78a72b4ea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Oct 2020 16:00:33 -0400 Subject: audio_core/CMakeLists: Make warnings consistent with core Normalizes the warnings shared between audio_core and core. --- src/audio_core/algorithm/filter.cpp | 3 ++- src/audio_core/algorithm/interpolate.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/audio_core/algorithm') diff --git a/src/audio_core/algorithm/filter.cpp b/src/audio_core/algorithm/filter.cpp index f65bf64f7..f34a5b9f3 100644 --- a/src/audio_core/algorithm/filter.cpp +++ b/src/audio_core/algorithm/filter.cpp @@ -55,7 +55,8 @@ void Filter::Process(std::vector& signal) { /// @param total_count The total number of biquads to be cascaded. /// @param index 0-index of the biquad to calculate the Q value for. static double CascadingBiquadQ(std::size_t total_count, std::size_t index) { - const double pole = M_PI * (2 * index + 1) / (4.0 * total_count); + const auto pole = + M_PI * static_cast(2 * index + 1) / (4.0 * static_cast(total_count)); return 1.0 / (2.0 * std::cos(pole)); } diff --git a/src/audio_core/algorithm/interpolate.cpp b/src/audio_core/algorithm/interpolate.cpp index 689a54508..699fcb84c 100644 --- a/src/audio_core/algorithm/interpolate.cpp +++ b/src/audio_core/algorithm/interpolate.cpp @@ -146,7 +146,7 @@ std::vector Interpolate(InterpolationState& state, std::vector input, return {}; if (ratio <= 0) { - LOG_CRITICAL(Audio, "Nonsensical interpolation ratio {}", ratio); + LOG_ERROR(Audio, "Nonsensical interpolation ratio {}", ratio); return input; } @@ -164,7 +164,8 @@ std::vector Interpolate(InterpolationState& state, std::vector input, const std::size_t num_frames{input.size() / 2}; std::vector output; - output.reserve(static_cast(input.size() / ratio + InterpolationState::taps)); + output.reserve(static_cast(static_cast(input.size()) / ratio + + InterpolationState::taps)); for (std::size_t frame{}; frame < num_frames; ++frame) { const std::size_t lut_index{(state.fraction >> 8) * InterpolationState::taps}; -- cgit v1.2.3