]> git.eshelyaron.com Git - emacs.git/commitdiff
Port to GTK with strict C11 compiler
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Mar 2016 15:36:59 +0000 (08:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Mar 2016 15:43:32 +0000 (08:43 -0700)
* src/gtkutil.c (xg_create_frame_widgets, xg_toggle_notify_cb):
Cast from function type to void * where the C standard requires this.
This works around a problem in the prototypes for
g_signal_handler_find and g_signal_handlers_block_by_func, which
use gpointer instead of GCallback.  Found by using gcc -pedantic.

src/gtkutil.c

index 7dca5851f2931a134219d2f319567b91a167c537..ba059b73a70750a7df5107293b0647ab37f04008 100644 (file)
@@ -1300,7 +1300,7 @@ xg_create_frame_widgets (struct frame *f)
     if (! g_signal_handler_find (G_OBJECT (gs),
                                  G_SIGNAL_MATCH_FUNC,
                                  0, 0, 0,
-                                 G_CALLBACK (style_changed_cb),
+                                 (gpointer) G_CALLBACK (style_changed_cb),
                                  0))
       {
         g_signal_connect (G_OBJECT (gs), "notify::gtk-theme-name",
@@ -1832,14 +1832,10 @@ xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data)
 
       if (!!visible != !!toggle_on)
         {
-          g_signal_handlers_block_by_func (G_OBJECT (wtoggle),
-                                           G_CALLBACK (xg_toggle_visibility_cb),
-                                           gobject);
+          gpointer cb = (gpointer) G_CALLBACK (xg_toggle_visibility_cb);
+          g_signal_handlers_block_by_func (G_OBJECT (wtoggle), cb, gobject);
           gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wtoggle), visible);
-          g_signal_handlers_unblock_by_func
-            (G_OBJECT (wtoggle),
-             G_CALLBACK (xg_toggle_visibility_cb),
-             gobject);
+          g_signal_handlers_unblock_by_func (G_OBJECT (wtoggle), cb, gobject);
         }
       x_gtk_show_hidden_files = visible;
     }