Fix on GCC v10:
tools/nfctool/adapter.c: In function ‘adapter_get’:
tools/nfctool/adapter.c:155:8: error: cast between incompatible function types from
‘gint (*)(struct nfc_adapter *, guint32)’ {aka ‘int (*)(struct nfc_adapter *, unsigned
int)’} to ‘gint (*)(const void *, const void *)’ {aka ‘int (*)(const void *, const void
*)’} [-Werror=cast-function-type]
155 | (GCompareFunc)adapter_compare_idx);
| ^
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)canonical.com>
---
tools/nfctool/adapter.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/nfctool/adapter.c b/tools/nfctool/adapter.c
index 5e3bf41884d1..343c4ab7d0ff 100644
--- a/tools/nfctool/adapter.c
+++ b/tools/nfctool/adapter.c
@@ -139,9 +139,11 @@ void adapter_idx_print_info(guint32 idx)
g_slist_foreach(adapters, (GFunc)adapter_print_info, NULL);
}
-static gint adapter_compare_idx(struct nfc_adapter *adapter, guint32 idx)
+static gint adapter_compare_idx(struct nfc_adapter *adapter, gpointer idx_ptr)
{
- return (gint)adapter->idx - (gint)idx;
+ gint idx = GPOINTER_TO_INT(idx_ptr);
+
+ return (gint)adapter->idx - idx;
}
struct nfc_adapter *adapter_get(guint32 idx)
--
2.27.0