Remove setting_get_type

This commit is contained in:
twinaphex 2016-10-23 02:28:22 +02:00
parent efe0220df2
commit 2b4d87a983
11 changed files with 26 additions and 37 deletions

View File

@ -271,7 +271,7 @@ static int action_left_shader_filter_default(unsigned type, const char *label,
if (!setting)
return menu_cbs_exit();
return menu_action_handle_setting(setting,
setting_get_type(setting), MENU_ACTION_LEFT, wraparound);
setting->type, MENU_ACTION_LEFT, wraparound);
#else
return 0;
#endif
@ -417,7 +417,7 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
if (string_is_equal(parent_group, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU))
&& (setting_get_type(cbs->setting) == ST_GROUP))
&& (cbs->setting->type == ST_GROUP))
{
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
return 0;

View File

@ -1937,7 +1937,7 @@ static int action_ok_file_load(const char *path,
setting = menu_setting_find(menu_label);
if (setting_get_type(setting) == ST_PATH)
if (setting->type == ST_PATH)
return action_ok_set_path(path, label, type, idx, entry_idx);
strlcpy(menu_path_new, menu_path, sizeof(menu_path_new));

View File

@ -285,7 +285,7 @@ static int action_right_shader_filter_default(unsigned type, const char *label,
rarch_setting_t *setting = menu_setting_find_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH);
if (!setting)
return menu_cbs_exit();
return menu_action_handle_setting(setting, setting_get_type(setting), MENU_ACTION_RIGHT,
return menu_action_handle_setting(setting, setting->type, MENU_ACTION_RIGHT,
wraparound);
#else
return 0;
@ -526,7 +526,7 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
if (string_is_equal(parent_group, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU))
&& (setting_get_type(cbs->setting) == ST_GROUP))
&& (cbs->setting->type == ST_GROUP))
{
BIND_ACTION_RIGHT(cbs, action_right_scroll);
return 0;

View File

@ -59,7 +59,7 @@ static int action_select_default(const char *path, const char *label, unsigned t
if (!cbs)
return -1;
switch (setting_get_type(cbs->setting))
switch (cbs->setting->type)
{
case ST_BOOL:
case ST_INT:

View File

@ -899,7 +899,7 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
if (string_is_equal(parent_group, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU))
&& setting_get_type(cbs->setting) == ST_GROUP)
&& cbs->setting->type == ST_GROUP)
{
BIND_ACTION_GET_TITLE(cbs, action_get_title_group_settings);
return 0;

View File

@ -480,7 +480,7 @@ static void *xmb_list_get_entry(void *data, enum menu_list_type type, unsigned i
return NULL;
}
static float xmb_item_y(xmb_handle_t *xmb, int i, size_t current)
static INLINE float xmb_item_y(xmb_handle_t *xmb, int i, size_t current)
{
float iy = xmb->icon.spacing.vertical;

View File

@ -2217,7 +2217,7 @@ static int menu_displaylist_parse_settings_internal(void *data,
const char *short_description =
menu_setting_get_short_description(setting);
const char *name = menu_setting_get_name(setting);
enum setting_type type = setting_get_type(setting);
enum setting_type type = setting->type;
switch (parse_type)
{
@ -2302,7 +2302,7 @@ loop:
case PARSE_GROUP:
case PARSE_ONLY_GROUP:
case PARSE_SUB_GROUP:
if (setting_get_type(setting) == precond)
if (setting->type == precond)
time_to_exit = true;
break;
case PARSE_ONLY_BIND:
@ -2402,7 +2402,7 @@ static int menu_displaylist_parse_settings_internal_enum(void *data,
const char *short_description =
menu_setting_get_short_description(setting);
const char *name = menu_setting_get_name(setting);
enum setting_type type = setting_get_type(setting);
enum setting_type type = setting->type;
switch (parse_type)
{
@ -2487,7 +2487,7 @@ loop:
case PARSE_GROUP:
case PARSE_ONLY_GROUP:
case PARSE_SUB_GROUP:
if (setting_get_type(setting) == precond)
if (setting->type == precond)
time_to_exit = true;
break;
case PARSE_ONLY_BIND:

View File

@ -604,7 +604,7 @@ int menu_action_handle_setting(rarch_setting_t *setting,
if (!setting)
return -1;
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_PATH:
if (action == MENU_ACTION_OK)
@ -688,9 +688,9 @@ static rarch_setting_t *menu_setting_find_internal(rarch_setting_t *setting,
{
uint32_t needle = msg_hash_calculate(label);
for (; setting_get_type(setting) != ST_NONE; menu_settings_list_increment(&setting))
for (; setting->type != ST_NONE; menu_settings_list_increment(&setting))
{
if (needle == setting->name_hash && setting_get_type(setting) <= ST_GROUP)
if (needle == setting->name_hash && setting->type <= ST_GROUP)
{
const char *name = menu_setting_get_name(setting);
const char *short_description = menu_setting_get_short_description(setting);
@ -714,9 +714,9 @@ static rarch_setting_t *menu_setting_find_internal(rarch_setting_t *setting,
static rarch_setting_t *menu_setting_find_internal_enum(rarch_setting_t *setting,
enum msg_hash_enums enum_idx)
{
for (; setting_get_type(setting) != ST_NONE; menu_settings_list_increment(&setting))
for (; setting->type != ST_NONE; menu_settings_list_increment(&setting))
{
if (setting->enum_idx == enum_idx && setting_get_type(setting) <= ST_GROUP)
if (setting->enum_idx == enum_idx && setting->type <= ST_GROUP)
{
const char *short_description = menu_setting_get_short_description(setting);
if (string_is_empty(short_description))
@ -770,7 +770,7 @@ int menu_setting_set_flags(rarch_setting_t *setting)
if (!setting)
return 0;
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_STRING_OPTIONS:
return MENU_SETTING_STRING_OPTIONS;
@ -818,7 +818,7 @@ void *setting_get_ptr(rarch_setting_t *setting)
if (!setting)
return NULL;
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_BOOL:
return setting->value.target.boolean;
@ -6710,7 +6710,7 @@ bool menu_setting_free(void *data)
return false;
/* Free data which was previously tagged */
for (; setting_get_type(setting) != ST_NONE; menu_settings_list_increment(&setting))
for (; setting->type != ST_NONE; menu_settings_list_increment(&setting))
for (values = setting->free_flags, n = 0; values != 0; values >>= 1, n++)
if (values & 1)
switch (1 << n)
@ -6852,7 +6852,7 @@ bool menu_setting_ctl(enum menu_setting_ctl_state state, void *data)
flags = setting_get_flags(setting);
if (setting_get_type(setting) != ST_ACTION)
if (setting->type != ST_ACTION)
return false;
if (!setting->change_handler)

View File

@ -45,9 +45,7 @@ enum menu_entry_type menu_entry_get_type(uint32_t i)
if (setting)
{
enum setting_type setting_type = setting_get_type(setting);
switch (setting_type)
switch (setting->type)
{
case ST_BOOL:
return MENU_ENTRY_BOOL;

View File

@ -115,13 +115,6 @@ uint32_t setting_get_index(rarch_setting_t *setting)
return setting->index;
}
enum setting_type setting_get_type(rarch_setting_t *setting)
{
if (!setting)
return ST_NONE;
return setting->type;
}
unsigned setting_get_index_offset(rarch_setting_t *setting)
{
if (!setting)
@ -339,7 +332,7 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
min = setting_get_min(setting);
max = setting_get_max(setting);
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_INT:
flags = setting_get_flags(setting);
@ -491,7 +484,7 @@ static void setting_reset_setting(rarch_setting_t* setting)
if (!setting)
return;
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_BOOL:
*setting->value.target.boolean = setting->default_value.boolean;
@ -514,7 +507,7 @@ static void setting_reset_setting(rarch_setting_t* setting)
case ST_DIR:
if (setting->default_value.string)
{
if (setting_get_type(setting) == ST_STRING)
if (setting->type == ST_STRING)
setting_set_with_string_representation(setting, setting->default_value.string);
else
fill_pathname_expand_special(setting->value.target.string,
@ -1835,7 +1828,7 @@ static int setting_generic_action_ok_linefeed(void *data, bool wraparound)
(void)wraparound;
switch (setting_get_type(setting))
switch (setting->type)
{
case ST_UINT:
cb = menu_input_st_uint_cb;

View File

@ -349,8 +349,6 @@ double setting_get_max(rarch_setting_t *setting);
unsigned setting_get_bind_type(rarch_setting_t *setting);
enum setting_type setting_get_type(rarch_setting_t *setting);
int setting_string_action_start_generic(void *data);
int setting_generic_action_ok_default(void *data, bool wraparound);