继续修复剩下的warning

This commit is contained in:
anod 2023-01-16 20:17:46 +08:00
parent b157277c25
commit 91dfe9325d

View File

@ -127,7 +127,7 @@ static int32_t bin_search( acl_text_t game )
return -ACHTLIB_INVALID;
}
int size = ACL_SERIAL_LEN(gblcht.serc);
uint32_t size = ACL_SERIAL_LEN(gblcht.serc);
char *serials = (char*)malloc( size );
if( serials == NULL ){
return -ACHTLIB_NOMEM;
@ -193,7 +193,7 @@ acl_error_t acl_select_game( acl_text_t game, acl_boolean_t filter, acl_count_t
offset = ACL_HEADER_LEN + ACL_SERIAL_LEN(inst->serc) + ACL_INDEX_OFFSET(inst->serc+1);
offset += ACL_CONFIG_OFFSET(groups[0]);
uint32_t gcount = groups[1] - groups[0];
int32_t gcount = groups[1] - groups[0];
if( RES_OK != fLseek(inst->fd, offset) )
return ACHTLIB_INVALID;
@ -208,7 +208,7 @@ acl_error_t acl_select_game( acl_text_t game, acl_boolean_t filter, acl_count_t
{
char reg = game[3];
index = -1;
for( int i=0; i < gcount; ++i )
for( int32_t i=0; i < gcount; ++i )
{
if( config_type(cfg[i].typeloc) == reg )
{
@ -302,8 +302,8 @@ static acl_error_t load_data()
gblset.entdata = NULL;
}
int elemlen = gblset.entry.entid > 0xffff ? sizeof(uint32_t) : sizeof(uint16_t);
int total = gblset.entry.datasz * elemlen;
uint32_t elemlen = gblset.entry.entid > 0xffff ? sizeof(uint32_t) : sizeof(uint16_t);
uint32_t total = gblset.entry.datasz * elemlen;
if( total == 0 ) return ACHTLIB_SUCCESS;
uint8_t *d = (uint8_t*)malloc( total );
@ -369,7 +369,7 @@ acl_error_t acl_select_entry( acl_entryid_t id, acl_elemlen_t *count)
CheatEntry cache[READ_CACHE_SIZE];
uint32_t readed;
for( int i = 0; i < gblset.entc; i += READ_CACHE_SIZE )
for( uint32_t i = 0; i < gblset.entc; i += READ_CACHE_SIZE )
{
if( RES_OK != fRead(gblcht.fd, cache, sizeof(cache), &readed)
|| readed != sizeof(cache) )