girepository: Use expected signed types for iterating

We are using various indexes types, but not always using the correct
sign or size, so let's adapt this to ensure we're consistent with the
values we're comparing with.
This commit is contained in:
Marco Trevisan (Treviño)
2024-01-16 01:57:09 +01:00
parent 91a3399027
commit 25ae968fc2
10 changed files with 35 additions and 37 deletions

View File

@@ -383,7 +383,9 @@ find_attribute (const char *name,
const char **attribute_names,
const char **attribute_values)
{
for (int i = 0; attribute_names[i] != NULL; i++)
size_t i;
for (i = 0; attribute_names[i] != NULL; i++)
if (strcmp (attribute_names[i], name) == 0)
return attribute_values[i];
@@ -484,8 +486,8 @@ static BasicTypeInfo basic_types[] = {
static const BasicTypeInfo *
parse_basic (const char *str)
{
unsigned int i;
unsigned int n_basic = G_N_ELEMENTS (basic_types);
size_t i;
size_t n_basic = G_N_ELEMENTS (basic_types);
for (i = 0; i < n_basic; i++)
{