GVariant: Add a G_VARIANT_BUILDER_INIT macro

The macro could be used at initialization time to avoid having an
unitialized builder, especially with g_auto variables.

The macro tries to be a bit more type-safe by making sure that the
variant_type parameter is actually "const GVariantType
*". Unfortunately I have no idea how to make it possible to also pass
a "const gchar *" parameter without warning.

https://bugzilla.gnome.org/show_bug.cgi?id=766370
This commit is contained in:
Krzesimir Nowak
2016-05-13 17:55:30 +02:00
committed by Matthias Clasen
parent e0e652e403
commit e1c640f819
4 changed files with 87 additions and 7 deletions

View File

@@ -3329,6 +3329,7 @@ g_variant_iter_next
g_variant_iter_loop
<SUBSECTION>
G_VARIANT_BUILDER_INIT
GVariantBuilder
g_variant_builder_unref
g_variant_builder_ref