From de8ac339fb52e88b3e2a6285503e5d3cfc77237e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 16 Jan 2024 00:44:08 +0100 Subject: [PATCH] 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. --- girepository/girwriter.c | 4 ++-- girepository/gitypeinfo.c | 2 +- girepository/gitypeinfo.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/girepository/girwriter.c b/girepository/girwriter.c index 22b366bd2..6c52ed054 100644 --- a/girepository/girwriter.c +++ b/girepository/girwriter.c @@ -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) diff --git a/girepository/gitypeinfo.c b/girepository/gitypeinfo.c index 349e0f879..5086ec2a2 100644 --- a/girepository/gitypeinfo.c +++ b/girepository/gitypeinfo.c @@ -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; diff --git a/girepository/gitypeinfo.h b/girepository/gitypeinfo.h index 56a5c7c24..d12790a36 100644 --- a/girepository/gitypeinfo.h +++ b/girepository/gitypeinfo.h @@ -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);