From f13503af1867981e0e7650b723c3d6e6e72f95a4 Mon Sep 17 00:00:00 2001 From: kobayu858 <129580202+kobayu858@users.noreply.github.com> Date: Sun, 3 Nov 2024 22:40:36 +0900 Subject: [PATCH] fix(autoware_image_projection_based_fusion): fix bugprone-misplaced-widening-cast (#9226) * fix: bugprone-misplaced-widening-cast Signed-off-by: kobayu858 * fix: clang-format Signed-off-by: kobayu858 --------- Signed-off-by: kobayu858 --- .../src/utils/utils.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/perception/autoware_image_projection_based_fusion/src/utils/utils.cpp b/perception/autoware_image_projection_based_fusion/src/utils/utils.cpp index 1f67d2e1cc86f..2fd0740a7891f 100644 --- a/perception/autoware_image_projection_based_fusion/src/utils/utils.cpp +++ b/perception/autoware_image_projection_based_fusion/src/utils/utils.cpp @@ -159,8 +159,10 @@ void updateOutputFusedObjects( cluster.data.resize(clusters_data_size.at(i)); auto & feature_obj = output_objs.at(i); if ( - cluster.data.size() < std::size_t(min_cluster_size * cluster.point_step) || - cluster.data.size() >= std::size_t(max_cluster_size * cluster.point_step)) { + cluster.data.size() < + static_cast(min_cluster_size) * static_cast(cluster.point_step) || + cluster.data.size() >= + static_cast(max_cluster_size) * static_cast(cluster.point_step)) { continue; } @@ -169,7 +171,9 @@ void updateOutputFusedObjects( sensor_msgs::msg::PointCloud2 refine_cluster; closest_cluster( cluster, cluster_2d_tolerance, min_cluster_size, camera_orig_point_frame, refine_cluster); - if (refine_cluster.data.size() < std::size_t(min_cluster_size * cluster.point_step)) { + if ( + refine_cluster.data.size() < + static_cast(min_cluster_size) * static_cast(cluster.point_step)) { continue; }