projects/aports·blob master · refs

56 lines · 1.8 KiB

1Patch-Source: https://github.com/CristianHenzel/ClipIt/pull/211
2From 46c53082bd81c769d3422f1bedbab57bc73e8007 Mon Sep 17 00:00:00 2001
3From: Mamoru TASAKA <[email protected]>
4Date: Fri, 17 Jan 2025 00:23:31 +0900
5Subject: [PATCH] Fix function prototype for g_timer_add family for C23
6
7g_timer_add or g_timeout_add_seconds manual says that
8the second argument must have type of GSourceFunc, i.e.
9function with one gpointer argument returning gboolean.
10
11Fixing so, unless compilation fails with C23.
12---
13 src/manage.c | 2 +-
14 src/manage.h | 2 +-
15 src/preferences.c | 2 +-
16 3 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/src/manage.c b/src/manage.c
19index 25f7b75..25ed6d4 100644
20--- a/src/manage.c
21+++ b/src/manage.c
22@@ -331,7 +331,7 @@ void search_window_response(GtkDialog *dialog, gint response_id, gpointer user_d
23 }
24
25 /* Shows the search dialog */
26-gboolean show_search()
27+gboolean show_search(gpointer user_data)
28 {
29 /* Prevent multiple instances */
30 if(gtk_grab_get_current()) {
31diff --git a/src/manage.h b/src/manage.h
32index 8740c0f..b810e74 100644
33--- a/src/manage.h
34+++ b/src/manage.h
35@@ -24,7 +24,7 @@
36
37 G_BEGIN_DECLS
38
39-gboolean show_search();
40+gboolean show_search(gpointer);
41 void remove_all_selected(gpointer);
42
43 G_END_DECLS
44diff --git a/src/preferences.c b/src/preferences.c
45index 4e9a9ed..8222758 100644
46--- a/src/preferences.c
47+++ b/src/preferences.c
48@@ -430,7 +430,7 @@ static void start_purge_timer(gint timeout_seconds);
49 static void stop_purge_timer();
50
51 /* Purge history if history_timeout is enabled. This function is called every prefs.history_timeout_seconds */
52-static gboolean purge_history() {
53+static gboolean purge_history(gpointer user_data) {
54 if (prefs.history_timeout) {
55 g_list_free(history);
56 history = NULL;