From 110e507c3a304b4c904cfc4bd2328d5eec5bc91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 17 Oct 2020 19:59:39 +0300 Subject: [PATCH] Add various missing nullable annotations --- glib/gkeyfile.c | 2 +- glib/gmain.c | 6 +++--- gobject/gbinding.c | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index 7c81bf070..9d0215331 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -1693,7 +1693,7 @@ g_key_file_get_keys (GKeyFile *key_file, * * Returns the name of the start group of the file. * - * Returns: The start group of the key file. + * Returns: (nullable): The start group of the key file. * * Since: 2.6 **/ diff --git a/glib/gmain.c b/glib/gmain.c index 9871d6bfd..e67bf767d 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -884,7 +884,7 @@ g_main_context_pop_thread_default (GMainContext *context) * If you need to hold a reference on the context, use * g_main_context_ref_thread_default() instead. * - * Returns: (transfer none): the thread-default #GMainContext, or + * Returns: (transfer none) (nullable): the thread-default #GMainContext, or * %NULL if the thread-default context is the global default context. * * Since: 2.22 @@ -2112,7 +2112,7 @@ g_source_set_name (GSource *source, * Gets a name for the source, used in debugging and profiling. The * name may be #NULL if it has never been set with g_source_set_name(). * - * Returns: the name of the source + * Returns: (nullable): the name of the source * * Since: 2.26 **/ @@ -3098,7 +3098,7 @@ g_main_depth (void) * * Returns the currently firing source for this thread. * - * Returns: (transfer none): The currently firing source or %NULL. + * Returns: (transfer none) (nullable): The currently firing source or %NULL. * * Since: 2.12 */ diff --git a/gobject/gbinding.c b/gobject/gbinding.c index 015889b24..78a883075 100644 --- a/gobject/gbinding.c +++ b/gobject/gbinding.c @@ -754,7 +754,12 @@ g_binding_get_flags (GBinding *binding) * * Retrieves the #GObject instance used as the source of the binding. * - * Returns: (transfer none): the source #GObject + * A #GBinding can outlive the source #GObject as the binding does not hold a + * strong reference to the source. If the source is destroyed before the + * binding then this function will return %NULL. + * + * Returns: (transfer none) (nullable): the source #GObject, or %NULL if the + * source does not exist any more. * * Since: 2.26 */ @@ -772,7 +777,12 @@ g_binding_get_source (GBinding *binding) * * Retrieves the #GObject instance used as the target of the binding. * - * Returns: (transfer none): the target #GObject + * A #GBinding can outlive the target #GObject as the binding does not hold a + * strong reference to the target. If the target is destroyed before the + * binding then this function will return %NULL. + * + * Returns: (transfer none) (nullable): the target #GObject, or %NULL if the + * target does not exist any more. * * Since: 2.26 */