mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
history.c - cleanups
This commit is contained in:
parent
ed25984a3c
commit
d2aea634b1
29
history.c
29
history.c
@ -179,17 +179,17 @@ size_t content_history_size(content_history_t *hist)
|
||||
|
||||
static bool content_history_read_file(content_history_t *hist, const char *path)
|
||||
{
|
||||
char buf[3][PATH_MAX];
|
||||
unsigned i;
|
||||
struct content_history_entry *entry = NULL;
|
||||
char *last = NULL;
|
||||
FILE *file = fopen(path, "r");
|
||||
|
||||
if (!file || !hist)
|
||||
{
|
||||
RARCH_ERR("Couldn't read content history file: %s.\n", path);
|
||||
return true;
|
||||
}
|
||||
|
||||
char buf[3][PATH_MAX];
|
||||
struct content_history_entry *entry = NULL;
|
||||
char *last = NULL;
|
||||
unsigned i;
|
||||
|
||||
for (hist->size = 0; hist->size < hist->cap; )
|
||||
{
|
||||
@ -250,14 +250,10 @@ error:
|
||||
|
||||
const char* content_history_get_path(content_history_t *hist, unsigned index)
|
||||
{
|
||||
const char *path, *core_path, *core_name;
|
||||
const char *path, *core_path, *core_name = NULL;
|
||||
if (!hist)
|
||||
return "";
|
||||
|
||||
path = NULL;
|
||||
core_path = NULL;
|
||||
core_name = NULL;
|
||||
|
||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||
|
||||
if (path)
|
||||
@ -267,14 +263,10 @@ const char* content_history_get_path(content_history_t *hist, unsigned index)
|
||||
|
||||
const char *content_history_get_core_path(content_history_t *hist, unsigned index)
|
||||
{
|
||||
const char *path, *core_path, *core_name;
|
||||
const char *path, *core_path, *core_name = NULL;
|
||||
if (!hist)
|
||||
return "";
|
||||
|
||||
path = NULL;
|
||||
core_path = NULL;
|
||||
core_name = NULL;
|
||||
|
||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||
|
||||
if (core_path)
|
||||
@ -284,15 +276,10 @@ const char *content_history_get_core_path(content_history_t *hist, unsigned inde
|
||||
|
||||
const char *content_history_get_core_name(content_history_t *hist, unsigned index)
|
||||
{
|
||||
const char *path, *core_path, *core_name;
|
||||
|
||||
const char *path, *core_path, *core_name = NULL;
|
||||
if (!hist)
|
||||
return "";
|
||||
|
||||
path = NULL;
|
||||
core_path = NULL;
|
||||
core_name = NULL;
|
||||
|
||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||
|
||||
if (core_name)
|
||||
|
Loading…
Reference in New Issue
Block a user