[gnome-applets/wip/muktupavels/werror] sticky-notes: fix -Wcast-function-type warning



commit 1d2580ba115a9cc8de988e90dc421ea36ef13cb7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Apr 4 22:31:23 2020 +0300

    sticky-notes: fix -Wcast-function-type warning

 gnome-applets/sticky-notes/sticky-notes.c | 12 +++++++++---
 gnome-applets/sticky-notes/sticky-notes.h |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gnome-applets/sticky-notes/sticky-notes.c b/gnome-applets/sticky-notes/sticky-notes.c
index b990bff2d..e1b24cd2e 100644
--- a/gnome-applets/sticky-notes/sticky-notes.c
+++ b/gnome-applets/sticky-notes/sticky-notes.c
@@ -892,7 +892,7 @@ void stickynotes_remove(StickyNote *note)
 }
 
 /* Save all sticky notes in an XML configuration file */
-gboolean
+void
 stickynotes_save_now (void)
 {
        WnckScreen *wnck_screen;
@@ -1007,8 +1007,14 @@ stickynotes_save_now (void)
        xmlFreeDoc(doc);
 
        save_scheduled = FALSE;
+}
 
-       return FALSE;
+static gboolean
+stickynotes_save_cb (gpointer user_data)
+{
+  stickynotes_save_now ();
+
+  return G_SOURCE_REMOVE;
 }
 
 void
@@ -1016,7 +1022,7 @@ stickynotes_save (void)
 {
   /* If a save isn't already schedules, save everything a minute from now. */
   if (!save_scheduled) {
-    g_timeout_add_seconds (60, (GSourceFunc) stickynotes_save_now, NULL);
+    g_timeout_add_seconds (60, stickynotes_save_cb, NULL);
     save_scheduled = TRUE;
   }
 }
diff --git a/gnome-applets/sticky-notes/sticky-notes.h b/gnome-applets/sticky-notes/sticky-notes.h
index 756a0cf5f..c2322dd75 100644
--- a/gnome-applets/sticky-notes/sticky-notes.h
+++ b/gnome-applets/sticky-notes/sticky-notes.h
@@ -88,7 +88,7 @@ void stickynote_change_properties(StickyNote *note);
 void stickynotes_add(GdkScreen *screen);
 void stickynotes_remove(StickyNote *note);
 void stickynotes_save(void);
-gboolean stickynotes_save_now (void);
+void stickynotes_save_now (void);
 void stickynotes_load(GdkScreen *screen);
 
 #endif /* __STICKYNOTES_H__ */


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