gvariant: Re-use g_variant_serialised_check() to check alignment

Rather than duplicating the alignment checks when constructing a new
GVariant, re-use the alignment checks from GVariantSerialised. This
ensures that the same checks are done everywhere in the GVariant code.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1342
This commit is contained in:
Philip Withnall
2018-11-06 11:43:43 +00:00
parent 7b0f2e0e34
commit 409ff69bd1
3 changed files with 25 additions and 16 deletions

View File

@@ -55,6 +55,8 @@ void g_variant_serialiser_serialise (GVarian
gsize n_children);
/* misc */
GLIB_AVAILABLE_IN_2_60
gboolean g_variant_serialised_check (GVariantSerialised serialised);
GLIB_AVAILABLE_IN_ALL
gboolean g_variant_serialised_is_normal (GVariantSerialised value);
GLIB_AVAILABLE_IN_ALL