summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2011-09-30 16:31:04 +0100
committerJavier Jardón <jjardon@gnome.org>2011-10-15 16:45:16 +0100
commit0853ce3077d577a5062f224918a115a2e52803af (patch)
tree0a39d144628198ba8b7182456a03359470353f9a
parent616afadd78c945bb7ac73ff27417b6ff5d66bd05 (diff)
downloadgtk+-0853ce3077d577a5062f224918a115a2e52803af.tar.gz
Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
-rw-r--r--demos/gtk-demo/main.c2
-rw-r--r--gdk/x11/gdkscreen-x11.c2
-rw-r--r--gtk/a11y/gtkcomboboxaccessible.c2
-rw-r--r--gtk/a11y/gtktreeviewaccessible.c2
-rw-r--r--gtk/gtkbindings.c4
-rw-r--r--gtk/gtkcellarea.c10
-rw-r--r--gtk/gtkcelllayout.c2
-rw-r--r--gtk/gtkcellview.c6
-rw-r--r--gtk/gtkcontainer.c10
-rw-r--r--gtk/gtklabel.c4
-rw-r--r--gtk/gtkliststore.c4
-rw-r--r--gtk/gtkmodules.c2
-rw-r--r--gtk/gtkscale.c4
-rw-r--r--gtk/gtkscalebutton.c2
-rw-r--r--gtk/gtksettings.c12
-rw-r--r--gtk/gtkstyleproperties.c6
-rw-r--r--gtk/gtkstyleproperty.c2
-rw-r--r--gtk/gtktextbufferserialize.c8
-rw-r--r--gtk/gtktreedatalist.c4
-rw-r--r--gtk/gtktreemodel.c2
-rw-r--r--gtk/gtktreemodelfilter.c2
-rw-r--r--gtk/gtktreestore.c4
-rw-r--r--gtk/gtktreeview.c8
-rw-r--r--gtk/tests/builder.c2
-rw-r--r--gtk/tests/defaultvalue.c6
-rw-r--r--gtk/tests/object.c2
-rw-r--r--tests/a11y/accessibility-dump.c4
-rw-r--r--tests/prop-editor.c22
-rw-r--r--tests/testgtk.c4
-rw-r--r--tests/testmerge.c2
30 files changed, 73 insertions, 73 deletions
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 4406c71bdc..19c32c9e18 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -711,7 +711,7 @@ selection_cb (GtkTreeSelection *selection,
GtkTreeModel *model)
{
GtkTreeIter iter;
- GValue value = {0, };
+ GValue value = G_VALUE_INIT;
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
return;
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 64e488f6d1..97e363ab81 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -1117,7 +1117,7 @@ gdk_x11_screen_get_setting (GdkScreen *screen,
GdkX11Screen *x11_screen;
gboolean success = FALSE;
gint i;
- GValue tmp_val = { 0, };
+ GValue tmp_val = G_VALUE_INIT;
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
diff --git a/gtk/a11y/gtkcomboboxaccessible.c b/gtk/a11y/gtkcomboboxaccessible.c
index f25f787a7a..aacf35ad14 100644
--- a/gtk/a11y/gtkcomboboxaccessible.c
+++ b/gtk/a11y/gtkcomboboxaccessible.c
@@ -117,7 +117,7 @@ gtk_combo_box_accessible_get_name (AtkObject *obj)
n_columns = gtk_tree_model_get_n_columns (model);
for (i = 0; i < n_columns; i++)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gtk_tree_model_get_value (model, &iter, i, &value);
if (G_VALUE_HOLDS_STRING (&value))
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 616ce5a5a3..f78f37621a 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -2442,7 +2442,7 @@ update_cell_value (GtkRendererCellAccessible *renderer_cell,
if (spec != NULL)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, spec->value_type);
g_object_get_property (cur_renderer->data, *prop_list, &value);
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index 9b2e67b4bd..5c5144cb9b 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -479,7 +479,7 @@ binding_compose_params (GObject *object,
valid = TRUE;
for (i = 1; i < query->n_params + 1 && valid; i++)
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
g_value_init (params, *types);
@@ -602,7 +602,7 @@ gtk_binding_entry_activate (GtkBindingEntry *entry,
GSignalQuery query;
guint signal_id;
GValue *params = NULL;
- GValue return_val = { 0, };
+ GValue return_val = G_VALUE_INIT;
gchar *accelerator = NULL;
signal_id = g_signal_lookup (sig->signal_name, G_OBJECT_TYPE (object));
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c
index 9764448cba..bb805ee3ea 100644
--- a/gtk/gtkcellarea.c
+++ b/gtk/gtkcellarea.c
@@ -1250,7 +1250,7 @@ apply_cell_attributes (GtkCellRenderer *renderer,
{
CellAttribute *attribute;
GSList *list;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gboolean is_expander;
gboolean is_expanded;
@@ -2602,7 +2602,7 @@ area_set_cell_property (GtkCellArea *area,
GParamSpec *pspec,
const GValue *value)
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
GtkCellAreaClass *class = g_type_class_peek (pspec->owner_type);
/* provide a copy to work from, convert (if necessary) and validate */
@@ -2656,7 +2656,7 @@ gtk_cell_area_cell_set_valist (GtkCellArea *area,
name = first_property_name;
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gchar *error = NULL;
GParamSpec *pspec =
g_param_spec_pool_lookup (cell_property_pool, name,
@@ -2718,7 +2718,7 @@ gtk_cell_area_cell_get_valist (GtkCellArea *area,
name = first_property_name;
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
GParamSpec *pspec;
gchar *error;
@@ -2824,7 +2824,7 @@ gtk_cell_area_cell_get_property (GtkCellArea *area,
G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (area));
else
{
- GValue *prop_value, tmp_value = { 0, };
+ GValue *prop_value, tmp_value = G_VALUE_INIT;
/* auto-conversion of the callers value type
*/
diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c
index d3870a0526..248acea95c 100644
--- a/gtk/gtkcelllayout.c
+++ b/gtk/gtkcelllayout.c
@@ -711,7 +711,7 @@ gtk_cell_layout_buildable_set_cell_property (GtkCellArea *area,
const gchar *value)
{
GParamSpec *pspec;
- GValue gvalue = { 0, };
+ GValue gvalue = G_VALUE_INIT;
GError *error = NULL;
pspec = gtk_cell_area_class_find_cell_property (GTK_CELL_AREA_GET_CLASS (area), name);
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index 09e583f732..3299eb2afd 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -987,7 +987,7 @@ gtk_cell_view_new_with_text (const gchar *text)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
- GValue value = {0, };
+ GValue value = G_VALUE_INIT;
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
@@ -1021,7 +1021,7 @@ gtk_cell_view_new_with_markup (const gchar *markup)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
- GValue value = {0, };
+ GValue value = G_VALUE_INIT;
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
@@ -1053,7 +1053,7 @@ gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
- GValue value = {0, };
+ GValue value = G_VALUE_INIT;
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 7ada895fc4..b950b71b42 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -553,7 +553,7 @@ gtk_container_buildable_set_child_property (GtkContainer *container,
const gchar *value)
{
GParamSpec *pspec;
- GValue gvalue = { 0, };
+ GValue gvalue = G_VALUE_INIT;
GError *error = NULL;
pspec = gtk_container_class_find_child_property
@@ -847,7 +847,7 @@ container_set_child_property (GtkContainer *container,
const GValue *value,
GObjectNotifyQueue *nqueue)
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
GtkContainerClass *class = g_type_class_peek (pspec->owner_type);
/* provide a copy to work from, convert (if necessary) and validate */
@@ -903,7 +903,7 @@ gtk_container_child_get_valist (GtkContainer *container,
name = first_property_name;
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
GParamSpec *pspec;
gchar *error;
@@ -983,7 +983,7 @@ gtk_container_child_get_property (GtkContainer *container,
G_OBJECT_TYPE_NAME (container));
else
{
- GValue *prop_value, tmp_value = { 0, };
+ GValue *prop_value, tmp_value = G_VALUE_INIT;
/* auto-conversion of the callers value type
*/
@@ -1047,7 +1047,7 @@ gtk_container_child_set_valist (GtkContainer *container,
name = first_property_name;
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gchar *error = NULL;
GParamSpec *pspec = g_param_spec_pool_lookup (_gtk_widget_child_property_pool,
name,
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 35467490fd..7035da484f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1285,7 +1285,7 @@ attribute_from_text (GtkBuilder *builder,
PangoLanguage *language;
PangoFontDescription *font_desc;
GdkColor *color;
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
if (!gtk_builder_value_from_string_type (builder, PANGO_TYPE_ATTR_TYPE, name, &val, error))
return NULL;
@@ -1441,7 +1441,7 @@ pango_start_element (GMarkupParseContext *context,
GError **error)
{
PangoParserData *data = (PangoParserData*)user_data;
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
guint i;
gint line_number, char_number;
diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c
index 9fd2dca40b..907b50e990 100644
--- a/gtk/gtkliststore.c
+++ b/gtk/gtkliststore.c
@@ -838,7 +838,7 @@ gtk_list_store_real_set_value (GtkListStore *list_store,
GtkTreeDataList *list;
GtkTreeDataList *prev;
gint old_column = column;
- GValue real_value = {0, };
+ GValue real_value = G_VALUE_INIT;
gboolean converted = FALSE;
gboolean retval = FALSE;
@@ -1036,7 +1036,7 @@ gtk_list_store_set_valist_internal (GtkListStore *list_store,
while (column != -1)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gchar *error = NULL;
if (column < 0 || column >= priv->n_columns)
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
index e237fa76ba..451b3fbf5f 100644
--- a/gtk/gtkmodules.c
+++ b/gtk/gtkmodules.c
@@ -510,7 +510,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
for (i = 0; i < gdk_display_get_n_screens (display); i++)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_STRING);
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 4effb04f0c..69c54e40d0 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1637,7 +1637,7 @@ marks_start_element (GMarkupParseContext *context,
msg_context = values[i];
else if (strcmp (names[i], "value") == 0)
{
- GValue gvalue = { 0, };
+ GValue gvalue = G_VALUE_INIT;
if (!gtk_builder_value_from_string_type (parser_data->builder, G_TYPE_DOUBLE, values[i], &gvalue, error))
return;
@@ -1647,7 +1647,7 @@ marks_start_element (GMarkupParseContext *context,
}
else if (strcmp (names[i], "position") == 0)
{
- GValue gvalue = { 0, };
+ GValue gvalue = G_VALUE_INIT;
if (!gtk_builder_value_from_string_type (parser_data->builder, GTK_TYPE_POSITION_TYPE, values[i], &gvalue, error))
return;
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index bd3157ad19..b6c10f4294 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -873,7 +873,7 @@ gtk_scale_button_screen_changed (GtkWidget *widget,
GtkScaleButton *button = (GtkScaleButton *) widget;
GtkScaleButtonPrivate *priv;
GdkScreen *screen;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
if (gtk_widget_has_screen (widget) == FALSE)
return;
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 495b6851da..a312d2219a 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1583,7 +1583,7 @@ gtk_settings_get_property (GObject *object,
}
else
{
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
/* Try to get xsetting as a string and parse it. */
@@ -1596,8 +1596,8 @@ gtk_settings_get_property (GObject *object,
}
else
{
- GValue tmp_value = { 0, };
- GValue gstring_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
+ GValue gstring_value = G_VALUE_INIT;
GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser);
g_value_init (&gstring_value, G_TYPE_GSTRING);
@@ -1759,7 +1759,7 @@ apply_queued_setting (GtkSettings *settings,
GtkSettingsValuePrivate *qvalue)
{
GtkSettingsPrivate *priv = settings->priv;
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser);
g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
@@ -2411,7 +2411,7 @@ _gtk_settings_handle_event (GdkEventSetting *event)
if (property_id == PROP_COLOR_SCHEME)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_STRING);
if (!gdk_screen_get_setting (screen, pspec->name, &value))
@@ -2699,7 +2699,7 @@ settings_update_color_scheme (GtkSettings *settings)
{
GtkSettingsPrivate *priv = settings->priv;
ColorSchemeData *data;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
data = g_slice_new0 (ColorSchemeData);
data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 24837d55dc..f3946f8659 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -584,7 +584,7 @@ gtk_style_properties_set_valist (GtkStyleProperties *props,
{
const GtkStyleProperty *node;
gchar *error = NULL;
- GValue val = { 0 };
+ GValue val = G_VALUE_INIT;
node = _gtk_style_property_lookup (property_name);
@@ -756,7 +756,7 @@ gtk_style_properties_get_valist (GtkStyleProperties *props,
}
else if (_gtk_style_property_is_shorthand (node))
{
- GValue packed = { 0 };
+ GValue packed = G_VALUE_INIT;
g_value_init (&packed, node->pspec->value_type);
_gtk_style_property_pack (node, props, state, &packed);
@@ -765,7 +765,7 @@ gtk_style_properties_get_valist (GtkStyleProperties *props,
}
else
{
- GValue default_value = { 0 };
+ GValue default_value = G_VALUE_INIT;
g_value_init (&default_value, node->pspec->value_type);
_gtk_style_property_default_value (node, props, state, &default_value);
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 35280787f4..05ffbf3426 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -1201,7 +1201,7 @@ border_image_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
- GValue temp = { 0, };
+ GValue temp = G_VALUE_INIT;
cairo_pattern_t *pattern = NULL;
GtkGradient *gradient = NULL;
GtkBorder slice, *width = NULL, *parsed_slice;
diff --git a/gtk/gtktextbufferserialize.c b/gtk/gtktextbufferserialize.c
index e4b4f73006..c750a80f0a 100644
--- a/gtk/gtktextbufferserialize.c
+++ b/gtk/gtktextbufferserialize.c
@@ -54,7 +54,7 @@ serialize_value (GValue *value)
{
if (g_value_type_transformable (value->g_type, G_TYPE_STRING))
{
- GValue text_value = { 0 };
+ GValue text_value = G_VALUE_INIT;
gchar *tmp;
g_value_init (&text_value, G_TYPE_STRING);
@@ -85,7 +85,7 @@ deserialize_value (const gchar *str,
{
if (g_value_type_transformable (G_TYPE_STRING, value->g_type))
{
- GValue text_value = { 0 };
+ GValue text_value = G_VALUE_INIT;
gboolean retval;
g_value_init (&text_value, G_TYPE_STRING);
@@ -313,7 +313,7 @@ serialize_tag (gpointer key,
for (i = 0; i < n_pspecs; i++)
{
- GValue value = { 0 };
+ GValue value = G_VALUE_INIT;
gchar *tmp, *tmp2;
if (!(pspecs[i]->flags & G_PARAM_READABLE) ||
@@ -1164,7 +1164,7 @@ parse_attr_element (GMarkupParseContext *context,
{
const gchar *name, *type, *value;
GType gtype;
- GValue gvalue = { 0 };
+ GValue gvalue = G_VALUE_INIT;
GParamSpec *pspec;
g_assert (peek_state (info) == STATE_TAG);
diff --git a/gtk/gtktreedatalist.c b/gtk/gtktreedatalist.c
index b9c4de0dfa..28ee29cfc4 100644
--- a/gtk/gtktreedatalist.c
+++ b/gtk/gtktreedatalist.c
@@ -326,8 +326,8 @@ _gtk_tree_data_list_compare_func (GtkTreeModel *model,
{
gint column = GPOINTER_TO_INT (user_data);
GType type = gtk_tree_model_get_column_type (model, column);
- GValue a_value = {0, };
- GValue b_value = {0, };
+ GValue a_value = G_VALUE_INIT;
+ GValue b_value = G_VALUE_INIT;
gint retval;
const gchar *stra, *strb;
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index 32b0626d4d..584e3512f8 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -1754,7 +1754,7 @@ gtk_tree_model_get_valist (GtkTreeModel *tree_model,
while (column != -1)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gchar *error = NULL;
if (column >= gtk_tree_model_get_n_columns (tree_model))
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index daa490bdab..d3877a57af 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -1264,7 +1264,7 @@ gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter,
}
else if (filter->priv->visible_column >= 0)
{
- GValue val = {0, };
+ GValue val = G_VALUE_INIT;
gtk_tree_model_get_value (child_model, child_iter,
filter->priv->visible_column, &val);
diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index c8ffb9cdd5..c427f2c2fd 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -849,7 +849,7 @@ gtk_tree_store_real_set_value (GtkTreeStore *tree_store,
GtkTreeDataList *list;
GtkTreeDataList *prev;
gint old_column = column;
- GValue real_value = { 0, };
+ GValue real_value = G_VALUE_INIT;
gboolean converted = FALSE;
gboolean retval = FALSE;
@@ -1040,7 +1040,7 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
while (column != -1)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
gchar *error = NULL;
if (column < 0 || column >= priv->n_columns)
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index fe5f598386..f7c5444682 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -15300,8 +15300,8 @@ gtk_tree_view_search_equal_func (GtkTreeModel *model,
gchar *normalized_key;
gchar *case_normalized_string = NULL;
gchar *case_normalized_key = NULL;
- GValue value = {0,};
- GValue transformed = {0,};
+ GValue value = G_VALUE_INIT;
+ GValue transformed = G_VALUE_INIT;
gtk_tree_model_get_value (model, iter, column, &value);
@@ -16329,8 +16329,8 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget,
GtkTooltip *tooltip,
gpointer data)
{
- GValue value = { 0, };
- GValue transformed = { 0, };
+ GValue value = G_VALUE_INIT;
+ GValue transformed = G_VALUE_INIT;
GtkTreeIter iter;
GtkTreePath *path;
GtkTreeModel *model;
diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c
index 3abc5b1ed7..082b69a12a 100644
--- a/gtk/tests/builder.c
+++ b/gtk/tests/builder.c
@@ -1721,7 +1721,7 @@ test_window (void)
static void
test_value_from_string (void)
{
- GValue value = { 0 };
+ GValue value = G_VALUE_INIT;
GError *error = NULL;
GtkBuilder *builder;
diff --git a/gtk/tests/defaultvalue.c b/gtk/tests/defaultvalue.c
index 22301a16f2..5392de9b4a 100644
--- a/gtk/tests/defaultvalue.c
+++ b/gtk/tests/defaultvalue.c
@@ -27,7 +27,7 @@ check_property (const char *output,
GParamSpec *pspec,
GValue *value)
{
- GValue default_value = { 0, };
+ GValue default_value = G_VALUE_INIT;
char *v, *dv, *msg;
if (g_param_value_defaults (pspec, value))
@@ -103,7 +103,7 @@ test_type (gconstpointer data)
for (i = 0; i < n_pspecs; ++i)
{
GParamSpec *pspec = pspecs[i];
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
if (pspec->owner_type != type)
continue;
@@ -298,7 +298,7 @@ test_type (gconstpointer data)
for (i = 0; i < n_pspecs; ++i)
{
GParamSpec *pspec = pspecs[i];
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
if (pspec->owner_type != type)
continue;
diff --git a/gtk/tests/object.c b/gtk/tests/object.c
index 4a38f005fe..6fda7722d7 100644
--- a/gtk/tests/object.c
+++ b/gtk/tests/object.c
@@ -212,7 +212,7 @@ object_test_property (GObject *object,
if (pspec->flags & G_PARAM_WRITABLE &&
!(pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
guint i;
const IgnoreProperty *ignore_properties;
/* select value to set */
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index 09019978f0..b2c79f85ee 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -426,8 +426,8 @@ dump_atk_value (AtkValue *atk_value,
guint depth,
GString *string)
{
- GValue value = { 0, };
- GValue svalue = { 0, };
+ GValue value = G_VALUE_INIT;
+ GValue svalue = G_VALUE_INIT;
g_string_append_printf (string, "%*s<AtkValue>\n", depth, "");
diff --git a/tests/prop-editor.c b/tests/prop-editor.c
index 1abac95377..22a6c893b3 100644
--- a/tests/prop-editor.c
+++ b/tests/prop-editor.c
@@ -184,7 +184,7 @@ static void
int_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_INT);
@@ -221,7 +221,7 @@ static void
uint_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_UINT);
get_property_value (object, pspec, &val);
@@ -257,7 +257,7 @@ static void
float_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_FLOAT);
get_property_value (object, pspec, &val);
@@ -293,7 +293,7 @@ static void
double_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_DOUBLE);
get_property_value (object, pspec, &val);
@@ -332,7 +332,7 @@ static void
string_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkEntry *entry = GTK_ENTRY (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
const gchar *str;
const gchar *text;
@@ -377,7 +377,7 @@ bool_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkToggleButton *tb = GTK_TOGGLE_BUTTON (data);
GtkWidget *child;
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_BOOLEAN);
get_property_value (object, pspec, &val);
@@ -425,7 +425,7 @@ static void
enum_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkComboBox *cb = GTK_COMBO_BOX (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
GEnumClass *eclass;
gint i;
@@ -499,7 +499,7 @@ static void
flags_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GList *children, *c;
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
GFlagsClass *fclass;
guint flags;
gint i;
@@ -559,7 +559,7 @@ unichar_changed (GObject *object, GParamSpec *pspec, gpointer data)
GtkEntry *entry = GTK_ENTRY (data);
gunichar new_val;
gunichar old_val = unichar_get_value (entry);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
gchar buf[7];
gint len;
@@ -684,7 +684,7 @@ static void
color_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkColorButton *cb = GTK_COLOR_BUTTON (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
GdkRGBA *color;
GdkRGBA cb_color;
@@ -730,7 +730,7 @@ static void
font_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkFontChooser *fb = GTK_FONT_CHOOSER (data);
- GValue val = { 0, };
+ GValue val = G_VALUE_INIT;
const PangoFontDescription *font_desc;
PangoFontDescription *fb_font_desc;
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 943a7653a1..2680f96968 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -6077,7 +6077,7 @@ void
toggle_resize (GtkWidget *widget, GtkWidget *child)
{
GtkContainer *container = GTK_CONTAINER (gtk_widget_get_parent (child));
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_BOOLEAN);
gtk_container_child_get_property (container, child, "resize", &value);
g_value_set_boolean (&value, !g_value_get_boolean (&value));
@@ -6088,7 +6088,7 @@ void
toggle_shrink (GtkWidget *widget, GtkWidget *child)
{
GtkContainer *container = GTK_CONTAINER (gtk_widget_get_parent (child));
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_BOOLEAN);
gtk_container_child_get_property (container, child, "shrink", &value);
g_value_set_boolean (&value, !g_value_get_boolean (&value));
diff --git a/tests/testmerge.c b/tests/testmerge.c
index 82c79496bf..0c14583720 100644
--- a/tests/testmerge.c
+++ b/tests/testmerge.c
@@ -364,7 +364,7 @@ iter_compare_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- GValue a_value = { 0, }, b_value = { 0, };
+ GValue a_value = G_VALUE_INIT, b_value = G_VALUE_INIT;
GtkAction *a_action, *b_action;
const gchar *a_name, *b_name;
gint retval = 0;