[neard][PATCH v2 35/73] manager: use proper format for integers (-Wformat)

Krzysztof Kozlowski <[email protected]>
Newsgroups dev.linux.lists.oe-linux-nfc,org.01.lists.linux-nfc
Message-ID <[email protected]>
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 <[email protected]>
---
 src/manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/manager.c b/src/manager.c
index e4b72a73fcbb..754c254d85ad 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)
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.