From 577af027774c422a1d5a73b7a8d1da03caa4e068 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Thu, 30 Aug 2018 20:46:43 +0200 Subject: [PATCH] srd_exit(): Fix a -Wcast-function-type compiler warning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit srd.c: In function ‘srd_exit’: srd.c:310:28: warning: cast between incompatible function types from ‘int (*)(struct srd_session *)’ to ‘void (*)(void *, void *)’ [-Wcast-function-type] g_slist_foreach(sessions, (GFunc)srd_session_destroy, NULL); ^ --- srd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srd.c b/srd.c index d4ec44b..5903c6d 100644 --- a/srd.c +++ b/srd.c @@ -307,7 +307,8 @@ SRD_API int srd_exit(void) { srd_dbg("Exiting libsigrokdecode."); - g_slist_foreach(sessions, (GFunc)srd_session_destroy, NULL); + for (GSList *l = sessions; l; l = l->next) + srd_session_destroy(l->data); srd_decoder_unload_all(); g_slist_free_full(searchpaths, g_free); -- 2.30.2