Remove useless wrapper function

This commit is contained in:
twinaphex 2017-10-01 17:11:09 +02:00
parent 3cac2a6df8
commit a87bef6ed0
4 changed files with 21 additions and 31 deletions

View File

@ -674,7 +674,7 @@ static void mui_compute_entries_box(mui_handle_t* mui, int width)
char *sublabel_str = NULL; char *sublabel_str = NULL;
unsigned lines = 0; unsigned lines = 0;
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
menu_entry_init(&entry); menu_entry_init(&entry);
menu_entry_get(&entry, 0, i, NULL, true); menu_entry_get(&entry, 0, i, NULL, true);
@ -751,7 +751,7 @@ static void mui_render(void *data, bool is_idle)
for (ii = 0; ii < entries_end; ii++) for (ii = 0; ii < entries_end; ii++)
{ {
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, ii); file_list_get_userdata_at_offset(list, ii);
if (pointer_y > (-mui->scroll_y + header_height + node->y) if (pointer_y > (-mui->scroll_y + header_height + node->y)
&& pointer_y < (-mui->scroll_y + header_height + node->y + node->line_height) && pointer_y < (-mui->scroll_y + header_height + node->y + node->line_height)
@ -777,7 +777,7 @@ static void mui_render(void *data, bool is_idle)
for (ii = 0; ii < entries_end; ii++) for (ii = 0; ii < entries_end; ii++)
{ {
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, ii); file_list_get_userdata_at_offset(list, ii);
if (mouse_y > (-mui->scroll_y + header_height + node->y) if (mouse_y > (-mui->scroll_y + header_height + node->y)
&& mouse_y < (-mui->scroll_y + header_height + node->y + node->line_height) && mouse_y < (-mui->scroll_y + header_height + node->y + node->line_height)
@ -1013,7 +1013,7 @@ static void mui_render_menu_list(
char *rich_label = NULL; char *rich_label = NULL;
bool entry_selected = false; bool entry_selected = false;
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
size_t selection = menu_navigation_get_selection(); size_t selection = menu_navigation_get_selection();
int y = header_height - mui->scroll_y + sum; int y = header_height - mui->scroll_y + sum;
entry_value[0] = '\0'; entry_value[0] = '\0';
@ -1476,7 +1476,7 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
/* highlighted entry */ /* highlighted entry */
list = menu_entries_get_selection_buf_ptr(0); list = menu_entries_get_selection_buf_ptr(0);
node = (mui_node_t*)menu_entries_get_userdata_at_offset( node = (mui_node_t*)file_list_get_userdata_at_offset(
list, selection); list, selection);
if (node) if (node)
@ -2196,7 +2196,7 @@ static int mui_pointer_down(void *userdata,
for (ii = 0; ii < entries_end; ii++) for (ii = 0; ii < entries_end; ii++)
{ {
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, ii); file_list_get_userdata_at_offset(list, ii);
if (y > (-mui->scroll_y + header_height + node->y) if (y > (-mui->scroll_y + header_height + node->y)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height) && y < (-mui->scroll_y + header_height + node->y + node->line_height)
@ -2265,7 +2265,7 @@ static int mui_pointer_up(void *userdata,
for (ii = 0; ii < entries_end; ii++) for (ii = 0; ii < entries_end; ii++)
{ {
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, ii); file_list_get_userdata_at_offset(list, ii);
if (y > (-mui->scroll_y + header_height + node->y) if (y > (-mui->scroll_y + header_height + node->y)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height) && y < (-mui->scroll_y + header_height + node->y + node->line_height)
@ -2304,7 +2304,7 @@ static void mui_list_insert(void *userdata,
return; return;
mui->need_compute = true; mui->need_compute = true;
node = (mui_node_t*)menu_entries_get_userdata_at_offset(list, i); node = (mui_node_t*)file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
node = (mui_node_t*)calloc(1, sizeof(mui_node_t)); node = (mui_node_t*)calloc(1, sizeof(mui_node_t));
@ -2709,7 +2709,7 @@ static void mui_list_clear(file_list_t *list)
menu_animation_ctx_subject_t subject; menu_animation_ctx_subject_t subject;
float *subjects[2]; float *subjects[2];
mui_node_t *node = (mui_node_t*) mui_node_t *node = (mui_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
continue; continue;

View File

@ -939,7 +939,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
{ {
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(selection_buf, i); file_list_get_userdata_at_offset(selection_buf, i);
if (node && node->fullpath) if (node && node->fullpath)
{ {
@ -1177,7 +1177,7 @@ static void xmb_selection_pointer_changed(
float ia = xmb->items_passive_alpha; float ia = xmb->items_passive_alpha;
float iz = xmb->items_passive_zoom; float iz = xmb->items_passive_zoom;
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(selection_buf, i); file_list_get_userdata_at_offset(selection_buf, i);
if (!node) if (!node)
continue; continue;
@ -1282,7 +1282,7 @@ static void xmb_list_open_old(xmb_handle_t *xmb,
float ia = 0; float ia = 0;
float real_y; float real_y;
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
continue; continue;
@ -1341,7 +1341,7 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
float ia; float ia;
float real_y; float real_y;
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
continue; continue;
@ -1438,7 +1438,7 @@ static xmb_node_t* xmb_get_userdata_from_horizontal_list(
xmb_handle_t *xmb, unsigned i) xmb_handle_t *xmb, unsigned i)
{ {
return (xmb_node_t*) return (xmb_node_t*)
menu_entries_get_userdata_at_offset(xmb->horizontal_list, i); file_list_get_userdata_at_offset(xmb->horizontal_list, i);
} }
static void xmb_push_animations(xmb_node_t *node, uintptr_t tag, float ia, float ix) static void xmb_push_animations(xmb_node_t *node, uintptr_t tag, float ia, float ix)
@ -1481,7 +1481,7 @@ static void xmb_list_switch_old(xmb_handle_t *xmb,
for (i = 0; i < end; i++) for (i = 0; i < end; i++)
{ {
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
continue; continue;
@ -1554,7 +1554,7 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
for (i = 0; i < end; i++) for (i = 0; i < end; i++)
{ {
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
float ia = xmb->items_passive_alpha; float ia = xmb->items_passive_alpha;
if (!node) if (!node)
@ -2292,7 +2292,7 @@ static int xmb_draw_item(
bool do_draw_text = false; bool do_draw_text = false;
unsigned ticker_limit = 35; unsigned ticker_limit = 35;
xmb_node_t * node = (xmb_node_t*) xmb_node_t * node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
goto iterate; goto iterate;
@ -2558,7 +2558,7 @@ static void xmb_draw_items(
if (list == xmb->selection_buf_old) if (list == xmb->selection_buf_old)
{ {
xmb_node_t *node = (xmb_node_t*) xmb_node_t *node = (xmb_node_t*)
menu_entries_get_userdata_at_offset(list, current); file_list_get_userdata_at_offset(list, current);
if (node && (uint8_t)(255 * node->alpha) == 0) if (node && (uint8_t)(255 * node->alpha) == 0)
return; return;
@ -3330,7 +3330,7 @@ static void xmb_layout(xmb_handle_t *xmb)
{ {
float ia = xmb->items_passive_alpha; float ia = xmb->items_passive_alpha;
float iz = xmb->items_passive_zoom; float iz = xmb->items_passive_zoom;
xmb_node_t *node = (xmb_node_t*)menu_entries_get_userdata_at_offset( xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
selection_buf, i); selection_buf, i);
if (!node) if (!node)
@ -3358,7 +3358,7 @@ static void xmb_layout(xmb_handle_t *xmb)
{ {
float ia = 0; float ia = 0;
float iz = xmb->items_passive_zoom; float iz = xmb->items_passive_zoom;
xmb_node_t *node = (xmb_node_t*)menu_entries_get_userdata_at_offset( xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
xmb->selection_buf_old, i); xmb->selection_buf_old, i);
if (!node) if (!node)
@ -3891,7 +3891,7 @@ static void xmb_list_insert(void *userdata,
if (!xmb || !list) if (!xmb || !list)
return; return;
node = (xmb_node_t*)menu_entries_get_userdata_at_offset(list, i); node = (xmb_node_t*)file_list_get_userdata_at_offset(list, i);
if (!node) if (!node)
node = xmb_alloc_node(); node = xmb_alloc_node();

View File

@ -52,13 +52,6 @@ void menu_entries_get_last(const file_list_t *list,
file_list_get_last(list, path, label, file_type, entry_idx); file_list_get_last(list, path, label, file_type, entry_idx);
} }
void *menu_entries_get_userdata_at_offset(const file_list_t *list, size_t idx)
{
if (!list)
return NULL;
return file_list_get_userdata_at_offset(list, idx);
}
menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset( menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset(
const file_list_t *list, size_t idx) const file_list_t *list, size_t idx)
{ {

View File

@ -147,9 +147,6 @@ void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
const char **path, const char **label, unsigned *file_type, const char **path, const char **label, unsigned *file_type,
size_t *entry_idx, const char **alt); size_t *entry_idx, const char **alt);
void *menu_entries_get_userdata_at_offset(
const file_list_t *list, size_t idx);
menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset( menu_file_list_cbs_t *menu_entries_get_actiondata_at_offset(
const file_list_t *list, size_t idx); const file_list_t *list, size_t idx);