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/11/09 12:11:15 UTC

[incubator-nuttx-apps] branch master updated (0d9579e -> d6b67eb)

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

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


    from 0d9579e  Remove deprecated usage of set-env in workflows
     new 0a1825b  testing/ostest/signest.c: Appease nxstyle
     new 6f6c452  testing/ostest/signest.c: Fix a printf warning
     new 0fcb94f  system/ramtest/ramtest.c: Appease nxstyle
     new a085678  system/ramtest/ramtest.c: Fix printf warnings
     new d6b67eb  nshlib/nsh_dbgcmds.c: Fix a few printf warnings

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nshlib/nsh_dbgcmds.c     |  6 +++--
 system/ramtest/ramtest.c | 41 +++++++++++++++++-----------------
 testing/ostest/signest.c | 58 +++++++++++++++++++++++++++---------------------
 3 files changed, 58 insertions(+), 47 deletions(-)


[incubator-nuttx-apps] 04/05: system/ramtest/ramtest.c: Fix printf warnings

Posted by xi...@apache.org.
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 a0856788796eb9a5965ffd8f6680871b41aaf466
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 5 20:57:54 2020 +0900

    system/ramtest/ramtest.c: Fix printf warnings
---
 system/ramtest/ramtest.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/system/ramtest/ramtest.c b/system/ramtest/ramtest.c
index 8204010..d3912ab 100644
--- a/system/ramtest/ramtest.c
+++ b/system/ramtest/ramtest.c
@@ -142,7 +142,8 @@ static void parse_commandline(int argc, char **argv,
   info->start = (uintptr_t)strtoul(argv[optind], &ptr, 16);
   if (*ptr != '\0')
     {
-      printf(RAMTEST_PREFIX "Invalid <hex-address>: %s->%lx [%02x]\n",
+      printf(RAMTEST_PREFIX "Invalid <hex-address>: %s->%" PRIxPTR
+             " [%02x]\n",
              argv[optind], info->start, *ptr);
       show_usage(argv[0], EXIT_FAILURE);
     }
@@ -157,7 +158,7 @@ static void parse_commandline(int argc, char **argv,
   info->size = (size_t)strtoul(argv[optind], &ptr, 10);
   if (*ptr != '\0')
     {
-      printf(RAMTEST_PREFIX "Invalid <decimal-size>: %s->%lx [%02x]\n",
+      printf(RAMTEST_PREFIX "Invalid <decimal-size>: %s->%zx [%02x]\n",
              argv[optind], info->size, *ptr);
       show_usage(argv[0], EXIT_FAILURE);
     }


[incubator-nuttx-apps] 05/05: nshlib/nsh_dbgcmds.c: Fix a few printf warnings

Posted by xi...@apache.org.
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 d6b67eb05e806ae9550d563a5e04373a199e2886
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 5 21:09:11 2020 +0900

    nshlib/nsh_dbgcmds.c: Fix a few printf warnings
---
 nshlib/nsh_dbgcmds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/nshlib/nsh_dbgcmds.c b/nshlib/nsh_dbgcmds.c
index 7559837..cb1a14e 100644
--- a/nshlib/nsh_dbgcmds.c
+++ b/nshlib/nsh_dbgcmds.c
@@ -445,7 +445,8 @@ int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
                       dumpbytes = count;
                     }
 
-                  snprintf(msg, sizeof(msg), "%s at %08x", argv[1], skip);
+                  snprintf(msg, sizeof(msg), "%s at %08jx", argv[1],
+                           (uintmax_t)skip);
                   nsh_dumpbuffer(vtbl, msg,
                                  &buffer[nbytesread - (position - skip)],
                                  dumpbytes);
@@ -473,7 +474,8 @@ int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
             }
 #endif
 
-          snprintf(msg, sizeof(msg), "%s at %08x", argv[1], position);
+          snprintf(msg, sizeof(msg), "%s at %08jx", argv[1],
+                   (uintmax_t)position);
           nsh_dumpbuffer(vtbl, msg, buffer, nbytesread);
           position += nbytesread;
 


[incubator-nuttx-apps] 02/05: testing/ostest/signest.c: Fix a printf warning

Posted by xi...@apache.org.
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 6f6c4529917ef69a1eeb1491eed745fbb90f46b7
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 5 20:49:45 2020 +0900

    testing/ostest/signest.c: Fix a printf warning
    
    error: too many arguments for format [-Werror=format-extra-args]
---
 testing/ostest/signest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c
index f7a1593..3548ee6 100644
--- a/testing/ostest/signest.c
+++ b/testing/ostest/signest.c
@@ -167,7 +167,8 @@ static int waiter_main(int argc, char *argv[])
           ret = sigaction(i, &act, NULL);
           if (ret < 0)
             {
-              printf("waiter_main: WARNING sigaction failed\n" , errno);
+              printf("waiter_main: WARNING sigaction failed with %d\n",
+                     errno);
               return EXIT_FAILURE;
             }
         }


[incubator-nuttx-apps] 01/05: testing/ostest/signest.c: Appease nxstyle

Posted by xi...@apache.org.
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 0a1825b384814d0d6b404b21ac1347896cb61b39
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 5 20:48:55 2020 +0900

    testing/ostest/signest.c: Appease nxstyle
---
 testing/ostest/signest.c | 55 +++++++++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c
index ea720d8..f7a1593 100644
--- a/testing/ostest/signest.c
+++ b/testing/ostest/signest.c
@@ -33,6 +33,10 @@
  *
  ****************************************************************************/
 
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
 #include <sys/types.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -80,17 +84,17 @@ static volatile int g_nest_level;
 static bool signest_catchable(int signo)
 {
 #ifdef CONFIG_SIG_SIGSTOP_ACTION
-   if (signo == SIGSTOP || signo == SIGCONT)
-     {
-       return false;
-     }
+  if (signo == SIGSTOP || signo == SIGCONT)
+    {
+      return false;
+    }
 #endif
 
 #ifdef CONFIG_SIG_SIGKILL_ACTION
-   if (signo == SIGKILL)
-     {
-       return false;
-     }
+  if (signo == SIGKILL)
+    {
+      return false;
+    }
 #endif
 
   return true;
@@ -131,8 +135,8 @@ static int waiter_main(int argc, char *argv[])
   int ret;
   int i;
 
-  printf("waiter_main: Waiter started\n" );
-  printf("waiter_main: Setting signal mask\n" );
+  printf("waiter_main: Waiter started\n");
+  printf("waiter_main: Setting signal mask\n");
 
   sigemptyset(&set);
   ret = sigprocmask(SIG_SETMASK, &set, NULL);
@@ -142,7 +146,7 @@ static int waiter_main(int argc, char *argv[])
       return EXIT_FAILURE;
     }
 
-  printf("waiter_main: Registering signal handler\n" );
+  printf("waiter_main: Registering signal handler\n");
 
   act.sa_handler = waiter_action;
   act.sa_flags   = 0;
@@ -171,7 +175,7 @@ static int waiter_main(int argc, char *argv[])
 
   /* Now just loop until the test completes */
 
-  printf("waiter_main: Waiting on semaphore\n" );
+  printf("waiter_main: Waiting on semaphore\n");
   FFLUSH();
 
   g_waiter_running = true;
@@ -190,7 +194,7 @@ static int interfere_main(int argc, char *argv[])
 {
   /* Now just loop staying in the way as much as possible */
 
-  printf("interfere_main: Waiting on semaphore\n" );
+  printf("interfere_main: Waiting on semaphore\n");
   FFLUSH();
 
   g_interferer_running = true;
@@ -204,6 +208,7 @@ static int interfere_main(int argc, char *argv[])
   g_interferer_running = false;
   return EXIT_SUCCESS;
 }
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -243,7 +248,7 @@ void signest_test(void)
   ret = sched_getparam (0, &param);
   if (ret < 0)
     {
-      printf("signest_test: ERROR sched_getparam() failed\n" );
+      printf("signest_test: ERROR sched_getparam() failed\n");
       param.sched_priority = PTHREAD_DEFAULT_PRIORITY;
     }
 
@@ -278,9 +283,11 @@ void signest_test(void)
   /* Wait a bit */
 
   FFLUSH();
-  usleep(500*1000L);
+  usleep(500 * 1000L);
 
-  /* Then signal the waiter thread with back-to-back signals, one masked and the other unmasked. */
+  /* Then signal the waiter thread with back-to-back signals, one masked
+   * and the other unmasked.
+   */
 
   for (i = 0; i < 10; i++)
     {
@@ -298,7 +305,7 @@ void signest_test(void)
               even_signals++;
             }
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
 
           /* Even then odd */
 
@@ -314,7 +321,7 @@ void signest_test(void)
               odd_signals++;
             }
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
         }
     }
 
@@ -359,7 +366,7 @@ void signest_test(void)
 
           sched_unlock();
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
 
           /* Even then odd */
 
@@ -379,7 +386,7 @@ void signest_test(void)
 
           sched_unlock();
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
         }
     }
 
@@ -423,7 +430,7 @@ void signest_test(void)
 
           sched_unlock();
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
 
           /* Even then odd */
 
@@ -444,7 +451,7 @@ void signest_test(void)
 
           sched_unlock();
 
-          usleep(10*1000L);
+          usleep(10 * 1000L);
         }
     }
 
@@ -454,7 +461,7 @@ errout_with_waiter:
   g_done = true;
   sem_post(&g_waiter_sem);
   sem_post(&g_interferer_sem);
-  usleep(500*1000L);
+  usleep(500 * 1000L);
 
   /* Check the final test results */
 
@@ -509,6 +516,6 @@ errout_with_waiter:
   sem_destroy(&g_waiter_sem);
   sem_destroy(&g_interferer_sem);
 
-  printf("signest_test: done\n" );
+  printf("signest_test: done\n");
   FFLUSH();
 }


[incubator-nuttx-apps] 03/05: system/ramtest/ramtest.c: Appease nxstyle

Posted by xi...@apache.org.
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 0fcb94f99908c7292a3e8856fbb48b7c9eb24c01
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Nov 5 20:52:38 2020 +0900

    system/ramtest/ramtest.c: Appease nxstyle
---
 system/ramtest/ramtest.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/system/ramtest/ramtest.c b/system/ramtest/ramtest.c
index c566189..8204010 100644
--- a/system/ramtest/ramtest.c
+++ b/system/ramtest/ramtest.c
@@ -198,7 +198,7 @@ static void write_memory(FAR struct ramtest_s *info, uint32_t value)
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           *ptr++ = value;
@@ -206,7 +206,7 @@ static void write_memory(FAR struct ramtest_s *info, uint32_t value)
     }
   else if (info->width == 16)
     {
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           *ptr++ = (uint16_t)value;
@@ -214,7 +214,7 @@ static void write_memory(FAR struct ramtest_s *info, uint32_t value)
     }
   else /* if (info->width == 8) */
     {
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           *ptr++ = (uint8_t)value;
@@ -232,7 +232,7 @@ static void verify_memory(FAR struct ramtest_s *info, uint32_t value)
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           if (*ptr != value)
@@ -248,7 +248,7 @@ static void verify_memory(FAR struct ramtest_s *info, uint32_t value)
   else if (info->width == 16)
     {
       uint16_t value16 = (uint16_t)(value & 0x0000ffff);
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           if (*ptr != value16)
@@ -264,7 +264,7 @@ static void verify_memory(FAR struct ramtest_s *info, uint32_t value)
   else /* if (info->width == 8) */
     {
       uint8_t value8 = (uint8_t)(value & 0x000000ff);
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           if (*ptr != value8)
@@ -332,7 +332,7 @@ static void write_memory2(FAR struct ramtest_s *info, uint32_t value_1,
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           *ptr++ = value_1;
@@ -341,7 +341,7 @@ static void write_memory2(FAR struct ramtest_s *info, uint32_t value_1,
     }
   else if (info->width == 16)
     {
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           *ptr++ = (uint16_t)value_1;
@@ -350,7 +350,7 @@ static void write_memory2(FAR struct ramtest_s *info, uint32_t value_1,
     }
   else /* if (info->width == 8) */
     {
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           *ptr++ = (uint8_t)value_1;
@@ -371,7 +371,7 @@ static void verify_memory2(FAR struct ramtest_s *info, uint32_t value_1,
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           if (ptr[0] != value_1 || ptr[1] != value_2)
@@ -391,7 +391,7 @@ static void verify_memory2(FAR struct ramtest_s *info, uint32_t value_1,
     {
       uint16_t value16_1 = (uint16_t)(value_1 & 0x0000ffff);
       uint16_t value16_2 = (uint16_t)(value_2 & 0x0000ffff);
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           if (ptr[0] != value16_1 || ptr[1] != value16_2)
@@ -411,7 +411,7 @@ static void verify_memory2(FAR struct ramtest_s *info, uint32_t value_1,
     {
       uint8_t value8_1 = (uint8_t)(value_1 & 0x000000ff);
       uint8_t value8_2 = (uint8_t)(value_2 & 0x000000ff);
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < even_nxfrs; i += 2)
         {
           if (ptr[0] != value8_1 || ptr[1] != value8_2)
@@ -453,7 +453,7 @@ static void write_addrinaddr(FAR struct ramtest_s *info)
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint32_t value32 = (uint32_t)((uintptr_t)ptr);
@@ -462,7 +462,7 @@ static void write_addrinaddr(FAR struct ramtest_s *info)
     }
   else if (info->width == 16)
     {
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint16_t value16 = (uint16_t)((uintptr_t)ptr & 0x0000ffff);
@@ -471,7 +471,7 @@ static void write_addrinaddr(FAR struct ramtest_s *info)
     }
   else /* if (info->width == 8) */
     {
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint8_t value8 = (uint8_t)((uintptr_t)ptr & 0x000000ff);
@@ -490,7 +490,7 @@ static void verify_addrinaddr(FAR struct ramtest_s *info)
 
   if (info->width == 32)
     {
-      uint32_t *ptr = (uint32_t*)info->start;
+      uint32_t *ptr = (uint32_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint32_t value32 = (uint32_t)((uintptr_t)ptr);
@@ -506,7 +506,7 @@ static void verify_addrinaddr(FAR struct ramtest_s *info)
     }
   else if (info->width == 16)
     {
-      uint16_t *ptr = (uint16_t*)info->start;
+      uint16_t *ptr = (uint16_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint16_t value16 = (uint16_t)((uintptr_t)ptr & 0x0000ffff);
@@ -522,7 +522,7 @@ static void verify_addrinaddr(FAR struct ramtest_s *info)
     }
   else /* if (info->width == 8) */
     {
-      uint8_t *ptr = (uint8_t*)info->start;
+      uint8_t *ptr = (uint8_t *)info->start;
       for (i = 0; i < info->nxfrs; i++)
         {
           uint16_t value8 = (uint8_t)((uintptr_t)ptr & 0x000000ff);