mirror of
https://github.com/libretro/RetroArch
synced 2025-02-23 15:40:35 +00:00
(archive_file) Cleanups
This commit is contained in:
parent
5b1ecbff87
commit
0c66441d08
@ -56,6 +56,20 @@ struct file_archive_file_data
|
|||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static size_t file_archive_size(file_archive_file_data_t *data)
|
||||||
|
{
|
||||||
|
if (!data)
|
||||||
|
return 0;
|
||||||
|
return data->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
|
||||||
|
{
|
||||||
|
if (!data)
|
||||||
|
return NULL;
|
||||||
|
return (const uint8_t*)data->data;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
/* Closes, unmaps and frees. */
|
/* Closes, unmaps and frees. */
|
||||||
static void file_archive_free(file_archive_file_data_t *data)
|
static void file_archive_free(file_archive_file_data_t *data)
|
||||||
@ -70,20 +84,6 @@ static void file_archive_free(file_archive_file_data_t *data)
|
|||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
|
|
||||||
{
|
|
||||||
if (!data)
|
|
||||||
return NULL;
|
|
||||||
return (const uint8_t*)data->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t file_archive_size(file_archive_file_data_t *data)
|
|
||||||
{
|
|
||||||
if (!data)
|
|
||||||
return 0;
|
|
||||||
return data->size;
|
|
||||||
}
|
|
||||||
|
|
||||||
static file_archive_file_data_t* file_archive_open(const char *path)
|
static file_archive_file_data_t* file_archive_open(const char *path)
|
||||||
{
|
{
|
||||||
file_archive_file_data_t *data = (file_archive_file_data_t*)calloc(1, sizeof(*data));
|
file_archive_file_data_t *data = (file_archive_file_data_t*)calloc(1, sizeof(*data));
|
||||||
@ -128,20 +128,6 @@ static void file_archive_free(file_archive_file_data_t *data)
|
|||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
|
|
||||||
{
|
|
||||||
if (!data)
|
|
||||||
return NULL;
|
|
||||||
return (const uint8_t*)data->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t file_archive_size(file_archive_file_data_t *data)
|
|
||||||
{
|
|
||||||
if (!data)
|
|
||||||
return 0;
|
|
||||||
return data->size;
|
|
||||||
}
|
|
||||||
|
|
||||||
static file_archive_file_data_t* file_archive_open(const char *path)
|
static file_archive_file_data_t* file_archive_open(const char *path)
|
||||||
{
|
{
|
||||||
ssize_t ret = -1;
|
ssize_t ret = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user