gicallableinfo: Fix int signedness in APIs

These ints can never be negative, so should be unsigned.

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

Helps: #3155
This commit is contained in:
Philip Withnall 2023-12-12 17:40:07 +00:00
parent 825581756a
commit 5cb8b9b826
3 changed files with 12 additions and 13 deletions

View File

@ -322,7 +322,7 @@ gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info)
*
* Returns: The number of arguments this callable expects.
*/
gint
guint
gi_callable_info_get_n_args (GICallableInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -350,7 +350,7 @@ gi_callable_info_get_n_args (GICallableInfo *info)
*/
GIArgInfo *
gi_callable_info_get_arg (GICallableInfo *info,
gint n)
guint n)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header;
@ -380,7 +380,7 @@ gi_callable_info_get_arg (GICallableInfo *info,
*/
void
gi_callable_info_load_arg (GICallableInfo *info,
gint n,
guint n,
GIArgInfo *arg)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -601,9 +601,9 @@ gboolean
gi_callable_info_invoke (GICallableInfo *info,
gpointer function,
const GIArgument *in_args,
int n_in_args,
gsize n_in_args,
const GIArgument *out_args,
int n_out_args,
gsize n_out_args,
GIArgument *return_value,
gboolean is_method,
gboolean throws,
@ -616,7 +616,7 @@ gi_callable_info_invoke (GICallableInfo *info,
GITypeInfo *rinfo;
GITypeTag rtag;
GIArgInfo *ainfo;
gint n_args, n_invoke_args, in_pos, out_pos, i;
gsize n_args, n_invoke_args, in_pos, out_pos, i;
gpointer *args;
gboolean success = FALSE;
GError *local_error = NULL;

View File

@ -78,24 +78,24 @@ GI_AVAILABLE_IN_ALL
gboolean gi_callable_info_skip_return (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
gint gi_callable_info_get_n_args (GICallableInfo *info);
guint gi_callable_info_get_n_args (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info,
gint n);
guint n);
GI_AVAILABLE_IN_ALL
void gi_callable_info_load_arg (GICallableInfo *info,
gint n,
guint n,
GIArgInfo *arg);
GI_AVAILABLE_IN_ALL
gboolean gi_callable_info_invoke (GICallableInfo *info,
gpointer function,
const GIArgument *in_args,
int n_in_args,
gsize n_in_args,
const GIArgument *out_args,
int n_out_args,
gsize n_out_args,
GIArgument *return_value,
gboolean is_method,
gboolean throws,

View File

@ -461,7 +461,6 @@ write_callable_info (const gchar *ns,
Xml *file)
{
GITypeInfo *type;
gint i;
if (gi_callable_info_can_throw_gerror (info))
xml_printf (file, " throws=\"1\"");
@ -490,7 +489,7 @@ write_callable_info (const gchar *ns,
return;
xml_start_element (file, "parameters");
for (i = 0; i < gi_callable_info_get_n_args (info); i++)
for (guint i = 0; i < gi_callable_info_get_n_args (info); i++)
{
GIArgInfo *arg = gi_callable_info_get_arg (info, i);