Skip to content

Commit

Permalink
Obey Restrict rules on gcc; fix code accordingly
Browse files Browse the repository at this point in the history
Closes #7081
  • Loading branch information
baconpaul authored Jul 29, 2023
1 parent 4494068 commit 8d791a1
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion libs/sst/sst-effects
1 change: 1 addition & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<$<CXX_COMPILER_ID:GNU>:-Werror=restrict>)
elseif(WIN32)
target_compile_definitions(${PROJECT_NAME} PUBLIC
WINDOWS=1
Expand Down
6 changes: 3 additions & 3 deletions src/common/dsp/effects/BBDEnsembleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ void BBDEnsembleEffect::process(float *dataL, float *dataR)
modlfos[j][i].post_process();
}

mech::mul_block<BLOCK_SIZE>(L, storage->db_to_linear(-8.0f), L);
mech::mul_block<BLOCK_SIZE>(R, storage->db_to_linear(-8.0f), R);
mech::mul_block<BLOCK_SIZE>(L, storage->db_to_linear(-8.0f));
mech::mul_block<BLOCK_SIZE>(R, storage->db_to_linear(-8.0f));
};

switch (bbd_stages)
Expand Down Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/ChorusEffectImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ template <int v> void ChorusEffect<v>::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);
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/CombulatorEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/FrequencyShifterEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/NimbusEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/ParametricEQ3BandEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/PhaserEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/ResonatorEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/Reverb2Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/RingModulatorEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/RotarySpeakerEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/TreemonsterEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/WaveShaperEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/chowdsp/CHOWEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/common/dsp/effects/chowdsp/ExciterEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<BLOCK_SIZE>(dataL, dryL, dataL);
mech::add_block<BLOCK_SIZE>(dataR, dryR, dataR);
mech::add_block<BLOCK_SIZE>(dataL, dryL);
mech::add_block<BLOCK_SIZE>(dataR, dryR);
}

void ExciterEffect::set_params()
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/chowdsp/SpringReverbEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/common/dsp/effects/chowdsp/TapeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down

0 comments on commit 8d791a1

Please sign in to comment.