Add G_VALUE_INIT

The implementation of GValue is not public or documented.  When
allocated on the stack, initializing a GValue is usually done as
documented with:

GValue value = { 0, };

There is lot code around (including WebKit) that added all the missing
fields, resulting in this ugly and non-obvious:

GValue value = { 0, { { 0 } } };

However, this doesn't play nice with -Wmissing-field-initializers for
example. Thus, G_VALUE_INIT.

http://bugzilla.gnome.org/show_bug.cgi?id=654793
http://bugzilla.gnome.org/show_bug.cgi?id=577231
This commit is contained in:
Marc-André Lureau
2011-07-17 21:18:04 +02:00
committed by Matthias Clasen
parent a9ca74efb1
commit d2ca14c270
3 changed files with 20 additions and 3 deletions

View File

@@ -376,6 +376,7 @@ g_variant_type_get_gtype
<SECTION>
<TITLE>Generic values</TITLE>
<FILE>generic_values</FILE>
G_VALUE_INIT
G_VALUE_HOLDS
G_VALUE_TYPE
G_VALUE_TYPE_NAME