[glib] g_variant_get_strv: support objects and signatures



commit 7026365db22a12b7606bf1e2defac803b359cf68
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Mar 5 06:10:01 2010 -0500

    g_variant_get_strv: support objects and signatures

 glib/gvariant.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 4cb6220..4f2b560 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -1211,7 +1211,10 @@ g_variant_get_strv (GVariant *value,
   gsize n;
   gsize i;
 
-  TYPE_CHECK (value, G_VARIANT_TYPE ("as"), NULL);
+  g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("as")) ||
+                        g_variant_is_of_type (value, G_VARIANT_TYPE ("ao")) ||
+                        g_variant_is_of_type (value, G_VARIANT_TYPE ("ag")),
+                        NULL);
 
   g_variant_get_data (value);
   n = g_variant_n_children (value);
@@ -1260,7 +1263,10 @@ g_variant_dup_strv (GVariant *value,
   gsize n;
   gsize i;
 
-  TYPE_CHECK (value, G_VARIANT_TYPE ("as"), NULL);
+  g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("as")) ||
+                        g_variant_is_of_type (value, G_VARIANT_TYPE ("ao")) ||
+                        g_variant_is_of_type (value, G_VARIANT_TYPE ("ag")),
+                        NULL);
 
   n = g_variant_n_children (value);
   strv = g_new (gchar *, n + 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]