[gnome-photos] Silence warnings with GLib 2.57.2



commit a26aff98ab3031676373e9e1e5a423ac72f0c00a
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Aug 17 14:21:46 2018 +0200

    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.
    
    https://gitlab.gnome.org/GNOME/glib/issues/1425

 src/photos-application.c               |  2 +-
 src/photos-base-item.c                 |  6 +++---
 src/photos-base-manager.c              |  4 ++--
 src/photos-dlna-renderer.c             |  2 +-
 src/photos-dlna-renderers-manager.c    |  2 +-
 src/photos-embed.c                     |  4 ++--
 src/photos-fetch-ids-job.c             |  2 +-
 src/photos-image-view.c                | 12 ++++++------
 src/photos-import-dialog.c             | 10 +++++-----
 src/photos-item-manager.c              |  6 +++---
 src/photos-main-toolbar.c              |  6 +++---
 src/photos-organize-collection-model.c |  2 +-
 src/photos-pipeline.c                  |  2 +-
 src/photos-preview-view.c              |  2 +-
 src/photos-selection-toolbar.c         |  2 +-
 src/photos-source-manager.c            |  2 +-
 src/photos-thumbnailer.c               |  4 ++--
 src/photos-tool-crop.c                 |  4 ++--
 src/photos-tool-filter-button.c        |  2 +-
 src/photos-widget-shader.c             |  6 +++---
 20 files changed, 41 insertions(+), 41 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index b3ea55f6..28b33f70 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -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);
 }
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 3f94bc24..8e170d1c 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -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;
 }
 
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
index 601c4eab..a0e1b272 100644
--- a/src/photos-base-manager.c
+++ b/src/photos-base-manager.c
@@ -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);
 }
diff --git a/src/photos-dlna-renderer.c b/src/photos-dlna-renderer.c
index bb0a36a5..2fbae0bf 100644
--- a/src/photos-dlna-renderer.c
+++ b/src/photos-dlna-renderer.c
@@ -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);
 }
diff --git a/src/photos-dlna-renderers-manager.c b/src/photos-dlna-renderers-manager.c
index b025420b..357966d1 100644
--- a/src/photos-dlna-renderers-manager.c
+++ b/src/photos-dlna-renderers-manager.c
@@ -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);
diff --git a/src/photos-embed.c b/src/photos-embed.c
index cbcea716..45a1b4e6 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -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);
 }
diff --git a/src/photos-fetch-ids-job.c b/src/photos-fetch-ids-job.c
index cd237896..e9bb1b22 100644
--- a/src/photos-fetch-ids-job.c
+++ b/src/photos-fetch-ids-job.c
@@ -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);
diff --git a/src/photos-image-view.c b/src/photos-image-view.c
index 3722b640..5fc72291 100644
--- a/src/photos-image-view.c
+++ b/src/photos-image-view.c
@@ -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)
     {
diff --git a/src/photos-import-dialog.c b/src/photos-import-dialog.c
index eecb0b31..f45d55ca 100644
--- a/src/photos-import-dialog.c
+++ b/src/photos-import-dialog.c
@@ -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);
 }
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index e3d66a24..cd33ef60 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -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);
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 48395760..6f35e329 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -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);
diff --git a/src/photos-organize-collection-model.c b/src/photos-organize-collection-model.c
index 4cf04a0e..13d08a5c 100644
--- a/src/photos-organize-collection-model.c
+++ b/src/photos-organize-collection-model.c
@@ -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);
     }
 
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index 20957822..8a4eff9f 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -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);
 
diff --git a/src/photos-preview-view.c b/src/photos-preview-view.c
index 82f4bb10..117e81a2 100644
--- a/src/photos-preview-view.c
+++ b/src/photos-preview-view.c
@@ -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;
 }
 
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index a61a3edd..b08081f8 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -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);
diff --git a/src/photos-source-manager.c b/src/photos-source-manager.c
index c0c7d930..574ec998 100644
--- a/src/photos-source-manager.c
+++ b/src/photos-source-manager.c
@@ -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);
 }
diff --git a/src/photos-thumbnailer.c b/src/photos-thumbnailer.c
index 5d75bc70..3a347e0b 100644
--- a/src/photos-thumbnailer.c
+++ b/src/photos-thumbnailer.c
@@ -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);
 }
diff --git a/src/photos-tool-crop.c b/src/photos-tool-crop.c
index e73b2451..ca751023 100644
--- a/src/photos-tool-crop.c
+++ b/src/photos-tool-crop.c
@@ -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);
 }
diff --git a/src/photos-tool-filter-button.c b/src/photos-tool-filter-button.c
index 394c8797..11bf21bb 100644
--- a/src/photos-tool-filter-button.c
+++ b/src/photos-tool-filter-button.c
@@ -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 */
 }
 
diff --git a/src/photos-widget-shader.c b/src/photos-widget-shader.c
index cb57aea0..69def2d6 100644
--- a/src/photos-widget-shader.c
+++ b/src/photos-widget-shader.c
@@ -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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]