diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 4d1e987b43..59de32dc3d 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -414,9 +414,10 @@ static void menu_action_setting_disp_set_label_menu_file_core( const char *alt = NULL; strcpy_literal(s, "(CORE)"); - menu_entries_get_at_offset(list, i, NULL, - NULL, NULL, NULL, &alt); - + file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL); + alt = list->list[i].alt + ? list->list[i].alt + : list->list[i].path; *w = (unsigned)strlen(s); if (alt) strlcpy(s2, alt, len2); @@ -438,8 +439,10 @@ static void menu_action_setting_disp_set_label_core_updater_entry( *s = '\0'; *w = 0; - menu_entries_get_at_offset(list, i, NULL, - NULL, NULL, NULL, &alt); + file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL); + alt = list->list[i].alt + ? list->list[i].alt + : list->list[i].path; if (alt) strlcpy(s2, alt, len2); @@ -490,8 +493,10 @@ static void menu_action_setting_disp_set_label_core_manager_entry( *s = '\0'; *w = 0; - menu_entries_get_at_offset(list, i, NULL, - NULL, NULL, NULL, &alt); + file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL); + alt = list->list[i].alt + ? list->list[i].alt + : list->list[i].path; if (alt) strlcpy(s2, alt, len2); @@ -525,8 +530,10 @@ static void menu_action_setting_disp_set_label_core_lock( *s = '\0'; *w = 0; - menu_entries_get_at_offset(list, i, NULL, - NULL, NULL, NULL, &alt); + file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL); + alt = list->list[i].alt + ? list->list[i].alt + : list->list[i].path; if (alt) strlcpy(s2, alt, len2); diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index c3fa206426..536c5d07d8 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -1472,8 +1472,10 @@ static int action_bind_sublabel_core_backup_entry( const char *crc = NULL; /* crc is entered as 'alt' text */ - menu_entries_get_at_offset(list, i, NULL, - NULL, NULL, NULL, &crc); + file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL); + crc = list->list[i].alt + ? list->list[i].alt + : list->list[i].path; /* Set sublabel prefix */ strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_BACKUP_CRC), len); diff --git a/menu/drivers/ozone/ozone_sidebar.c b/menu/drivers/ozone/ozone_sidebar.c index b6ee8d2f17..e3f8c044c6 100644 --- a/menu/drivers/ozone/ozone_sidebar.c +++ b/menu/drivers/ozone/ozone_sidebar.c @@ -936,8 +936,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone) /* If the playlist icon doesn't exist return default */ if (!path_is_valid(texturepath)) - fill_pathname_join_concat(texturepath, icons_path, "default", - ".png", sizeof(texturepath)); + fill_pathname_join_concat(texturepath, icons_path, "default", + ".png", sizeof(texturepath)); ti.width = 0; ti.height = 0; @@ -984,9 +984,11 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone) } /* Console name */ - menu_entries_get_at_offset( - &ozone->horizontal_list, i, - NULL, NULL, NULL, NULL, &console_name); + file_list_get_at_offset( + &ozone->horizontal_list, i, NULL, NULL, NULL, NULL); + console_name = ozone->horizontal_list.list[i].alt + ? ozone->horizontal_list.list[i].alt + : ozone->horizontal_list.list[i].path; if (node->console_name) free(node->console_name); @@ -994,8 +996,10 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone) /* Note: console_name will *always* be valid here, * but provide a fallback to prevent NULL pointer * dereferencing in case of unknown errors... */ - node->console_name = strdup( - console_name ? console_name : path); + if (console_name) + node->console_name = strdup(console_name); + else + node->console_name = strdup(path); } } } diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 7781d6c0b6..46013f37ca 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -1513,10 +1513,10 @@ static void stripes_set_title(stripes_handle_t *stripes) else { const char *path = NULL; - menu_entries_get_at_offset( + file_list_get_at_offset( &stripes->horizontal_list, stripes->categories_selection_ptr - (stripes->system_tab_end + 1), - &path, NULL, NULL, NULL, NULL); + &path, NULL, NULL, NULL); if (!path) return; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 57ce04783d..704bf1c89c 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1881,10 +1881,9 @@ static void xmb_set_title(xmb_handle_t *xmb) { const char *path = NULL; - menu_entries_get_at_offset( - &xmb->horizontal_list, + file_list_get_at_offset(&xmb->horizontal_list, xmb->categories_selection_ptr - (xmb->system_tab_end + 1), - &path, NULL, NULL, NULL, NULL); + &path, NULL, NULL, NULL); if (!path) return; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 2bf0b3e274..6dc1601f7a 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3463,9 +3463,7 @@ static unsigned menu_displaylist_parse_cores( unsigned type = 0; const char *path = NULL; - menu_entries_get_at_offset(info->list, - i, &path, NULL, &type, NULL, - NULL); + file_list_get_at_offset(info->list, i, &path, NULL, &type, NULL); if (type == FILE_TYPE_CORE) { diff --git a/menu/menu_entries.h b/menu/menu_entries.h index aa168087a3..36b3eeb987 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -179,10 +179,6 @@ size_t menu_entries_get_stack_size(size_t idx); size_t menu_entries_get_size(void); -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); - void menu_entries_prepend(file_list_t *list, const char *path, const char *label, enum msg_hash_enums enum_idx, diff --git a/retroarch.c b/retroarch.c index 7ccc65b164..ae6144d82d 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1950,8 +1950,7 @@ static int generic_menu_iterate( const char *path = NULL; /* Get core path */ - menu_entries_get_at_offset(selection_buf, selection, - &path, NULL, NULL, NULL, NULL); + file_list_get_at_offset(selection_buf, selection, &path, NULL, NULL, NULL); /* Search for specified core */ if (core_list && path && @@ -1974,8 +1973,7 @@ static int generic_menu_iterate( core_info_ctx_find_t core_info; /* Get core path */ - menu_entries_get_at_offset(selection_buf, selection, - &path, NULL, NULL, NULL, NULL); + file_list_get_at_offset(selection_buf, selection, &path, NULL, NULL, NULL); /* Search for specified core */ core_info.inf = NULL; @@ -2030,8 +2028,7 @@ static int generic_menu_iterate( unsigned type = 0; enum msg_hash_enums enum_idx = MSG_UNKNOWN; size_t selection = menu_st->selection_ptr; - menu_entries_get_at_offset(selection_buf, selection, - NULL, NULL, &type, NULL, NULL); + file_list_get_at_offset(selection_buf, selection, NULL, NULL, &type, NULL); switch (type) { @@ -2714,17 +2711,6 @@ static void menu_list_flush_stack( } } -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) -{ - file_list_get_at_offset(list, idx, path, label, file_type, entry_idx); - if (list && alt) - *alt = list->list[idx].alt - ? list->list[idx].alt - : list->list[idx].path; -} - /** * menu_entries_elem_get_first_char: * @list : File list handle.