gitypeinfo: Fix int signedness in APIs

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
This commit is contained in:
Philip Withnall 2023-12-12 18:22:38 +00:00
parent e138287769
commit 23d9a79c62
3 changed files with 7 additions and 6 deletions

View File

@ -244,7 +244,8 @@ write_type_info (const gchar *ns,
} }
else if (tag == GI_TYPE_TAG_ARRAY) else if (tag == GI_TYPE_TAG_ARRAY)
{ {
gint length, size; gint length;
gssize size;
const char *name = NULL; const char *name = NULL;
xml_start_element (file, "array"); xml_start_element (file, "array");
@ -276,7 +277,7 @@ write_type_info (const gchar *ns,
size = gi_type_info_get_array_fixed_size (info); size = gi_type_info_get_array_fixed_size (info);
if (size >= 0) if (size >= 0)
xml_printf (file, " fixed-size=\"%d\"", size); xml_printf (file, " fixed-size=\"%" G_GSSIZE_FORMAT "\"", size);
if (gi_type_info_is_zero_terminated (info)) if (gi_type_info_is_zero_terminated (info))
xml_printf (file, " zero-terminated=\"1\""); xml_printf (file, " zero-terminated=\"1\"");

View File

@ -135,7 +135,7 @@ gi_type_info_get_tag (GITypeInfo *info)
*/ */
GITypeInfo * GITypeInfo *
gi_type_info_get_param_type (GITypeInfo *info, gi_type_info_get_param_type (GITypeInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;
@ -270,7 +270,7 @@ gi_type_info_get_array_length (GITypeInfo *info)
* Returns: the size or `-1` if the type is not an array * Returns: the size or `-1` if the type is not an array
* Since: 2.80 * Since: 2.80
*/ */
gint gssize
gi_type_info_get_array_fixed_size (GITypeInfo *info) gi_type_info_get_array_fixed_size (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -90,7 +90,7 @@ GITypeTag gi_type_info_get_tag (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info, GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info); GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
@ -99,7 +99,7 @@ GI_AVAILABLE_IN_ALL
gint gi_type_info_get_array_length (GITypeInfo *info); gint gi_type_info_get_array_length (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_type_info_get_array_fixed_size(GITypeInfo *info); gssize gi_type_info_get_array_fixed_size (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_type_info_is_zero_terminated (GITypeInfo *info); gboolean gi_type_info_is_zero_terminated (GITypeInfo *info);