diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-11 16:53:14 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:44:07 +0200 |
commit | 311478ec1f45cc840632ab4f0d8914b07bf5629b (patch) | |
tree | 5e2b014b4e6bbe521fe812cafc27c340fd222535 | |
parent | af87acbba6059bd744d06ead696a53415b69195e (diff) | |
download | neard-311478ec1f45cc840632ab4f0d8914b07bf5629b.tar.gz |
manager: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like:
In file included from src/near.h:36,
from src/manager.c:34:
src/manager.c: In function ‘__near_manager_adapter_add’:
./include/near/log.h:45:14: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
45 | near_debug("%s:%s() " fmt, \
| ^~~~~~~~~~
src/manager.c:45:2: note: in expansion of macro ‘DBG’
45 | DBG("idx %d", idx);
| ^~~
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r-- | src/manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/manager.c b/src/manager.c index e4b72a7..754c254 100644 --- a/src/manager.c +++ b/src/manager.c @@ -42,7 +42,7 @@ int __near_manager_adapter_add(uint32_t idx, const char *name, const char *path; int err; - DBG("idx %d", idx); + DBG("idx %u", idx); adapter = __near_adapter_create(idx, name, protocols, powered); if (!adapter) @@ -66,7 +66,7 @@ void __near_manager_adapter_remove(uint32_t idx) struct near_adapter *adapter; const char *path; - DBG("idx %d", idx); + DBG("idx %u", idx); adapter = __near_adapter_get(idx); if (!adapter) |