tag: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like:
src/tag.c: In function ‘near_tag_get_tag’:
src/tag.c:99:33: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
99 | path = g_strdup_printf("%s/nfc%d/tag%d", NFC_PATH,
| ~^
| |
| int
| %d
100 | adapter_idx, target_idx);
| ~~~~~~~~~~~
| |
| uint32_t {aka unsigned int}
In file included from src/near.h:36,
from src/tag.c:35:
src/tag.c: In function ‘near_tag_set_nfcid’:
./include/near/log.h:45:14: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
45 | near_debug("%s:%s() " fmt, \
| ^~~~~~~~~~
src/tag.c:791:2: note: in expansion of macro ‘DBG’
791 | DBG("NFCID len %zd", nfcid_len);
| ^~~
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
1 file changed