[linux-nfc] [neard][PATCH 23/34] p2p: use proper format for integers (-Wformat)

Krzysztof Kozlowski <[email protected]>
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Properly print signed and unsigned integers.  This fixes warnings like:

    In file included from plugins/p2p.c:38:
    plugins/p2p.c: In function ‘p2p_listener_event’:
    ./include/near/log.h:45:14: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__u32’ {aka ‘unsigned int’} [-Werror=format=]
       45 |   near_debug("%s:%s() " fmt, \
          |              ^~~~~~~~~~
    plugins/p2p.c:261:2: note: in expansion of macro ‘DBG’
      261 |  DBG("target idx %d", client_addr.target_idx);
          |  ^~~

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 plugins/p2p.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/p2p.c b/plugins/p2p.c
index 13702ade3e14..cf3e0accaf33 100644
--- a/plugins/p2p.c
+++ b/plugins/p2p.c
@@ -256,9 +256,9 @@ static gboolean p2p_listener_event(GIOChannel *channel, GIOCondition condition,
 		return FALSE;
 	}
 
-	DBG("client dsap %d ssap %d",
+	DBG("client dsap %u ssap %u",
 		client_addr.dsap, client_addr.ssap);
-	DBG("target idx %d", client_addr.target_idx);
+	DBG("target idx %u", client_addr.target_idx);
 
 	client_data = g_try_malloc0(sizeof(struct p2p_data));
 	if (!client_data) {
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
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.