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 2020/03/28 16:56:54 UTC

[incubator-nuttx-apps] 02/02: examples/udpblaster: Fix some nxstyle errors

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

commit e8b0c903bceffb0187122aeba53eb101784702ef
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Mar 29 01:21:56 2020 +0900

    examples/udpblaster: Fix some nxstyle errors
---
 examples/udpblaster/udpblaster_host.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/examples/udpblaster/udpblaster_host.c b/examples/udpblaster/udpblaster_host.c
index 935f98f..7facfe3 100644
--- a/examples/udpblaster/udpblaster_host.c
+++ b/examples/udpblaster/udpblaster_host.c
@@ -50,6 +50,10 @@
 #include "udpblaster.h"
 
 /****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
  * main
  ****************************************************************************/
 
@@ -115,10 +119,13 @@ int main(int argc, char **argv, char **envp)
    * bits/sec     = CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE
    * bytes/sec    = CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE / 8
    * packets/sec  = (bytes/sec) / (bytes/packet)
-   *              = CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE / UDPBLASTER_SENDSIZE / 8
+   *              = CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE /
+   *                UDPBLASTER_SENDSIZE / 8
    * delay        = microseconds/packet
-   *              = (1000000 * UDPBLASTER_SENDSIZE) / CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE / 8
-   *              = (125000 * UDPBLASTER_SENDSIZE) / CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE
+   *              = (1000000 * UDPBLASTER_SENDSIZE) /
+   *                CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE / 8
+   *              = (125000 * UDPBLASTER_SENDSIZE) /
+   *                CONFIG_EXAMPLES_UDPBLASTER_HOSTRATE
    */
 
   sendsize = UDPBLASTER_SENDSIZE;
@@ -127,7 +134,7 @@ int main(int argc, char **argv, char **envp)
   npackets = 0;
   ndots    = 0;
 
-  for (;;)
+  for (; ; )
     {
       ret = sendto(sockfd, g_udpblaster_text, sendsize, 0,
                    (struct sockaddr *)&target, addrlen);
@@ -143,10 +150,10 @@ int main(int argc, char **argv, char **envp)
           npackets = 0;
 
           if (++ndots >= 50)
-          {
-            putchar('\n');
-            ndots = 0;
-          }
+            {
+              putchar('\n');
+              ndots = 0;
+            }
         }
 
       usleep(delay);