You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/01/15 08:24:07 UTC

[incubator-nuttx-apps] branch master updated: netutils : iperf: Fix compile warnings with Arm GCC 9.3.1

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f079d1  netutils : iperf: Fix compile warnings with Arm GCC 9.3.1
7f079d1 is described below

commit 7f079d1c3c07b9e3385348b2128a8ad75b75c6c3
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Jan 15 14:57:35 2021 +0900

    netutils : iperf: Fix compile warnings with Arm GCC 9.3.1
    
    Summary:
    - This commit fixes compile warnings with Arm GCC 9.3.1
    
    Impact:
    - None
    
    Testing:
    - Tested with lm3s6965-ek:discover
    - NOTE: need to add the following configs
      +CONFIG_EXAMPLES_IPERF=y
      +CONFIG_EXAMPLES_IPERFTEST_DEVNAME="eth0"
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 netutils/iperf/iperf.c      | 8 +++++---
 netutils/iperf/iperf_main.c | 6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c
index b24764d..59570bd 100644
--- a/netutils/iperf/iperf.c
+++ b/netutils/iperf/iperf.c
@@ -208,8 +208,10 @@ static void iperf_report_task(void *arg)
   while (!s_iperf_ctrl.finish)
     {
       sleep(interval);
-      printf("%4d-%4d sec,  %.2f Mbits/sec\n", cur, cur + interval,
-        (double)((s_iperf_ctrl.total_len - last_len) * 8) / interval / 1e6);
+      printf("%4" PRId32 "-%4" PRId32 " sec,  %.2f Mbits/sec\n",
+             cur, cur + interval,
+             (double)((s_iperf_ctrl.total_len - last_len) * 8) /
+             interval / 1e6);
       cur += interval;
       last_len = s_iperf_ctrl.total_len;
       if (cur >= time)
@@ -220,7 +222,7 @@ static void iperf_report_task(void *arg)
 
   if (cur != 0)
     {
-      printf("%4d-%4d sec,  %.2f Mbits/sec\n", 0, time,
+      printf("%4d-%4" PRId32 " sec,  %.2f Mbits/sec\n", 0, time,
             (double)(s_iperf_ctrl.total_len * 8) / cur / 1e6);
     }
 
diff --git a/netutils/iperf/iperf_main.c b/netutils/iperf/iperf_main.c
index 7e29314..f559a86 100644
--- a/netutils/iperf/iperf_main.c
+++ b/netutils/iperf/iperf_main.c
@@ -215,8 +215,10 @@ int main(int argc, FAR char *argv[])
         }
     }
 
-  printf("\n mode=%s-%s sip=%d.%d.%d.%d:%d,\
-         dip=%d.%d.%d.%d:%d, interval=%d, time=%d\n",
+  printf("\n mode=%s-%s "
+         "sip=%" PRId32 ".%" PRId32 ".%" PRId32 ".%" PRId32 ":%d,"
+         "dip=%" PRId32 ".%" PRId32 ".%" PRId32 ".%" PRId32 ":%d, "
+         "interval=%" PRId32 ", time=%" PRId32 " \n",
          cfg.flag & IPERF_FLAG_TCP ?"tcp":"udp",
          cfg.flag & IPERF_FLAG_SERVER ?"server":"client",
          cfg.sip & 0xff, (cfg.sip >> 8) & 0xff, (cfg.sip >> 16) & 0xff,