clipit/clipit-pr211-c23-function-prototype.patch
Mamoru TASAKA b3d8fc249c support C23
2025-01-17 00:35:52 +09:00

55 lines
1.7 KiB
Diff

From 46c53082bd81c769d3422f1bedbab57bc73e8007 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 17 Jan 2025 00:23:31 +0900
Subject: [PATCH] Fix function prototype for g_timer_add family for C23
g_timer_add or g_timeout_add_seconds manual says that
the second argument must have type of GSourceFunc, i.e.
function with one gpointer argument returning gboolean.
Fixing so, unless compilation fails with C23.
---
src/manage.c | 2 +-
src/manage.h | 2 +-
src/preferences.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/manage.c b/src/manage.c
index 25f7b75..25ed6d4 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -331,7 +331,7 @@ void search_window_response(GtkDialog *dialog, gint response_id, gpointer user_d
}
/* Shows the search dialog */
-gboolean show_search()
+gboolean show_search(gpointer user_data)
{
/* Prevent multiple instances */
if(gtk_grab_get_current()) {
diff --git a/src/manage.h b/src/manage.h
index 8740c0f..b810e74 100644
--- a/src/manage.h
+++ b/src/manage.h
@@ -24,7 +24,7 @@
G_BEGIN_DECLS
-gboolean show_search();
+gboolean show_search(gpointer);
void remove_all_selected(gpointer);
G_END_DECLS
diff --git a/src/preferences.c b/src/preferences.c
index 4e9a9ed..8222758 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -430,7 +430,7 @@ static void start_purge_timer(gint timeout_seconds);
static void stop_purge_timer();
/* Purge history if history_timeout is enabled. This function is called every prefs.history_timeout_seconds */
-static gboolean purge_history() {
+static gboolean purge_history(gpointer user_data) {
if (prefs.history_timeout) {
g_list_free(history);
history = NULL;