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:27 UTC

[incubator-nuttx-apps] 02/05: examples/media/media_main.c: Fix printf format warnings

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 */