summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-10-06 15:57:49 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-10-06 15:57:49 +0200
commit23db45031fe3406985ad3cf2216a7f61cf2a15d4 (patch)
treeeda86269181aaa6dc9f5de9bfca3e06bf4276383
parent4f0d192d748e987af43ec5b811a643eb0a8601b2 (diff)
downloadlibsigrokdecode-23db45031fe3406985ad3cf2216a7f61cf2a15d4.tar.gz
libsigrokdecode-23db45031fe3406985ad3cf2216a7f61cf2a15d4.zip
srd.c: Fix a compiler warning with gcc 8.
srd.c: In function ‘srd_searchpaths_get’: srd.c:399:40: warning: cast between incompatible function types from ‘gchar * (*)(const gchar *)’ {aka ‘char * (*)(const char *)’} to ‘void * (*)(const void *, void *)’ [-Wcast-function-type] return g_slist_copy_deep(searchpaths, (GCopyFunc)g_strdup, NULL); ^ Upstream glib issue / documentation change: https://gitlab.gnome.org/GNOME/glib/issues/1492 https://gitlab.gnome.org/pwithnall/glib/commit/e81f4c2acea5ada6ae989426e462613f7c612cac
-rw-r--r--srd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/srd.c b/srd.c
index 5903c6d..eb29f61 100644
--- a/srd.c
+++ b/srd.c
@@ -396,7 +396,12 @@ err:
*/
SRD_API GSList *srd_searchpaths_get(void)
{
- return g_slist_copy_deep(searchpaths, (GCopyFunc)g_strdup, NULL);
+ GSList *paths = NULL;
+
+ for (GSList *l = searchpaths; l; l = l->next)
+ paths = g_slist_append(paths, g_strdup(l->data));
+
+ return paths;
}
/** @} */