gibaseinfo: Change argument type for gi_type_info_init()

Make it take a `GITypeInfo` rather than a `GIBaseInfo`, because that’s
what it actually operates on.

This is an internal API, so this isn’t an API break.

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

Helps: #3218
This commit is contained in:
Philip Withnall 2024-01-23 17:53:15 +00:00
parent fee9223e74
commit a3da3a032c
4 changed files with 19 additions and 4 deletions

View File

@ -365,7 +365,7 @@ gi_arg_info_load_type (GIArgInfo *info,
g_return_if_fail (info != NULL);
g_return_if_fail (GI_IS_ARG_INFO (info));
gi_type_info_init ((GIBaseInfo *) type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
}
void

View File

@ -465,8 +465,23 @@ gi_type_info_new (GIBaseInfo *container,
(type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset);
}
/*< private >
* gi_type_info_init:
* @info: (out caller-allocates): caller-allocated #GITypeInfo to populate
* @container: (nullable): info which contains this one
* @typelib: typelib containing the info
* @offset: offset of the info within @typelib, in bytes
*
* Initialise a stack-allocated #GITypeInfo representing an object of type
* [type@GIRepository.TypeInfo] from @offset of @typelib.
*
* This is a specialised form of [func@GIRepository.info_init] for type
* information.
*
* Since: 2.80
*/
void
gi_type_info_init (GIBaseInfo *info,
gi_type_info_init (GITypeInfo *info,
GIBaseInfo *container,
GITypelib *typelib,
uint32_t offset)

View File

@ -215,7 +215,7 @@ gi_callable_info_load_return_type (GICallableInfo *info,
offset = signature_offset (info);
gi_type_info_init ((GIBaseInfo *) type, (GIBaseInfo*)info, rinfo->typelib, offset);
gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset);
}
/**

View File

@ -242,7 +242,7 @@ GITypeInfo * gi_type_info_new (GIBaseInfo *container,
GITypelib *typelib,
uint32_t offset);
void gi_type_info_init (GIBaseInfo *info,
void gi_type_info_init (GITypeInfo *info,
GIBaseInfo *container,
GITypelib *typelib,
uint32_t offset);