From 36826661401f1912eef8c710609f4bd6454720ad Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Wed, 2 Jun 2010 16:05:13 +0200 Subject: [PATCH] Annotate GVariant and GSettings _strv() functions Add GObject introspection annotations so that the length parameter is correctly detected for g_variant_new_strv(), g_variant_get_strv() and g_variant_dup_strv(). Also specify that it can be a NULL pointer in g_variant_get_strv() and g_variant_dup_strv(). For g_settings_set_strv(), detect that a NULL value is allowed, meaning empty array. Closes bug #620384. Signed-off-by: Ryan Lortie --- gio/gsettings.c | 2 +- glib/gvariant.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gio/gsettings.c b/gio/gsettings.c index 373b703..6ad842a 100644 --- a/gio/gsettings.c +++ b/gio/gsettings.c @@ -1833,7 +1833,7 @@ g_settings_get_strv (GSettings *settings, * g_settings_set_strv: * @settings: a #GSettings object * @key: the name of the key to set - * @value: the value to set it to, or %NULL + * @value: (allow-none): the value to set it to, or %NULL * @returns: %TRUE if setting the key succeeded, * %FALSE if the key was not writable * diff --git a/glib/gvariant.c b/glib/gvariant.c index 0863f37..9dca0d0 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -1244,7 +1244,7 @@ g_variant_get_byte_array (GVariant *value, * g_variant_new_strv: * @strv: an array of strings * @length: the length of @strv, or -1 - * @returns: a new floating #GVariant instance + * @returns: (array length=length): a new floating #GVariant instance * * Constructs an array of strings #GVariant from the given array of * strings. @@ -1277,8 +1277,8 @@ g_variant_new_strv (const gchar * const *strv, /** * g_variant_get_strv: * @value: an array of strings #GVariant - * @length: the length of the result, or %NULL - * @returns: an array of constant strings + * @length: (allow-none): the length of the result, or %NULL + * @returns: (array length=length): an array of constant strings * * Gets the contents of an array of strings #GVariant. This call * makes a shallow copy; the return result should be released with @@ -1329,8 +1329,8 @@ g_variant_get_strv (GVariant *value, /** * g_variant_dup_strv: * @value: an array of strings #GVariant - * @length: the length of the result, or %NULL - * @returns: an array of constant strings + * @length: (allow-none): the length of the result, or %NULL + * @returns: (array length=length): an array of constant strings * * Gets the contents of an array of strings #GVariant. This call * makes a deep copy; the return result should be released with -- 2.7.4