gitypeinfo: Rename get_array_length() to get_array_length_index()

It returns the index of the array length argument, not the length
itself.

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

Helps: #3155
This commit is contained in:
Philip Withnall 2023-12-12 18:23:05 +00:00
parent 23d9a79c62
commit 299315007f
3 changed files with 5 additions and 5 deletions

View File

@ -271,7 +271,7 @@ write_type_info (const gchar *ns,
type = gi_type_info_get_param_type (info, 0); type = gi_type_info_get_param_type (info, 0);
length = gi_type_info_get_array_length (info); length = gi_type_info_get_array_length_index (info);
if (length >= 0) if (length >= 0)
xml_printf (file, " length=\"%d\"", length); xml_printf (file, " length=\"%d\"", length);

View File

@ -226,17 +226,17 @@ gi_type_info_get_interface (GITypeInfo *info)
} }
/** /**
* gi_type_info_get_array_length: * gi_type_info_get_array_length_index:
* @info: a #GITypeInfo * @info: a #GITypeInfo
* *
* Obtain the position of the argument which gives the array length of the type. * Obtain the position of the argument which gives the array length of the type.
* The type tag must be a `GI_TYPE_TAG_ARRAY` or `-1` will be returned. * The type tag must be a `GI_TYPE_TAG_ARRAY` or `-1` will be returned.
* *
* Returns: the array length, or `-1` if the type is not an array * Returns: the array length argument index, or `-1` if the type is not an array
* Since: 2.80 * Since: 2.80
*/ */
gint gint
gi_type_info_get_array_length (GITypeInfo *info) gi_type_info_get_array_length_index (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;

View File

@ -96,7 +96,7 @@ GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info); GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_type_info_get_array_length (GITypeInfo *info); gint gi_type_info_get_array_length_index (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gssize gi_type_info_get_array_fixed_size (GITypeInfo *info); gssize gi_type_info_get_array_fixed_size (GITypeInfo *info);