Commit 3eeec778 authored by Philip Withnall's avatar Philip Withnall

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's avatarPhilip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795975
parent 05fe1106
......@@ -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
*/
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment