Skip to content

Commit d0f2036

Browse files
committed
Replace all casts for width = EXPR size()
1 parent 0665bd9 commit d0f2036

File tree

56 files changed

+98
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+98
-98
lines changed

common/include/pcl/point_cloud.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ namespace pcl
260260
// This causes a drastic performance hit. Prefer not to use reserve with libstdc++ (default on clang)
261261
cloud1.points.insert (cloud1.points.end (), cloud2.points.begin (), cloud2.points.end ());
262262

263-
cloud1.width = static_cast<std::uint32_t>(cloud1.size ());
263+
cloud1.width = cloud1.size ();
264264
cloud1.height = 1;
265265
cloud1.is_dense = cloud1.is_dense && cloud2.is_dense;
266266
return true;
@@ -491,7 +491,7 @@ namespace pcl
491491
push_back (const PointT& pt)
492492
{
493493
points.push_back (pt);
494-
width = static_cast<std::uint32_t> (size ());
494+
width = size ();
495495
height = 1;
496496
}
497497

@@ -504,7 +504,7 @@ namespace pcl
504504
emplace_back (Args&& ...args)
505505
{
506506
points.emplace_back (std::forward<Args> (args)...);
507-
width = static_cast<std::uint32_t> (size ());
507+
width = size ();
508508
height = 1;
509509
return points.back();
510510
}
@@ -519,7 +519,7 @@ namespace pcl
519519
insert (iterator position, const PointT& pt)
520520
{
521521
iterator it = points.insert (position, pt);
522-
width = static_cast<std::uint32_t> (size ());
522+
width = size ();
523523
height = 1;
524524
return (it);
525525
}
@@ -534,7 +534,7 @@ namespace pcl
534534
insert (iterator position, std::size_t n, const PointT& pt)
535535
{
536536
points.insert (position, n, pt);
537-
width = static_cast<std::uint32_t> (size ());
537+
width = size ();
538538
height = 1;
539539
}
540540

@@ -548,7 +548,7 @@ namespace pcl
548548
insert (iterator position, InputIterator first, InputIterator last)
549549
{
550550
points.insert (position, first, last);
551-
width = static_cast<std::uint32_t> (size ());
551+
width = size ();
552552
height = 1;
553553
}
554554

@@ -562,7 +562,7 @@ namespace pcl
562562
emplace (iterator position, Args&& ...args)
563563
{
564564
iterator it = points.emplace (position, std::forward<Args> (args)...);
565-
width = static_cast<std::uint32_t> (size ());
565+
width = size ();
566566
height = 1;
567567
return (it);
568568
}
@@ -576,7 +576,7 @@ namespace pcl
576576
erase (iterator position)
577577
{
578578
iterator it = points.erase (position);
579-
width = static_cast<std::uint32_t> (size ());
579+
width = size ();
580580
height = 1;
581581
return (it);
582582
}
@@ -591,7 +591,7 @@ namespace pcl
591591
erase (iterator first, iterator last)
592592
{
593593
iterator it = points.erase (first, last);
594-
width = static_cast<std::uint32_t> (size ());
594+
width = size ();
595595
height = 1;
596596
return (it);
597597
}

doc/tutorials/content/sources/don_segmentation/don_segmentation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ main (int argc, char *argv[])
177177
cloud_cluster_don->points.push_back (doncloud->points[*pit]);
178178
}
179179

180-
cloud_cluster_don->width = int (cloud_cluster_don->size ());
180+
cloud_cluster_don->width = cloud_cluster_don->size ();
181181
cloud_cluster_don->height = 1;
182182
cloud_cluster_don->is_dense = true;
183183

examples/features/example_difference_of_normals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ int main (int argc, char *argv[])
217217
cloud_cluster_don->points.push_back (doncloud->points[index]);
218218
}
219219

220-
cloud_cluster_don->width = int (cloud_cluster_don->size ());
220+
cloud_cluster_don->width = cloud_cluster_don->size ();
221221
cloud_cluster_don->height = 1;
222222
cloud_cluster_don->is_dense = true;
223223

examples/segmentation/example_extract_clusters_normals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ main (int, char **argv)
8989
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_cluster (new pcl::PointCloud<pcl::PointXYZ>);
9090
for (const int &index : it->indices)
9191
cloud_cluster->points.push_back (cloud_ptr->points[index]);
92-
cloud_cluster->width = static_cast<std::uint32_t> (cloud_cluster->size ());
92+
cloud_cluster->width = cloud_cluster->size ();
9393
cloud_cluster->height = 1;
9494
cloud_cluster->is_dense = true;
9595

features/include/pcl/features/impl/brisk_2d.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::compute (
514514
}
515515
}
516516

517-
keypoints_->width = std::uint32_t (keypoints_->size ());
517+
keypoints_->width = keypoints_->size ();
518518
keypoints_->height = 1;
519519

520520
// first, calculate the integral image over the whole image:

features/include/pcl/features/impl/cppf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pcl::CPPFEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
115115
}
116116
// overwrite the sizes done by Feature::initCompute ()
117117
output.height = 1;
118-
output.width = static_cast<std::uint32_t> (output.size ());
118+
output.width = output.size ();
119119
}
120120

121121
#define PCL_INSTANTIATE_CPPFEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::CPPFEstimation<T,NT,OutT>;

features/include/pcl/features/impl/cvfh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pcl::CVFHEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
211211
filterNormalsWithHighCurvature (*normals_, *indices_, indices_out, indices_in, curv_threshold_);
212212

213213
pcl::PointCloud<pcl::PointNormal>::Ptr normals_filtered_cloud (new pcl::PointCloud<pcl::PointNormal> ());
214-
normals_filtered_cloud->width = static_cast<std::uint32_t> (indices_in.size ());
214+
normals_filtered_cloud->width = indices_in.size ();
215215
normals_filtered_cloud->height = 1;
216216
normals_filtered_cloud->points.resize (normals_filtered_cloud->width);
217217

@@ -294,7 +294,7 @@ pcl::CVFHEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
294294

295295
//compute modified VFH for all dominant clusters and add them to the list!
296296
output.points.resize (dominant_normals_.size ());
297-
output.width = static_cast<std::uint32_t> (dominant_normals_.size ());
297+
output.width = dominant_normals_.size ();
298298

299299
for (std::size_t i = 0; i < dominant_normals_.size (); ++i)
300300
{

features/include/pcl/features/impl/feature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Feature<PointInT, PointOutT>::compute (PointCloudOut &output)
210210
// If the input width or height are not set, set output width as size
211211
if (indices_->size () != input_->points.size () || input_->width * input_->height == 0)
212212
{
213-
output.width = static_cast<std::uint32_t> (indices_->size ());
213+
output.width = indices_->size ();
214214
output.height = 1;
215215
}
216216
else

features/include/pcl/features/impl/multiscale_feature_persistence.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ pcl::MultiscaleFeaturePersistence<PointSource, PointFeature>::determinePersisten
252252
// Consider that output cloud is unorganized
253253
output_features.header = feature_estimator_->getInputCloud ()->header;
254254
output_features.is_dense = feature_estimator_->getInputCloud ()->is_dense;
255-
output_features.width = static_cast<std::uint32_t> (output_features.size ());
255+
output_features.width = output_features.size ();
256256
output_features.height = 1;
257257
}
258258

features/include/pcl/features/impl/our_cvfh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ pcl::OURCVFHEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloud
571571
filterNormalsWithHighCurvature (*normals_, *indices_, indices_out, indices_in, curv_threshold_);
572572

573573
pcl::PointCloud<pcl::PointNormal>::Ptr normals_filtered_cloud (new pcl::PointCloud<pcl::PointNormal> ());
574-
normals_filtered_cloud->width = static_cast<std::uint32_t> (indices_in.size ());
574+
normals_filtered_cloud->width = indices_in.size ();
575575
normals_filtered_cloud->height = 1;
576576
normals_filtered_cloud->points.resize (normals_filtered_cloud->width);
577577

@@ -696,7 +696,7 @@ pcl::OURCVFHEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloud
696696

697697
//compute modified VFH for all dominant clusters and add them to the list!
698698
output.points.resize (dominant_normals_.size ());
699-
output.width = static_cast<std::uint32_t> (dominant_normals_.size ());
699+
output.width = dominant_normals_.size ();
700700

701701
for (std::size_t i = 0; i < dominant_normals_.size (); ++i)
702702
{

0 commit comments

Comments
 (0)