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/15 01:49:25 UTC

[incubator-nuttx-apps] branch master updated (03284a0 -> c408462)

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 03284a0  Fix license headers on Make.defs and Makefile
     new 780891f  examples/media/media_main.c: Appease nxstyle
     new 0d3fde2  examples/media/media_main.c: Fix printf format warnings
     new fa727e0  examples/fboverlay/fboverlay_main.c: Fix printf format warnings
     new 473fef4  examples/romfs/romfs_main.c: Appease nxstyle
     new c408462  examples/romfs/romfs_main.c: Fix a printf format warning

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:
 examples/fboverlay/fboverlay_main.c | 13 +++++++------
 examples/media/media_main.c         | 34 ++++++++++++++++++++--------------
 examples/romfs/romfs_main.c         | 32 ++++++++++++++++++++++----------
 3 files changed, 49 insertions(+), 30 deletions(-)


[incubator-nuttx-apps] 05/05: examples/romfs/romfs_main.c: Fix a printf format 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 c408462892a112ff94f10f25b7870e2b3e94f6b6
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Nov 14 08:54:51 2020 +0900

    examples/romfs/romfs_main.c: Fix a printf format warning
---
 examples/romfs/romfs_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/romfs/romfs_main.c b/examples/romfs/romfs_main.c
index da9f428..80e9b11 100644
--- a/examples/romfs/romfs_main.c
+++ b/examples/romfs/romfs_main.c
@@ -60,7 +60,9 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
+#include <inttypes.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -274,7 +276,8 @@ static void checkattributes(const char *path, mode_t mode, size_t size)
 
   if (size != buf.st_size)
     {
-      printf("  -- ERROR: Expected size %d, got %d\n", mode, buf.st_size);
+      printf("  -- ERROR: Expected size %zu, got %ju\n", size,
+             (uintmax_t)buf.st_size);
       g_nerrors++;
     }
 }


[incubator-nuttx-apps] 03/05: examples/fboverlay/fboverlay_main.c: Fix printf format 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 fa727e08f199141673b1b768bcc904cdd9e965d4
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Nov 14 08:48:38 2020 +0900

    examples/fboverlay/fboverlay_main.c: Fix printf format warnings
---
 examples/fboverlay/fboverlay_main.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/examples/fboverlay/fboverlay_main.c b/examples/fboverlay/fboverlay_main.c
index a3fbf8d..35ac372 100644
--- a/examples/fboverlay/fboverlay_main.c
+++ b/examples/fboverlay/fboverlay_main.c
@@ -37,6 +37,7 @@
  * Included Files
  ****************************************************************************/
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -427,12 +428,12 @@ static void print_plane_info(int fb)
 
   printf("PlaneInfo:\n"
          "    fbmem: %p\n"
-         "    fblen: %lu\n"
+         "    fblen: %zu\n"
          "   stride: %u\n"
          "  display: %u\n"
          "      bpp: %u\n"
          "    fbmem: %p\n",
-         pinfo.fbmem, (unsigned long)pinfo.fblen, pinfo.stride,
+         pinfo.fbmem, pinfo.fblen, pinfo.stride,
          pinfo.display,
          pinfo.bpp, fbmem);
 }
@@ -484,7 +485,7 @@ static void print_overlay_info(int fb, uint8_t overlayno)
 
   printf("OverlayInfo:\n"
          "    fbmem: %p\n"
-         "    fblen: %lu\n"
+         "    fblen: %zu\n"
          "   stride: %u\n"
          "  overlay: %u\n"
          "      bpp: %u\n"
@@ -495,7 +496,7 @@ static void print_overlay_info(int fb, uint8_t overlayno)
          "     mode: %08x\n"
          "     accl: %08" PRIx32 "\n"
          "     mmap: %p\n",
-         oinfo.fbmem, (unsigned long)oinfo.fblen, oinfo.stride,
+         oinfo.fbmem, oinfo.fblen, oinfo.stride,
          oinfo.overlay,
          oinfo.bpp, oinfo.blank, oinfo.chromakey, oinfo.color,
          oinfo.transp.transp, oinfo.transp.transp_mode, oinfo.accl, fbmem);
@@ -560,8 +561,8 @@ static int overlay_fill(int fb, uint8_t overlayno, uint32_t color,
 
       if (offset > oinfo.fblen)
         {
-          fprintf(stderr, "Area is out of range: %d >= %d\n", offset,
-                  oinfo.fblen);
+          fprintf(stderr, "Area is out of range: %" PRId32 " >= %zu\n",
+                  offset, oinfo.fblen);
           return -1;
         }
 


[incubator-nuttx-apps] 02/05: examples/media/media_main.c: Fix printf format 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 0d3fde2d6b748950fadb31dba38fb0d727ce8e50
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Fri Nov 13 19:58:14 2020 +0900

    examples/media/media_main.c: Fix printf format warnings
---
 examples/media/media_main.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/examples/media/media_main.c b/examples/media/media_main.c
index 73730d6..d3483f0 100644
--- a/examples/media/media_main.c
+++ b/examples/media/media_main.c
@@ -41,6 +41,7 @@
 
 #include <sys/ioctl.h>
 
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -217,16 +218,16 @@ int main(int argc, FAR char *argv[])
         {
           int errcode = errno;
 
-          fprintf(stderr, "ERROR: lseek to %lu failed: %d\n",
-                  (unsigned long)pos, errcode);
+          fprintf(stderr, "ERROR: lseek to %ju failed: %d\n",
+                  (uintmax_t)pos, errcode);
           fprintf(stderr, "ERROR: Aborting at block: %lu\n", blockno);
           info.nblocks = blockno;
           break;
         }
       else if (seekpos != pos)
         {
-          fprintf(stderr, "ERROR: lseek failed: %lu vs %lu\n",
-                  (unsigned)seekpos, (unsigned long) pos);
+          fprintf(stderr, "ERROR: lseek failed: %ju vs %ju\n",
+                  (uintmax_t)seekpos, (uintmax_t) pos);
           fprintf(stderr, "ERROR: Aborting at block: %lu\n", blockno);
           info.nblocks = blockno;
           break;
@@ -259,16 +260,16 @@ int main(int argc, FAR char *argv[])
         {
           int errcode = errno;
 
-          fprintf(stderr, "ERROR: lseek to %lu failed: %d\n",
-                  (unsigned long)pos, errcode);
+          fprintf(stderr, "ERROR: lseek to %ju failed: %d\n",
+                  (uintmax_t)pos, errcode);
           fprintf(stderr, "ERROR: Aborting at block: %lu\n", blockno);
           info.nblocks = blockno;
           break;
         }
       else if (seekpos != pos)
         {
-          fprintf(stderr, "ERROR: lseek failed: %lu vs %lu\n",
-                  (unsigned)seekpos, (unsigned long) pos);
+          fprintf(stderr, "ERROR: lseek failed: %ju vs %ju\n",
+                  (uintmax_t)seekpos, (uintmax_t)pos);
           fprintf(stderr, "ERROR: Aborting at block: %lu\n", blockno);
           info.nblocks = blockno;
           break;
@@ -339,8 +340,8 @@ int main(int argc, FAR char *argv[])
     }
   else if (seekpos != 0)
     {
-      fprintf(stderr, "ERROR: lseek to 0 failed: %lu\n",
-              (unsigned)seekpos);
+      fprintf(stderr, "ERROR: lseek to 0 failed: %ju\n",
+              (uintmax_t)seekpos);
     }
 
   /* Re-read and verify each sector */


[incubator-nuttx-apps] 04/05: examples/romfs/romfs_main.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 473fef4e58c4c9d43f8b2fd41441c66f06a78c23
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Nov 14 08:53:18 2020 +0900

    examples/romfs/romfs_main.c: Appease nxstyle
---
 examples/romfs/romfs_main.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/examples/romfs/romfs_main.c b/examples/romfs/romfs_main.c
index 200c9ea..da9f428 100644
--- a/examples/romfs/romfs_main.c
+++ b/examples/romfs/romfs_main.c
@@ -244,6 +244,7 @@ static struct node_s *findindirectory(struct node_s *entry, const char *name)
           return entry;
         }
     }
+
   return NULL;
 }
 
@@ -266,7 +267,8 @@ static void checkattributes(const char *path, mode_t mode, size_t size)
 
   if (mode != buf.st_mode)
     {
-      printf("  -- ERROR: Expected mode %08x, got %08x\n", mode, buf.st_mode);
+      printf("  -- ERROR: Expected mode %08x, got %08x\n", mode,
+             buf.st_mode);
       g_nerrors++;
     }
 
@@ -322,8 +324,9 @@ static void checkfile(const char *path, struct node_s *node)
 
   /* Memory map and verify the file contents */
 
-  filedata = (char*)mmap(NULL, node->size, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
-  if (!filedata || filedata == (char*)MAP_FAILED)
+  filedata = (char *)mmap(NULL, node->size, PROT_READ, MAP_SHARED | MAP_FILE,
+                          fd, 0);
+  if (!filedata || filedata == (char *)MAP_FAILED)
     {
       printf("  -- ERROR: mmap of %s failed: %d\n", path, errno);
       g_nerrors++;
@@ -334,11 +337,13 @@ static void checkfile(const char *path, struct node_s *node)
         {
           memcpy(g_scratchbuffer, filedata, node->size);
           g_scratchbuffer[node->size] = '\0';
-          printf("  -- ERROR: Mapped file content read does not match expectation:\n");
+          printf("  -- ERROR: Mapped file content read does not match "
+                 "expectation:\n");
           printf("  --        Memory:   [%s]\n", filedata);
           printf("  --        Expected: [%s]\n", node->u.filecontent);
           g_nerrors++;
         }
+
       munmap(filedata, node->size);
     }
 
@@ -373,7 +378,8 @@ static void readdirectories(const char *path, struct node_s *entry)
 
   for (direntry = readdir(dirp); direntry; direntry = readdir(dirp))
     {
-      if (strcmp(direntry->d_name, ".") == 0 || strcmp(direntry->d_name, "..") == 0)
+      if (strcmp(direntry->d_name, ".") == 0 ||
+          strcmp(direntry->d_name, "..") == 0)
         {
            printf("  Skipping %s\n", direntry->d_name);
            continue;
@@ -421,6 +427,7 @@ static void readdirectories(const char *path, struct node_s *entry)
               checkfile(fullpath, node);
             }
         }
+
       free(fullpath);
     }
 
@@ -435,7 +442,7 @@ static void checkdirectories(struct node_s *entry)
 {
   for (; entry; entry = entry->peer)
     {
-      if (!entry->found )
+      if (!entry->found)
         {
           printf("ERROR: %s never found\n", entry->name);
           g_nerrors++;
@@ -458,12 +465,13 @@ static void checkdirectories(struct node_s *entry)
 
 int main(int argc, FAR char *argv[])
 {
-   int  ret;
+  int ret;
 
   /* Create a RAM disk for the test */
 
   ret = romdisk_register(CONFIG_EXAMPLES_ROMFS_RAMDEVNO, testdir_img,
-                         NSECTORS(testdir_img_len), CONFIG_EXAMPLES_ROMFS_SECTORSIZE);
+                         NSECTORS(testdir_img_len),
+                         CONFIG_EXAMPLES_ROMFS_SECTORSIZE);
   if (ret < 0)
     {
       printf("ERROR: Failed to create RAM disk\n");
@@ -475,7 +483,8 @@ int main(int argc, FAR char *argv[])
   printf("Mounting ROMFS filesystem at target=%s with source=%s\n",
          CONFIG_EXAMPLES_ROMFS_MOUNTPOINT, MOUNT_DEVNAME);
 
-  ret = mount(MOUNT_DEVNAME, CONFIG_EXAMPLES_ROMFS_MOUNTPOINT, "romfs", MS_RDONLY, NULL);
+  ret = mount(MOUNT_DEVNAME, CONFIG_EXAMPLES_ROMFS_MOUNTPOINT, "romfs",
+              MS_RDONLY, NULL);
   if (ret < 0)
     {
       printf("ERROR: Mount failed: %d\n", errno);


[incubator-nuttx-apps] 01/05: examples/media/media_main.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 780891f8aacaa88c048546a1fc9e28aec30dd682
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Fri Nov 13 19:54:28 2020 +0900

    examples/media/media_main.c: Appease nxstyle
---
 examples/media/media_main.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/examples/media/media_main.c b/examples/media/media_main.c
index e4b12ed..73730d6 100644
--- a/examples/media/media_main.c
+++ b/examples/media/media_main.c
@@ -159,6 +159,7 @@ int main(int argc, FAR char *argv[])
               devpath, errno);
       return 1;
     }
+
   /* Get the block size to use */
 
   get_blocksize(fd, &info);
@@ -172,7 +173,8 @@ int main(int argc, FAR char *argv[])
   txbuffer = (FAR uint8_t *)malloc((size_t)info.blocksize);
   if (txbuffer == NULL)
     {
-      fprintf(stderr, "ERROR: failed to allocate TX I/O buffer of size %lu\n",
+      fprintf(stderr,
+              "ERROR: failed to allocate TX I/O buffer of size %lu\n",
               (unsigned long)info.blocksize);
       close(fd);
       return 1;
@@ -181,7 +183,8 @@ int main(int argc, FAR char *argv[])
   rxbuffer = (FAR uint8_t *)malloc((size_t)info.blocksize);
   if (rxbuffer == NULL)
     {
-      fprintf(stderr, "ERROR: failed to allocate IRX /O buffer of size %lu\n",
+      fprintf(stderr,
+              "ERROR: failed to allocate IRX /O buffer of size %lu\n",
               (unsigned long)info.blocksize);
       free(txbuffer);
       close(fd);
@@ -299,7 +302,8 @@ int main(int argc, FAR char *argv[])
               if (txbuffer[i] != rxbuffer[i])
                 {
                   fprintf(stderr,
-                          "ERROR: block=%lu offset=%lu.  Unexpected value: %02x vs. %02x\n",
+                          "ERROR: block=%lu offset=%lu.  "
+                          "Unexpected value: %02x vs. %02x\n",
                           blockno, i, rxbuffer[i], txbuffer[i]);
                   nerrors++;
                 }
@@ -384,7 +388,8 @@ int main(int argc, FAR char *argv[])
               if (txbuffer[i] != rxbuffer[i])
                 {
                   fprintf(stderr,
-                          "ERROR: block=%lu offset=%lu.  Unexpected value: %02x vs. %02x\n",
+                          "ERROR: block=%lu offset=%lu.  "
+                          "Unexpected value: %02x vs. %02x\n",
                           blockno, i, rxbuffer[i], txbuffer[i]);
                   nerrors++;
                 }