mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-22 09:57:52 +02:00
girepository: Use size_t for size-related arguments and return types
We used to use unsigned values, while they should be big enough to old the data we're handling here, it's cleaner and clearer if we use size_t as type for such values, as it makes straight forward to understand what a value should contain. It also makes these values more future proof.
This commit is contained in:
@@ -132,10 +132,9 @@ gi_struct_info_find_field (GIStructInfo *info,
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
uint32_t offset = rinfo->offset + header->struct_blob_size;
|
||||
int i;
|
||||
size_t offset = rinfo->offset + header->struct_blob_size;
|
||||
|
||||
for (i = 0; i < blob->n_fields; i++)
|
||||
for (size_t i = 0; i < blob->n_fields; i++)
|
||||
{
|
||||
FieldBlob *field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
|
||||
const char *fname = (const char *)&rinfo->typelib->data[field_blob->name];
|
||||
@@ -192,7 +191,7 @@ gi_struct_info_get_method (GIStructInfo *info,
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
int offset;
|
||||
size_t offset;
|
||||
|
||||
offset = gi_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size;
|
||||
return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
|
||||
@@ -215,7 +214,7 @@ GIFunctionInfo *
|
||||
gi_struct_info_find_method (GIStructInfo *info,
|
||||
const char *name)
|
||||
{
|
||||
int offset;
|
||||
size_t offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
|
||||
|
Reference in New Issue
Block a user