diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 605ed93704..2d11ce7026 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -927,7 +927,7 @@ static void menu_action_setting_disp_set_label(file_list_t* list, strlcpy(s, core_opt ? core_opt : "", len); } else - setting_get_label(list, s, + menu_setting_get_label(list, s, len, w, type, label, entry_label, i); strlcpy(s2, path, len2); diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 6a158b1035..85d9f13617 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -637,7 +637,7 @@ static int generic_action_ok(const char *path, if (cbs) { - setting_set_with_string_representation(cbs->setting, action_path); + menu_setting_set_with_string_representation(cbs->setting, action_path); ret = menu_setting_generic(cbs->setting, false); } } diff --git a/menu/menu_entry.c b/menu/menu_entry.c index 24dee17b8e..a0abac076a 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -162,7 +162,7 @@ struct string_list *menu_entry_enum_values(uint32_t i) void menu_entry_enum_set_value_with_string(uint32_t i, const char *s) { rarch_setting_t *setting = menu_entry_get_setting(i); - setting_set_with_string_representation(setting, s); + menu_setting_set_with_string_representation(setting, s); } int32_t menu_entry_bind_index(uint32_t i) @@ -247,8 +247,7 @@ int menu_entry_pathdir_set_value(uint32_t i, const char *s) if (menu_setting_get_type(cbs->setting) != ST_DIR) return -1; - setting_set_with_string_representation(cbs->setting, menu_path); - + menu_setting_set_with_string_representation(cbs->setting, menu_path); menu_setting_generic(cbs->setting, false); menu_list_flush_stack(menu_list, NULL, 49); @@ -285,7 +284,7 @@ void menu_entry_get_value(uint32_t i, char *s, size_t len) void menu_entry_set_value(uint32_t i, const char *s) { rarch_setting_t *setting = menu_entry_get_setting(i); - setting_set_with_string_representation(setting, s); + menu_setting_set_with_string_representation(setting, s); } uint32_t menu_entry_num_has_range(uint32_t i) diff --git a/menu/menu_input.c b/menu/menu_input.c index 942ed97ee0..c22549942b 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -332,9 +332,7 @@ void menu_input_st_uint_callback(void *userdata, const char *str) menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING, &label); setting = menu_setting_find(label); - - if (setting) - setting_set_with_string_representation(setting, str); + menu_setting_set_with_string_representation(setting, str); } menu_input_key_end_line(); @@ -378,7 +376,7 @@ void menu_input_st_string_callback(void *userdata, const char *str) if (setting) { - setting_set_with_string_representation(setting, str); + menu_setting_set_with_string_representation(setting, str); menu_setting_generic(setting, false); } else @@ -605,7 +603,7 @@ static int menu_input_set_bind_mode_common(rarch_setting_t *setting, if (!setting) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); @@ -688,7 +686,7 @@ int menu_input_set_input_device_bind_mode(void *data, if (!setting) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); bind_port = settings->input.joypad_map[index_offset]; if (menu_input_set_bind_mode_common(setting, type) == -1) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 78ce68caaa..1abb0b85df 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -564,7 +564,7 @@ static void setting_reset_setting(rarch_setting_t* setting) if (setting->default_value.string) { if (menu_setting_get_type(setting) == ST_STRING) - setting_set_with_string_representation(setting, setting->default_value.string); + menu_setting_set_with_string_representation(setting, setting->default_value.string); else fill_pathname_expand_special(setting->value.string, setting->default_value.string, setting->size); @@ -597,14 +597,14 @@ static void setting_reset_setting(rarch_setting_t* setting) /** - * setting_set_with_string_representation: + * menu_setting_set_with_string_representation: * @setting : pointer to setting * @value : value for the setting (string) * * Set a settings' value with a string. It is assumed * that the string has been properly formatted. **/ -int setting_set_with_string_representation(rarch_setting_t* setting, +int menu_setting_set_with_string_representation(rarch_setting_t* setting, const char* value) { double min, max; @@ -721,7 +721,7 @@ void setting_get_string_representation(void *data, char *s, size_t len) setting->get_string_representation(setting, s, len); } -unsigned setting_get_index_offset(rarch_setting_t *setting) +unsigned menu_setting_get_index_offset(rarch_setting_t *setting) { if (!setting) return 0; @@ -746,7 +746,7 @@ static int setting_action_start_bind_device(void *data) if (!setting || !settings) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); settings->input.joypad_map[index_offset] = index_offset; return 0; @@ -842,7 +842,7 @@ static int setting_action_start_libretro_device_type(void *data) if (setting_generic_action_start_default(setting) != 0) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); port = index_offset; devices[types++] = RETRO_DEVICE_NONE; @@ -1105,7 +1105,7 @@ static int setting_action_left_bind_device(void *data, bool wraparound) if (!setting) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); p = &settings->input.joypad_map[index_offset]; @@ -1127,7 +1127,7 @@ static int setting_action_right_bind_device(void *data, bool wraparound) if (!setting) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); p = &settings->input.joypad_map[index_offset]; @@ -1144,7 +1144,7 @@ static int setting_bool_action_toggle_default(void *data, bool wraparound) if (!setting) return -1; - setting_set_with_string_representation(setting, + menu_setting_set_with_string_representation(setting, *setting->value.boolean ? "false" : "true"); return 0; @@ -1473,7 +1473,7 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun if (!settings || !setting) return -1; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); if(config_save_autoconf_profile(settings->input.device_names[index_offset], index_offset)) menu_display_msg_queue_push("Autoconf file saved successfully", 1, 100, true); @@ -1719,7 +1719,7 @@ static void setting_get_string_representation_st_bind(void *data, if (!setting) return; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); keybind = (const struct retro_keybind*)setting->value.keybind; auto_bind = (const struct retro_keybind*) input_get_auto_bind(index_offset, keybind->id); @@ -1782,7 +1782,7 @@ static void setting_get_string_representation_uint_libretro_device(void *data, if (!setting) return; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); if (index_offset < system->num_ports) desc = libretro_find_controller_description( @@ -1831,7 +1831,7 @@ static void setting_get_string_representation_uint_analog_dpad_mode(void *data, if (setting) { - unsigned index_offset = setting_get_index_offset(setting); + unsigned index_offset = menu_setting_get_index_offset(setting); strlcpy(s, modes[settings->input.analog_dpad_mode [index_offset] % ANALOG_DPAD_LAST], len); } @@ -2402,7 +2402,7 @@ static void get_string_representation_bind_device(void * data, char *s, if (!setting) return; - index_offset = setting_get_index_offset(setting); + index_offset = menu_setting_get_index_offset(setting); map = settings->input.joypad_map[index_offset]; if (map < settings->input.max_users) @@ -2424,7 +2424,7 @@ static void get_string_representation_bind_device(void * data, char *s, /** - * setting_get_label: + * menu_setting_get_label: * @list : File list on which to perform the search * @s : String for the type to be represented on-screen as * a label. @@ -2438,7 +2438,7 @@ static void get_string_representation_bind_device(void * data, char *s, * * Get associated label of a setting. **/ -void setting_get_label(void *data, char *s, +void menu_setting_get_label(void *data, char *s, size_t len, unsigned *w, unsigned type, const char *menu_label, const char *label, unsigned idx) { @@ -2565,7 +2565,7 @@ static void general_write_handler(void *data) menu_hash_to_str(MENU_LABEL_HELP), sizeof(info.label)); menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); - setting_set_with_string_representation(setting, "false"); + menu_setting_set_with_string_representation(setting, "false"); } break; case MENU_LABEL_AUDIO_MAX_TIMING_SKEW: @@ -2635,7 +2635,7 @@ static void general_write_handler(void *data) if (*setting->value.boolean && global->console.screen.pal_enable) rarch_cmd = EVENT_CMD_REINIT; else - setting_set_with_string_representation(setting, "false"); + menu_setting_set_with_string_representation(setting, "false"); break; case MENU_LABEL_SYSTEM_BGM_ENABLE: if (*setting->value.boolean) diff --git a/menu/menu_setting.h b/menu/menu_setting.h index 63e82e2e75..88aa604d67 100644 --- a/menu/menu_setting.h +++ b/menu/menu_setting.h @@ -119,7 +119,7 @@ rarch_setting_t *menu_setting_find(const char *label); * Set a settings' value with a string. It is assumed * that the string has been properly formatted. **/ -int setting_set_with_string_representation( +int menu_setting_set_with_string_representation( rarch_setting_t* setting, const char *value); /** @@ -130,10 +130,10 @@ int setting_set_with_string_representation( * * Get a setting value's string representation. **/ -void setting_get_string_representation(void *data, char *s, size_t len); +void menu_setting_get_string_representation(void *data, char *s, size_t len); /** - * setting_get_label: + * menu_setting_get_label: * @list : File list on which to perform the search * @s : String for the type to be represented on-screen as * a label. @@ -147,7 +147,7 @@ void setting_get_string_representation(void *data, char *s, size_t len); * * Get associated label of a setting. **/ -void setting_get_label(void *data, char *s, +void menu_setting_get_label(void *data, char *s, size_t len, unsigned *w, unsigned type, const char *menu_label, const char *label, unsigned idx); @@ -191,7 +191,7 @@ unsigned menu_setting_get_bind_type(rarch_setting_t *setting); uint32_t menu_setting_get_index(rarch_setting_t *setting); -unsigned setting_get_index_offset(rarch_setting_t *setting); +unsigned menu_setting_get_index_offset(rarch_setting_t *setting); void *setting_get_ptr(rarch_setting_t *setting);