Add G_VALUE_INIT
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Sun, 17 Jul 2011 19:18:04 +0000 (21:18 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 13 Aug 2011 22:16:44 +0000 (18:16 -0400)
commitd2ca14c270a8a0c01d8a897fad4ea2a9c2e31105
treeb0421380d3f30d40db3d24c6bec447c30e172961
parenta9ca74efb11bda0a90f482a44bb2ec214744ecc6
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
docs/reference/gobject/gobject-sections.txt
gobject/gvalue.c
gobject/gvalue.h