aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-11 16:44:45 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:44:07 +0200
commit32a390663c25400eaa3001c3c2354520e7b7416d (patch)
tree793bb71f3a8ebabd8401cf86a6919ecd3bbf0a9a
parentb4bfa622cc9c11b97e6bf3467593926b0b906384 (diff)
downloadneard-32a390663c25400eaa3001c3c2354520e7b7416d.tar.gz
p2p: use proper format for integers (-Wformat)
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 <krzysztof.kozlowski@canonical.com>
-rw-r--r--plugins/p2p.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/p2p.c b/plugins/p2p.c
index 13702ad..cf3e0ac 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) {