testing/fstest/fstest_main.c: Fix printf format warnings

This commit is contained in:
YAMAMOTO Takashi 2020-11-10 23:06:10 +09:00 committed by Xiang Xiao
parent 75758c17b4
commit 4d00277111

View File

@ -386,7 +386,7 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Failed to open file for writing: %d\n", errno);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
}
fstest_freefile(file);
@ -427,7 +427,7 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Failed to write file: %d\n", errcode);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Write offset: %ld\n", (long)offset);
printf(" Write size: %ld\n", (long)nbytestowrite);
}
@ -455,7 +455,7 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Partial write:\n");
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Write offset: %ld\n", (long)offset);
printf(" Write size: %ld\n", (long)nbytestowrite);
printf(" Written: %ld\n", (long)nbyteswritten);
@ -541,7 +541,7 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
{
printf("ERROR: Failed to read file: %d\n", errno);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Read offset: %ld\n", (long)offset);
printf(" Read size: %ld\n", (long)len);
return ERROR;
@ -552,7 +552,7 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
#if 0 /* No... we do this on purpose sometimes */
printf("ERROR: Unexpected end-of-file:\n");
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Read offset: %ld\n", (long)offset);
printf(" Read size: %ld\n", (long)len);
#endif
@ -562,7 +562,7 @@ static ssize_t fstest_rdblock(int fd, FAR struct fstest_filedesc_s *file,
{
printf("ERROR: Partial read:\n");
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Read offset: %ld\n", (long)offset);
printf(" Read size: %ld\n", (long)len);
printf(" Bytes read: %ld\n", (long)nbytesread);
@ -592,7 +592,7 @@ static inline int fstest_rdfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Failed to open file for reading: %d\n", errno);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
}
return ERROR;
@ -622,7 +622,7 @@ static inline int fstest_rdfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Bad CRC: %d vs %d\n", crc, file->crc);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
close(fd);
return ERROR;
}
@ -634,7 +634,7 @@ static inline int fstest_rdfile(FAR struct fstest_filedesc_s *file)
{
printf("ERROR: Read past the end of file\n");
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" Bytes read: %ld\n", (long)nbytesread);
close(fd);
return ERROR;
@ -723,7 +723,7 @@ static int fstest_verifyfs(void)
{
printf("ERROR: Failed to read a file: %d\n", i);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
return ERROR;
}
}
@ -734,7 +734,7 @@ static int fstest_verifyfs(void)
#if CONFIG_TESTING_FSTEST_VERBOSE != 0
printf("ERROR: Successfully read a deleted file\n");
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
#endif
fstest_freefile(file);
g_ndeleted--;
@ -807,7 +807,7 @@ static int fstest_delfiles(void)
{
printf("ERROR: Unlink %d failed: %d\n", i + 1, errno);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" File index: %d\n", j);
/* If we don't do this we can get stuck in an infinite
@ -859,7 +859,7 @@ static int fstest_delallfiles(void)
{
printf("ERROR: Unlink %d failed: %d\n", i + 1, errno);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" File size: %zd\n", file->len);
printf(" File index: %d\n", i);
}
else