[glib: 3/4] gsignal: Add missing (transfer) and (nullable) return annotations
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/4] gsignal: Add missing (transfer) and (nullable) return annotations
- Date: Sat, 12 Dec 2020 00:04:33 +0000 (UTC)
commit 181a12c393fbd4856b29998047592b3d0571a004
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri Dec 11 23:49:30 2020 +0000
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
gobject/gsignal.c | 53 +++++++++++++++++++++++++++--------------------------
1 file changed, 27 insertions(+), 26 deletions(-)
---
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 41599eb0d..81d2834b9 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -1035,9 +1035,9 @@ signal_finalize_hook (GHookList *hook_list,
* g_signal_add_emission_hook:
* @signal_id: the signal identifier, as returned by g_signal_lookup().
* @detail: the detail on which to call the hook.
- * @hook_func: a #GSignalEmissionHook function.
- * @hook_data: user data for @hook_func.
- * @data_destroy: a #GDestroyNotify for @hook_data.
+ * @hook_func: (not nullable): a #GSignalEmissionHook function.
+ * @hook_data: (nullable): user data for @hook_func.
+ * @data_destroy: (nullable): a #GDestroyNotify for @hook_data.
*
* 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
@@ -1389,7 +1389,7 @@ g_signal_list_ids (GType itype,
*
* 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 *
g_signal_name (guint signal_id)
@@ -1408,7 +1408,7 @@ g_signal_name (guint signal_id)
/**
* g_signal_query:
* @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.
*
* 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
* for this type. Used to invoke a class method generically. Pass 0 to
* not associate a class method slot with this signal.
- * @accumulator: the accumulator for this signal; may be %NULL.
- * @accu_data: user data for the @accumulator.
+ * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
+ * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter
* 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
@@ -1527,11 +1527,11 @@ g_signal_new (const gchar *signal_name,
* @signal_flags: a combination of #GSignalFlags specifying detail of when
* the default handler is to be invoked. You should at least specify
* %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
* not associate a class method with this signal.
- * @accumulator: the accumulator for this signal; may be %NULL.
- * @accu_data: user data for the @accumulator.
+ * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
+ * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter
* 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
@@ -1668,15 +1668,15 @@ signal_add_class_closure (SignalNode *node,
* @class_closure: (nullable): The closure to invoke on signal emission;
* 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 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
* without a return value
* @n_params: the length of @param_types
- * @param_types: (array length=n_params): an array of types, one for
- * each parameter
+ * @param_types: (array length=n_params) (nullable): an array of types, one for
+ * each parameter (may be %NULL if @n_params is zero)
*
* 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
* the default handler is to be invoked. You should at least specify
* %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
- * @class_closure: The closure to invoke on signal emission; may be %NULL.
- * @accumulator: the accumulator for this signal; may be %NULL.
- * @accu_data: user data for the @accumulator.
+ * @class_closure: (nullable): The closure to invoke on signal emission; may be %NULL.
+ * @accumulator: (nullable): the accumulator for this signal; may be %NULL.
+ * @accu_data: (nullable): user data for the @accumulator.
* @c_marshaller: (nullable): the function to translate arrays of parameter
* 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
@@ -2366,7 +2366,8 @@ g_signal_chain_from_overridden_handler (gpointer 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*
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.
* @signal_id: the id of the signal.
* @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
* default handler of the signal.
*
@@ -2449,7 +2450,7 @@ g_signal_connect_closure_by_id (gpointer instance,
* g_signal_connect_closure:
* @instance: (type GObject.Object): the instance to connect to.
* @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
* default handler of the signal.
*
@@ -2540,9 +2541,9 @@ node_check_deprecated (const SignalNode *node)
* g_signal_connect_data:
* @instance: (type GObject.Object): the instance to connect to.
* @detailed_signal: a string of the form "signal-name::detail".
- * @c_handler: the #GCallback to connect.
- * @data: data to pass to @c_handler calls.
- * @destroy_data: a #GClosureNotify for @data.
+ * @c_handler: (not nullable): the #GCallback to connect.
+ * @data: (nullable): data to pass to @c_handler calls.
+ * @destroy_data: (nullable): a #GClosureNotify for @data.
* @connect_flags: a combination of #GConnectFlags.
*
* 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.
* @closure: (nullable): The closure the handler will invoke.
* @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.
* 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.
* @closure: (nullable): The closure the handlers will invoke.
* @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.
* 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.
* @closure: (nullable): The closure the handlers will invoke.
* @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
* 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.
* @closure: (nullable): The closure the handlers will invoke.
* @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
* selection criteria. The criteria mask is passed as an OR-ed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]