Commit 6d6d7a8b authored by Allison Karlitskaya's avatar Allison Karlitskaya
Browse files

GVariantTypeInfo tweaks

  1) always emit ending type FIXED for fixed sized items

    The serialiser needs to know if it dealing with a fixed sized item
    in case the serialised data is corrupt and the item has the wrong

  2) add a macro that will be used by test cases to check that all
     memory has been freed.
parent cb7dfdc1
......@@ -362,10 +362,10 @@ tuple_allocate_members (const GVariantType *type,
member->type_info = g_variant_type_info_get (item_type);
item_type = g_variant_type_next (item_type);
if (item_type == NULL)
member->ending_type = G_VARIANT_MEMBER_ENDING_LAST;
else if (member->type_info->fixed_size)
if (member->type_info->fixed_size)
member->ending_type = G_VARIANT_MEMBER_ENDING_FIXED;
else if (item_type == NULL)
member->ending_type = G_VARIANT_MEMBER_ENDING_LAST;
member->ending_type = G_VARIANT_MEMBER_ENDING_OFFSET;
......@@ -848,3 +848,7 @@ g_variant_type_info_unref (GVariantTypeInfo *info)
/* used from the test cases */
#define assert_no_type_infos() \
g_assert_cmpint (g_hash_table_size (g_variant_type_info_table), ==, 0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment