diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-11 16:50:49 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:44:07 +0200 |
commit | af87acbba6059bd744d06ead696a53415b69195e (patch) | |
tree | c9d01608248daa4a26f9569b568b8f6b9438fe67 | |
parent | da5f7e53b3653f1e1f46401922713a5660b65dc1 (diff) | |
download | neard-af87acbba6059bd744d06ead696a53415b69195e.tar.gz |
device: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like:
src/device.c: In function ‘near_device_get_device’:
src/device.c:85:33: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
85 | path = g_strdup_printf("%s/nfc%d/device%d", NFC_PATH,
| ~^
| |
| int
| %d
86 | adapter_idx, target_idx);
| ~~~~~~~~~~~
| |
| uint32_t {aka unsigned int}
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r-- | src/device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c index a6598e0..aeae7d3 100644 --- a/src/device.c +++ b/src/device.c @@ -82,7 +82,7 @@ struct near_device *near_device_get_device(uint32_t adapter_idx, DBG(""); - path = g_strdup_printf("%s/nfc%d/device%d", NFC_PATH, + path = g_strdup_printf("%s/nfc%u/device%u", NFC_PATH, adapter_idx, target_idx); if (!path) return NULL; @@ -305,7 +305,7 @@ int near_device_add_records(struct near_device *device, GList *records, for (list = records; list; list = list->next) { record = list->data; - path = g_strdup_printf("%s/nfc%d/device%d/record%d", + path = g_strdup_printf("%s/nfc%u/device%u/record%u", NFC_PATH, device->adapter_idx, device->target_idx, device->n_records); @@ -342,7 +342,7 @@ struct near_device *__near_device_add(uint32_t adapter_idx, uint32_t target_idx, if (!device) return NULL; - device->path = g_strdup_printf("%s/nfc%d/device%d", NFC_PATH, + device->path = g_strdup_printf("%s/nfc%u/device%u", NFC_PATH, adapter_idx, target_idx); if (!device->path) { g_free(device); |