girepository: Fix various implicit conversions from size_t to smaller types

Basically various trivial instances of the following MSVC compiler
warning:
```
../gio/gio-tool-set.c(50): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-04-25 00:41:34 +01:00
parent e7aa0039b9
commit ec36370dcb
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73
5 changed files with 9 additions and 6 deletions

View File

@ -223,12 +223,14 @@ gi_base_info_type_register_static (const char *type_name,
{
GTypeInfo info;
g_assert (instance_size <= G_MAXUINT16);
info.class_size = sizeof (GIBaseInfoClass);
info.base_init = NULL;
info.base_finalize = NULL;
info.class_init = class_init;
info.class_finalize = NULL;
info.instance_size = instance_size;
info.instance_size = (guint16) instance_size;
info.n_preallocs = 0;
info.instance_init = NULL;
info.value_table = NULL;

View File

@ -651,7 +651,7 @@ gi_callable_info_invoke (GICallableInfo *info,
GITypeInfo *rinfo;
GITypeTag rtag;
GIArgInfo *ainfo;
size_t n_args, n_invoke_args, in_pos, out_pos, i;
unsigned int n_args, n_invoke_args, in_pos, out_pos, i;
void **args;
gboolean success = FALSE;
GError *local_error = NULL;

View File

@ -190,7 +190,7 @@ gi_field_info_get_field (GIFieldInfo *field_info,
void *mem,
GIArgument *value)
{
int offset;
size_t offset;
GITypeInfo *type_info;
gboolean result = FALSE;
@ -385,7 +385,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
void *mem,
const GIArgument *value)
{
int offset;
size_t offset;
GITypeInfo *type_info;
gboolean result = FALSE;

View File

@ -571,7 +571,7 @@ gi_ir_node_get_size (GIIrNode *node)
g_assert (size <= G_MAXUINT32);
return size;
return (guint32) size;
}
static void

View File

@ -1338,7 +1338,8 @@ gi_ir_writer_write (GIRepository *repository,
gboolean show_all)
{
FILE *ofile;
size_t i, j;
size_t i;
unsigned int j;
char **dependencies;
Xml *xml;