From 84e091a1b2641358c2bf2ab639d20f74bb83163b Mon Sep 17 00:00:00 2001 From: srcejon Date: Mon, 4 Mar 2024 15:51:03 +0000 Subject: [PATCH] Mark log2fapprox as const. --- sdrbase/dsp/spectrumvis.cpp | 2 +- sdrbase/dsp/spectrumvis.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdrbase/dsp/spectrumvis.cpp b/sdrbase/dsp/spectrumvis.cpp index 246577648..71eff9b82 100644 --- a/sdrbase/dsp/spectrumvis.cpp +++ b/sdrbase/dsp/spectrumvis.cpp @@ -1098,7 +1098,7 @@ void SpectrumVis::webapiUpdateSpectrumSettings( // so we can use the following approximation to get a good speed-up for both compilers: // https://www.vplesko.com/posts/replacing_log2f.html // https://www.vplesko.com/assets/replacing_log2f/main.c.txt -float SpectrumVis::log2fapprox(float x) +float SpectrumVis::log2fapprox(float x) const { // IEEE 754 representation constants. const int32_t mantissaLen = 23; diff --git a/sdrbase/dsp/spectrumvis.h b/sdrbase/dsp/spectrumvis.h index c3078d8d2..7f567fed5 100644 --- a/sdrbase/dsp/spectrumvis.h +++ b/sdrbase/dsp/spectrumvis.h @@ -259,7 +259,7 @@ private: void handleScalef(Real scalef); void handleWSOpenClose(bool openClose); void handleConfigureWSSpectrum(const QString& address, uint16_t port); - float log2fapprox(float x); + float log2fapprox(float x) const; static void webapiFormatSpectrumSettings(SWGSDRangel::SWGGLSpectrum& response, const SpectrumSettings& settings); static void webapiUpdateSpectrumSettings(