diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 59c5bbb169..04d198f61e 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -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) diff --git a/frontend/menu/utils/file_list.c b/frontend/menu/utils/file_list.c index c650e2115e..da4b8712ac 100644 --- a/frontend/menu/utils/file_list.c +++ b/frontend/menu/utils/file_list.c @@ -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); } diff --git a/frontend/menu/utils/file_list.h b/frontend/menu/utils/file_list.h index f09817c497..04f86a42ac 100644 --- a/frontend/menu/utils/file_list.h +++ b/frontend/menu/utils/file_list.h @@ -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);