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

Krzysztof Kozlowski <[email protected]>
Newsgroups dev.linux.lists.oe-linux-nfc,org.01.lists.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
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.