mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(task_database) Use size_t for size to prevent narrowing issue
This commit is contained in:
parent
ecc5c1809d
commit
a6c82df0fd
@ -251,7 +251,7 @@ static int intfstream_get_serial(intfstream_t *fd, char *serial, size_t serial_l
|
||||
}
|
||||
|
||||
static bool intfstream_file_get_serial(const char *name,
|
||||
uint64_t offset, uint64_t size, char *serial, size_t serial_len)
|
||||
uint64_t offset, size_t size, char *serial, size_t serial_len)
|
||||
{
|
||||
int rv;
|
||||
uint8_t *data = NULL;
|
||||
@ -273,12 +273,12 @@ static bool intfstream_file_get_serial(const char *name,
|
||||
if (file_size < 0)
|
||||
goto error;
|
||||
|
||||
if (offset != 0 || size < (uint64_t) file_size)
|
||||
if (offset != 0 || size < (size_t) file_size)
|
||||
{
|
||||
if (intfstream_seek(fd, (int64_t)offset, SEEK_SET) == -1)
|
||||
goto error;
|
||||
|
||||
data = (uint8_t*)malloc((size_t)size);
|
||||
data = (uint8_t*)malloc(size);
|
||||
|
||||
if (intfstream_read(fd, data, size) != (int64_t) size)
|
||||
{
|
||||
@ -313,7 +313,7 @@ static int task_database_cue_get_serial(const char *name, char* serial, size_t s
|
||||
{
|
||||
char track_path[PATH_MAX_LENGTH];
|
||||
uint64_t offset = 0;
|
||||
uint64_t size = 0;
|
||||
size_t size = 0;
|
||||
|
||||
track_path[0] = '\0';
|
||||
|
||||
@ -429,7 +429,7 @@ static int task_database_cue_get_crc(const char *name, uint32_t *crc)
|
||||
{
|
||||
char track_path[PATH_MAX_LENGTH];
|
||||
uint64_t offset = 0;
|
||||
uint64_t size = 0;
|
||||
size_t size = 0;
|
||||
|
||||
track_path[0] = '\0';
|
||||
|
||||
@ -443,7 +443,7 @@ static int task_database_cue_get_crc(const char *name, uint32_t *crc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return intfstream_file_get_crc(track_path, offset, (size_t)size, crc);
|
||||
return intfstream_file_get_crc(track_path, offset, size, crc);
|
||||
}
|
||||
|
||||
static int task_database_gdi_get_crc(const char *name, uint32_t *crc)
|
||||
|
@ -1132,7 +1132,7 @@ static int64_t intfstream_get_file_size(const char *path)
|
||||
|
||||
static bool update_cand(int64_t *cand_index, int64_t *last_index,
|
||||
uint64_t *largest, char *last_file, uint64_t *offset,
|
||||
uint64_t *size, char *track_path, uint64_t max_len)
|
||||
size_t *size, char *track_path, uint64_t max_len)
|
||||
{
|
||||
if (*cand_index != -1)
|
||||
{
|
||||
@ -1141,7 +1141,7 @@ static bool update_cand(int64_t *cand_index, int64_t *last_index,
|
||||
*largest = *last_index - *cand_index;
|
||||
strlcpy(track_path, last_file, (size_t)max_len);
|
||||
*offset = *cand_index;
|
||||
*size = *largest;
|
||||
*size = (size_t)*largest;
|
||||
*cand_index = -1;
|
||||
return true;
|
||||
}
|
||||
@ -1151,7 +1151,7 @@ static bool update_cand(int64_t *cand_index, int64_t *last_index,
|
||||
}
|
||||
|
||||
int cue_find_track(const char *cue_path, bool first,
|
||||
uint64_t *offset, uint64_t *size, char *track_path, uint64_t max_len)
|
||||
uint64_t *offset, size_t *size, char *track_path, uint64_t max_len)
|
||||
{
|
||||
int rv;
|
||||
intfstream_info_t info;
|
||||
|
@ -45,7 +45,7 @@ int detect_wii_game(intfstream_t *fd, char *s, size_t len,
|
||||
int detect_system(intfstream_t *fd, const char **system_name,
|
||||
const char * filename);
|
||||
int cue_find_track(const char *cue_path, bool first, uint64_t *offset,
|
||||
uint64_t *size, char *track_path, uint64_t max_len);
|
||||
size_t *size, char *track_path, uint64_t max_len);
|
||||
bool cue_next_file(intfstream_t *fd, const char *cue_path,
|
||||
char *s, uint64_t len);
|
||||
int gdi_find_track(const char *gdi_path, bool first, char *track_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user