Skip to content

Commit ac20758

Browse files
committed
Fixed some more LFS_TRACE format specifiers
- block_cycles is signed and should use PRId32 - flags is signed (which is a bit weird) and should be cast for %x Unfortunately exactly what PRI* expands to is dependant on both the compiler and the underlying architecture, so I don't think it's possible for us to catch these mistakes with CI... Found by stefano-zanotti
1 parent d01280e commit ac20758

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lfs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5890,7 +5890,7 @@ int lfs_format(lfs_t *lfs, const struct lfs_config *cfg) {
58905890
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
58915891
".read_size=%"PRIu32", .prog_size=%"PRIu32", "
58925892
".block_size=%"PRIu32", .block_count=%"PRIu32", "
5893-
".block_cycles=%"PRIu32", .cache_size=%"PRIu32", "
5893+
".block_cycles=%"PRId32", .cache_size=%"PRIu32", "
58945894
".lookahead_size=%"PRIu32", .read_buffer=%p, "
58955895
".prog_buffer=%p, .lookahead_buffer=%p, "
58965896
".name_max=%"PRIu32", .file_max=%"PRIu32", "
@@ -5920,7 +5920,7 @@ int lfs_mount(lfs_t *lfs, const struct lfs_config *cfg) {
59205920
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
59215921
".read_size=%"PRIu32", .prog_size=%"PRIu32", "
59225922
".block_size=%"PRIu32", .block_count=%"PRIu32", "
5923-
".block_cycles=%"PRIu32", .cache_size=%"PRIu32", "
5923+
".block_cycles=%"PRId32", .cache_size=%"PRIu32", "
59245924
".lookahead_size=%"PRIu32", .read_buffer=%p, "
59255925
".prog_buffer=%p, .lookahead_buffer=%p, "
59265926
".name_max=%"PRIu32", .file_max=%"PRIu32", "
@@ -6057,7 +6057,7 @@ int lfs_file_open(lfs_t *lfs, lfs_file_t *file, const char *path, int flags) {
60576057
return err;
60586058
}
60596059
LFS_TRACE("lfs_file_open(%p, %p, \"%s\", %x)",
6060-
(void*)lfs, (void*)file, path, flags);
6060+
(void*)lfs, (void*)file, path, (unsigned)flags);
60616061
LFS_ASSERT(!lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)file));
60626062

60636063
err = lfs_file_open_(lfs, file, path, flags);
@@ -6077,7 +6077,7 @@ int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file,
60776077
}
60786078
LFS_TRACE("lfs_file_opencfg(%p, %p, \"%s\", %x, %p {"
60796079
".buffer=%p, .attrs=%p, .attr_count=%"PRIu32"})",
6080-
(void*)lfs, (void*)file, path, flags,
6080+
(void*)lfs, (void*)file, path, (unsigned)flags,
60816081
(void*)cfg, cfg->buffer, (void*)cfg->attrs, cfg->attr_count);
60826082
LFS_ASSERT(!lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)file));
60836083

@@ -6439,7 +6439,7 @@ int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg) {
64396439
".read=%p, .prog=%p, .erase=%p, .sync=%p, "
64406440
".read_size=%"PRIu32", .prog_size=%"PRIu32", "
64416441
".block_size=%"PRIu32", .block_count=%"PRIu32", "
6442-
".block_cycles=%"PRIu32", .cache_size=%"PRIu32", "
6442+
".block_cycles=%"PRId32", .cache_size=%"PRIu32", "
64436443
".lookahead_size=%"PRIu32", .read_buffer=%p, "
64446444
".prog_buffer=%p, .lookahead_buffer=%p, "
64456445
".name_max=%"PRIu32", .file_max=%"PRIu32", "

0 commit comments

Comments
 (0)