Commit a26aff98 authored by Debarshi Ray's avatar Debarshi Ray

Silence warnings with GLib 2.57.2

The g_clear_pointer macro in GLib gained a bit of type safety when
using GCC and GCC-compatible compilers. It checks if the function
pointer is meant to accept a pointer to the type that the first
argument refers to. Now, GCC doesn't like it if the function pointer is
cast to GDestroyNotify, and emits this warning:
  warning: function called through a non-compatible type

Since the macro, even the earlier version of it, was explicitly
designed to avoid the need to cast the arguments, these redundant casts
should be removed.

glib#1425
parent 2841befa
......@@ -2585,7 +2585,7 @@ photos_application_shutdown (GApplication *application)
self->init_fishes_id = 0;
}
g_clear_pointer (&self->refresh_miner_ids, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->refresh_miner_ids, g_hash_table_unref);
G_APPLICATION_CLASS (photos_application_parent_class)->shutdown (application);
}
......
......@@ -456,7 +456,7 @@ photos_base_item_check_effects_and_update_info (PhotosBaseItem *self)
}
}
g_clear_pointer (&priv->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&priv->surface, cairo_surface_destroy);
windows = gtk_application_get_windows (GTK_APPLICATION (app));
if (windows != NULL)
......@@ -2973,7 +2973,7 @@ photos_base_item_dispose (GObject *object)
photos_base_item_clear_pixels (self);
g_clear_pointer (&priv->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&priv->surface, cairo_surface_destroy);
g_clear_object (&priv->default_app);
g_clear_object (&priv->original_icon);
g_clear_object (&priv->watcher);
......@@ -4404,7 +4404,7 @@ photos_base_item_query_info (PhotosBaseItem *self,
ret_val = g_object_ref (info);
out:
g_clear_pointer (&matcher, (GDestroyNotify) g_file_attribute_matcher_unref);
g_clear_pointer (&matcher, g_file_attribute_matcher_unref);
return ret_val;
}
......
......@@ -355,8 +355,8 @@ photos_base_manager_dispose (GObject *object)
priv = photos_base_manager_get_instance_private (self);
g_clear_object (&priv->active_object);
g_clear_pointer (&priv->objects, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->sequence, (GDestroyNotify) g_sequence_free);
g_clear_pointer (&priv->objects, g_hash_table_unref);
g_clear_pointer (&priv->sequence, g_sequence_free);
G_OBJECT_CLASS (photos_base_manager_parent_class)->dispose (object);
}
......
......@@ -79,7 +79,7 @@ photos_dlna_renderer_dispose (GObject *object)
g_clear_object (&self->device);
g_clear_object (&self->push_host);
g_clear_object (&self->player);
g_clear_pointer (&self->urls_to_item, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->urls_to_item, g_hash_table_unref);
G_OBJECT_CLASS (photos_dlna_renderer_parent_class)->dispose (object);
}
......
......@@ -57,7 +57,7 @@ photos_dlna_renderers_manager_dispose (GObject *object)
PhotosDlnaRenderersManager *self = PHOTOS_DLNA_RENDERERS_MANAGER (object);
g_clear_object (&self->proxy);
g_clear_pointer (&self->renderers, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->renderers, g_hash_table_unref);
g_clear_error (&self->error);
G_OBJECT_CLASS (photos_dlna_renderers_manager_parent_class)->dispose (object);
......
......@@ -413,7 +413,7 @@ photos_embed_notify_visible_child (PhotosEmbed *self)
photos_mode_controller_set_window_mode (self->mode_cntrlr, mode);
out:
g_clear_pointer (&event, (GDestroyNotify) gdk_event_free);
g_clear_pointer (&event, gdk_event_free);
}
......@@ -780,7 +780,7 @@ photos_embed_dispose (GObject *object)
g_clear_object (&self->mode_cntrlr);
g_clear_object (&self->srch_cntrlr);
g_clear_object (&self->trk_ovrvw_cntrlr);
g_clear_pointer (&self->notifications, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->notifications, g_hash_table_unref);
G_OBJECT_CLASS (photos_embed_parent_class)->dispose (object);
}
......
......@@ -130,7 +130,7 @@ photos_fetch_ids_job_dispose (GObject *object)
{
PhotosFetchIdsJob *self = PHOTOS_FETCH_IDS_JOB (object);
g_clear_pointer (&self->ids, (GDestroyNotify) g_ptr_array_unref);
g_clear_pointer (&self->ids, g_ptr_array_unref);
g_clear_object (&self->queue);
G_OBJECT_CLASS (photos_fetch_ids_job_parent_class)->dispose (object);
......
......@@ -246,8 +246,8 @@ photos_image_view_update_region (PhotosImageView *self)
{
GeglRectangle bbox;
g_clear_pointer (&self->bbox_region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->bbox_region, cairo_region_destroy);
g_clear_pointer (&self->region, cairo_region_destroy);
bbox = gegl_node_get_bounding_box (self->node);
self->bbox_region = cairo_region_create_rectangle ((cairo_rectangle_int_t *) &bbox);
......@@ -774,8 +774,8 @@ photos_image_view_finalize (GObject *object)
{
PhotosImageView *self = PHOTOS_IMAGE_VIEW (object);
g_clear_pointer (&self->bbox_region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->bbox_region, cairo_region_destroy);
g_clear_pointer (&self->region, cairo_region_destroy);
g_clear_pointer (&self->surface_memory, g_free);
G_OBJECT_CLASS (photos_image_view_parent_class)->finalize (object);
......@@ -1152,8 +1152,8 @@ photos_image_view_set_node (PhotosImageView *self, GeglNode *node)
self->zoom_visible_scaled = 1.0;
g_clear_object (&self->buffer);
g_clear_object (&self->node);
g_clear_pointer (&self->bbox_region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->region, (GDestroyNotify) cairo_region_destroy);
g_clear_pointer (&self->bbox_region, cairo_region_destroy);
g_clear_pointer (&self->region, cairo_region_destroy);
if (node != NULL)
{
......
......@@ -500,8 +500,8 @@ photos_import_dialog_initialize_index_and_popover (PhotosImportDialog *self)
PhotosBaseItem *collection;
guint n_buttons = 0;
g_clear_pointer (&self->index, (GDestroyNotify) dzl_fuzzy_mutable_index_unref);
g_clear_pointer (&self->recent_collections, (GDestroyNotify) photos_utils_object_list_free_full);
g_clear_pointer (&self->index, dzl_fuzzy_mutable_index_unref);
g_clear_pointer (&self->recent_collections, photos_utils_object_list_free_full);
gtk_container_foreach (GTK_CONTAINER (self->collections_popover_grid), (GtkCallback) gtk_widget_destroy, NULL);
gtk_dialog_set_response_sensitive (GTK_DIALOG (self), GTK_RESPONSE_OK, FALSE);
photos_import_dialog_enable_create_new (self, FALSE);
......@@ -677,9 +677,9 @@ photos_import_dialog_dispose (GObject *object)
g_clear_object (&self->default_collection);
g_clear_object (&self->item_mngr);
g_clear_object (&self->queue);
g_clear_pointer (&self->index, (GDestroyNotify) dzl_fuzzy_mutable_index_unref);
g_clear_pointer (&self->collections, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->recent_collections, (GDestroyNotify) photos_utils_object_list_free_full);
g_clear_pointer (&self->index, dzl_fuzzy_mutable_index_unref);
g_clear_pointer (&self->collections, g_hash_table_unref);
g_clear_pointer (&self->recent_collections, photos_utils_object_list_free_full);
G_OBJECT_CLASS (photos_import_dialog_parent_class)->dispose (object);
}
......
......@@ -1016,9 +1016,9 @@ photos_item_manager_dispose (GObject *object)
self->item_mngr_chldrn = NULL;
}
g_clear_pointer (&self->collections, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->hidden_items, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->wait_for_changes_table, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->collections, g_hash_table_unref);
g_clear_pointer (&self->hidden_items, g_hash_table_unref);
g_clear_pointer (&self->wait_for_changes_table, g_hash_table_unref);
g_clear_object (&self->active_object);
g_clear_object (&self->loader_cancellable);
g_clear_object (&self->active_collection);
......
......@@ -247,7 +247,7 @@ photos_main_toolbar_add_remote_display_button (PhotosMainToolbar *self)
g_autofree gchar *text = NULL;
const gchar *name;
g_clear_pointer (&self->remote_display_button, (GDestroyNotify) gtk_widget_destroy);
g_clear_pointer (&self->remote_display_button, gtk_widget_destroy);
renderer = photos_remote_display_manager_get_renderer (self->remote_mngr);
name = photos_dlna_renderer_get_friendly_name (renderer);
......@@ -281,7 +281,7 @@ photos_main_toolbar_update_remote_display_button (PhotosMainToolbar *self)
if (active && !selection_mode && window_mode != PHOTOS_WINDOW_MODE_PREVIEW)
photos_main_toolbar_add_remote_display_button (self);
else
g_clear_pointer (&self->remote_display_button, (GDestroyNotify) gtk_widget_destroy);
g_clear_pointer (&self->remote_display_button, gtk_widget_destroy);
}
......@@ -339,7 +339,7 @@ photos_main_toolbar_add_selection_button (PhotosMainToolbar *self)
static void
photos_main_toolbar_clear_state_data (PhotosMainToolbar *self)
{
g_clear_pointer (&self->remote_display_button, (GDestroyNotify) gtk_widget_destroy);
g_clear_pointer (&self->remote_display_button, gtk_widget_destroy);
if (self->item_mngr != NULL)
g_signal_handlers_disconnect_by_func (self->item_mngr, photos_main_toolbar_item_active_changed, self);
......
......@@ -80,7 +80,7 @@ photos_organize_collection_model_find_collection_iter (PhotosOrganizeCollectionM
GtkTreeIter iter;
gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &iter, self->coll_path);
g_clear_pointer (&self->coll_path, (GDestroyNotify) gtk_tree_path_free);
g_clear_pointer (&self->coll_path, gtk_tree_path_free);
return gtk_tree_iter_copy (&iter);
}
......
......@@ -277,7 +277,7 @@ photos_pipeline_dispose (GObject *object)
*
* See: https://bugzilla.gnome.org/show_bug.cgi?id=759995
*/
g_clear_pointer (&self->hash, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->hash, g_hash_table_unref);
g_clear_object (&self->graph);
......
......@@ -499,7 +499,7 @@ photos_preview_view_scroll_event (GtkWidget *widget, GdkEvent *event, gpointer u
}
out:
g_clear_pointer (&parameter, (GDestroyNotify) g_variant_unref);
g_clear_pointer (&parameter, g_variant_unref);
return ret_val;
}
......
......@@ -329,7 +329,7 @@ photos_selection_toolbar_dispose (GObject *object)
{
PhotosSelectionToolbar *self = PHOTOS_SELECTION_TOOLBAR (object);
g_clear_pointer (&self->item_listeners, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->item_listeners, g_hash_table_unref);
g_clear_object (&self->item_mngr);
g_clear_object (&self->mode_cntrlr);
g_clear_object (&self->sel_cntrlr);
......
......@@ -381,7 +381,7 @@ photos_source_manager_dispose (GObject *object)
g_clear_object (&self->cancellable);
g_clear_object (&self->client);
g_clear_object (&self->volume_monitor);
g_clear_pointer (&self->sources_notified, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->sources_notified, g_hash_table_unref);
G_OBJECT_CLASS (photos_source_manager_parent_class)->dispose (object);
}
......
......@@ -782,8 +782,8 @@ photos_thumbnailer_dispose (GObject *object)
g_assert_null (self->skeleton);
g_clear_object (&self->connection);
g_clear_pointer (&self->cancellables, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&self->resource_gegl, (GDestroyNotify) g_resources_unregister);
g_clear_pointer (&self->cancellables, g_hash_table_unref);
g_clear_pointer (&self->resource_gegl, g_resources_unregister);
G_OBJECT_CLASS (photos_thumbnailer_parent_class)->dispose (object);
}
......
......@@ -269,7 +269,7 @@ photos_tool_crop_surface_create (PhotosToolCrop *self)
{
GdkWindow *window;
g_clear_pointer (&self->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&self->surface, cairo_surface_destroy);
window = gtk_widget_get_window (self->view);
self->surface = gdk_window_create_similar_surface (window,
......@@ -1431,7 +1431,7 @@ photos_tool_crop_dispose (GObject *object)
}
g_clear_object (&self->grid);
g_clear_pointer (&self->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&self->surface, cairo_surface_destroy);
G_OBJECT_CLASS (photos_tool_crop_parent_class)->dispose (object);
}
......
......@@ -135,7 +135,7 @@ photos_tool_filter_button_constructed (GObject *object)
g_signal_connect_swapped (self->button, "toggled", G_CALLBACK (photos_tool_filter_button_toggled), self);
photos_tool_filter_button_toggled (self);
g_clear_pointer (&preview_icon_surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&preview_icon_surface, cairo_surface_destroy);
self->group = NULL; /* We will not need it any more */
}
......
......@@ -66,7 +66,7 @@ photos_widget_shader_surface_create (PhotosWidgetShader *self)
GdkWindow *window;
cairo_t *cr = NULL;
g_clear_pointer (&self->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&self->surface, cairo_surface_destroy);
if (self->widget == NULL)
goto out;
......@@ -87,7 +87,7 @@ photos_widget_shader_surface_create (PhotosWidgetShader *self)
cairo_paint (cr);
out:
g_clear_pointer (&cr, (GDestroyNotify) cairo_destroy);
g_clear_pointer (&cr, cairo_destroy);
}
......@@ -128,7 +128,7 @@ photos_widget_shader_finalize (GObject *object)
PhotosWidgetShader *self = PHOTOS_WIDGET_SHADER (object);
g_assert_null (self->widget);
g_clear_pointer (&self->surface, (GDestroyNotify) cairo_surface_destroy);
g_clear_pointer (&self->surface, cairo_surface_destroy);
G_OBJECT_CLASS (photos_widget_shader_parent_class)->finalize (object);
}
......
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