doc: Correctly annotate GAsyncQueue methods

Generic pointers are assumed to be nullable unless explicitly marked as
not nullable.
This commit is contained in:
Emmanuele Bassi 2022-10-13 23:44:11 +01:00
parent 9fb7edd845
commit 80f56c9eb4

View File

@ -281,9 +281,11 @@ g_async_queue_unlock (GAsyncQueue *queue)
/** /**
* g_async_queue_push: * g_async_queue_push:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @data: @data to push into the @queue * @data: (not nullable): data to push onto the @queue
* *
* Pushes the @data into the @queue. @data must not be %NULL. * Pushes the @data into the @queue.
*
* The @data parameter must not be %NULL.
*/ */
void void
g_async_queue_push (GAsyncQueue *queue, g_async_queue_push (GAsyncQueue *queue,
@ -300,9 +302,11 @@ g_async_queue_push (GAsyncQueue *queue,
/** /**
* g_async_queue_push_unlocked: * g_async_queue_push_unlocked:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @data: @data to push into the @queue * @data: (not nullable): data to push onto the @queue
* *
* Pushes the @data into the @queue. @data must not be %NULL. * Pushes the @data into the @queue.
*
* The @data parameter must not be %NULL.
* *
* This function must be called while holding the @queue's lock. * This function must be called while holding the @queue's lock.
*/ */
@ -321,7 +325,7 @@ g_async_queue_push_unlocked (GAsyncQueue *queue,
/** /**
* g_async_queue_push_sorted: * g_async_queue_push_sorted:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @data: the @data to push into the @queue * @data: (not nullable): the @data to push into the @queue
* @func: the #GCompareDataFunc is used to sort @queue * @func: the #GCompareDataFunc is used to sort @queue
* @user_data: user data passed to @func. * @user_data: user data passed to @func.
* *
@ -362,7 +366,7 @@ g_async_queue_invert_compare (gpointer v1,
/** /**
* g_async_queue_push_sorted_unlocked: * g_async_queue_push_sorted_unlocked:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @data: the @data to push into the @queue * @data: the data to push into the @queue
* @func: the #GCompareDataFunc is used to sort @queue * @func: the #GCompareDataFunc is used to sort @queue
* @user_data: user data passed to @func. * @user_data: user data passed to @func.
* *
@ -485,7 +489,7 @@ g_async_queue_pop_unlocked (GAsyncQueue *queue)
* %NULL is returned. * %NULL is returned.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* available immediately. * available immediately.
*/ */
gpointer gpointer
g_async_queue_try_pop (GAsyncQueue *queue) g_async_queue_try_pop (GAsyncQueue *queue)
@ -511,7 +515,7 @@ g_async_queue_try_pop (GAsyncQueue *queue)
* This function must be called while holding the @queue's lock. * This function must be called while holding the @queue's lock.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* available immediately. * available immediately.
*/ */
gpointer gpointer
g_async_queue_try_pop_unlocked (GAsyncQueue *queue) g_async_queue_try_pop_unlocked (GAsyncQueue *queue)
@ -532,7 +536,7 @@ g_async_queue_try_pop_unlocked (GAsyncQueue *queue)
* If no data is received before the timeout, %NULL is returned. * If no data is received before the timeout, %NULL is returned.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* received before the timeout. * received before the timeout.
*/ */
gpointer gpointer
g_async_queue_timeout_pop (GAsyncQueue *queue, g_async_queue_timeout_pop (GAsyncQueue *queue,
@ -563,7 +567,7 @@ g_async_queue_timeout_pop (GAsyncQueue *queue,
* This function must be called while holding the @queue's lock. * This function must be called while holding the @queue's lock.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* received before the timeout. * received before the timeout.
*/ */
gpointer gpointer
g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue, g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue,
@ -590,7 +594,7 @@ g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue,
* and g_time_val_add() can be used. * and g_time_val_add() can be used.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* received before @end_time. * received before @end_time.
* *
* Deprecated: use g_async_queue_timeout_pop(). * Deprecated: use g_async_queue_timeout_pop().
*/ */
@ -636,7 +640,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* This function must be called while holding the @queue's lock. * This function must be called while holding the @queue's lock.
* *
* Returns: (nullable): data from the queue or %NULL, when no data is * Returns: (nullable): data from the queue or %NULL, when no data is
* received before @end_time. * received before @end_time.
* *
* Deprecated: use g_async_queue_timeout_pop_unlocked(). * Deprecated: use g_async_queue_timeout_pop_unlocked().
*/ */
@ -798,7 +802,7 @@ g_async_queue_sort_unlocked (GAsyncQueue *queue,
/** /**
* g_async_queue_remove: * g_async_queue_remove:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @item: the data to remove from the @queue * @item: (not nullable): the data to remove from the @queue
* *
* Remove an item from the queue. * Remove an item from the queue.
* *
@ -848,7 +852,7 @@ g_async_queue_remove_unlocked (GAsyncQueue *queue,
/** /**
* g_async_queue_push_front: * g_async_queue_push_front:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @item: data to push into the @queue * @item: (not nullable): data to push into the @queue
* *
* Pushes the @item into the @queue. @item must not be %NULL. * Pushes the @item into the @queue. @item must not be %NULL.
* In contrast to g_async_queue_push(), this function * In contrast to g_async_queue_push(), this function
@ -872,7 +876,7 @@ g_async_queue_push_front (GAsyncQueue *queue,
/** /**
* g_async_queue_push_front_unlocked: * g_async_queue_push_front_unlocked:
* @queue: a #GAsyncQueue * @queue: a #GAsyncQueue
* @item: data to push into the @queue * @item: (not nullable): data to push into the @queue
* *
* Pushes the @item into the @queue. @item must not be %NULL. * Pushes the @item into the @queue. @item must not be %NULL.
* In contrast to g_async_queue_push_unlocked(), this function * In contrast to g_async_queue_push_unlocked(), this function