You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/12 18:18:01 UTC

[incubator-nuttx-apps] 02/02: Run nxstyle against files modified in previous commit.

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

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

commit 58085e5983ee9e672ee14a20fbae374d4a567222
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Sun Apr 12 11:22:34 2020 -0600

    Run nxstyle against files modified in previous commit.
---
 examples/pf_ieee802154/pf_server.c | 17 ++++++++++++-----
 examples/userfs/userfs_main.c      |  4 ++--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/examples/pf_ieee802154/pf_server.c b/examples/pf_ieee802154/pf_server.c
index f2afa67..941e938 100644
--- a/examples/pf_ieee802154/pf_server.c
+++ b/examples/pf_ieee802154/pf_server.c
@@ -70,9 +70,11 @@ static inline int check_buffer(unsigned char *buf)
         {
           j = 1;
         }
+
       if (buf[j] != ch)
         {
-          printf("server: Buffer content error for offset=%d, index=%d\n", offset, j);
+          printf("server: Buffer content error for offset=%d, index=%d\n",
+                 offset, j);
           ret = 0;
         }
     }
@@ -95,6 +97,7 @@ int main(int argc, FAR char *argv[])
   int nbytes;
   int optval;
   int offset;
+  int ret;
 
   /* Parse any command line options */
 
@@ -112,7 +115,9 @@ int main(int argc, FAR char *argv[])
   /* Set socket to reuse address */
 
   optval = 1;
-  if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
+  ret = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (FAR void *)&optval,
+                   sizeof(int));
+  if (ret < 0)
     {
       printf("server: setsockopt SO_REUSEADDR failure: %d\n", errno);
       exit(1);
@@ -124,7 +129,7 @@ int main(int argc, FAR char *argv[])
   memcpy(&server.sa_addr, &g_server_addr, sizeof(struct ieee802154_saddr_s));
   addrlen = sizeof(struct sockaddr_ieee802154_s);
 
-  if (bind(sockfd, (struct sockaddr*)&server, addrlen) < 0)
+  if (bind(sockfd, (FAR struct sockaddr *)&server, addrlen) < 0)
     {
       printf("server: bind failure: %d\n", errno);
       exit(1);
@@ -170,14 +175,16 @@ int main(int argc, FAR char *argv[])
 
       if (nbytes != SENDSIZE)
         {
-          printf("server: %d. recv size incorrect: %d vs %d\n", offset, nbytes, SENDSIZE);
+          printf("server: %d. recv size incorrect: %d vs %d\n",
+                 offset, nbytes, SENDSIZE);
           close(sockfd);
           exit(1);
         }
 
       if (offset < inbuf[0])
         {
-          printf("server: %d. %d packets lost, resetting offset\n", offset, inbuf[0] - offset);
+          printf("server: %d. %d packets lost, resetting offset\n",
+                 offset, inbuf[0] - offset);
           offset = inbuf[0];
         }
       else if (offset > inbuf[0])
diff --git a/examples/userfs/userfs_main.c b/examples/userfs/userfs_main.c
index 83478cd..1907352 100644
--- a/examples/userfs/userfs_main.c
+++ b/examples/userfs/userfs_main.c
@@ -215,7 +215,7 @@ static int ufstest_open(FAR void *volinfo, FAR const char *relpath,
   if (file != NULL)
     {
       opriv = (FAR struct ufstest_openfile_s *)
-         malloc(sizeof(struct ufstest_openfile_s ));
+         malloc(sizeof(struct ufstest_openfile_s));
       if (opriv == NULL)
         {
           return -ENOMEM;
@@ -420,7 +420,7 @@ static int ufstest_opendir(FAR void *volinfo, FAR const char *relpath,
       /* The path refers to the top level directory. */
 
       odir = (FAR struct ufstest_opendir_s *)
-         malloc(sizeof(struct ufstest_opendir_s ));
+         malloc(sizeof(struct ufstest_opendir_s));
       if (odir == NULL)
         {
           return -ENOMEM;