[linux-nfc] [neard][PATCH v2 07/73] nfctool: fix nfctool_print_and_remove_snl() cast-function-type

Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:13 +0200
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Fix on GCC v10:

    tools/nfctool/main.c: In function ‘nfctool_snl_cb’:
    tools/nfctool/main.c:352:30: error: cast between incompatible function types from ‘void (*)(struct nfc_snl *, guint32)’ {aka ‘void (*)(struct nfc_snl *, unsigned int)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
      352 |  g_slist_foreach(sdres_list, (GFunc)nfctool_print_and_remove_snl,
          |                              ^

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 tools/nfctool/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/nfctool/main.c b/tools/nfctool/main.c
index 282df519fcc8..72a39de3ccbf 100644
--- a/tools/nfctool/main.c
+++ b/tools/nfctool/main.c
@@ -325,13 +325,13 @@ static int nfctool_poll_cb(guint8 cmd, guint32 idx, gpointer data)
 }
 
 static void nfctool_print_and_remove_snl(struct nfc_snl *sdres,
-					 guint32 adapter_idx)
+					 gpointer adapter_idx)
 {
 	GSList *elem;
 
 	printf(" uri: %s - sap: %d\n", sdres->uri, sdres->sap);
 
-	if (adapter_idx == opts.adapter_idx) {
+	if (GPOINTER_TO_UINT(adapter_idx) == opts.adapter_idx) {
 		elem = g_slist_find_custom(opts.snl_list, sdres->uri,
 					   (GCompareFunc)g_strcmp0);
 
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s