gitypeinfo: Use gssize to return the array length index

Use a bigger integer value, even though int is more than enough, but
to make it clearer that we're returning a size-related value.
This commit is contained in:
Marco Trevisan (Treviño) 2024-01-16 00:44:08 +01:00
parent a3d29b6437
commit de8ac339fb
3 changed files with 4 additions and 4 deletions

View File

@ -244,7 +244,7 @@ write_type_info (const char *ns,
}
else if (tag == GI_TYPE_TAG_ARRAY)
{
int length;
gssize length;
gssize size;
const char *name = NULL;
@ -273,7 +273,7 @@ write_type_info (const char *ns,
length = gi_type_info_get_array_length_index (info);
if (length >= 0)
xml_printf (file, " length=\"%d\"", length);
xml_printf (file, " length=\"%" G_GSSIZE_FORMAT "\"", length);
size = gi_type_info_get_array_fixed_size (info);
if (size >= 0)

View File

@ -241,7 +241,7 @@ gi_type_info_get_interface (GITypeInfo *info)
* or it has no length argument
* Since: 2.80
*/
int
gssize
gi_type_info_get_array_length_index (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -96,7 +96,7 @@ GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
int gi_type_info_get_array_length_index (GITypeInfo *info);
gssize gi_type_info_get_array_length_index (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
gssize gi_type_info_get_array_fixed_size (GITypeInfo *info);