[gcr/wip/nielsdg/fix-warnings: 2/3] Cast result of g_object_ref() if necessary



commit d748ab581f0fdbf6b9524ebf69e2ab714293cbd1
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Jan 11 11:02:52 2020 +0100

    Cast result of g_object_ref() if necessary
    
    Although `g_object_ref()` technically returns a `gpointer`, on some
    compilers it will return the type of its argument. This means we need to
    add the necessary casting.

 gcr/gcr-gnupg-process.c       | 2 +-
 gcr/gcr-pkcs11-importer.c     | 2 +-
 ui/frob-tree-selector.c       | 2 +-
 ui/gcr-certificate-exporter.c | 2 +-
 ui/gcr-list-selector.c        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gcr/gcr-gnupg-process.c b/gcr/gcr-gnupg-process.c
index a91ce54..20f4a34 100644
--- a/gcr/gcr-gnupg-process.c
+++ b/gcr/gcr-gnupg-process.c
@@ -310,7 +310,7 @@ static GObject*
 _gcr_gnupg_process_get_source_object (GAsyncResult *result)
 {
        g_return_val_if_fail (GCR_IS_GNUPG_PROCESS (result), NULL);
-       return g_object_ref (result);
+       return G_OBJECT (g_object_ref (result));
 }
 
 static void
diff --git a/gcr/gcr-pkcs11-importer.c b/gcr/gcr-pkcs11-importer.c
index ab497aa..7cf3295 100644
--- a/gcr/gcr-pkcs11-importer.c
+++ b/gcr/gcr-pkcs11-importer.c
@@ -856,7 +856,7 @@ _gcr_pkcs11_importer_import_async (GcrImporter *importer,
                                         _gcr_pkcs11_importer_import_async);
        data = g_new0 (GcrImporterData, 1);
        data->async = TRUE;
-       data->importer = g_object_ref (importer);
+       data->importer = GCR_PKCS11_IMPORTER (g_object_ref (importer));
        data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
        g_simple_async_result_set_op_res_gpointer (res, data, gcr_importer_data_free);
 
diff --git a/ui/frob-tree-selector.c b/ui/frob-tree-selector.c
index 816350e..692592c 100644
--- a/ui/frob-tree-selector.c
+++ b/ui/frob-tree-selector.c
@@ -93,7 +93,7 @@ test_collection_instance (const gchar *label)
        } else {
                collection = g_hash_table_lookup (all_collections, label);
                if (collection != NULL)
-                       return g_object_ref (collection);
+                       return GCR_SIMPLE_COLLECTION (g_object_ref (collection));
        }
 
        collection = g_object_new (TEST_TYPE_COLLECTION, NULL);
diff --git a/ui/gcr-certificate-exporter.c b/ui/gcr-certificate-exporter.c
index 371397c..4b1817f 100644
--- a/ui/gcr-certificate-exporter.c
+++ b/ui/gcr-certificate-exporter.c
@@ -307,7 +307,7 @@ exporter_display_chooser (GcrCertificateExporter *self)
                             _("_Save"), GTK_RESPONSE_ACCEPT,
                             NULL);
 
-       self->pv->chooser_dialog = g_object_ref_sink(dialog);
+       self->pv->chooser_dialog = GTK_FILE_CHOOSER (g_object_ref_sink (dialog));
        gtk_dialog_set_default_response (GTK_DIALOG (dialog),
                                         GTK_RESPONSE_ACCEPT);
        gtk_file_chooser_set_local_only (self->pv->chooser_dialog, FALSE);
diff --git a/ui/gcr-list-selector.c b/ui/gcr-list-selector.c
index a4045cb..7271cf0 100644
--- a/ui/gcr-list-selector.c
+++ b/ui/gcr-list-selector.c
@@ -440,7 +440,7 @@ _gcr_list_selector_set_live_search (GcrListSelector *self, GcrLiveSearch *search
 
        /* connect handlers if new search is not null */
        if (search != NULL) {
-               self->pv->search_widget = g_object_ref (search);
+               self->pv->search_widget = GTK_WIDGET (g_object_ref (search));
 
                g_signal_connect (self, "start-interactive-search",
                                  G_CALLBACK (on_tree_view_start_search), NULL);


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