From 637cefb636171aad3f4479f9b25da4b23aa15c50 Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Wed, 30 Aug 2023 11:44:59 +0200 Subject: [PATCH] added pragmas to calm gcc in bw_{env_gen,hs2,ls2,one_pole,peak} --- include/bw_env_gen.h | 14 ++++++++++++++ include/bw_hs2.h | 8 ++++++++ include/bw_ls2.h | 8 ++++++++ include/bw_one_pole.h | 11 +++++++++++ include/bw_peak.h | 14 ++++++++++++++ 5 files changed, 55 insertions(+) diff --git a/include/bw_env_gen.h b/include/bw_env_gen.h index 36abfba..f24479c 100644 --- a/include/bw_env_gen.h +++ b/include/bw_env_gen.h @@ -53,6 +53,8 @@ *
  • Added overladed C++ process() function taking * C-style arrays as arguments.
  • *
  • Removed usage of reserved identifiers.
  • + *
  • Added pragmas to silence bogus GCC uninitialized variable + * warnings.
  • * * *
  • Version 0.6.0: @@ -422,28 +424,40 @@ static inline void bw_env_gen_process_multi(bw_env_gen_coeffs *BW_RESTRICT coeff static inline void bw_env_gen_set_attack(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->attack != value) { coeffs->attack = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ENV_GEN_PARAM_ATTACK; +#pragma GCC diagnostic pop } } static inline void bw_env_gen_set_decay(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->decay != value) { coeffs->decay = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ENV_GEN_PARAM_DECAY; +#pragma GCC diagnostic pop } } static inline void bw_env_gen_set_sustain(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->sustain != value) { coeffs->sustain = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ENV_GEN_PARAM_SUSTAIN; +#pragma GCC diagnostic pop } } static inline void bw_env_gen_set_release(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->release != value) { coeffs->release = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ENV_GEN_PARAM_RELEASE; +#pragma GCC diagnostic pop } } diff --git a/include/bw_hs2.h b/include/bw_hs2.h index ebb2902..5123ed0 100644 --- a/include/bw_hs2.h +++ b/include/bw_hs2.h @@ -38,6 +38,8 @@ *
  • Added overladed C++ process() function taking * C-style arrays as arguments.
  • *
  • Removed usage of reserved identifiers.
  • + *
  • Added pragmas to silence bogus GCC uninitialized variable + * warnings.
  • * * *
  • Version 0.6.0: @@ -293,7 +295,10 @@ static inline void bw_hs2_process_multi(bw_hs2_coeffs *BW_RESTRICT coeffs, bw_hs static inline void bw_hs2_set_cutoff(bw_hs2_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->cutoff) { coeffs->cutoff = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_HS2_PARAM_CUTOFF; +#pragma GCC diagnostic pop } } @@ -304,7 +309,10 @@ static inline void bw_hs2_set_Q(bw_hs2_coeffs *BW_RESTRICT coeffs, float value) static inline void bw_hs2_set_high_gain_lin(bw_hs2_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->high_gain != value) { coeffs->high_gain = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_HS2_PARAM_HIGH_GAIN; +#pragma GCC diagnostic pop } } diff --git a/include/bw_ls2.h b/include/bw_ls2.h index ce35fe4..32952ce 100644 --- a/include/bw_ls2.h +++ b/include/bw_ls2.h @@ -39,6 +39,8 @@ *
  • Added overladed C++ process() function taking * C-style arrays as arguments.
  • *
  • Removed usage of reserved identifiers.
  • + *
  • Added pragmas to silence bogus GCC uninitialized variable + * warnings.
  • * * *
  • Version 0.6.0: @@ -292,7 +294,10 @@ static inline void bw_ls2_process_multi(bw_ls2_coeffs *BW_RESTRICT coeffs, bw_ls static inline void bw_ls2_set_cutoff(bw_ls2_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->cutoff != value) { coeffs->cutoff = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_LS2_PARAM_CUTOFF; +#pragma GCC diagnostic pop } } @@ -303,7 +308,10 @@ static inline void bw_ls2_set_Q(bw_ls2_coeffs *BW_RESTRICT coeffs, float value) static inline void bw_ls2_set_dc_gain_lin(bw_ls2_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->dc_gain != value) { coeffs->dc_gain = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_LS2_PARAM_DC_GAIN; +#pragma GCC diagnostic pop } } diff --git a/include/bw_one_pole.h b/include/bw_one_pole.h index b7b1ee7..dcfd2b7 100644 --- a/include/bw_one_pole.h +++ b/include/bw_one_pole.h @@ -43,6 +43,8 @@ *
  • Now using backward Euler rather than impulse invariant * method.
  • *
  • Added more debugging code.
  • + *
  • Added pragmas to silence bogus GCC uninitialized variable + * warnings.
  • * * *
  • Version 0.6.0: @@ -966,7 +968,10 @@ static inline void bw_one_pole_set_cutoff_up( if (coeffs->cutoff_up != value) { coeffs->cutoff_up = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ONE_POLE_PARAM_CUTOFF_UP; +#pragma GCC diagnostic pop } BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs)); @@ -984,7 +989,10 @@ static inline void bw_one_pole_set_cutoff_down( if (coeffs->cutoff_down != value) { coeffs->cutoff_down = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ONE_POLE_PARAM_CUTOFF_DOWN; +#pragma GCC diagnostic pop } BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs)); @@ -1050,7 +1058,10 @@ static inline void bw_one_pole_set_sticky_thresh( if (coeffs->sticky_thresh != value) { coeffs->sticky_thresh = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_ONE_POLE_PARAM_STICKY_THRESH; +#pragma GCC diagnostic pop } BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs)); diff --git a/include/bw_peak.h b/include/bw_peak.h index 68cfdea..1a16d78 100644 --- a/include/bw_peak.h +++ b/include/bw_peak.h @@ -46,6 +46,8 @@ *
  • Added overladed C++ process() function taking * C-style arrays as arguments.
  • *
  • Removed usage of reserved identifiers.
  • + *
  • Added pragmas to silence bogus GCC uninitialized variable + * warnings.
  • * * *
  • Version 0.6.0: @@ -331,14 +333,20 @@ static inline void bw_peak_set_cutoff(bw_peak_coeffs *BW_RESTRICT coeffs, float static inline void bw_peak_set_Q(bw_peak_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->Q != value) { coeffs->Q = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_PEAK_PARAM_Q; +#pragma GCC diagnostic pop } } static inline void bw_peak_set_peak_gain_lin(bw_peak_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->peak_gain != value) { coeffs->peak_gain = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_PEAK_PARAM_PEAK_GAIN; +#pragma GCC diagnostic pop } } @@ -349,14 +357,20 @@ static inline void bw_peak_set_peak_gain_dB(bw_peak_coeffs *BW_RESTRICT coeffs, static inline void bw_peak_set_bandwidth(bw_peak_coeffs *BW_RESTRICT coeffs, float value) { if (coeffs->bandwidth != value) { coeffs->bandwidth = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_PEAK_PARAM_BANDWIDTH; +#pragma GCC diagnostic pop } } static inline void bw_peak_set_use_bandwidth(bw_peak_coeffs *BW_RESTRICT coeffs, char value) { if ((coeffs->use_bandwidth && !value) || (!coeffs->use_bandwidth && value)) { coeffs->use_bandwidth = value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" coeffs->param_changed |= BW_PEAK_PARAM_Q | BW_PEAK_PARAM_BANDWIDTH; +#pragma GCC diagnostic pop } }