@@ -269,7 +269,7 @@ static int intfstream_get_serial(intfstream_t *fd, char *s, size_t len, const ch
269269}
270270
271271static bool intfstream_file_get_serial (const char * name ,
272- uint64_t offset , size_t size , char * s , size_t len )
272+ uint64_t offset , int64_t size , char * s , size_t len )
273273{
274274 int rv ;
275275 uint8_t * data = NULL ;
@@ -291,7 +291,7 @@ static bool intfstream_file_get_serial(const char *name,
291291 if (file_size < 0 )
292292 goto error ;
293293
294- if (offset != 0 || size < ( size_t ) file_size )
294+ if (offset != 0 || size < file_size )
295295 {
296296 if (intfstream_seek (fd , (int64_t )offset , SEEK_SET ) == -1 )
297297 goto error ;
@@ -364,7 +364,7 @@ static int task_database_gdi_get_serial(const char *name, char *s, size_t len)
364364 return 0 ;
365365 }
366366
367- return intfstream_file_get_serial (track_path , 0 , SIZE_MAX , s , len );
367+ return intfstream_file_get_serial (track_path , 0 , INT64_MAX , s , len );
368368}
369369
370370static int task_database_chd_get_serial (const char * name , char * serial , size_t len )
@@ -385,7 +385,7 @@ static int task_database_chd_get_serial(const char *name, char *serial, size_t l
385385}
386386
387387static bool intfstream_file_get_crc (const char * name ,
388- uint64_t offset , size_t len , uint32_t * crc )
388+ uint64_t offset , int64_t len , uint32_t * crc )
389389{
390390 bool rv ;
391391 intfstream_t * fd = intfstream_open_file (name ,
@@ -407,7 +407,7 @@ static bool intfstream_file_get_crc(const char *name,
407407 if (file_size < 0 )
408408 goto error ;
409409
410- if (offset != 0 || len < ( uint64_t ) file_size )
410+ if (offset != 0 || len < file_size )
411411 {
412412 if (intfstream_seek (fd , (int64_t )offset , SEEK_SET ) == -1 )
413413 goto error ;
@@ -480,7 +480,7 @@ static int task_database_gdi_get_crc(const char *name, uint32_t *crc)
480480 return 0 ;
481481 }
482482
483- return intfstream_file_get_crc (track_path , 0 , SIZE_MAX , crc );
483+ return intfstream_file_get_crc (track_path , 0 , INT64_MAX , crc );
484484}
485485
486486static bool task_database_chd_get_crc (const char * name , uint32_t * crc )
@@ -624,7 +624,7 @@ static int task_database_iterate_playlist(
624624 db -> type = DATABASE_TYPE_CRC_LOOKUP ;
625625 /* first check crc of archive itself */
626626 return intfstream_file_get_crc (name ,
627- 0 , SIZE_MAX , & db_state -> archive_crc );
627+ 0 , INT64_MAX , & db_state -> archive_crc );
628628#else
629629 break ;
630630#endif
@@ -656,7 +656,7 @@ static int task_database_iterate_playlist(
656656 case FILE_TYPE_WIA :
657657 case FILE_TYPE_ISO :
658658 db_state -> serial [0 ] = '\0' ;
659- intfstream_file_get_serial (name , 0 , SIZE_MAX , db_state -> serial , sizeof (db_state -> serial ));
659+ intfstream_file_get_serial (name , 0 , INT64_MAX , db_state -> serial , sizeof (db_state -> serial ));
660660 db -> type = DATABASE_TYPE_SERIAL_LOOKUP ;
661661 break ;
662662 case FILE_TYPE_CHD :
@@ -675,7 +675,7 @@ static int task_database_iterate_playlist(
675675 default :
676676 db_state -> serial [0 ] = '\0' ;
677677 db -> type = DATABASE_TYPE_CRC_LOOKUP ;
678- return intfstream_file_get_crc (name , 0 , SIZE_MAX , & db_state -> crc );
678+ return intfstream_file_get_crc (name , 0 , INT64_MAX , & db_state -> crc );
679679 }
680680
681681 return 1 ;
@@ -1136,7 +1136,7 @@ static int task_database_iterate_serial_lookup(
11361136 if (task_database_check_serial_and_crc (db_state ))
11371137 {
11381138 if (db_state -> crc == 0 )
1139- intfstream_file_get_crc (name , 0 , SIZE_MAX , & db_state -> crc );
1139+ intfstream_file_get_crc (name , 0 , INT64_MAX , & db_state -> crc );
11401140 if (db_state -> crc == db_info_entry -> crc32 )
11411141 return database_info_list_iterate_found_match (_db ,
11421142 db_state , db , NULL );
0 commit comments