garray: Fix (nullable) annotation on GArray.[prepend|insert]_vals()

They do both accept NULL value arrays, but only if the number of
elements in the value array is zero. Fix the annotations and mention
this in the documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795975
This commit is contained in:
Philip Withnall 2018-05-09 15:34:39 +01:00
parent 05fe110635
commit 3eeec77800

View File

@ -439,11 +439,14 @@ g_array_append_vals (GArray *farray,
/**
* g_array_prepend_vals:
* @array: a #GArray
* @data: (not nullable): a pointer to the elements to prepend to the start of the array
* @len: the number of elements to prepend
* @data: (nullable): a pointer to the elements to prepend to the start of the array
* @len: the number of elements to prepend, which may be zero
*
* Adds @len elements onto the start of the array.
*
* @data may be %NULL if (and only if) @len is zero. If @len is zero, this
* function is a no-op.
*
* This operation is slower than g_array_append_vals() since the
* existing elements in the array have to be moved to make space for
* the new elements.
@ -498,11 +501,14 @@ g_array_prepend_vals (GArray *farray,
* g_array_insert_vals:
* @array: a #GArray
* @index_: the index to place the elements at
* @data: (not nullable): a pointer to the elements to insert
* @data: (nullable): a pointer to the elements to insert
* @len: the number of elements to insert
*
* Inserts @len elements into a #GArray at the given index.
*
* @data may be %NULL if (and only if) @len is zero. If @len is zero, this
* function is a no-op.
*
* Returns: the #GArray
*/
/**