Skip to content

Commit

Permalink
fix(agnocastlib): fix google-readability-casting (#302)
Browse files Browse the repository at this point in the history
Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
  • Loading branch information
veqcc authored Nov 26, 2024
1 parent 012c37e commit 3fb87bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Checks: "
-cppcoreguidelines-special-member-functions,
google-*,
-google-readability-casting,
-google-default-arguments,
-google-build-using-namespace,
Expand Down
3 changes: 2 additions & 1 deletion src/agnocastlib/src/agnocast_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ bool AgnocastExecutor::get_next_agnocast_executables(
exit(EXIT_FAILURE);
}

for (int32_t i = (int32_t)receive_args.ret_len - 1; i >= 0; i--) { // older messages first
for (int32_t i = static_cast<int32_t>(receive_args.ret_len) - 1; i >= 0;
i--) { // older messages first
const auto callable = agnocast::create_callable(
reinterpret_cast<void *>(receive_args.ret_last_msg_addrs[i]),
receive_args.ret_publisher_pids[i], receive_args.ret_timestamps[i], topic_local_id);
Expand Down
2 changes: 1 addition & 1 deletion src/agnocastlib/src/agnocast_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ union ioctl_subscriber_args SubscriptionBase::initialize(bool is_take_sub)
}

for (uint32_t i = 0; i < subscriber_args.ret_publisher_num; i++) {
if ((pid_t)subscriber_args.ret_pids[i] == subscriber_pid_) {
if (static_cast<pid_t>(subscriber_args.ret_pids[i]) == subscriber_pid_) {
/*
* NOTE: In ROS2, communication should work fine even if the same process exists as both a
* publisher and a subscriber for a given topic. However, in Agnocast, to avoid applying
Expand Down

0 comments on commit 3fb87bc

Please sign in to comment.