]> sigrok.org Git - libsigrok.git/commitdiff
std: std_gvar_tuple_array/_rational: Fix GVariantBuilder type.
authorGuido Trentalancia <redacted>
Sun, 18 Nov 2018 23:01:04 +0000 (00:01 +0100)
committerUwe Hermann <redacted>
Thu, 25 Jul 2019 22:10:35 +0000 (00:10 +0200)
Fix the type of container used to initialize the GVariantBuilder
structure which builds an array of tuples.

src/std.c

index cd3bdd0b33de3f4ec296d1e84e7ca18d8bafa3be..4e069702294d0a5d58344b5e3bf0c7fe2740d83c 100644 (file)
--- a/src/std.c
+++ b/src/std.c
@@ -624,7 +624,7 @@ SR_PRIV GVariant *std_gvar_tuple_array(const uint64_t a[][2], unsigned int n)
        GVariant *rational[2];
        GVariantBuilder gvb;
 
-       g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&gvb, G_VARIANT_TYPE_TUPLE);
 
        for (i = 0; i < n; i++) {
                rational[0] = g_variant_new_uint64(a[i][0]);
@@ -643,7 +643,7 @@ SR_PRIV GVariant *std_gvar_tuple_rational(const struct sr_rational *r, unsigned
        GVariant *rational[2];
        GVariantBuilder gvb;
 
-       g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
+       g_variant_builder_init(&gvb, G_VARIANT_TYPE_TUPLE);
 
        for (i = 0; i < n; i++) {
                rational[0] = g_variant_new_uint64(r[i].p);