mirror of
https://github.com/libretro/libretro-common.git
synced 2025-04-02 10:31:51 -04:00
Updates
This commit is contained in:
parent
8189a7ee60
commit
dab7738778
4 changed files with 14 additions and 12 deletions
|
@ -48,7 +48,7 @@ typedef struct intfstream_info
|
|||
struct
|
||||
{
|
||||
uint8_t *data;
|
||||
unsigned size;
|
||||
uint64_t size;
|
||||
} buf;
|
||||
bool writable;
|
||||
} memory;
|
||||
|
@ -75,7 +75,7 @@ int64_t intfstream_write(intfstream_internal_t *intf,
|
|||
const void *s, uint64_t len);
|
||||
|
||||
char *intfstream_gets(intfstream_internal_t *intf,
|
||||
char *buffer, size_t len);
|
||||
char *buffer, uint64_t len);
|
||||
|
||||
int intfstream_getc(intfstream_internal_t *intf);
|
||||
|
||||
|
@ -98,7 +98,7 @@ intfstream_t* intfstream_open_file(const char *path,
|
|||
unsigned mode, unsigned hints);
|
||||
|
||||
intfstream_t *intfstream_open_memory(void *data,
|
||||
unsigned mode, unsigned hints, size_t size);
|
||||
unsigned mode, unsigned hints, uint64_t size);
|
||||
|
||||
intfstream_t *intfstream_open_chd_track(const char *path,
|
||||
unsigned mode, unsigned hints, int32_t track);
|
||||
|
|
|
@ -393,7 +393,7 @@ int64_t filestream_read_file(const char *path, void **buf, int64_t *len)
|
|||
if (content_buf_size < 0)
|
||||
goto error;
|
||||
|
||||
content_buf = malloc((uint64_t)(content_buf_size + 1));
|
||||
content_buf = malloc((size_t)(content_buf_size + 1));
|
||||
|
||||
if (!content_buf)
|
||||
goto error;
|
||||
|
|
|
@ -43,7 +43,7 @@ struct intfstream_internal
|
|||
struct
|
||||
{
|
||||
uint8_t *data;
|
||||
unsigned size;
|
||||
uint64_t size;
|
||||
} buf;
|
||||
memstream_t *fp;
|
||||
bool writable;
|
||||
|
@ -299,7 +299,7 @@ int64_t intfstream_write(intfstream_internal_t *intf,
|
|||
}
|
||||
|
||||
char *intfstream_gets(intfstream_internal_t *intf,
|
||||
char *buffer, size_t len)
|
||||
char *buffer, uint64_t len)
|
||||
{
|
||||
if (!intf)
|
||||
return NULL;
|
||||
|
@ -307,9 +307,11 @@ char *intfstream_gets(intfstream_internal_t *intf,
|
|||
switch (intf->type)
|
||||
{
|
||||
case INTFSTREAM_FILE:
|
||||
return filestream_gets(intf->file.fp, buffer, len);
|
||||
return filestream_gets(intf->file.fp,
|
||||
buffer, (size_t)len);
|
||||
case INTFSTREAM_MEMORY:
|
||||
return memstream_gets(intf->memory.fp, buffer, len);
|
||||
return memstream_gets(intf->memory.fp,
|
||||
buffer, (size_t)len);
|
||||
case INTFSTREAM_CHD:
|
||||
#ifdef HAVE_CHD
|
||||
return chdstream_gets(intf->chd.fp, buffer, len);
|
||||
|
@ -428,14 +430,14 @@ error:
|
|||
}
|
||||
|
||||
intfstream_t *intfstream_open_memory(void *data,
|
||||
unsigned mode, unsigned hints, size_t size)
|
||||
unsigned mode, unsigned hints, uint64_t size)
|
||||
{
|
||||
intfstream_info_t info;
|
||||
intfstream_t *fd = NULL;
|
||||
|
||||
info.type = INTFSTREAM_MEMORY;
|
||||
info.memory.buf.data = (uint8_t*)data;
|
||||
info.memory.buf.size = (unsigned)size;
|
||||
info.memory.buf.size = size;
|
||||
info.memory.writable = false;
|
||||
|
||||
fd = (intfstream_t*)intfstream_init(&info);
|
||||
|
|
|
@ -103,7 +103,7 @@ uint64_t memstream_read(memstream_t *stream, void *data, uint64_t bytes)
|
|||
if (bytes > avail)
|
||||
bytes = avail;
|
||||
|
||||
memcpy(data, stream->buf + stream->ptr, bytes);
|
||||
memcpy(data, stream->buf + stream->ptr, (size_t)bytes);
|
||||
stream->ptr += bytes;
|
||||
memstream_update_pos(stream);
|
||||
return bytes;
|
||||
|
@ -120,7 +120,7 @@ uint64_t memstream_write(memstream_t *stream, const void *data, uint64_t bytes)
|
|||
if (bytes > avail)
|
||||
bytes = avail;
|
||||
|
||||
memcpy(stream->buf + stream->ptr, data, bytes);
|
||||
memcpy(stream->buf + stream->ptr, data, (size_t)bytes);
|
||||
stream->ptr += bytes;
|
||||
memstream_update_pos(stream);
|
||||
return bytes;
|
||||
|
|
Loading…
Add table
Reference in a new issue