(menu_cbs.c) Cleanups

This commit is contained in:
twinaphex 2016-07-01 20:23:22 +02:00
parent 9d3251a54b
commit f513e1fac2
4 changed files with 1 additions and 28 deletions

View File

@ -3094,7 +3094,6 @@ static int xmb_list_bind_init_compare_label(menu_file_list_cbs_t *cbs,
static int xmb_list_bind_init(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash)
{
if (xmb_list_bind_init_compare_label(cbs, label_hash) == 0)

View File

@ -15,7 +15,6 @@
#include <compat/strl.h>
#include <string/stdstring.h>
#include <lists/string_list.h>
#include "menu_driver.h"
#include "menu_cbs.h"
@ -39,10 +38,7 @@ void menu_cbs_init(void *data,
unsigned type, size_t idx)
{
menu_ctx_bind_t bind_info;
char elem0[PATH_MAX_LENGTH] = {0};
char elem1[PATH_MAX_LENGTH] = {0};
const char *repr_label = NULL;
struct string_list *str_list = NULL;
const char *menu_label = NULL;
uint32_t label_hash = 0;
uint32_t menu_label_hash = 0;
@ -51,21 +47,10 @@ void menu_cbs_init(void *data,
if (!list)
return;
elem0[0] = '\0';
elem1[0] = '\0';
menu_entries_get_last_stack(NULL, &menu_label, NULL, &enum_idx, NULL);
if (label)
str_list = string_split(label, "|");
if (str_list && str_list->size > 0)
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
if (str_list && str_list->size > 1)
strlcpy(elem1, str_list->elems[1].data, sizeof(elem1));
if (!label || !menu_label)
goto error;
return;
label_hash = msg_hash_calculate(label);
menu_label_hash = msg_hash_calculate(menu_label);
@ -146,16 +131,10 @@ void menu_cbs_init(void *data,
bind_info.label = label;
bind_info.type = type;
bind_info.idx = idx;
bind_info.elem0 = elem0;
bind_info.elem1 = elem1;
bind_info.label_hash = label_hash;
bind_info.menu_label_hash = menu_label_hash;
menu_driver_ctl(RARCH_MENU_CTL_BIND_INIT, &bind_info);
error:
string_list_free(str_list);
str_list = NULL;
}
int menu_cbs_exit(void)

View File

@ -886,8 +886,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
bind->label,
bind->type,
bind->idx,
bind->elem0,
bind->elem1,
bind->label_hash,
bind->menu_label_hash);
}

View File

@ -290,7 +290,6 @@ typedef struct menu_ctx_driver
void (*list_set_selection)(void *data, file_list_t *list);
int (*bind_init)(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
uint32_t label_hash, uint32_t menu_label_hash);
bool (*load_image)(void *userdata, void *data, enum menu_image_type type);
const char *ident;
@ -380,8 +379,6 @@ typedef struct menu_ctx_bind
const char *label;
unsigned type;
size_t idx;
const char *elem0;
const char *elem1;
uint32_t label_hash;
uint32_t menu_label_hash;
int retcode;