gsignal: Add missing (transfer) and (nullable) return annotations

This commit only looks at the `Returns:` lines in the documentation, and
has examined all of them in the file. Function arguments have not been
checked.

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

Helps: #2227
This commit is contained in:
Philip Withnall 2020-12-11 23:49:30 +00:00
parent c7a7dd9ae3
commit 181a12c393

View File

@ -1035,9 +1035,9 @@ signal_finalize_hook (GHookList *hook_list,
* g_signal_add_emission_hook: * g_signal_add_emission_hook:
* @signal_id: the signal identifier, as returned by g_signal_lookup(). * @signal_id: the signal identifier, as returned by g_signal_lookup().
* @detail: the detail on which to call the hook. * @detail: the detail on which to call the hook.
* @hook_func: a #GSignalEmissionHook function. * @hook_func: (not nullable): a #GSignalEmissionHook function.
* @hook_data: user data for @hook_func. * @hook_data: (nullable): user data for @hook_func.
* @data_destroy: a #GDestroyNotify for @hook_data. * @data_destroy: (nullable): a #GDestroyNotify for @hook_data.
* *
* Adds an emission hook for a signal, which will get called for any emission * Adds an emission hook for a signal, which will get called for any emission
* of that signal, independent of the instance. This is possible only * of that signal, independent of the instance. This is possible only
@ -1389,7 +1389,7 @@ g_signal_list_ids (GType itype,
* *
* Two different signals may have the same name, if they have differing types. * Two different signals may have the same name, if they have differing types.
* *
* Returns: the signal name, or %NULL if the signal number was invalid. * Returns: (nullable): the signal name, or %NULL if the signal number was invalid.
*/ */
const gchar * const gchar *
g_signal_name (guint signal_id) g_signal_name (guint signal_id)
@ -1408,7 +1408,7 @@ g_signal_name (guint signal_id)
/** /**
* g_signal_query: * g_signal_query:
* @signal_id: The signal id of the signal to query information for. * @signal_id: The signal id of the signal to query information for.
* @query: (out caller-allocates): A user provided structure that is * @query: (out caller-allocates) (not optional): A user provided structure that is
* filled in with constant values upon success. * filled in with constant values upon success.
* *
* Queries the signal system for in-depth information about a * Queries the signal system for in-depth information about a
@ -1454,8 +1454,8 @@ g_signal_query (guint signal_id,
* @class_offset: The offset of the function pointer in the class structure * @class_offset: The offset of the function pointer in the class structure
* for this type. Used to invoke a class method generically. Pass 0 to * for this type. Used to invoke a class method generically. Pass 0 to
* not associate a class method slot with this signal. * not associate a class method slot with this signal.
* @accumulator: the accumulator for this signal; may be %NULL. * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
* @accu_data: user data for the @accumulator. * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter * @c_marshaller: (nullable): the function to translate arrays of parameter
* values to signal emissions into C language callback invocations or %NULL. * values to signal emissions into C language callback invocations or %NULL.
* @return_type: the type of return value, or #G_TYPE_NONE for a signal * @return_type: the type of return value, or #G_TYPE_NONE for a signal
@ -1527,11 +1527,11 @@ g_signal_new (const gchar *signal_name,
* @signal_flags: a combination of #GSignalFlags specifying detail of when * @signal_flags: a combination of #GSignalFlags specifying detail of when
* the default handler is to be invoked. You should at least specify * the default handler is to be invoked. You should at least specify
* %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST. * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
* @class_handler: a #GCallback which acts as class implementation of * @class_handler: (nullable): a #GCallback which acts as class implementation of
* this signal. Used to invoke a class method generically. Pass %NULL to * this signal. Used to invoke a class method generically. Pass %NULL to
* not associate a class method with this signal. * not associate a class method with this signal.
* @accumulator: the accumulator for this signal; may be %NULL. * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
* @accu_data: user data for the @accumulator. * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter * @c_marshaller: (nullable): the function to translate arrays of parameter
* values to signal emissions into C language callback invocations or %NULL. * values to signal emissions into C language callback invocations or %NULL.
* @return_type: the type of return value, or #G_TYPE_NONE for a signal * @return_type: the type of return value, or #G_TYPE_NONE for a signal
@ -1668,15 +1668,15 @@ signal_add_class_closure (SignalNode *node,
* @class_closure: (nullable): The closure to invoke on signal emission; * @class_closure: (nullable): The closure to invoke on signal emission;
* may be %NULL * may be %NULL
* @accumulator: (nullable): the accumulator for this signal; may be %NULL * @accumulator: (nullable): the accumulator for this signal; may be %NULL
* @accu_data: user data for the @accumulator * @accu_data: (nullable): user data for the @accumulator
* @c_marshaller: (nullable): the function to translate arrays of * @c_marshaller: (nullable): the function to translate arrays of
* parameter values to signal emissions into C language callback * parameter values to signal emissions into C language callback
* invocations or %NULL * invocations or %NULL
* @return_type: the type of return value, or #G_TYPE_NONE for a signal * @return_type: the type of return value, or #G_TYPE_NONE for a signal
* without a return value * without a return value
* @n_params: the length of @param_types * @n_params: the length of @param_types
* @param_types: (array length=n_params): an array of types, one for * @param_types: (array length=n_params) (nullable): an array of types, one for
* each parameter * each parameter (may be %NULL if @n_params is zero)
* *
* Creates a new signal. (This is usually done in the class initializer.) * Creates a new signal. (This is usually done in the class initializer.)
* *
@ -1935,9 +1935,9 @@ g_signal_set_va_marshaller (guint signal_id,
* @signal_flags: a combination of #GSignalFlags specifying detail of when * @signal_flags: a combination of #GSignalFlags specifying detail of when
* the default handler is to be invoked. You should at least specify * the default handler is to be invoked. You should at least specify
* %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST. * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
* @class_closure: The closure to invoke on signal emission; may be %NULL. * @class_closure: (nullable): The closure to invoke on signal emission; may be %NULL.
* @accumulator: the accumulator for this signal; may be %NULL. * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
* @accu_data: user data for the @accumulator. * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter * @c_marshaller: (nullable): the function to translate arrays of parameter
* values to signal emissions into C language callback invocations or %NULL. * values to signal emissions into C language callback invocations or %NULL.
* @return_type: the type of return value, or #G_TYPE_NONE for a signal * @return_type: the type of return value, or #G_TYPE_NONE for a signal
@ -2366,7 +2366,8 @@ g_signal_chain_from_overridden_handler (gpointer instance,
* *
* Returns the invocation hint of the innermost signal emission of instance. * Returns the invocation hint of the innermost signal emission of instance.
* *
* Returns: (transfer none): the invocation hint of the innermost signal emission. * Returns: (transfer none) (nullable): the invocation hint of the innermost
* signal emission, or %NULL if not found.
*/ */
GSignalInvocationHint* GSignalInvocationHint*
g_signal_get_invocation_hint (gpointer instance) g_signal_get_invocation_hint (gpointer instance)
@ -2387,7 +2388,7 @@ g_signal_get_invocation_hint (gpointer instance)
* @instance: (type GObject.Object): the instance to connect to. * @instance: (type GObject.Object): the instance to connect to.
* @signal_id: the id of the signal. * @signal_id: the id of the signal.
* @detail: the detail. * @detail: the detail.
* @closure: the closure to connect. * @closure: (not nullable): the closure to connect.
* @after: whether the handler should be called before or after the * @after: whether the handler should be called before or after the
* default handler of the signal. * default handler of the signal.
* *
@ -2449,7 +2450,7 @@ g_signal_connect_closure_by_id (gpointer instance,
* g_signal_connect_closure: * g_signal_connect_closure:
* @instance: (type GObject.Object): the instance to connect to. * @instance: (type GObject.Object): the instance to connect to.
* @detailed_signal: a string of the form "signal-name::detail". * @detailed_signal: a string of the form "signal-name::detail".
* @closure: the closure to connect. * @closure: (not nullable): the closure to connect.
* @after: whether the handler should be called before or after the * @after: whether the handler should be called before or after the
* default handler of the signal. * default handler of the signal.
* *
@ -2540,9 +2541,9 @@ node_check_deprecated (const SignalNode *node)
* g_signal_connect_data: * g_signal_connect_data:
* @instance: (type GObject.Object): the instance to connect to. * @instance: (type GObject.Object): the instance to connect to.
* @detailed_signal: a string of the form "signal-name::detail". * @detailed_signal: a string of the form "signal-name::detail".
* @c_handler: the #GCallback to connect. * @c_handler: (not nullable): the #GCallback to connect.
* @data: data to pass to @c_handler calls. * @data: (nullable): data to pass to @c_handler calls.
* @destroy_data: a #GClosureNotify for @data. * @destroy_data: (nullable): a #GClosureNotify for @data.
* @connect_flags: a combination of #GConnectFlags. * @connect_flags: a combination of #GConnectFlags.
* *
* Connects a #GCallback function to a signal for a particular object. Similar * Connects a #GCallback function to a signal for a particular object. Similar
@ -2819,7 +2820,7 @@ g_signal_handlers_destroy (gpointer instance)
* @detail: Signal detail the handler has to be connected to. * @detail: Signal detail the handler has to be connected to.
* @closure: (nullable): The closure the handler will invoke. * @closure: (nullable): The closure the handler will invoke.
* @func: The C closure callback of the handler (useless for non-C closures). * @func: The C closure callback of the handler (useless for non-C closures).
* @data: The closure data of the handler's closure. * @data: (nullable): The closure data of the handler's closure.
* *
* Finds the first signal handler that matches certain selection criteria. * Finds the first signal handler that matches certain selection criteria.
* The criteria mask is passed as an OR-ed combination of #GSignalMatchType * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
@ -2899,7 +2900,7 @@ signal_handlers_foreach_matched_R (gpointer instance,
* @detail: Signal detail the handlers have to be connected to. * @detail: Signal detail the handlers have to be connected to.
* @closure: (nullable): The closure the handlers will invoke. * @closure: (nullable): The closure the handlers will invoke.
* @func: The C closure callback of the handlers (useless for non-C closures). * @func: The C closure callback of the handlers (useless for non-C closures).
* @data: The closure data of the handlers' closures. * @data: (nullable): The closure data of the handlers' closures.
* *
* Blocks all handlers on an instance that match a certain selection criteria. * Blocks all handlers on an instance that match a certain selection criteria.
* The criteria mask is passed as an OR-ed combination of #GSignalMatchType * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
@ -2946,7 +2947,7 @@ g_signal_handlers_block_matched (gpointer instance,
* @detail: Signal detail the handlers have to be connected to. * @detail: Signal detail the handlers have to be connected to.
* @closure: (nullable): The closure the handlers will invoke. * @closure: (nullable): The closure the handlers will invoke.
* @func: The C closure callback of the handlers (useless for non-C closures). * @func: The C closure callback of the handlers (useless for non-C closures).
* @data: The closure data of the handlers' closures. * @data: (nullable): The closure data of the handlers' closures.
* *
* Unblocks all handlers on an instance that match a certain selection * Unblocks all handlers on an instance that match a certain selection
* criteria. The criteria mask is passed as an OR-ed combination of * criteria. The criteria mask is passed as an OR-ed combination of
@ -2994,7 +2995,7 @@ g_signal_handlers_unblock_matched (gpointer instance,
* @detail: Signal detail the handlers have to be connected to. * @detail: Signal detail the handlers have to be connected to.
* @closure: (nullable): The closure the handlers will invoke. * @closure: (nullable): The closure the handlers will invoke.
* @func: The C closure callback of the handlers (useless for non-C closures). * @func: The C closure callback of the handlers (useless for non-C closures).
* @data: The closure data of the handlers' closures. * @data: (nullable): The closure data of the handlers' closures.
* *
* Disconnects all handlers on an instance that match a certain * Disconnects all handlers on an instance that match a certain
* selection criteria. The criteria mask is passed as an OR-ed * selection criteria. The criteria mask is passed as an OR-ed