From 6b3ec2624254a0a57ae76d4291e15aaf9b835e47 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Sat, 21 Oct 2017 13:56:48 +0200 Subject: [PATCH] Added 2 missing tests with FLUID_N_ELEMENTS() --- src/drivers/fluid_mdriver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/fluid_mdriver.c b/src/drivers/fluid_mdriver.c index a0449db2..ee459dc1 100644 --- a/src/drivers/fluid_mdriver.c +++ b/src/drivers/fluid_mdriver.c @@ -204,9 +204,9 @@ fluid_midi_driver_t* new_fluid_midi_driver(fluid_settings_t* settings, handle_mi { fluid_midi_driver_t* driver = NULL; char *allnames; - int i; + unsigned int i; - for (i = 0; fluid_midi_drivers[i].name != NULL; i++) { + for (i = 0; i < FLUID_N_ELEMENTS(fluid_midi_drivers); i++) { if (fluid_settings_str_equal(settings, "midi.driver", fluid_midi_drivers[i].name)) { FLUID_LOG(FLUID_DBG, "Using '%s' midi driver", fluid_midi_drivers[i].name); driver = fluid_midi_drivers[i].new(settings, handler, event_handler_data); @@ -231,9 +231,9 @@ fluid_midi_driver_t* new_fluid_midi_driver(fluid_settings_t* settings, handle_mi */ void delete_fluid_midi_driver(fluid_midi_driver_t* driver) { - int i; + unsigned int i; - for (i = 0; fluid_midi_drivers[i].name != NULL; i++) { + for (i = 0; i < FLUID_N_ELEMENTS(fluid_midi_drivers); i++) { if (fluid_midi_drivers[i].name == driver->name) { fluid_midi_drivers[i].free(driver); return;