| 1 | Patch-Source: https://github.com/CristianHenzel/ClipIt/pull/211
|
| 2 | From 46c53082bd81c769d3422f1bedbab57bc73e8007 Mon Sep 17 00:00:00 2001
|
| 3 | From: Mamoru TASAKA <[email protected]>
|
| 4 | Date: Fri, 17 Jan 2025 00:23:31 +0900
|
| 5 | Subject: [PATCH] Fix function prototype for g_timer_add family for C23
|
| 6 |
|
| 7 | g_timer_add or g_timeout_add_seconds manual says that
|
| 8 | the second argument must have type of GSourceFunc, i.e.
|
| 9 | function with one gpointer argument returning gboolean.
|
| 10 |
|
| 11 | Fixing 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 |
|
| 18 | diff --git a/src/manage.c b/src/manage.c
|
| 19 | index 25f7b75..25ed6d4 100644
|
| 20 | |
| 21 | |
| 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()) {
|
| 31 | diff --git a/src/manage.h b/src/manage.h
|
| 32 | index 8740c0f..b810e74 100644
|
| 33 | |
| 34 | |
| 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
|
| 44 | diff --git a/src/preferences.c b/src/preferences.c
|
| 45 | index 4e9a9ed..8222758 100644
|
| 46 | |
| 47 | |
| 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;
|