refactor delete_fluid_voice() to return void

return value was ignored anyway
This commit is contained in:
derselbst 2017-10-30 11:33:23 +01:00
parent bf978e2b6b
commit 5427a4ebf5
2 changed files with 4 additions and 6 deletions

View file

@ -217,19 +217,17 @@ new_fluid_voice(fluid_real_t output_rate)
/* /*
* delete_fluid_voice * delete_fluid_voice
*/ */
int void
delete_fluid_voice(fluid_voice_t* voice) delete_fluid_voice(fluid_voice_t* voice)
{ {
fluid_return_val_if_fail(voice != NULL, FLUID_OK); fluid_return_if_fail(voice != NULL);
if (!voice->can_access_rvoice || !voice->can_access_overflow_rvoice) { if (!voice->can_access_rvoice || !voice->can_access_overflow_rvoice) {
/* stop rvoice before deleting voice! */ FLUID_LOG(FLUID_WARN, "Deleting voice %u which has locked rvoices!", voice->id);
return FLUID_FAILED;
} }
FLUID_FREE(voice->overflow_rvoice); FLUID_FREE(voice->overflow_rvoice);
FLUID_FREE(voice->rvoice); FLUID_FREE(voice->rvoice);
FLUID_FREE(voice); FLUID_FREE(voice);
return FLUID_OK;
} }
/* fluid_voice_init /* fluid_voice_init

View file

@ -111,7 +111,7 @@ struct _fluid_voice_t
fluid_voice_t* new_fluid_voice(fluid_real_t output_rate); fluid_voice_t* new_fluid_voice(fluid_real_t output_rate);
int delete_fluid_voice(fluid_voice_t* voice); void delete_fluid_voice(fluid_voice_t* voice);
void fluid_voice_start(fluid_voice_t* voice); void fluid_voice_start(fluid_voice_t* voice);
void fluid_voice_calculate_gen_pitch(fluid_voice_t* voice); void fluid_voice_calculate_gen_pitch(fluid_voice_t* voice);