mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
history.c - cleanups
This commit is contained in:
parent
ed25984a3c
commit
d2aea634b1
29
history.c
29
history.c
@ -179,18 +179,18 @@ size_t content_history_size(content_history_t *hist)
|
|||||||
|
|
||||||
static bool content_history_read_file(content_history_t *hist, const char *path)
|
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");
|
FILE *file = fopen(path, "r");
|
||||||
|
|
||||||
if (!file || !hist)
|
if (!file || !hist)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Couldn't read content history file: %s.\n", path);
|
RARCH_ERR("Couldn't read content history file: %s.\n", path);
|
||||||
return true;
|
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; )
|
for (hist->size = 0; hist->size < hist->cap; )
|
||||||
{
|
{
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
@ -250,14 +250,10 @@ error:
|
|||||||
|
|
||||||
const char* content_history_get_path(content_history_t *hist, unsigned index)
|
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)
|
if (!hist)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
path = NULL;
|
|
||||||
core_path = NULL;
|
|
||||||
core_name = NULL;
|
|
||||||
|
|
||||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||||
|
|
||||||
if (path)
|
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 *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)
|
if (!hist)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
path = NULL;
|
|
||||||
core_path = NULL;
|
|
||||||
core_name = NULL;
|
|
||||||
|
|
||||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||||
|
|
||||||
if (core_path)
|
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 *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)
|
if (!hist)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
path = NULL;
|
|
||||||
core_path = NULL;
|
|
||||||
core_name = NULL;
|
|
||||||
|
|
||||||
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
content_history_get_index(hist, index, &path, &core_path, &core_name);
|
||||||
|
|
||||||
if (core_name)
|
if (core_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user