From bc2ca9df20818621309595a67101c504c1d10e6c Mon Sep 17 00:00:00 2001 From: Alexander Klauer Date: Fri, 4 Mar 2022 11:29:58 +0000 Subject: [PATCH] Explain magic literals in G_VARIANT_*_INIT --- glib/gvariant.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/glib/gvariant.h b/glib/gvariant.h index 11c74d596..7ba586c61 100644 --- a/glib/gvariant.h +++ b/glib/gvariant.h @@ -362,7 +362,14 @@ GQuark g_variant_parse_error_quark (void); * * Since: 2.50 */ -#define G_VARIANT_BUILDER_INIT(variant_type) { { { 2942751021u, variant_type, { 0, } } } } +#define G_VARIANT_BUILDER_INIT(variant_type) \ + { \ + { \ + { \ + 2942751021u /* == GVSB_MAGIC_PARTIAL, see gvariant.c */, variant_type, { 0, } \ + } \ + } \ + } GLIB_AVAILABLE_IN_ALL GVariantBuilder * g_variant_builder_new (const GVariantType *type); @@ -478,7 +485,14 @@ struct _GVariantDict { * * Since: 2.50 */ -#define G_VARIANT_DICT_INIT(asv) { { { asv, 3488698669u, { 0, } } } } +#define G_VARIANT_DICT_INIT(asv) \ + { \ + { \ + { \ + asv, 3488698669u /* == GVSD_MAGIC_PARTIAL, see gvariant.c */, { 0, } \ + } \ + } \ + } GLIB_AVAILABLE_IN_2_40 GVariantDict * g_variant_dict_new (GVariant *from_asv);