From a4d6ed761db2945a9c74c9abd8cb8c1472daacfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 16 Jun 2019 23:13:02 +0200 Subject: Fix compiler warning and make operator SINT() a constexpr --- src/analyzer/constants.h | 2 +- src/util/audiosignal.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/analyzer/constants.h b/src/analyzer/constants.h index 4ea46f7149..1170c487f7 100644 --- a/src/analyzer/constants.h +++ b/src/analyzer/constants.h @@ -11,7 +11,7 @@ namespace mixxx { // fixed number of channels like the engine does, usually 2 = stereo. constexpr mixxx::AudioSignal::ChannelCount kAnalysisChannels = mixxx::kEngineChannelCount; constexpr SINT kAnalysisFramesPerBlock = 4096; -const SINT kAnalysisSamplesPerBlock = +constexpr SINT kAnalysisSamplesPerBlock = kAnalysisFramesPerBlock * kAnalysisChannels; // Only analyze the first minute in fast-analysis mode. diff --git a/src/util/audiosignal.h b/src/util/audiosignal.h index 85ddfa3bfd..754157d2d5 100644 --- a/src/util/audiosignal.h +++ b/src/util/audiosignal.h @@ -61,8 +61,7 @@ public: return (kValueMin <= m_value) && (m_value <= kValueMax); } - /*implicit*/ operator SINT() const { - DEBUG_ASSERT(m_value >= 0); // unsigned value + /*implicit*/ constexpr operator SINT() const { return m_value; } @@ -106,8 +105,7 @@ public: return (kValueMin <= m_value) && (m_value <= kValueMax); } - /*implicit*/ operator SINT() const { - DEBUG_ASSERT(m_value >= 0); // unsigned value + /*implicit*/ constexpr operator SINT() const { return m_value; } -- cgit v1.2.3