[gtk/wip/baedert/for-master: 6/29] css: Avoid more type checks in hot paths
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 6/29] css: Avoid more type checks in hot paths
- Date: Fri, 23 Aug 2019 07:44:24 +0000 (UTC)
commit ac65be958ab454045c7cec29cf644ae3b4d53430
Author: Timm Bäder <mail baedert org>
Date: Sat Aug 17 18:55:35 2019 +0200
css: Avoid more type checks in hot paths
gtk/gtkcssimagebuiltin.c | 4 ++--
gtk/gtkcssimageicontheme.c | 4 ++--
gtk/gtkcssimagelinear.c | 4 ++--
gtk/gtkcssimageradial.c | 4 ++--
gtk/gtkcssstaticstyle.c | 2 +-
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]