Skip to content

Commit

Permalink
Remove menu_entries_get_actiondata_at_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Oct 1, 2017
1 parent df15a67 commit 2b55e58
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 31 deletions.
6 changes: 3 additions & 3 deletions menu/cbs/menu_cbs_left.c
Expand Up @@ -209,9 +209,9 @@ static int action_left_mainmenu(unsigned type, const char *label,
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs =
menu_entries_get_actiondata_at_offset(selection_buf,
selection);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf,
selection) : NULL;

list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = MENU_ACTION_LEFT;
Expand Down
2 changes: 1 addition & 1 deletion menu/cbs/menu_cbs_right.c
Expand Up @@ -191,7 +191,7 @@ static int action_right_goto_tab(void)
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs = menu_entries_get_actiondata_at_offset(selection_buf, selection);
menu_file_list_cbs_t *cbs = selection_buf ? file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;

list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = MENU_ACTION_RIGHT;
Expand Down
2 changes: 1 addition & 1 deletion menu/cbs/menu_cbs_select.c
Expand Up @@ -42,7 +42,7 @@ static int action_select_default(const char *path, const char *label, unsigned t
menu_entry_init(&entry);
menu_entry_get(&entry, 0, idx, NULL, false);

cbs = menu_entries_get_actiondata_at_offset(selection_buf, idx);
cbs = selection_buf ? file_list_get_actiondata_at_offset(selection_buf, idx) : NULL;

if (!cbs)
{
Expand Down
5 changes: 3 additions & 2 deletions menu/drivers/menu_generic.c
Expand Up @@ -133,8 +133,9 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
case ITERATE_TYPE_INFO:
{
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs =
menu_entries_get_actiondata_at_offset(selection_buf, selection);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf, selection)
: NULL;

if (cbs->enum_idx != MSG_UNKNOWN)
{
Expand Down
13 changes: 2 additions & 11 deletions menu/menu_entries.c
Expand Up @@ -44,15 +44,6 @@ void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
file_list_get_alt_at_offset(list, idx, alt);
}

menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset(
const file_list_t *list, size_t idx)
{
if (!list)
return NULL;
return (menu_file_list_cbs_t*)
file_list_get_actiondata_at_offset(list, idx);
}

static bool menu_entries_clear(file_list_t *list)
{
unsigned i;
Expand Down Expand Up @@ -509,8 +500,8 @@ size_t menu_entries_get_size(void)
rarch_setting_t *menu_entries_get_setting(uint32_t i)
{
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs =
menu_entries_get_actiondata_at_offset(selection_buf, i);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf, i) : NULL;

if (!cbs)
return NULL;
Expand Down
3 changes: 0 additions & 3 deletions menu/menu_entries.h
Expand Up @@ -145,9 +145,6 @@ void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
const char **path, const char **label, unsigned *file_type,
size_t *entry_idx, const char **alt);

menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset(
const file_list_t *list, size_t idx);

void menu_entries_set_alt_at_offset(file_list_t *list, size_t idx,
const char *alt);

Expand Down
6 changes: 2 additions & 4 deletions menu/menu_input.c
Expand Up @@ -563,13 +563,11 @@ static int menu_input_pointer_post_iterate(
void menu_input_post_iterate(int *ret, unsigned action)
{
menu_entry_t entry;
menu_file_list_cbs_t *cbs = NULL;
settings_t *settings = config_get_ptr();
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();

if (selection_buf)
cbs = menu_entries_get_actiondata_at_offset(selection_buf, selection);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;

menu_entry_init(&entry);
menu_entry_get(&entry, 0, selection, NULL, false);
Expand Down
4 changes: 2 additions & 2 deletions menu/menu_setting.c
Expand Up @@ -916,8 +916,8 @@ int menu_setting_set(unsigned type, const char *label,
int ret = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs = menu_entries_get_actiondata_at_offset(
selection_buf, selection);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;

if (!cbs)
return 0;
Expand Down
8 changes: 4 additions & 4 deletions menu/widgets/menu_entry.c
Expand Up @@ -313,7 +313,7 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
menu_entries_get_at_offset(list, i, &path, &entry_label, &entry->type,
&entry->entry_idx, NULL);

cbs = menu_entries_get_actiondata_at_offset(list, i);
cbs = list ? file_list_get_actiondata_at_offset(list, i) : NULL;

if (cbs)
{
Expand Down Expand Up @@ -417,8 +417,8 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
int ret = 0;
file_list_t *selection_buf =
menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs =
menu_entries_get_actiondata_at_offset(selection_buf, i);
menu_file_list_cbs_t *cbs = selection_buf ?
file_list_get_actiondata_at_offset(selection_buf, i) : NULL;

switch (action)
{
Expand Down Expand Up @@ -482,7 +482,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
break;
}

cbs = menu_entries_get_actiondata_at_offset(selection_buf, i);
cbs = selection_buf ? file_list_get_actiondata_at_offset(selection_buf, i) : NULL;

if (menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL))
{
Expand Down

0 comments on commit 2b55e58

Please sign in to comment.