[gtk+] Fix compiler warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix compiler warnings
- Date: Tue, 2 Jun 2015 13:10:04 +0000 (UTC)
commit 00236c0d216edd758c1b33da9352d3a53dbc898e
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 30 21:21:00 2015 -0400
Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
gtk/deprecated/gtkrc.c | 4 ----
gtk/deprecated/gtkrecentaction.c | 5 ++---
gtk/deprecated/gtkstyleproperties.c | 19 +++++++++----------
gtk/deprecated/gtktable.c | 8 ++++----
gtk/deprecated/gtkuimanager.c | 6 +++---
5 files changed, 18 insertions(+), 24 deletions(-)
---
diff --git a/gtk/deprecated/gtkrc.c b/gtk/deprecated/gtkrc.c
index 5a6dc9f..2d48449 100644
--- a/gtk/deprecated/gtkrc.c
+++ b/gtk/deprecated/gtkrc.c
@@ -1090,8 +1090,6 @@ gtk_rc_style_finalize (GObject *object)
if (rc_style->rc_properties)
{
- guint i;
-
for (i = 0; i < rc_style->rc_properties->len; i++)
{
GtkRcProperty *node = &g_array_index (rc_style->rc_properties, GtkRcProperty, i);
@@ -1280,8 +1278,6 @@ gtk_rc_style_real_merge (GtkRcStyle *dest,
if (src->rc_properties)
{
- guint i;
-
for (i = 0; i < src->rc_properties->len; i++)
insert_rc_property (dest,
&g_array_index (src->rc_properties, GtkRcProperty, i),
diff --git a/gtk/deprecated/gtkrecentaction.c b/gtk/deprecated/gtkrecentaction.c
index 394aa6d..782d177 100644
--- a/gtk/deprecated/gtkrecentaction.c
+++ b/gtk/deprecated/gtkrecentaction.c
@@ -154,9 +154,8 @@ gtk_recent_action_unselect_uri (GtkRecentChooser *chooser,
for (l = priv->choosers; l; l = l->next)
{
- GtkRecentChooser *chooser = l->data;
-
- gtk_recent_chooser_unselect_uri (chooser, uri);
+ GtkRecentChooser *c = l->data;
+ gtk_recent_chooser_unselect_uri (c, uri);
}
}
diff --git a/gtk/deprecated/gtkstyleproperties.c b/gtk/deprecated/gtkstyleproperties.c
index 291260d..7e0cc38 100644
--- a/gtk/deprecated/gtkstyleproperties.c
+++ b/gtk/deprecated/gtkstyleproperties.c
@@ -317,7 +317,7 @@ gtk_style_properties_provider_lookup (GtkStyleProviderPrivate *provider,
{
GtkCssStyleProperty *prop = key;
PropertyData *data = value;
- GtkCssValue *value;
+ GtkCssValue *val;
guint id;
id = _gtk_css_style_property_get_id (prop);
@@ -325,11 +325,11 @@ gtk_style_properties_provider_lookup (GtkStyleProviderPrivate *provider,
if (!_gtk_css_lookup_is_missing (lookup, id))
continue;
- value = property_data_match_state (data, _gtk_css_matcher_get_state (matcher));
- if (value == NULL)
+ val = property_data_match_state (data, _gtk_css_matcher_get_state (matcher));
+ if (val == NULL)
continue;
- _gtk_css_lookup_set (lookup, id, NULL, value);
+ _gtk_css_lookup_set (lookup, id, NULL, val);
}
if (change)
@@ -846,7 +846,7 @@ gtk_style_properties_merge (GtkStyleProperties *props,
{
GtkStylePropertiesPrivate *priv, *priv_to_merge;
GHashTableIter iter;
- gpointer key, value;
+ gpointer key, val;
g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props_to_merge));
@@ -859,13 +859,13 @@ gtk_style_properties_merge (GtkStyleProperties *props,
{
g_hash_table_iter_init (&iter, priv_to_merge->color_map);
- while (g_hash_table_iter_next (&iter, &key, &value))
+ while (g_hash_table_iter_next (&iter, &key, &val))
{
const gchar *name;
GtkSymbolicColor *color;
name = key;
- color = value;
+ color = val;
if (!replace &&
g_hash_table_lookup (priv->color_map, name))
@@ -878,9 +878,9 @@ gtk_style_properties_merge (GtkStyleProperties *props,
/* Merge symbolic style properties */
g_hash_table_iter_init (&iter, priv_to_merge->properties);
- while (g_hash_table_iter_next (&iter, &key, &value))
+ while (g_hash_table_iter_next (&iter, &key, &val))
{
- PropertyData *prop_to_merge = value;
+ PropertyData *prop_to_merge = val;
PropertyData *prop;
guint i;
@@ -926,7 +926,6 @@ gtk_style_properties_merge (GtkStyleProperties *props,
value->value != NULL)
{
GPtrArray *array, *array_to_merge;
- gint i;
/* Append the array, mainly thought
* for the gtk-key-bindings property
diff --git a/gtk/deprecated/gtktable.c b/gtk/deprecated/gtktable.c
index 94fa5ba..46c5853 100644
--- a/gtk/deprecated/gtktable.c
+++ b/gtk/deprecated/gtktable.c
@@ -1792,10 +1792,10 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
for (col = 0; col < priv->ncols; col++)
if (priv->cols[col].shrink)
{
- gint allocation = priv->cols[col].allocation;
+ gint alloc = priv->cols[col].allocation;
priv->cols[col].allocation = MAX (1, (gint) priv->cols[col].allocation - extra / nshrink);
- extra -= allocation - priv->cols[col].allocation;
+ extra -= alloc - priv->cols[col].allocation;
nshrink -= 1;
if (priv->cols[col].allocation < 2)
{
@@ -1884,10 +1884,10 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
for (row = 0; row < priv->nrows; row++)
if (priv->rows[row].shrink)
{
- gint allocation = priv->rows[row].allocation;
+ gint alloc = priv->rows[row].allocation;
priv->rows[row].allocation = MAX (1, (gint) priv->rows[row].allocation - extra / nshrink);
- extra -= allocation - priv->rows[row].allocation;
+ extra -= alloc - priv->rows[row].allocation;
nshrink -= 1;
if (priv->rows[row].allocation < 2)
{
diff --git a/gtk/deprecated/gtkuimanager.c b/gtk/deprecated/gtkuimanager.c
index 772d653..30744fd 100644
--- a/gtk/deprecated/gtkuimanager.c
+++ b/gtk/deprecated/gtkuimanager.c
@@ -2952,9 +2952,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (in_popup && !popup_accels)
{
/* don't show accels in popups */
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (info->proxy));
- if (GTK_IS_ACCEL_LABEL (child))
- g_object_set (child, "accel-closure", NULL, NULL);
+ GtkWidget *c = gtk_bin_get_child (GTK_BIN (info->proxy));
+ if (GTK_IS_ACCEL_LABEL (c))
+ g_object_set (c, "accel-closure", NULL, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]