Skip to content

Commit 9b03735

Browse files
authored
Fix clang warnings about type mismatches. (#309)
The clang-on-linux job is still complaining about the types of PRId64 vs. std::chrono::seconds.count(). Give up and switch to streams here, which should solve the issue. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 21a968b commit 9b03735

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

rclcpp/executors/cbg_executor/src/ping.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ int main(int argc, char * argv[])
7171
}
7272

7373
const std::chrono::seconds EXPERIMENT_DURATION = 10s;
74-
RCLCPP_INFO(
75-
logger, "Running experiment from now on for %" PRId64 "s ...", EXPERIMENT_DURATION.count());
74+
RCLCPP_INFO_STREAM(
75+
logger, "Running experiment from now on for " << EXPERIMENT_DURATION.count() << " seconds ...");
7676
std::this_thread::sleep_for(EXPERIMENT_DURATION);
7777

7878
// ... and stop the experiment.

rclcpp/executors/cbg_executor/src/ping_pong.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ int main(int argc, char * argv[])
9696
nanoseconds low_prio_thread_begin = get_thread_time(low_prio_thread);
9797

9898
const std::chrono::seconds EXPERIMENT_DURATION = 10s;
99-
RCLCPP_INFO(
100-
logger, "Running experiment from now on for %" PRId64 "s ...", EXPERIMENT_DURATION.count());
99+
RCLCPP_INFO_STREAM(
100+
logger, "Running experiment from now on for " << EXPERIMENT_DURATION.count() << " seconds ...");
101101
std::this_thread::sleep_for(EXPERIMENT_DURATION);
102102

103103
// Get end CPU time of each thread ...

rclcpp/executors/cbg_executor/src/pong.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ int main(int argc, char * argv[])
9090
nanoseconds low_prio_thread_begin = get_thread_time(low_prio_thread);
9191

9292
const std::chrono::seconds EXPERIMENT_DURATION = 10s;
93-
RCLCPP_INFO(
94-
logger, "Running experiment from now on for %" PRId64 "s ...", EXPERIMENT_DURATION.count());
93+
RCLCPP_INFO_STREAM(
94+
logger, "Running experiment from now on for " << EXPERIMENT_DURATION.count() << " seconds ...");
9595
std::this_thread::sleep_for(EXPERIMENT_DURATION);
9696

9797
// Get end CPU time of each thread ...

0 commit comments

Comments
 (0)