unit: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like:
unit/test-ndef-parse.c: In function ‘test_ndef_single_sp’:
unit/test-ndef-parse.c:318:33: error: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
318 | g_print("NDEF SP URI field: %.*s\n", uri->field_length,
| ~~^~ ~~~~~~~~~~~~~~~~~
| | |
| int uint32_t {aka unsigned int}
unit/test-snep-read.c: In function ‘test_snep_dummy_req_put’:
unit/test-snep-read.c:42:12: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
42 | g_printf("[SNEP unit] " fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~
......
118 | frag_cnt, fragment->nfc_data_length,
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| uint32_t {aka unsigned int}
unit/test-snep-read.c: In function ‘test_snep_read_verify_resp’:
unit/test-snep-read.c:42:12: error: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘int’ [-Werror=format=]
42 | g_printf("[SNEP unit] " fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~
......
454 | resp->response, exp_resp_code);
| ~~~~~~~~~~~~~
| |
| int
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2 files changed