Prefix all functions with menu_setting_

This commit is contained in:
twinaphex 2015-10-11 17:24:37 +02:00
parent 166261f08f
commit ec4289e7ad
6 changed files with 32 additions and 35 deletions

View File

@ -927,7 +927,7 @@ static void menu_action_setting_disp_set_label(file_list_t* list,
strlcpy(s, core_opt ? core_opt : "", len); strlcpy(s, core_opt ? core_opt : "", len);
} }
else else
setting_get_label(list, s, menu_setting_get_label(list, s,
len, w, type, label, entry_label, i); len, w, type, label, entry_label, i);
strlcpy(s2, path, len2); strlcpy(s2, path, len2);

View File

@ -637,7 +637,7 @@ static int generic_action_ok(const char *path,
if (cbs) 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); ret = menu_setting_generic(cbs->setting, false);
} }
} }

View File

@ -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) void menu_entry_enum_set_value_with_string(uint32_t i, const char *s)
{ {
rarch_setting_t *setting = menu_entry_get_setting(i); 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) 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) if (menu_setting_get_type(cbs->setting) != ST_DIR)
return -1; 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_setting_generic(cbs->setting, false);
menu_list_flush_stack(menu_list, NULL, 49); 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) void menu_entry_set_value(uint32_t i, const char *s)
{ {
rarch_setting_t *setting = menu_entry_get_setting(i); 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) uint32_t menu_entry_num_has_range(uint32_t i)

View File

@ -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); menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING, &label);
setting = menu_setting_find(label); setting = menu_setting_find(label);
menu_setting_set_with_string_representation(setting, str);
if (setting)
setting_set_with_string_representation(setting, str);
} }
menu_input_key_end_line(); menu_input_key_end_line();
@ -378,7 +376,7 @@ void menu_input_st_string_callback(void *userdata, const char *str)
if (setting) if (setting)
{ {
setting_set_with_string_representation(setting, str); menu_setting_set_with_string_representation(setting, str);
menu_setting_generic(setting, false); menu_setting_generic(setting, false);
} }
else else
@ -605,7 +603,7 @@ static int menu_input_set_bind_mode_common(rarch_setting_t *setting,
if (!setting) if (!setting)
return -1; 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); 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) if (!setting)
return -1; 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]; bind_port = settings->input.joypad_map[index_offset];
if (menu_input_set_bind_mode_common(setting, type) == -1) if (menu_input_set_bind_mode_common(setting, type) == -1)

View File

@ -564,7 +564,7 @@ static void setting_reset_setting(rarch_setting_t* setting)
if (setting->default_value.string) if (setting->default_value.string)
{ {
if (menu_setting_get_type(setting) == ST_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 else
fill_pathname_expand_special(setting->value.string, fill_pathname_expand_special(setting->value.string,
setting->default_value.string, setting->size); 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 * @setting : pointer to setting
* @value : value for the setting (string) * @value : value for the setting (string)
* *
* Set a settings' value with a string. It is assumed * Set a settings' value with a string. It is assumed
* that the string has been properly formatted. * 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) const char* value)
{ {
double min, max; 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); 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) if (!setting)
return 0; return 0;
@ -746,7 +746,7 @@ static int setting_action_start_bind_device(void *data)
if (!setting || !settings) if (!setting || !settings)
return -1; 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; settings->input.joypad_map[index_offset] = index_offset;
return 0; return 0;
@ -842,7 +842,7 @@ static int setting_action_start_libretro_device_type(void *data)
if (setting_generic_action_start_default(setting) != 0) if (setting_generic_action_start_default(setting) != 0)
return -1; return -1;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
port = index_offset; port = index_offset;
devices[types++] = RETRO_DEVICE_NONE; devices[types++] = RETRO_DEVICE_NONE;
@ -1105,7 +1105,7 @@ static int setting_action_left_bind_device(void *data, bool wraparound)
if (!setting) if (!setting)
return -1; return -1;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
p = &settings->input.joypad_map[index_offset]; p = &settings->input.joypad_map[index_offset];
@ -1127,7 +1127,7 @@ static int setting_action_right_bind_device(void *data, bool wraparound)
if (!setting) if (!setting)
return -1; return -1;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
p = &settings->input.joypad_map[index_offset]; p = &settings->input.joypad_map[index_offset];
@ -1144,7 +1144,7 @@ static int setting_bool_action_toggle_default(void *data, bool wraparound)
if (!setting) if (!setting)
return -1; return -1;
setting_set_with_string_representation(setting, menu_setting_set_with_string_representation(setting,
*setting->value.boolean ? "false" : "true"); *setting->value.boolean ? "false" : "true");
return 0; return 0;
@ -1473,7 +1473,7 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun
if (!settings || !setting) if (!settings || !setting)
return -1; 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)) 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); 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) if (!setting)
return; return;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
keybind = (const struct retro_keybind*)setting->value.keybind; keybind = (const struct retro_keybind*)setting->value.keybind;
auto_bind = (const struct retro_keybind*) auto_bind = (const struct retro_keybind*)
input_get_auto_bind(index_offset, keybind->id); 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) if (!setting)
return; return;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
if (index_offset < system->num_ports) if (index_offset < system->num_ports)
desc = libretro_find_controller_description( desc = libretro_find_controller_description(
@ -1831,7 +1831,7 @@ static void setting_get_string_representation_uint_analog_dpad_mode(void *data,
if (setting) 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 strlcpy(s, modes[settings->input.analog_dpad_mode
[index_offset] % ANALOG_DPAD_LAST], len); [index_offset] % ANALOG_DPAD_LAST], len);
} }
@ -2402,7 +2402,7 @@ static void get_string_representation_bind_device(void * data, char *s,
if (!setting) if (!setting)
return; return;
index_offset = setting_get_index_offset(setting); index_offset = menu_setting_get_index_offset(setting);
map = settings->input.joypad_map[index_offset]; map = settings->input.joypad_map[index_offset];
if (map < settings->input.max_users) 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 * @list : File list on which to perform the search
* @s : String for the type to be represented on-screen as * @s : String for the type to be represented on-screen as
* a label. * a label.
@ -2438,7 +2438,7 @@ static void get_string_representation_bind_device(void * data, char *s,
* *
* Get associated label of a setting. * 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, size_t len, unsigned *w, unsigned type,
const char *menu_label, const char *label, unsigned idx) 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_hash_to_str(MENU_LABEL_HELP), sizeof(info.label));
menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
setting_set_with_string_representation(setting, "false"); menu_setting_set_with_string_representation(setting, "false");
} }
break; break;
case MENU_LABEL_AUDIO_MAX_TIMING_SKEW: 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) if (*setting->value.boolean && global->console.screen.pal_enable)
rarch_cmd = EVENT_CMD_REINIT; rarch_cmd = EVENT_CMD_REINIT;
else else
setting_set_with_string_representation(setting, "false"); menu_setting_set_with_string_representation(setting, "false");
break; break;
case MENU_LABEL_SYSTEM_BGM_ENABLE: case MENU_LABEL_SYSTEM_BGM_ENABLE:
if (*setting->value.boolean) if (*setting->value.boolean)

View File

@ -119,7 +119,7 @@ rarch_setting_t *menu_setting_find(const char *label);
* Set a settings' value with a string. It is assumed * Set a settings' value with a string. It is assumed
* that the string has been properly formatted. * 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); rarch_setting_t* setting, const char *value);
/** /**
@ -130,10 +130,10 @@ int setting_set_with_string_representation(
* *
* Get a setting value's 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 * @list : File list on which to perform the search
* @s : String for the type to be represented on-screen as * @s : String for the type to be represented on-screen as
* a label. * a label.
@ -147,7 +147,7 @@ void setting_get_string_representation(void *data, char *s, size_t len);
* *
* Get associated label of a setting. * 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, size_t len, unsigned *w, unsigned type,
const char *menu_label, const char *label, unsigned idx); 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); 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); void *setting_get_ptr(rarch_setting_t *setting);