mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:33:33 +08:00
Fix many format strings.
Fixes these invalid format strings:
- A `%d` for a pointer (replaced it by `%p`)
- A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
- 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
- 1 case of a %u for an `int` (replaced by %i)
- 3 cases of %d for a `long` (replaced by %ld)
- 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
- An unused formatting argument (removed it)
- A missing `%d` (added it)
- A missing `%s` (added it)
- 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
- 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
- 2 cases of %*-s, which should probably have been %-*s.
(Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
- A %04x for a `uint32_t` (replaced by "%04" PRIx32)
This commit is contained in:
@@ -166,7 +166,7 @@ bl_update_main(int argc, char *argv[])
|
||||
|
||||
if (size != BL_FILE_SIZE_LIMIT)
|
||||
{
|
||||
PX4_ERR("erase error at 0x%08x", &base[size]);
|
||||
PX4_ERR("erase error at %p", &base[size]);
|
||||
}
|
||||
|
||||
PX4_INFO("flashing...");
|
||||
@@ -177,7 +177,7 @@ bl_update_main(int argc, char *argv[])
|
||||
|
||||
if (size != s.st_size)
|
||||
{
|
||||
PX4_ERR("program error at 0x%0x8", &base[size]);
|
||||
PX4_ERR("program error at %p", &base[size]);
|
||||
goto flash_end;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ bl_update_main(int argc, char *argv[])
|
||||
for (int i = 0; i < s.st_size; i++)
|
||||
{
|
||||
if (base[i] != buf[i]) {
|
||||
PX4_WARN("verify failed at %u - retry update, DO NOT reboot", i);
|
||||
PX4_WARN("verify failed at %i - retry update, DO NOT reboot", i);
|
||||
goto flash_end;
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ setopt(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PX4_ERR("option bits setting failed; readback 0x%04x", *optcr);
|
||||
PX4_ERR("option bits setting failed; readback 0x%04" PRIx32, *optcr);
|
||||
return 1;
|
||||
}
|
||||
#endif // CONFIG_STM32_STM32F4XXX
|
||||
|
||||
@@ -143,7 +143,7 @@ task_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
hrt_abstime rend = hrt_absolute_time();
|
||||
PX4_INFO("task %d pass, hit %d, miss %d, io time read %llums. write %llums.",
|
||||
PX4_INFO("task %d pass, hit %d, miss %d, io time read %" PRIu64 "ms. write %" PRIu64 "ms.",
|
||||
my_id, hit, miss, (rend - rstart) / NUM_MISSIONS_TEST / 1000, (wend - wstart) / NUM_MISSIONS_TEST / 1000);
|
||||
px4_sem_post(sems + my_id);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user