diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-09 11:09:42 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:26:24 +0200 |
commit | 183dbc4055be868e2148aaca2405da3a7152d062 (patch) | |
tree | d352c13f86140578e63a7de6020b8fa4412decd8 | |
parent | 2e5132f005273a387cc2b341551cfb3b810b6c33 (diff) | |
download | neard-183dbc4055be868e2148aaca2405da3a7152d062.tar.gz |
nfctool: fix adapter_compare_idx() cast-function-type
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@canonical.com>
-rw-r--r-- | tools/nfctool/adapter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/nfctool/adapter.c b/tools/nfctool/adapter.c index 5e3bf41..343c4ab 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) |