From 01a26787e3c2cb42db16fe7458dab5598c8c7215 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Wed, 30 Sep 2020 01:41:22 +0200 Subject: [PATCH 1/2] Fix return missing in move operator= --- src/sfizz/BufferPool.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sfizz/BufferPool.h b/src/sfizz/BufferPool.h index 2d057edf..b9971fcf 100644 --- a/src/sfizz/BufferPool.h +++ b/src/sfizz/BufferPool.h @@ -36,6 +36,7 @@ public: this->value = other.value; this->available = other.available; other.available = nullptr; + return *this; } SpanHolder(T&& value, int* available) : value(std::forward(value)) From 824689e38a6f76e4d67b149681cdfda34141700a Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Wed, 30 Sep 2020 01:41:48 +0200 Subject: [PATCH 2/2] Fix a misuse of const qualification in AudioSpan --- src/sfizz/AudioSpan.h | 12 ++++++------ src/sfizz/Voice.cpp | 2 +- src/sfizz/Voice.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sfizz/AudioSpan.h b/src/sfizz/AudioSpan.h index 0791eafa..fa879312 100644 --- a/src/sfizz/AudioSpan.h +++ b/src/sfizz/AudioSpan.h @@ -200,7 +200,7 @@ public: * @param channelIndex the channel * @return Type* the raw pointer to the channel */ - Type* getChannel(size_t channelIndex) + Type* getChannel(size_t channelIndex) const { ASSERT(channelIndex < numChannels); if (channelIndex < numChannels) @@ -231,7 +231,7 @@ public: * @param channelIndex the channel * @return absl::Span */ - absl::Span getSpan(size_t channelIndex) + absl::Span getSpan(size_t channelIndex) const { ASSERT(channelIndex < numChannels); if (channelIndex < numChannels) @@ -402,7 +402,7 @@ public: * * @param length the number of elements to take on each channel */ - AudioSpan first(size_type length) + AudioSpan first(size_type length) const { ASSERT(length <= numFrames); return { spans, numChannels, 0, length }; @@ -413,7 +413,7 @@ public: * * @param length the number of elements to take on each channel */ - AudioSpan last(size_type length) + AudioSpan last(size_type length) const { ASSERT(length <= numFrames); return { spans, numChannels, numFrames - length, length }; @@ -427,7 +427,7 @@ public: * * @param length the number of elements to take on each channel */ - AudioSpan subspan(size_type offset, size_type length) + AudioSpan subspan(size_type offset, size_type length) const { ASSERT(length + offset <= numFrames); return { spans, numChannels, offset, length }; @@ -440,7 +440,7 @@ public: * * @param length the number of elements to take on each channel */ - AudioSpan subspan(size_type offset) + AudioSpan subspan(size_type offset) const { ASSERT(offset <= numFrames); return { spans, numChannels, offset, numFrames - offset }; diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 1c36df54..4a0fc5b0 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -615,7 +615,7 @@ void sfz::Voice::fillWithData(AudioSpan buffer) noexcept template void sfz::Voice::fillInterpolated( - const sfz::AudioSpan& source, sfz::AudioSpan& dest, + const sfz::AudioSpan& source, const sfz::AudioSpan& dest, absl::Span indices, absl::Span coeffs) { auto ind = indices.data(); diff --git a/src/sfizz/Voice.h b/src/sfizz/Voice.h index 419c6584..9d5bfceb 100644 --- a/src/sfizz/Voice.h +++ b/src/sfizz/Voice.h @@ -376,7 +376,7 @@ private: */ template static void fillInterpolated( - const AudioSpan& source, AudioSpan& dest, + const AudioSpan& source, const AudioSpan& dest, absl::Span indices, absl::Span coeffs); /**