mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 11:18:25 +00:00
Cleanups in RGUI file_list
This commit is contained in:
parent
b348e3f390
commit
05e306b599
@ -235,8 +235,8 @@ rgui_handle_t *rgui_init(const char *base_path,
|
||||
rgui->userdata = userdata;
|
||||
strlcpy(rgui->base_path, base_path, sizeof(rgui->base_path));
|
||||
|
||||
rgui->path_stack = rgui_list_new();
|
||||
rgui->folder_buf = rgui_list_new();
|
||||
rgui->path_stack = (rgui_list_t*)calloc(1, sizeof(rgui_list_t));
|
||||
rgui->folder_buf = (rgui_list_t*)calloc(1, sizeof(rgui_list_t));
|
||||
rgui_list_push(rgui->path_stack, base_path, RGUI_FILE_DIRECTORY, 0);
|
||||
|
||||
if (font_bmp_buf)
|
||||
|
@ -35,16 +35,6 @@ struct rgui_list
|
||||
size_t size;
|
||||
};
|
||||
|
||||
rgui_list_t *rgui_list_new(void)
|
||||
{
|
||||
return (rgui_list_t*)calloc(1, sizeof(rgui_list_t));
|
||||
}
|
||||
|
||||
bool rgui_list_empty(const rgui_list_t *list)
|
||||
{
|
||||
return list->size == 0;
|
||||
}
|
||||
|
||||
void rgui_list_push(rgui_list_t *list,
|
||||
const char *path, unsigned type, size_t directory_ptr)
|
||||
{
|
||||
@ -63,7 +53,7 @@ void rgui_list_push(rgui_list_t *list,
|
||||
|
||||
void rgui_list_pop(rgui_list_t *list)
|
||||
{
|
||||
if (!rgui_list_empty(list))
|
||||
if (!(list->size == 0))
|
||||
free(list->list[--list->size].path);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ extern "C" {
|
||||
|
||||
typedef struct rgui_list rgui_list_t;
|
||||
|
||||
rgui_list_t *rgui_list_new(void);
|
||||
void rgui_list_free(rgui_list_t *list);
|
||||
|
||||
void rgui_list_push(rgui_list_t *list,
|
||||
@ -30,7 +29,6 @@ void rgui_list_push(rgui_list_t *list,
|
||||
void rgui_list_pop(rgui_list_t *list);
|
||||
void rgui_list_clear(rgui_list_t *list);
|
||||
|
||||
bool rgui_list_empty(const rgui_list_t *list);
|
||||
void rgui_list_get_last(const rgui_list_t *list,
|
||||
const char **path, unsigned *type, size_t *directory_ptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user