From 8ef23fe366a12bb819cc851ff81cf431835f1703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=A1k?= Date: Tue, 18 Feb 2025 16:00:00 +0100 Subject: [PATCH] fix issues in gcc --- platform/sdl/sound_filter.cpp | 6 +++--- platform/sdl/sound_filter.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/sdl/sound_filter.cpp b/platform/sdl/sound_filter.cpp index d376379..5bb080e 100644 --- a/platform/sdl/sound_filter.cpp +++ b/platform/sdl/sound_filter.cpp @@ -2,12 +2,12 @@ #include #include "sound_filter.h" -static constexpr float M_PI = 3.1415926535f; +static constexpr float pi_number = 3.1415926535f; Biquad::Biquad() : b0(1), b1(0), b2(0), a1(0), a2(0), z1(0), z2(0) {} void Biquad::setLowShelf(float gainDB, float cutoff, float sampleRate) { const float A = std::pow(10.0f, gainDB / 40.0f); - const float omega = 2.0f * float(M_PI) * cutoff / sampleRate; + const float omega = 2.0f * float(pi_number) * cutoff / sampleRate; const float sn = std::sin(omega); const float cs = std::cos(omega); const float S = 1.0f; // shelf slope (1.0 is a typical choice) @@ -33,7 +33,7 @@ void Biquad::setLowShelf(float gainDB, float cutoff, float sampleRate) { void Biquad::setHighShelf(float gainDB, float cutoff, float sampleRate) { const float A = std::pow(10.0f, gainDB / 40.0f); - const float omega = 2.0f * float(M_PI) * cutoff / sampleRate; + const float omega = 2.0f * float(pi_number) * cutoff / sampleRate; const float sn = std::sin(omega); const float cs = std::cos(omega); const float S = 1.0f; // shelf slope diff --git a/platform/sdl/sound_filter.h b/platform/sdl/sound_filter.h index f8297cf..bb53d8f 100644 --- a/platform/sdl/sound_filter.h +++ b/platform/sdl/sound_filter.h @@ -14,7 +14,7 @@ public: void setHighShelf(float gainDB, float cutoff, float sampleRate); // Process a single sample (Direct Form II Transposed) - inline float process(float in); + float process(float in); // (Optional) Reset the filter state (e.g. when starting a new buffer) void reset();