From: Uwe Hermann Date: Thu, 30 Aug 2018 18:46:43 +0000 (+0200) Subject: srd_exit(): Fix a -Wcast-function-type compiler warning. X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=577af027774c422a1d5a73b7a8d1da03caa4e068 srd_exit(): Fix a -Wcast-function-type compiler warning. 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); ^ --- 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);