mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 02:00:34 +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:
@@ -222,13 +222,13 @@ void BlockLocalPositionEstimator::update()
|
||||
s->get().orientation == distance_sensor_s::ROTATION_DOWNWARD_FACING &&
|
||||
_sub_lidar == nullptr) {
|
||||
_sub_lidar = s;
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Lidar detected with ID %i", msg_label, i);
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Lidar detected with ID %zu", msg_label, i);
|
||||
|
||||
} else if (s->get().type == distance_sensor_s::MAV_DISTANCE_SENSOR_ULTRASOUND &&
|
||||
s->get().orientation == distance_sensor_s::ROTATION_DOWNWARD_FACING &&
|
||||
_sub_sonar == nullptr) {
|
||||
_sub_sonar = s;
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Sonar detected with ID %i", msg_label, i);
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Sonar detected with ID %zu", msg_label, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -373,7 +373,7 @@ void BlockLocalPositionEstimator::update()
|
||||
// don't want it to take too long
|
||||
if (!PX4_ISFINITE(_x(i))) {
|
||||
reinit_x = true;
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sreinit x, x(%d) not finite", msg_label, i);
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sreinit x, x(%zu) not finite", msg_label, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -393,7 +393,7 @@ void BlockLocalPositionEstimator::update()
|
||||
for (size_t j = 0; j <= i; j++) {
|
||||
if (!PX4_ISFINITE(_P(i, j))) {
|
||||
mavlink_and_console_log_info(&mavlink_log_pub,
|
||||
"%sreinit P (%d, %d) not finite", msg_label, i, j);
|
||||
"%sreinit P (%zu, %zu) not finite", msg_label, i, j);
|
||||
reinit_P = true;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void BlockLocalPositionEstimator::update()
|
||||
// make sure diagonal elements are positive
|
||||
if (_P(i, i) <= 0) {
|
||||
mavlink_and_console_log_info(&mavlink_log_pub,
|
||||
"%sreinit P (%d, %d) negative", msg_label, i, j);
|
||||
"%sreinit P (%zu, %zu) negative", msg_label, i, j);
|
||||
reinit_P = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user