From 3bd76ba574e9a3da89600e85c6c35bcb005a1317 Mon Sep 17 00:00:00 2001 From: Vasile Vilvoiu Date: Sat, 6 May 2023 16:22:03 +0300 Subject: Fix compilation issues. --- src/fft.cpp | 9 +++++---- src/input-parser.cpp | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/fft.cpp b/src/fft.cpp index d5fa4c2..5668ac8 100644 --- a/src/fft.cpp +++ b/src/fft.cpp @@ -11,6 +11,7 @@ #include #include #include +#include static double sinc(double x) @@ -25,11 +26,11 @@ sinc(double x) } else { double result = 1.0f; - if (abs(x) >= taylor_0_bound) { + if (std::abs(x) >= taylor_0_bound) { double x2 = x * x; result -= x2 / 6.0f; - if (abs(x) >= taylor_2_bound) { + if (std::abs(x) >= taylor_2_bound) { result += (x2 * x2) / 120.0f; } } @@ -239,8 +240,8 @@ FFT::Crop(const RealWindow& input, double rate, double fmin, double fmax) double di_fmax = std::round(FFT::GetFrequencyIndex(rate, input.size(), fmax)); /* we're cropping, so no interpolation allowed */ - auto i_fmin = static_cast(di_fmin); - auto i_fmax = static_cast(di_fmax); + auto i_fmin = static_cast(di_fmin); + auto i_fmax = static_cast(di_fmax); if (i_fmin < 0) { throw std::runtime_error("fmin outside of window"); diff --git a/src/input-parser.cpp b/src/input-parser.cpp index 677aa48..f9ad73b 100644 --- a/src/input-parser.cpp +++ b/src/input-parser.cpp @@ -41,21 +41,21 @@ std::unique_ptr InputParser::Build(DataType dtype, double prescale, bool is_complex) { if (dtype == DataType::kSignedInt8) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kSignedInt16) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kSignedInt32) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kSignedInt64) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt8) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt16) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt32) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt64) { - return std::make_unique>(prescale, is_complex); + return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kFloat32) { return std::make_unique>(prescale, is_complex); } else if (dtype == DataType::kFloat64) { @@ -152,15 +152,15 @@ FloatInputParser::ParseBlock(const std::vector &block) return count; } -template class IntegerInputParser; -template class IntegerInputParser; -template class IntegerInputParser; -template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; -template class IntegerInputParser; -template class IntegerInputParser; -template class IntegerInputParser; -template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; +template class IntegerInputParser; template class FloatInputParser; template class FloatInputParser; -- cgit v1.2.3