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

Krzysztof Kozlowski <[email protected]>
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Fix on GCC v10:

    tools/nfctool/adapter.c: In function ‘adpater_print_targets’:
    tools/nfctool/adapter.c:69:33: error: cast between incompatible function types from ‘void (*)(guint32,  gchar *)’ {aka ‘void (*)(unsigned int,  char *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
       69 |  g_slist_foreach(adapter->tags, (GFunc)adapter_print_target, "tag");
          |                                 ^

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

diff --git a/tools/nfctool/adapter.c b/tools/nfctool/adapter.c
index 5a0c34a0f28b..453c2c099009 100644
--- a/tools/nfctool/adapter.c
+++ b/tools/nfctool/adapter.c
@@ -57,9 +57,9 @@ int adapter_all_get_devices(void)
 	return 0;
 }
 
-static void adapter_print_target(guint32 idx, gchar *type)
+static void adapter_print_target(gpointer idx, gchar *type)
 {
-	printf("%s%d ", type, idx);
+	printf("%s%d ", type, GPOINTER_TO_INT(idx));
 }
 
 void adpater_print_targets(struct nfc_adapter *adapter, gchar *prefix)
-- 
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.