mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
file_list_set_userdata / file_list_set_actiondata are trivial one-line
functions - just set it directly
This commit is contained in:
parent
0c1e63a3c1
commit
db314cf5df
@ -10256,7 +10256,7 @@ static void materialui_list_insert(
|
||||
}
|
||||
}
|
||||
|
||||
file_list_set_userdata(list, i, node);
|
||||
list->list[i].userdata = node;
|
||||
}
|
||||
|
||||
/* Clears the current menu list */
|
||||
|
@ -3373,7 +3373,7 @@ static void ozone_list_insert(void *userdata,
|
||||
node->fullpath = strdup(fullpath);
|
||||
}
|
||||
|
||||
file_list_set_userdata(list, i, node);
|
||||
list->list[i].userdata = node;
|
||||
}
|
||||
|
||||
static void ozone_list_deep_copy(const file_list_t *src, file_list_t *dst,
|
||||
@ -3402,13 +3402,13 @@ static void ozone_list_deep_copy(const file_list_t *src, file_list_t *dst,
|
||||
d->label = string_is_empty(d->label) ? NULL : strdup(d->label);
|
||||
|
||||
if (src_udata)
|
||||
file_list_set_userdata(dst, j, (void*)ozone_copy_node((const ozone_node_t*)src_udata));
|
||||
dst->list[j].userdata = (void*)ozone_copy_node((const ozone_node_t*)src_udata);
|
||||
|
||||
if (src_adata)
|
||||
{
|
||||
void *data = malloc(sizeof(menu_file_list_cbs_t));
|
||||
memcpy(data, src_adata, sizeof(menu_file_list_cbs_t));
|
||||
file_list_set_actiondata(dst, j, data);
|
||||
dst->list[j].actiondata = data;
|
||||
}
|
||||
|
||||
++j;
|
||||
@ -3767,7 +3767,6 @@ void ozone_free_list_nodes(file_list_t *list, bool actiondata)
|
||||
{
|
||||
ozone_free_node((ozone_node_t*)file_list_get_userdata_at_offset(list, i));
|
||||
|
||||
/* file_list_set_userdata() doesn't accept NULL */
|
||||
list->list[i].userdata = NULL;
|
||||
|
||||
if (actiondata)
|
||||
|
@ -440,7 +440,6 @@ static void stripes_free_list_nodes(file_list_t *list, bool actiondata)
|
||||
{
|
||||
stripes_free_node((stripes_node_t*)file_list_get_userdata_at_offset(list, i));
|
||||
|
||||
/* file_list_set_userdata() doesn't accept NULL */
|
||||
list->list[i].userdata = NULL;
|
||||
|
||||
if (actiondata)
|
||||
@ -1359,7 +1358,7 @@ static stripes_node_t *stripes_node_allocate_userdata(
|
||||
&stripes->horizontal_list, i);
|
||||
stripes_free_node(tmp);
|
||||
|
||||
file_list_set_userdata(&stripes->horizontal_list, i, node);
|
||||
stripes->horizontal_list.list[i].userdata = node;
|
||||
|
||||
return node;
|
||||
}
|
||||
@ -3820,7 +3819,7 @@ static void stripes_list_insert(void *userdata,
|
||||
node->zoom = stripes->items_active_alpha;
|
||||
}
|
||||
|
||||
file_list_set_userdata(list, i, node);
|
||||
list->list[i].userdata = node;
|
||||
}
|
||||
|
||||
static void stripes_list_clear(file_list_t *list)
|
||||
@ -3864,13 +3863,13 @@ static void stripes_list_deep_copy(const file_list_t *src, file_list_t *dst,
|
||||
d->label = string_is_empty(d->label) ? NULL : strdup(d->label);
|
||||
|
||||
if (src_udata)
|
||||
file_list_set_userdata(dst, j, (void*)stripes_copy_node((const stripes_node_t*)src_udata));
|
||||
dst->list[j].userdata = (void*)stripes_copy_node((const stripes_node_t*)src_udata);
|
||||
|
||||
if (src_adata)
|
||||
{
|
||||
void *data = malloc(sizeof(menu_file_list_cbs_t));
|
||||
memcpy(data, src_adata, sizeof(menu_file_list_cbs_t));
|
||||
file_list_set_actiondata(dst, j, data);
|
||||
dst->list[j].actiondata = data;
|
||||
}
|
||||
|
||||
++j;
|
||||
|
@ -685,7 +685,6 @@ static void xmb_free_list_nodes(file_list_t *list, bool actiondata)
|
||||
{
|
||||
xmb_free_node((xmb_node_t*)file_list_get_userdata_at_offset(list, i));
|
||||
|
||||
/* file_list_set_userdata() doesn't accept NULL */
|
||||
list->list[i].userdata = NULL;
|
||||
|
||||
if (actiondata)
|
||||
@ -1725,7 +1724,7 @@ static xmb_node_t *xmb_node_allocate_userdata(
|
||||
&xmb->horizontal_list, i);
|
||||
xmb_free_node(tmp);
|
||||
|
||||
file_list_set_userdata(&xmb->horizontal_list, i, node);
|
||||
xmb->horizontal_list.list[i].userdata = node;
|
||||
|
||||
return node;
|
||||
}
|
||||
@ -6346,7 +6345,7 @@ static void xmb_list_insert(void *userdata,
|
||||
node->zoom = xmb->items_active_alpha;
|
||||
}
|
||||
|
||||
file_list_set_userdata(list, i, node);
|
||||
list->list[i].userdata = node;
|
||||
}
|
||||
|
||||
static void xmb_list_clear(file_list_t *list)
|
||||
@ -6390,13 +6389,13 @@ static void xmb_list_deep_copy(const file_list_t *src, file_list_t *dst,
|
||||
d->label = string_is_empty(d->label) ? NULL : strdup(d->label);
|
||||
|
||||
if (src_udata)
|
||||
file_list_set_userdata(dst, j, (void*)xmb_copy_node((const xmb_node_t*)src_udata));
|
||||
dst->list[j].userdata = (void*)xmb_copy_node((const xmb_node_t*)src_udata);
|
||||
|
||||
if (src_adata)
|
||||
{
|
||||
void *data = malloc(sizeof(menu_file_list_cbs_t));
|
||||
memcpy(data, src_adata, sizeof(menu_file_list_cbs_t));
|
||||
file_list_set_actiondata(dst, j, data);
|
||||
dst->list[j].actiondata = data;
|
||||
}
|
||||
|
||||
++j;
|
||||
|
11
retroarch.c
11
retroarch.c
@ -3027,11 +3027,10 @@ void menu_entries_append(
|
||||
cbs->action_down = NULL;
|
||||
cbs->action_get_value = NULL;
|
||||
|
||||
file_list_set_actiondata(list, idx, cbs);
|
||||
list->list[idx].actiondata = cbs;
|
||||
|
||||
if (list)
|
||||
menu_cbs_init(p_rarch->menu_driver_ctx,
|
||||
list, cbs, path, label, type, idx);
|
||||
menu_cbs_init(p_rarch->menu_driver_ctx,
|
||||
list, cbs, path, label, type, idx);
|
||||
}
|
||||
|
||||
bool menu_entries_append_enum(
|
||||
@ -3113,7 +3112,7 @@ bool menu_entries_append_enum(
|
||||
cbs->action_down = NULL;
|
||||
cbs->action_get_value = NULL;
|
||||
|
||||
file_list_set_actiondata(list, idx, cbs);
|
||||
list->list[idx].actiondata = cbs;
|
||||
|
||||
if ( enum_idx != MENU_ENUM_LABEL_PLAYLIST_ENTRY
|
||||
&& enum_idx != MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY
|
||||
@ -3201,7 +3200,7 @@ void menu_entries_prepend(file_list_t *list,
|
||||
cbs->action_down = NULL;
|
||||
cbs->action_get_value = NULL;
|
||||
|
||||
file_list_set_actiondata(list, idx, cbs);
|
||||
list->list[idx].actiondata = cbs;
|
||||
|
||||
menu_cbs_init(p_rarch->menu_driver_ctx,
|
||||
list, cbs, path, label, type, idx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user