From 65eb5642225e2913d94dfd97474bca8c7aa6371d Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sat, 2 May 2020 11:35:14 +0200 Subject: [PATCH 1/2] Make atomic_queue constexpr functions compliant to C++11 --- src/external/atomic_queue/atomic_queue.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/external/atomic_queue/atomic_queue.h b/src/external/atomic_queue/atomic_queue.h index 23536adc..f679d32c 100644 --- a/src/external/atomic_queue/atomic_queue.h +++ b/src/external/atomic_queue/atomic_queue.h @@ -55,12 +55,17 @@ struct GetIndexShuffleBits { // the element within the cache line) with the next N bits (which are the index of the cache line) // of the element index. template -constexpr unsigned remap_index(unsigned index) noexcept { - constexpr unsigned MASK = (1u << BITS) - 1; - unsigned mix = (index ^ (index >> BITS)) & MASK; +constexpr unsigned remap_index_with_mix(unsigned index, unsigned mix) +{ return index ^ mix ^ (mix << BITS); } +template +constexpr unsigned remap_index(unsigned index) noexcept { + return remap_index_with_mix( + index, (index ^ (index >> BITS)) & ((1u << BITS) - 1)); +} + template<> constexpr unsigned remap_index<0>(unsigned index) noexcept { return index; @@ -68,8 +73,7 @@ constexpr unsigned remap_index<0>(unsigned index) noexcept { template constexpr T& map(T* elements, unsigned index) noexcept { - index = remap_index(index); - return elements[index]; + return elements[remap_index(index)]; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From d531c3725445f24d3c9093c551076fbf00e42789 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sat, 2 May 2020 11:36:45 +0200 Subject: [PATCH 2/2] Delete unused private field --- src/sfizz/Voice.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sfizz/Voice.h b/src/sfizz/Voice.h index b4e61c5e..bc1e537c 100644 --- a/src/sfizz/Voice.h +++ b/src/sfizz/Voice.h @@ -265,7 +265,6 @@ private: float baseVolumedB{ 0.0 }; float baseGain { 1.0 }; float baseFrequency { 440.0 }; - float phase { 0.0f }; float floatPositionOffset { 0.0f }; int sourcePosition { 0 };