From 8d791a18b7153b249ab819e2aa805f1451ce50c0 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 29 Jul 2023 15:55:45 -0400 Subject: [PATCH] Obey Restrict rules on gcc; fix code accordingly Closes #7081 --- libs/sst/sst-basic-blocks | 2 +- libs/sst/sst-effects | 2 +- src/common/CMakeLists.txt | 1 + src/common/dsp/effects/BBDEnsembleEffect.cpp | 6 +++--- src/common/dsp/effects/ChorusEffectImpl.h | 2 +- src/common/dsp/effects/CombulatorEffect.cpp | 2 +- src/common/dsp/effects/FrequencyShifterEffect.cpp | 2 +- src/common/dsp/effects/NimbusEffect.cpp | 2 +- src/common/dsp/effects/ParametricEQ3BandEffect.cpp | 2 +- src/common/dsp/effects/PhaserEffect.cpp | 2 +- src/common/dsp/effects/ResonatorEffect.cpp | 2 +- src/common/dsp/effects/Reverb2Effect.cpp | 2 +- src/common/dsp/effects/RingModulatorEffect.cpp | 2 +- src/common/dsp/effects/RotarySpeakerEffect.cpp | 2 +- src/common/dsp/effects/TreemonsterEffect.cpp | 2 +- src/common/dsp/effects/WaveShaperEffect.cpp | 2 +- src/common/dsp/effects/chowdsp/CHOWEffect.cpp | 2 +- src/common/dsp/effects/chowdsp/ExciterEffect.cpp | 4 ++-- src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp | 2 +- src/common/dsp/effects/chowdsp/TapeEffect.cpp | 2 +- 20 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libs/sst/sst-basic-blocks b/libs/sst/sst-basic-blocks index 9b547d0f714..97aebc287b5 160000 --- a/libs/sst/sst-basic-blocks +++ b/libs/sst/sst-basic-blocks @@ -1 +1 @@ -Subproject commit 9b547d0f7142956b9bb60fc57f7e5b5ecdbf0e73 +Subproject commit 97aebc287b5d1cad430571b361442c2837536620 diff --git a/libs/sst/sst-effects b/libs/sst/sst-effects index 74fb113fbb5..0fb0a04d71c 160000 --- a/libs/sst/sst-effects +++ b/libs/sst/sst-effects @@ -1 +1 @@ -Subproject commit 74fb113fbb5d8ccf509ea3a984098699b4e44ce2 +Subproject commit 0fb0a04d71cb353b9af2537c5294b3d895763464 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 1996fc1933c..196df2eec22 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -317,6 +317,7 @@ elseif(UNIX) target_link_libraries(${PROJECT_NAME} PRIVATE execinfo) endif() target_link_libraries(${PROJECT_NAME} PUBLIC surge::simde) + target_compile_options(${PROJECT_NAME} PUBLIC $<$:-Werror=restrict>) elseif(WIN32) target_compile_definitions(${PROJECT_NAME} PUBLIC WINDOWS=1 diff --git a/src/common/dsp/effects/BBDEnsembleEffect.cpp b/src/common/dsp/effects/BBDEnsembleEffect.cpp index af2c80fa926..9b7156b3ed9 100644 --- a/src/common/dsp/effects/BBDEnsembleEffect.cpp +++ b/src/common/dsp/effects/BBDEnsembleEffect.cpp @@ -343,8 +343,8 @@ void BBDEnsembleEffect::process(float *dataL, float *dataR) modlfos[j][i].post_process(); } - mech::mul_block(L, storage->db_to_linear(-8.0f), L); - mech::mul_block(R, storage->db_to_linear(-8.0f), R); + mech::mul_block(L, storage->db_to_linear(-8.0f)); + mech::mul_block(R, storage->db_to_linear(-8.0f)); }; switch (bbd_stages) @@ -378,7 +378,7 @@ void BBDEnsembleEffect::process(float *dataL, float *dataR) applyWidth(L, R, width); mix.set_target_smoothed(clamp1bp(*pd_float[ens_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void BBDEnsembleEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/ChorusEffectImpl.h b/src/common/dsp/effects/ChorusEffectImpl.h index df5145cbc61..e8b1d769015 100644 --- a/src/common/dsp/effects/ChorusEffectImpl.h +++ b/src/common/dsp/effects/ChorusEffectImpl.h @@ -181,7 +181,7 @@ template void ChorusEffect::process(float *dataL, float *dataR) // scale width applyWidth(tbufferL, tbufferR, width); - mix.fade_2_blocks_to(dataL, tbufferL, dataR, tbufferR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, tbufferL, dataR, tbufferR, BLOCK_SIZE_QUAD); wpos += BLOCK_SIZE; wpos = wpos & (max_delay_length - 1); diff --git a/src/common/dsp/effects/CombulatorEffect.cpp b/src/common/dsp/effects/CombulatorEffect.cpp index 35d406af3a5..22e1b237d5b 100644 --- a/src/common/dsp/effects/CombulatorEffect.cpp +++ b/src/common/dsp/effects/CombulatorEffect.cpp @@ -387,7 +387,7 @@ void CombulatorEffect::process(float *dataL, float *dataR) auto cm = clamp01(*pd_float[combulator_mix]); mix.set_target_smoothed(cm); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void CombulatorEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/FrequencyShifterEffect.cpp b/src/common/dsp/effects/FrequencyShifterEffect.cpp index 55a0f6d16f1..d2876e8b7e2 100644 --- a/src/common/dsp/effects/FrequencyShifterEffect.cpp +++ b/src/common/dsp/effects/FrequencyShifterEffect.cpp @@ -168,7 +168,7 @@ void FrequencyShifterEffect::process(float *dataL, float *dataR) (R[k] * feedback.v)); } - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); wpos += BLOCK_SIZE; wpos = wpos & (max_delay_length - 1); diff --git a/src/common/dsp/effects/NimbusEffect.cpp b/src/common/dsp/effects/NimbusEffect.cpp index a352f6ddf7b..f9b21bf86c2 100644 --- a/src/common/dsp/effects/NimbusEffect.cpp +++ b/src/common/dsp/effects/NimbusEffect.cpp @@ -236,7 +236,7 @@ void NimbusEffect::process(float *dataL, float *dataR) resampReadPtr = rp; mix.set_target_smoothed(clamp01(*pd_float[nmb_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void NimbusEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/ParametricEQ3BandEffect.cpp b/src/common/dsp/effects/ParametricEQ3BandEffect.cpp index 53c5d379078..7b222979b91 100644 --- a/src/common/dsp/effects/ParametricEQ3BandEffect.cpp +++ b/src/common/dsp/effects/ParametricEQ3BandEffect.cpp @@ -100,7 +100,7 @@ void ParametricEQ3BandEffect::process(float *dataL, float *dataR) gain.multiply_2_blocks(L, R, BLOCK_SIZE_QUAD); mix.set_target_smoothed(clamp1bp(*pd_float[eq3_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void ParametricEQ3BandEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/PhaserEffect.cpp b/src/common/dsp/effects/PhaserEffect.cpp index ddd04d2ebea..f168b2cdee7 100644 --- a/src/common/dsp/effects/PhaserEffect.cpp +++ b/src/common/dsp/effects/PhaserEffect.cpp @@ -229,7 +229,7 @@ void PhaserEffect::process(float *dataL, float *dataR) applyWidth(L, R, width); mix.set_target_smoothed(clamp01(*pd_float[ph_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void PhaserEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/ResonatorEffect.cpp b/src/common/dsp/effects/ResonatorEffect.cpp index e5a47651c71..7f5bdd26ad4 100644 --- a/src/common/dsp/effects/ResonatorEffect.cpp +++ b/src/common/dsp/effects/ResonatorEffect.cpp @@ -286,7 +286,7 @@ void ResonatorEffect::process(float *dataL, float *dataR) gain.multiply_2_blocks(L, R, BLOCK_SIZE_QUAD); mix.set_target_smoothed(clamp1bp(*pd_float[resonator_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void ResonatorEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/Reverb2Effect.cpp b/src/common/dsp/effects/Reverb2Effect.cpp index 6d850b9fb2d..bbe6aebf3fb 100644 --- a/src/common/dsp/effects/Reverb2Effect.cpp +++ b/src/common/dsp/effects/Reverb2Effect.cpp @@ -259,7 +259,7 @@ void Reverb2Effect::process(float *dataL, float *dataR) // scale width applyWidth(wetL, wetR, width); - mix.fade_2_blocks_to(dataL, wetL, dataR, wetR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, wetL, dataR, wetR, BLOCK_SIZE_QUAD); } void Reverb2Effect::suspend() { init(); } diff --git a/src/common/dsp/effects/RingModulatorEffect.cpp b/src/common/dsp/effects/RingModulatorEffect.cpp index e15a956f5df..be4cb298a54 100644 --- a/src/common/dsp/effects/RingModulatorEffect.cpp +++ b/src/common/dsp/effects/RingModulatorEffect.cpp @@ -201,7 +201,7 @@ void RingModulatorEffect::process(float *dataL, float *dataR) hp.process_block(wetL, wetR); } - mix.fade_2_blocks_to(dataL, wetL, dataR, wetR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, wetL, dataR, wetR, BLOCK_SIZE_QUAD); } void RingModulatorEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/RotarySpeakerEffect.cpp b/src/common/dsp/effects/RotarySpeakerEffect.cpp index acd00de7629..96b9790866d 100644 --- a/src/common/dsp/effects/RotarySpeakerEffect.cpp +++ b/src/common/dsp/effects/RotarySpeakerEffect.cpp @@ -379,7 +379,7 @@ void RotarySpeakerEffect::process(float *dataL, float *dataR) // scale width applyWidth(wbL, wbR, width); - mix.fade_2_blocks_to(dataL, wbL, dataR, wbR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, wbL, dataR, wbR, BLOCK_SIZE_QUAD); wpos += BLOCK_SIZE; wpos = wpos & (max_delay_length - 1); diff --git a/src/common/dsp/effects/TreemonsterEffect.cpp b/src/common/dsp/effects/TreemonsterEffect.cpp index 329c802bca2..9208f83e7b2 100644 --- a/src/common/dsp/effects/TreemonsterEffect.cpp +++ b/src/common/dsp/effects/TreemonsterEffect.cpp @@ -239,7 +239,7 @@ void TreemonsterEffect::process(float *dataL, float *dataR) // main dry-wet mix mix.set_target_smoothed(clamp01(*pd_float[tm_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void TreemonsterEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/WaveShaperEffect.cpp b/src/common/dsp/effects/WaveShaperEffect.cpp index 751e4d7f18c..3506ff9858e 100644 --- a/src/common/dsp/effects/WaveShaperEffect.cpp +++ b/src/common/dsp/effects/WaveShaperEffect.cpp @@ -191,7 +191,7 @@ void WaveShaperEffect::process(float *dataL, float *dataR) } boost.multiply_2_blocks(wetL, wetR, BLOCK_SIZE_QUAD); - mix.fade_2_blocks_to(dataL, wetL, dataR, wetR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, wetL, dataR, wetR, BLOCK_SIZE_QUAD); } void WaveShaperEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/chowdsp/CHOWEffect.cpp b/src/common/dsp/effects/chowdsp/CHOWEffect.cpp index e30ddd166b5..24f56e9b71f 100644 --- a/src/common/dsp/effects/chowdsp/CHOWEffect.cpp +++ b/src/common/dsp/effects/chowdsp/CHOWEffect.cpp @@ -82,7 +82,7 @@ void CHOWEffect::process(float *dataL, float *dataR) makeup.multiply_2_blocks(dataL, dataR, BLOCK_SIZE_QUAD); mix.set_target_smoothed(clamp01(*pd_float[chow_mix])); - mix.fade_2_blocks_to(L, dataL, R, dataR, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(L, dataL, R, dataR, BLOCK_SIZE_QUAD); } void CHOWEffect::set_params() diff --git a/src/common/dsp/effects/chowdsp/ExciterEffect.cpp b/src/common/dsp/effects/chowdsp/ExciterEffect.cpp index 71f8c805ea3..0a954024b60 100644 --- a/src/common/dsp/effects/chowdsp/ExciterEffect.cpp +++ b/src/common/dsp/effects/chowdsp/ExciterEffect.cpp @@ -75,8 +75,8 @@ void ExciterEffect::process(float *dataL, float *dataR) // dry/wet process wet_gain.multiply_2_blocks(dataL, dataR, BLOCK_SIZE_QUAD); - mech::add_block(dataL, dryL, dataL); - mech::add_block(dataR, dryR, dataR); + mech::add_block(dataL, dryL); + mech::add_block(dataR, dryR); } void ExciterEffect::set_params() diff --git a/src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp b/src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp index 6e70f4ba2e5..a7c2c75170f 100644 --- a/src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp +++ b/src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp @@ -60,7 +60,7 @@ void SpringReverbEffect::process(float *dataL, float *dataR) proc.processBlock(L, R, BLOCK_SIZE); mix.set_target_smoothed(clamp01(*pd_float[spring_reverb_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void SpringReverbEffect::suspend() { init(); } diff --git a/src/common/dsp/effects/chowdsp/TapeEffect.cpp b/src/common/dsp/effects/chowdsp/TapeEffect.cpp index 3bd0b355393..32a4575d164 100644 --- a/src/common/dsp/effects/chowdsp/TapeEffect.cpp +++ b/src/common/dsp/effects/chowdsp/TapeEffect.cpp @@ -107,7 +107,7 @@ void TapeEffect::process(float *dataL, float *dataR) } mix.set_target_smoothed(clamp01(*pd_float[tape_mix])); - mix.fade_2_blocks_to(dataL, L, dataR, R, dataL, dataR, BLOCK_SIZE_QUAD); + mix.fade_2_blocks_inplace(dataL, L, dataR, R, BLOCK_SIZE_QUAD); } void TapeEffect::suspend() {}