giarginfo: Use gssize to return the closure and destroy indexes

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:42:53 +01:00
parent bc2e4b3de5
commit a3d29b6437
3 changed files with 8 additions and 6 deletions

View File

@ -269,7 +269,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
* Returns: Index of the user data argument or `-1` if there is none
* Since: 2.80
*/
int
gssize
gi_arg_info_get_closure_index (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -294,7 +294,7 @@ gi_arg_info_get_closure_index (GIArgInfo *info)
* none
* Since: 2.80
*/
int
gssize
gi_arg_info_get_destroy_index (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -69,10 +69,10 @@ GI_AVAILABLE_IN_ALL
GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
int gi_arg_info_get_closure_index (GIArgInfo *info);
gssize gi_arg_info_get_closure_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
int gi_arg_info_get_destroy_index (GIArgInfo *info);
gssize gi_arg_info_get_destroy_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info);

View File

@ -545,10 +545,12 @@ write_callable_info (const char *ns,
}
if (gi_arg_info_get_closure_index (arg) >= 0)
xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure_index (arg));
xml_printf (file, " closure=\"%" G_GSSIZE_FORMAT "\"",
gi_arg_info_get_closure_index (arg));
if (gi_arg_info_get_destroy_index (arg) >= 0)
xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy_index (arg));
xml_printf (file, " destroy=\"%" G_GSSIZE_FORMAT "\"",
gi_arg_info_get_destroy_index (arg));
if (gi_arg_info_is_skip (arg))
xml_printf (file, " skip=\"1\"");