Commit ade22d00 authored by Emmanuele Bassi's avatar Emmanuele Bassi

gtk: Cast g_object_ref() to the right type

In GLib 2.56, g_object_ref() will check that you're assigning the return
value to a variable of the same type you're passing in.
parent c03ce68c
...@@ -226,7 +226,7 @@ gtk_cell_renderer_spin_set_property (GObject *object, ...@@ -226,7 +226,7 @@ gtk_cell_renderer_spin_set_property (GObject *object,
} }
if (obj) if (obj)
priv->adjustment = g_object_ref_sink (obj); priv->adjustment = GTK_ADJUSTMENT (g_object_ref_sink (obj));
break; break;
case PROP_CLIMB_RATE: case PROP_CLIMB_RATE:
priv->climb_rate = g_value_get_double (value); priv->climb_rate = g_value_get_double (value);
......
...@@ -462,7 +462,7 @@ plane_set_property (GObject *object, ...@@ -462,7 +462,7 @@ plane_set_property (GObject *object,
adjustment = g_value_get_object (value); adjustment = g_value_get_object (value);
if (adjustment) if (adjustment)
{ {
plane->priv->h_adj = g_object_ref_sink (adjustment); plane->priv->h_adj = GTK_ADJUSTMENT (g_object_ref_sink (adjustment));
g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (h_changed), plane); g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (h_changed), plane);
} }
break; break;
...@@ -470,7 +470,7 @@ plane_set_property (GObject *object, ...@@ -470,7 +470,7 @@ plane_set_property (GObject *object,
adjustment = g_value_get_object (value); adjustment = g_value_get_object (value);
if (adjustment) if (adjustment)
{ {
plane->priv->s_adj = g_object_ref_sink (adjustment); plane->priv->s_adj = GTK_ADJUSTMENT (g_object_ref_sink (adjustment));
g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (sv_changed), plane); g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (sv_changed), plane);
} }
break; break;
...@@ -478,7 +478,7 @@ plane_set_property (GObject *object, ...@@ -478,7 +478,7 @@ plane_set_property (GObject *object,
adjustment = g_value_get_object (value); adjustment = g_value_get_object (value);
if (adjustment) if (adjustment)
{ {
plane->priv->v_adj = g_object_ref_sink (adjustment); plane->priv->v_adj = GTK_ADJUSTMENT (g_object_ref_sink (adjustment));
g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (sv_changed), plane); g_signal_connect_swapped (adjustment, "value-changed", G_CALLBACK (sv_changed), plane);
} }
break; break;
......
...@@ -292,7 +292,7 @@ gtk_combo_box_text_buildable_custom_tag_start (GtkBuildable *buildable, ...@@ -292,7 +292,7 @@ gtk_combo_box_text_buildable_custom_tag_start (GtkBuildable *buildable,
data = g_slice_new0 (ItemParserData); data = g_slice_new0 (ItemParserData);
data->builder = g_object_ref (builder); data->builder = g_object_ref (builder);
data->object = g_object_ref (buildable); data->object = G_OBJECT (g_object_ref (buildable));
data->domain = gtk_builder_get_translation_domain (builder); data->domain = gtk_builder_get_translation_domain (builder);
data->string = g_string_new (""); data->string = g_string_new ("");
......
...@@ -174,7 +174,7 @@ gtk_css_image_fallback_compute (GtkCssImage *image, ...@@ -174,7 +174,7 @@ gtk_css_image_fallback_compute (GtkCssImage *image,
return GTK_CSS_IMAGE (copy); return GTK_CSS_IMAGE (copy);
} }
else else
return g_object_ref (fallback); return GTK_CSS_IMAGE (g_object_ref (fallback));
} }
static gboolean static gboolean
......
...@@ -41,7 +41,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image, ...@@ -41,7 +41,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
GtkCssImageGradient *copy; GtkCssImageGradient *copy;
if (gradient->pattern) if (gradient->pattern)
return g_object_ref (gradient); return GTK_CSS_IMAGE (g_object_ref (gradient));
copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL); copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
copy->gradient = gtk_gradient_ref (gradient->gradient); copy->gradient = gtk_gradient_ref (gradient->gradient);
......
...@@ -107,7 +107,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image, ...@@ -107,7 +107,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
scale = MAX(MIN (scale, scaled->n_images), 1); scale = MAX(MIN (scale, scaled->n_images), 1);
if (scaled->scale == scale) if (scaled->scale == scale)
return g_object_ref (scaled); return GTK_CSS_IMAGE (g_object_ref (scaled));
else else
{ {
copy = g_object_new (_gtk_css_image_scaled_get_type (), NULL); copy = g_object_new (_gtk_css_image_scaled_get_type (), NULL);
......
...@@ -1706,7 +1706,7 @@ gtk_label_buildable_custom_tag_start (GtkBuildable *buildable, ...@@ -1706,7 +1706,7 @@ gtk_label_buildable_custom_tag_start (GtkBuildable *buildable,
parser_data = g_slice_new0 (PangoParserData); parser_data = g_slice_new0 (PangoParserData);
parser_data->builder = g_object_ref (builder); parser_data->builder = g_object_ref (builder);
parser_data->object = g_object_ref (buildable); parser_data->object = G_OBJECT (g_object_ref (buildable));
*parser = pango_parser; *parser = pango_parser;
*data = parser_data; *data = parser_data;
return TRUE; return TRUE;
......
...@@ -225,7 +225,7 @@ gtk_sidebar_row_set_property (GObject *object, ...@@ -225,7 +225,7 @@ gtk_sidebar_row_set_property (GObject *object,
object = g_value_get_object (value); object = g_value_get_object (value);
if (object != NULL) if (object != NULL)
{ {
self->start_icon = g_object_ref (object); self->start_icon = G_ICON (g_object_ref (object));
gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget), gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget),
self->start_icon, self->start_icon,
GTK_ICON_SIZE_MENU); GTK_ICON_SIZE_MENU);
...@@ -243,7 +243,7 @@ gtk_sidebar_row_set_property (GObject *object, ...@@ -243,7 +243,7 @@ gtk_sidebar_row_set_property (GObject *object,
object = g_value_get_object (value); object = g_value_get_object (value);
if (object != NULL) if (object != NULL)
{ {
self->end_icon = g_object_ref (object); self->end_icon = G_ICON (g_object_ref (object));
gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget), gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget),
self->end_icon, self->end_icon,
GTK_ICON_SIZE_MENU); GTK_ICON_SIZE_MENU);
......
...@@ -788,7 +788,7 @@ gtk_tool_palette_add (GtkContainer *container, ...@@ -788,7 +788,7 @@ gtk_tool_palette_add (GtkContainer *container,
g_ptr_array_add (palette->priv->groups, info); g_ptr_array_add (palette->priv->groups, info);
info->pos = palette->priv->groups->len - 1; info->pos = palette->priv->groups->len - 1;
info->widget = g_object_ref_sink (child); info->widget = (GtkToolItemGroup *) g_object_ref_sink (child);
gtk_widget_set_parent (child, GTK_WIDGET (palette)); gtk_widget_set_parent (child, GTK_WIDGET (palette));
} }
......
...@@ -14981,7 +14981,7 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view, ...@@ -14981,7 +14981,7 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view,
if (entry) if (entry)
{ {
tree_view->priv->search_entry = g_object_ref (entry); tree_view->priv->search_entry = GTK_WIDGET (g_object_ref (entry));
tree_view->priv->search_custom_entry_set = TRUE; tree_view->priv->search_custom_entry_set = TRUE;
if (tree_view->priv->search_entry_changed_id == 0) if (tree_view->priv->search_entry_changed_id == 0)
......
...@@ -14409,7 +14409,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable, ...@@ -14409,7 +14409,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable,
AccelGroupParserData *data; AccelGroupParserData *data;
data = g_slice_new0 (AccelGroupParserData); data = g_slice_new0 (AccelGroupParserData);
data->object = g_object_ref (buildable); data->object = G_OBJECT (g_object_ref (buildable));
data->builder = builder; data->builder = builder;
*parser = accel_group_parser; *parser = accel_group_parser;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment