mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 23:00:07 +00:00
Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
This commit is contained in:
parent
23032587db
commit
00236c0d21
@ -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),
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user