From 2d9ed6a7e7b77fc6c5a01bfe91812f650ab06968 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 10 Nov 2020 14:13:26 +0900 Subject: [PATCH] system/ping/ping.c: Fix printf format warnings --- system/ping/ping.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/ping/ping.c b/system/ping/ping.c index e969603de..e62eed02b 100644 --- a/system/ping/ping.c +++ b/system/ping/ping.c @@ -122,10 +122,10 @@ static void ping_result(FAR const struct ping_result_s *result) case ICMP_I_BEGIN: printf("PING %u.%u.%u.%u %u bytes of data\n", - (result->dest.s_addr) & 0xff, - (result->dest.s_addr >> 8) & 0xff, - (result->dest.s_addr >> 16) & 0xff, - (result->dest.s_addr >> 24) & 0xff, + (unsigned int)(result->dest.s_addr) & 0xff, + (unsigned int)(result->dest.s_addr >> 8) & 0xff, + (unsigned int)(result->dest.s_addr >> 16) & 0xff, + (unsigned int)(result->dest.s_addr >> 24) & 0xff, result->info->datalen); break; @@ -145,10 +145,10 @@ static void ping_result(FAR const struct ping_result_s *result) case ICMP_W_TIMEOUT: printf("No response from %u.%u.%u.%u: icmp_seq=%u time=%d ms\n", - (result->dest.s_addr) & 0xff, - (result->dest.s_addr >> 8) & 0xff, - (result->dest.s_addr >> 16) & 0xff, - (result->dest.s_addr >> 24) & 0xff, + (unsigned int)(result->dest.s_addr) & 0xff, + (unsigned int)(result->dest.s_addr >> 8) & 0xff, + (unsigned int)(result->dest.s_addr >> 16) & 0xff, + (unsigned int)(result->dest.s_addr >> 24) & 0xff, result->seqno, result->extra); break; @@ -181,10 +181,10 @@ static void ping_result(FAR const struct ping_result_s *result) case ICMP_I_ROUNDTRIP: printf("%u bytes from %u.%u.%u.%u: icmp_seq=%u time=%d ms\n", result->info->datalen, - (result->dest.s_addr) & 0xff, - (result->dest.s_addr >> 8) & 0xff, - (result->dest.s_addr >> 16) & 0xff, - (result->dest.s_addr >> 24) & 0xff, + (unsigned int)(result->dest.s_addr) & 0xff, + (unsigned int)(result->dest.s_addr >> 8) & 0xff, + (unsigned int)(result->dest.s_addr >> 16) & 0xff, + (unsigned int)(result->dest.s_addr >> 24) & 0xff, result->seqno, result->extra); break;