Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress sign compare warnings #2068

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions filters/include/pcl/filters/impl/extract_indices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pcl::ExtractIndices<PointT>::filterDirectly (PointCloudPtr &cloud)
pcl::for_each_type<FieldList> (pcl::detail::FieldAdder<PointT> (fields));
for (int rii = 0; rii < static_cast<int> (removed_indices_->size ()); ++rii) // rii = removed indices iterator
{
int pt_index = (*removed_indices_)[rii];
size_t pt_index = (size_t) (*removed_indices_)[rii];
if (pt_index >= input_->points.size ())
{
PCL_ERROR ("[pcl::%s::filterDirectly] The index exceeds the size of the input. Do nothing.\n",
Expand Down Expand Up @@ -91,7 +91,7 @@ pcl::ExtractIndices<PointT>::applyFilter (PointCloud &output)
pcl::for_each_type<FieldList> (pcl::detail::FieldAdder<PointT> (fields));
for (int rii = 0; rii < static_cast<int> (removed_indices_->size ()); ++rii) // rii = removed indices iterator
{
int pt_index = (*removed_indices_)[rii];
size_t pt_index = (size_t)(*removed_indices_)[rii];
if (pt_index >= input_->points.size ())
{
PCL_ERROR ("[pcl::%s::applyFilter] The index exceeds the size of the input. Do nothing.\n",
Expand Down
4 changes: 2 additions & 2 deletions surface/include/pcl/surface/impl/mls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud<PointT> &cloud,
// Update neighborhood, since point was projected, and computing relative
// positions. Note updating only distances for the weights for speed
std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > de_meaned (num_neighbors);
for (size_t ni = 0; ni < num_neighbors; ++ni)
for (size_t ni = 0; ni < (size_t) num_neighbors; ++ni)
{
de_meaned[ni][0] = cloud.points[nn_indices[ni]].x - mean[0];
de_meaned[ni][1] = cloud.points[nn_indices[ni]].y - mean[1];
Expand All @@ -831,7 +831,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud<PointT> &cloud,
// Go through neighbors, transform them in the local coordinate system,
// save height and the evaluation of the polynome's terms
double u_coord, v_coord, u_pow, v_pow;
for (size_t ni = 0; ni < num_neighbors; ++ni)
for (size_t ni = 0; ni < (size_t) num_neighbors; ++ni)
{
// Transforming coordinates
u_coord = de_meaned[ni].dot (u_axis);
Expand Down
2 changes: 1 addition & 1 deletion tools/lum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ main (int argc, char **argv)
double loopDist = 5.0;
pcl::console::parse_argument (argc, argv, "-D", loopDist);

int loopCount = 20;
unsigned int loopCount = 20;
pcl::console::parse_argument (argc, argv, "-c", loopCount);

pcl::registration::LUM<PointType> lum;
Expand Down
6 changes: 3 additions & 3 deletions tools/octree_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class OctreeViewer
for (tree_it = octree.begin(depth); tree_it!=tree_it_end; ++tree_it)
{
// If the iterator is not at the right depth, continue
if (tree_it.getCurrentOctreeDepth () != depth)
if (tree_it.getCurrentOctreeDepth () != (unsigned int) depth)
continue;

// Compute the point at the center of the voxel which represents the current OctreeNode
Expand All @@ -400,7 +400,7 @@ class OctreeViewer
cloudVoxel->points.push_back (pt_voxel_center);

// If the asked depth is the depth of the octree, retrieve the centroid at this LeafNode
if (octree.getTreeDepth () == depth)
if (octree.getTreeDepth () == (unsigned int) depth)
{
pcl::octree::OctreePointCloudVoxelCentroid<pcl::PointXYZ>::LeafNode* container = static_cast<pcl::octree::OctreePointCloudVoxelCentroid<pcl::PointXYZ>::LeafNode*> (tree_it.getCurrentOctreeNode ());

Expand All @@ -416,7 +416,7 @@ class OctreeViewer

// Iterate over the leafs to compute the centroid of all of them
pcl::CentroidPoint<pcl::PointXYZ> centroid;
for (int j = 0; j < voxelCentroids.size (); ++j)
for (size_t j = 0; j < voxelCentroids.size (); ++j)
{
centroid.add (voxelCentroids[j]);
}
Expand Down
2 changes: 1 addition & 1 deletion visualization/src/pcl_plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ pcl::visualization::PCLPlotter::computeHistogram (
if (pcl_isfinite (data[i]))
{
unsigned int index = (unsigned int) (floor ((data[i] - min) / size));
if (index == nbins) index = nbins - 1; //including right boundary
if (index == (unsigned int) nbins) index = nbins - 1; //including right boundary
histogram[index].second++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh,
int texture_units = tex_manager->GetNumberOfTextureUnits ();
if ((mesh.tex_materials.size () > 1) && (texture_units > 1))
{
if (texture_units < mesh.tex_materials.size ())
if ((size_t) texture_units < mesh.tex_materials.size ())
PCL_WARN ("[PCLVisualizer::addTextureMesh] GPU texture units %d < mesh textures %d!\n",
texture_units, mesh.tex_materials.size ());
// Load textures
Expand Down