summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2019-08-17 18:55:35 +0200
committerTimm Bäder <mail@baedert.org>2019-09-09 17:36:23 +0200
commit6837e80d14bc0bf920b51b40f64028165c4d1a43 (patch)
tree73282d6dc1ee799779ba3f6e61faf17b2a2ea0c9 /gtk
parent4f3e65e74584b108faa75afbe3c49b11eac62c85 (diff)
downloadgtk+-6837e80d14bc0bf920b51b40f64028165c4d1a43.tar.gz
css: Avoid more type checks in hot paths
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcssimagebuiltin.c4
-rw-r--r--gtk/gtkcssimageicontheme.c4
-rw-r--r--gtk/gtkcssimagelinear.c4
-rw-r--r--gtk/gtkcssimageradial.c4
-rw-r--r--gtk/gtkcssstaticstyle.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index d8d3efa699..f377e44e89 100644
--- a/gtk/gtkcssimagebuiltin.c
+++ b/gtk/gtkcssimagebuiltin.c
@@ -494,8 +494,8 @@ static gboolean
gtk_css_image_builtin_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
- GtkCssImageBuiltin *builtin1 = GTK_CSS_IMAGE_BUILTIN (image1);
- GtkCssImageBuiltin *builtin2 = GTK_CSS_IMAGE_BUILTIN (image2);
+ GtkCssImageBuiltin *builtin1 = (GtkCssImageBuiltin *) image1;
+ GtkCssImageBuiltin *builtin2 = (GtkCssImageBuiltin *) image2;
return gdk_rgba_equal (&builtin1->fg_color, &builtin2->fg_color)
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color);
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c
index 5a194862b0..582dbfec30 100644
--- a/gtk/gtkcssimageicontheme.c
+++ b/gtk/gtkcssimageicontheme.c
@@ -187,8 +187,8 @@ static gboolean
gtk_css_image_icon_theme_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
- GtkCssImageIconTheme *icon_theme1 = GTK_CSS_IMAGE_ICON_THEME (image1);
- GtkCssImageIconTheme *icon_theme2 = GTK_CSS_IMAGE_ICON_THEME (image2);
+ GtkCssImageIconTheme *icon_theme1 = (GtkCssImageIconTheme *) image1;
+ GtkCssImageIconTheme *icon_theme2 = (GtkCssImageIconTheme *) image2;
return g_str_equal (icon_theme1->name, icon_theme2->name);
}
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index 6c79da2978..a1d1bf4eba 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -577,8 +577,8 @@ static gboolean
gtk_css_image_linear_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
- GtkCssImageLinear *linear1 = GTK_CSS_IMAGE_LINEAR (image1);
- GtkCssImageLinear *linear2 = GTK_CSS_IMAGE_LINEAR (image2);
+ GtkCssImageLinear *linear1 = (GtkCssImageLinear *) image1;
+ GtkCssImageLinear *linear2 = (GtkCssImageLinear *) image2;
guint i;
if (linear1->repeating != linear2->repeating ||
diff --git a/gtk/gtkcssimageradial.c b/gtk/gtkcssimageradial.c
index 930fc5b6e0..4dafe162ce 100644
--- a/gtk/gtkcssimageradial.c
+++ b/gtk/gtkcssimageradial.c
@@ -629,8 +629,8 @@ static gboolean
gtk_css_image_radial_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
- GtkCssImageRadial *radial1 = GTK_CSS_IMAGE_RADIAL (image1);
- GtkCssImageRadial *radial2 = GTK_CSS_IMAGE_RADIAL (image2);
+ GtkCssImageRadial *radial1 = (GtkCssImageRadial *) image1;
+ GtkCssImageRadial *radial2 = (GtkCssImageRadial *) image2;
guint i;
if (radial1->repeating != radial2->repeating ||
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index d0557597a3..ef6ac593b6 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -225,7 +225,7 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
else
_gtk_css_value_ref (specified);
- value = _gtk_css_value_compute (specified, id, provider, GTK_CSS_STYLE (style), parent_style);
+ value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style);
gtk_css_static_style_set_value (style, id, value, section);