srd_decoder_unload_all(): Fix a -Wcast-function-type compiler warning.
authorUwe Hermann <uwe@hermann-uwe.de>
Thu, 30 Aug 2018 18:42:05 +0000 (20:42 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 30 Aug 2018 20:21:03 +0000 (22:21 +0200)
  decoder.c: In function ‘srd_decoder_unload_all’:
  decoder.c:1080:27: warning: cast between incompatible function types from ‘int (*)(struct srd_decoder *)’ to ‘void (*)(void *, void *)’ [-Wcast-function-type]
    g_slist_foreach(pd_list, (GFunc)srd_decoder_unload, NULL);
                           ^

decoder.c

index c195e4bd00710240f75733a34d04a939da694822..7374b779453e015025b59ae6dc4b5f16e5416e09 100644 (file)
--- a/decoder.c
+++ b/decoder.c
@@ -1077,7 +1077,8 @@ SRD_API int srd_decoder_load_all(void)
  */
 SRD_API int srd_decoder_unload_all(void)
 {
-       g_slist_foreach(pd_list, (GFunc)srd_decoder_unload, NULL);
+       for (GSList *l = pd_list; l; l = l->next)
+               srd_decoder_unload(l->data);
        g_slist_free(pd_list);
        pd_list = NULL;