[gtk+] css: Fix compiler warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] css: Fix compiler warnings
- Date: Tue, 2 Jun 2015 13:10:35 +0000 (UTC)
commit 29ab70b801aded2b63a418b822c8636513d040b4
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 30 21:24:48 2015 -0400
css: Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
gtk/gtkcssimagewin32.c | 12 ++++++------
gtk/gtkcssinitialvalue.c | 8 +++++---
gtk/gtkcssshadowvalue.c | 8 ++++----
3 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkcssimagewin32.c b/gtk/gtkcssimagewin32.c
index aa1f4af..9ebd2f3 100644
--- a/gtk/gtkcssimagewin32.c
+++ b/gtk/gtkcssimagewin32.c
@@ -41,18 +41,18 @@ gtk_css_image_win32_draw (GtkCssImage *image,
if (wimage->state2 >= 0)
{
cairo_surface_t *surface2;
- cairo_t *cr;
+ cairo_t *cr2;
int dx2, dy2;
surface2 = _gtk_win32_theme_part_create_surface (wimage->theme, wimage->part2, wimage->state2,
wimage->margins,
width, height, &dx2, &dy2);
- cr = cairo_create (surface);
+ cr2 = cairo_create (surface);
- cairo_set_source_surface (cr, surface2, dx2 - dx, dy2-dy);
- cairo_paint_with_alpha (cr, wimage->over_alpha);
-
- cairo_destroy (cr);
+ cairo_set_source_surface (cr2, surface2, dx2 - dx, dy2-dy);
+ cairo_paint_with_alpha (cr2, wimage->over_alpha);
+
+ cairo_destroy (cr2);
cairo_surface_destroy (surface2);
}
diff --git a/gtk/gtkcssinitialvalue.c b/gtk/gtkcssinitialvalue.c
index 905fa9f..736e716 100644
--- a/gtk/gtkcssinitialvalue.c
+++ b/gtk/gtkcssinitialvalue.c
@@ -66,7 +66,6 @@ gtk_css_value_initial_compute (GtkCssValue *value,
{
PangoFontDescription *description;
char *font_name;
- GtkCssValue *value;
g_object_get (settings, "gtk-font-name", &font_name, NULL);
description = pango_font_description_from_string (font_name);
@@ -76,9 +75,12 @@ gtk_css_value_initial_compute (GtkCssValue *value,
if (pango_font_description_get_set_fields (description) & PANGO_FONT_MASK_FAMILY)
{
- value = _gtk_css_array_value_new (_gtk_css_string_value_new (pango_font_description_get_family
(description)));
+ GtkCssValue *val;
+
+ val = _gtk_css_array_value_new (_gtk_css_string_value_new (pango_font_description_get_family
(description)));
pango_font_description_free (description);
- return value;
+
+ return val;
}
pango_font_description_free (description);
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index ffdc2b6..903027f 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -635,13 +635,13 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
{
GtkRoundedBox box, clip_box;
double spread, radius, clip_radius, x, y, outside;
- double x1, y1, x2, y2;
+ double x1c, y1c, x2c, y2c;
g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW);
- cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
- if ((shadow->inset && !_gtk_rounded_box_intersects_rectangle (padding_box, x1, y1, x2, y2)) ||
- (!shadow->inset && _gtk_rounded_box_contains_rectangle (padding_box, x1, y1, x2, y2)))
+ cairo_clip_extents (cr, &x1c, &y1c, &x2c, &y2c);
+ if ((shadow->inset && !_gtk_rounded_box_intersects_rectangle (padding_box, x1c, y1c, x2c, y2c)) ||
+ (!shadow->inset && _gtk_rounded_box_contains_rectangle (padding_box, x1c, y1c, x2c, y2c)))
return;
cairo_save (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]