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.git


The following commit(s) were added to refs/heads/master by this push:
     new 22b7199  fs:cromf Use inttypes in printing macros
22b7199 is described below

commit 22b719945f8fb7a86dcbd84f0e39c4e1bfd3cc45
Author: David Sidrane <[email protected]>
AuthorDate: Tue Apr 20 08:31:55 2021 -0700

    fs:cromf Use inttypes in printing macros
---
 fs/cromfs/fs_cromfs.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/fs/cromfs/fs_cromfs.c b/fs/cromfs/fs_cromfs.c
index 71b27a2..644d782 100644
--- a/fs/cromfs/fs_cromfs.c
+++ b/fs/cromfs/fs_cromfs.c
@@ -28,6 +28,7 @@
 #include <sys/statfs.h>
 #include <sys/stat.h>
 
+#include <inttypes.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <string.h>
@@ -509,7 +510,8 @@ static int cromfs_compare_node(FAR const struct 
cromfs_volume_s *fs,
   name   = (FAR char *)cromfs_offset2addr(fs, node->cn_name);
   namlen = strlen(name);
 
-  finfo("Compare %s to %s[0-%u]\n", name, cpnode->segment, cpnode->seglen);
+  finfo("Compare %s to %s[0-%" PRIu16 "]\n", name, cpnode->segment,
+        cpnode->seglen);
 
   /* If the lengths of the name does not match the length of the next path
    * segment, then this is not the node we are looking for.
@@ -952,8 +954,8 @@ static ssize_t cromfs_read(FAR struct file *filep, FAR char 
*buffer,
           src = (FAR const uint8_t *)currhdr + LZF_TYPE0_HDR_SIZE;
           memcpy(dest, &src[copyoffs], copysize);
 
-          finfo("blkoffs=%lu ulen=%u copysize=%u\n",
-                (unsigned long)blkoffs, ulen, copysize);
+          finfo("blkoffs=%" PRIu32 " ulen=%" PRIu16 " copysize=%u\n",
+                blkoffs, ulen, copysize);
         }
       else
         {
@@ -986,10 +988,9 @@ static ssize_t cromfs_read(FAR struct file *filep, FAR 
char *buffer,
                   ff->ff_ulen   = decomplen;
                 }
 
-              finfo(
-                "voloffs=%lu blkoffs=%lu ulen=%u ff_offset=%u copysize=%u\n",
-                (unsigned long)voloffs, (unsigned long)blkoffs, ulen,
-                ff->ff_offset, copysize);
+              finfo("voloffs=%" PRIu32 " blkoffs=%" PRIu32
+                    " ulen=%" PRIu16 " ff_offset=%" PRIu32 " copysize=%u\n",
+                    voloffs, blkoffs, ulen, ff->ff_offset, copysize);
               DEBUGASSERT(ff->ff_ulen >= copysize);
             }
           else
@@ -1025,10 +1026,11 @@ static ssize_t cromfs_read(FAR struct file *filep, FAR 
char *buffer,
                   ff->ff_ulen   = decomplen;
                 }
 
-              finfo("voloffs=%lu blkoffs=%lu ulen=%u clen=%u ff_offset=%u "
-                    "copyoffs=%u copysize=%u\n",
-                    (unsigned long)voloffs, (unsigned long)blkoffs, ulen,
-                    clen, ff->ff_offset, copyoffs, copysize);
+              finfo("voloffs=%" PRIu32 " blkoffs=%" PRIu32 " ulen=%" PRIu16
+                    " clen=%" PRIu16 " ff_offset=%" PRIu32
+                    "  copyoffs=%u copysize=%u\n",
+                    voloffs, blkoffs, ulen, clen, ff->ff_offset,
+                    copyoffs, copysize);
               DEBUGASSERT(ff->ff_ulen >= (copyoffs + copysize));
 
               /* Then copy to user buffer */
@@ -1254,7 +1256,7 @@ static int cromfs_readdir(struct inode *mountpt, struct 
fs_dirent_s *dir)
        * special error -ENOENT
        */
 
-      finfo("Entry %d: End of directory\n", offset);
+      finfo("Entry %" PRIu32 ": End of directory\n", offset);
       return -ENOENT;
     }
 
@@ -1269,7 +1271,7 @@ static int cromfs_readdir(struct inode *mountpt, struct 
fs_dirent_s *dir)
        * special error -ENOENT
        */
 
-      finfo("Entry %d: End of directory\n", offset);
+      finfo("Entry %" PRIu32 ": End of directory\n", offset);
       return -ENOENT;
     }
 
@@ -1284,7 +1286,7 @@ static int cromfs_readdir(struct inode *mountpt, struct 
fs_dirent_s *dir)
   /* Save the filename and file type */
 
   name = (FAR char *)cromfs_offset2addr(fs, node->cn_name);
-  finfo("Entry %lu: %s\n", (unsigned long)offset, name);
+  finfo("Entry %" PRIu32 ": %s\n", offset, name);
   strncpy(dir->fd_dir.d_name, name, NAME_MAX);
 
   switch (node->cn_mode & S_IFMT)

Reply via email to