From b15f6c4b2ad716508131c4092e804bdc7a114225 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Sat, 21 Oct 2017 16:49:07 +0200 Subject: [PATCH] Reverted change to unsigned type on fluid_synth_set_reverb_preset(), used fluid_return_val_if_fail() for consistency. --- src/synth/fluid_synth.c | 8 +++++--- src/synth/fluid_synth.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index c24f42b2..f9e85f06 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -3895,10 +3895,12 @@ fluid_synth_set_reverb_on(fluid_synth_t* synth, int on) * @note Currently private to libfluidsynth. */ int -fluid_synth_set_reverb_preset(fluid_synth_t* synth, unsigned int num) +fluid_synth_set_reverb_preset(fluid_synth_t* synth, int num) { - if (num >= FLUID_N_ELEMENTS(revmodel_preset)) - return FLUID_FAILED; + fluid_return_val_if_fail ( + num < 0 || num >= (int)FLUID_N_ELEMENTS(revmodel_preset), + FLUID_FAILED + ); fluid_synth_set_reverb (synth, revmodel_preset[num].roomsize, revmodel_preset[num].damp, revmodel_preset[num].width, diff --git a/src/synth/fluid_synth.h b/src/synth/fluid_synth.h index 72ae713d..476b006b 100644 --- a/src/synth/fluid_synth.h +++ b/src/synth/fluid_synth.h @@ -191,7 +191,7 @@ void fluid_synth_dither_s16(int *dither_index, int len, float* lin, float* rin, void* rout, int roff, int rincr); int fluid_synth_reset_reverb(fluid_synth_t* synth); -int fluid_synth_set_reverb_preset(fluid_synth_t* synth, unsigned int num); +int fluid_synth_set_reverb_preset(fluid_synth_t* synth, int num); int fluid_synth_set_reverb_full(fluid_synth_t* synth, int set, double roomsize, double damping, double width, double level);