diff --git a/include/fluidsynth/settings.h b/include/fluidsynth/settings.h index a040d09b..5d1f7cb4 100644 --- a/include/fluidsynth/settings.h +++ b/include/fluidsynth/settings.h @@ -175,7 +175,7 @@ int fluid_settings_getint_range(fluid_settings_t* settings, const char *name, * @param name Setting name * @param option A string option for this setting (iterates through the list) */ -typedef void (*fluid_settings_foreach_option_t)(void *data, char *name, char *option); +typedef void (*fluid_settings_foreach_option_t)(void *data, const char *name, const char *option); FLUIDSYNTH_API void fluid_settings_foreach_option(fluid_settings_t* settings, diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c index 081e4637..dcb907ab 100644 --- a/src/bindings/fluid_cmd.c +++ b/src/bindings/fluid_cmd.c @@ -1517,7 +1517,7 @@ struct _fluid_handle_option_data_t { fluid_ostream_t out; }; -void fluid_handle_print_option(void* data, char* name, char* option) +void fluid_handle_print_option(void* data, const char* name, const char* option) { struct _fluid_handle_option_data_t* d = (struct _fluid_handle_option_data_t*) data; diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 47b141d2..f20e9d41 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -141,7 +141,7 @@ typedef struct /* Function to display each string option value */ static void -settings_option_foreach_func (void *data, char *name, char *option) +settings_option_foreach_func (void *data, const char *name, const char *option) { OptionBag *bag = data; diff --git a/src/utils/fluid_settings.c b/src/utils/fluid_settings.c index 25dc7f0a..81927b45 100644 --- a/src/utils/fluid_settings.c +++ b/src/utils/fluid_settings.c @@ -1421,7 +1421,7 @@ fluid_settings_foreach_option (fluid_settings_t* settings, const char *name, newlist = fluid_list_sort (newlist, fluid_list_str_compare_func); for (p = newlist; p; p = p->next) - (*func)(data, (char *)name, (char *)fluid_list_get (p)); + (*func)(data, name, (const char *)fluid_list_get (p)); fluid_rec_mutex_unlock (settings->mutex); /* -- unlock */ @@ -1611,7 +1611,7 @@ fluid_settings_foreach (fluid_settings_t* settings, void* data, /* Loop over names and call the callback */ for (p = bag.names; p; p = p->next) { - if (fluid_settings_get (settings, (char *)(p->data), &node) == FLUID_OK + if (fluid_settings_get (settings, (const char *)(p->data), &node) == FLUID_OK && node) (*func) (data, (char *)(p->data), node->type); FLUID_FREE (p->data); /* -- Free name */