gnucash master: Fix clang error about type mismatch GtkWidget* != void* aka gpointer

John Ralls jralls at code.gnucash.org
Sun May 10 17:56:07 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/3d6a06d5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d58f260a (commit)



commit 3d6a06d5037073776a2a732e1c319b6664f5c168
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun May 10 14:49:20 2020 -0700

    Fix clang error about type mismatch GtkWidget* != void* aka gpointer
    
    in the second argument and an extra ptr level in the first.
    (The declaration is
    g_atomic_pointer_compare_and_exchange(void* atomic, gpointer old,
                                          gpointer new)
    but that's wrong as it tests *atomic == old so atomic needs to be
    void**. But we were passing &gpointer* i.e. void***.)

diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index c5fa26a64..921038462 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -2256,9 +2256,9 @@ gppat_filter_response_cb (GtkWidget *dialog,
     }
 
     /* Clean up and delete dialog */
-    gptemp = (gpointer *)fd->dialog;
+    gptemp = (gpointer)fd->dialog;
     g_atomic_pointer_compare_and_exchange(&gptemp,
-                                          dialog, NULL);
+                                          (gpointer)dialog, NULL);
     fd->dialog = gptemp;
     gtk_widget_destroy(dialog);
     LEAVE("types 0x%x", fd->visible_types);
diff --git a/gnucash/gnome-utils/gnc-tree-view-owner.c b/gnucash/gnome-utils/gnc-tree-view-owner.c
index 8030d9a5b..6baab177b 100644
--- a/gnucash/gnome-utils/gnc-tree-view-owner.c
+++ b/gnucash/gnome-utils/gnc-tree-view-owner.c
@@ -1140,9 +1140,9 @@ gppot_filter_response_cb (GtkWidget *dialog,
     }
 
     /* Clean up and delete dialog */
-    gptemp = (gpointer *)fd->dialog;
+    gptemp = (gpointer)fd->dialog;
     g_atomic_pointer_compare_and_exchange(&gptemp,
-                                          dialog, NULL);
+                                          (gpointer)dialog, NULL);
     fd->dialog = gptemp;
     gtk_widget_destroy(dialog);
     LEAVE("");



Summary of changes:
 gnucash/gnome-utils/gnc-tree-view-account.c | 4 ++--
 gnucash/gnome-utils/gnc-tree-view-owner.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list