From c0cfafd6ba1434ac0ca23b254ff9eef9043dd981 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 14:39:55 +0100 Subject: [PATCH 01/14] Fix warnings in io/robot_eye_grabber.cpp > robot_eye_grabber.cpp:196:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] --- io/src/robot_eye_grabber.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/src/robot_eye_grabber.cpp b/io/src/robot_eye_grabber.cpp index d96bd0628b0..1554cf99801 100644 --- a/io/src/robot_eye_grabber.cpp +++ b/io/src/robot_eye_grabber.cpp @@ -193,7 +193,7 @@ pcl::RobotEyeGrabber::convertPacketData (unsigned char *data_packet, size_t leng const size_t bytes_per_point = 8; const size_t total_points = (length - offset)/ bytes_per_point; - for (int i = 0; i < total_points; ++i) + for (size_t i = 0; i < total_points; ++i) { PointXYZI xyzi; computeXYZI (xyzi, data_packet + i*bytes_per_point + offset); From 7f271dba865900d2e26b50962dfdbc09842cb945 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 15:02:02 +0100 Subject: [PATCH 02/14] Fix warnings in visualization/image_viewer.hpp > image_viewer.hpp:118:15: warning: unused variable 'image_height_f' [-Wunused-variable] > image_viewer.hpp:177:15: warning: unused variable 'image_height_f' [-Wunused-variable] --- .../include/pcl/visualization/impl/image_viewer.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/visualization/include/pcl/visualization/impl/image_viewer.hpp b/visualization/include/pcl/visualization/impl/image_viewer.hpp index 03ea5b3ca06..5d37e00c9e0 100644 --- a/visualization/include/pcl/visualization/impl/image_viewer.hpp +++ b/visualization/include/pcl/visualization/impl/image_viewer.hpp @@ -117,7 +117,6 @@ pcl::visualization::ImageViewer::addMask ( search.setInputCloud (image); std::vector xy; xy.reserve (mask.size () * 2); - const float image_height_f = static_cast (image->height); for (size_t i = 0; i < mask.size (); ++i) { pcl::PointXY p_projected; @@ -125,7 +124,7 @@ pcl::visualization::ImageViewer::addMask ( xy.push_back (p_projected.x); #if ((VTK_MAJOR_VERSION >= 6) || ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 7))) - xy.push_back (image_height_f - p_projected.y); + xy.push_back (static_cast (image->height) - p_projected.y); #else xy.push_back (p_projected.y); #endif @@ -174,7 +173,6 @@ pcl::visualization::ImageViewer::addPlanarPolygon ( // Construct a search object to get the camera parameters and fill points pcl::search::OrganizedNeighbor search; search.setInputCloud (image); - const float image_height_f = static_cast (image->height); std::vector xy; xy.reserve ((polygon.getContour ().size () + 1) * 2); for (size_t i = 0; i < polygon.getContour ().size (); ++i) @@ -183,7 +181,7 @@ pcl::visualization::ImageViewer::addPlanarPolygon ( search.projectPoint (polygon.getContour ()[i], p); xy.push_back (p.x); #if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 7)) - xy.push_back (image_height_f - p.y); + xy.push_back (static_cast (image->height) - p.y); #else xy.push_back (p.y); #endif From f71773723322878304de1d9f676982eb2d75e2ad Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 15:38:07 +0100 Subject: [PATCH 03/14] Fix warnings in stereo/digital_elevation_map.h > digital_elevation_map.h:39:9: warning: unknown pragma ignored [-Wunknown-pragmas] `#pragma warning(disable : 4996)` is MSVS-only. Further, it seems to be added here to prevent warnings originating from "point_types.h". Therefore if we really need it, it should be re-added with MSVC ifdef and directly in "point_types.h". --- stereo/include/pcl/stereo/digital_elevation_map.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/stereo/include/pcl/stereo/digital_elevation_map.h b/stereo/include/pcl/stereo/digital_elevation_map.h index c7dfc0a031e..8cd847687cf 100644 --- a/stereo/include/pcl/stereo/digital_elevation_map.h +++ b/stereo/include/pcl/stereo/digital_elevation_map.h @@ -36,10 +36,8 @@ #ifndef PCL_DIGITAL_ELEVATION_MAP_H_ #define PCL_DIGITAL_ELEVATION_MAP_H_ -#pragma warning(disable : 4996) #include #include -#pragma warning(default : 4996) namespace pcl { From b03aba003afa6b2f938adc685c6c67c87c56e465 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 15:56:29 +0100 Subject: [PATCH 04/14] Fix warnings in test/common/test_copy_make_borders.cpp > test_copy_make_borders.cpp:55:23: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] ... and 18 more. --- test/common/test_copy_make_borders.cpp | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/common/test_copy_make_borders.cpp b/test/common/test_copy_make_borders.cpp index e1e67b89970..c14a976fbf5 100644 --- a/test/common/test_copy_make_borders.cpp +++ b/test/common/test_copy_make_borders.cpp @@ -52,14 +52,14 @@ TEST (CopyPointCloud, constant) pcl::copyPointCloud (cloud, dst, top, bottom, left, right, pcl::BORDER_CONSTANT, constant); for (int j = 0; j < top; ++j) - for (int i = 0; i < dst.width; ++i) + for (uint32_t i = 0; i < dst.width; ++i) EXPECT_XYZ_EQ (dst (i,j), constant); - for (int j = top; j < cloud.height+top; ++j) + for (unsigned int j = top; j < cloud.height+top; ++j) { - for (int i = 0; i < dst.width; ++i) + for (uint32_t i = 0; i < dst.width; ++i) { - if (i < left) + if (static_cast (i) < left) EXPECT_XYZ_EQ (dst (i,j), constant); else { @@ -71,8 +71,8 @@ TEST (CopyPointCloud, constant) } } - for (int j = cloud.height+top; j < dst.height; ++j) - for (int i = 0; i < dst.width; ++i) + for (uint32_t j = cloud.height+top; j < dst.height; ++j) + for (uint32_t i = 0; i < dst.width; ++i) EXPECT_XYZ_EQ (dst (i,j), constant); } @@ -85,17 +85,17 @@ TEST (CopyPointCloud, replicate) { for (int i = 0; i < left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (0,0)); - for (int i = left; i < cloud.width+left; ++i) + for (unsigned int i = left; i < cloud.width+left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (i-left,0)); - for (int i = cloud.width+left; i < dst.width; ++i) + for (uint32_t i = cloud.width+left; i < dst.width; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (cloud.width-1,0)); } - for (int j = top; j < cloud.height+top; ++j) + for (unsigned int j = top; j < cloud.height+top; ++j) { - for (int i = 0; i < dst.width; ++i) + for (uint32_t i = 0; i < dst.width; ++i) { - if (i < left) + if (static_cast (i) < left) EXPECT_XYZ_EQ (dst (i,j), cloud (0,j-top)); else { @@ -107,13 +107,13 @@ TEST (CopyPointCloud, replicate) } } - for (int j = cloud.height+top; j < dst.height; ++j) + for (uint32_t j = cloud.height+top; j < dst.height; ++j) { for (int i = 0; i < left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (0,cloud.height-1)); - for (int i = left; i < cloud.width+left; ++i) + for (unsigned int i = left; i < cloud.width+left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (i-left,cloud.height-1)); - for (int i = cloud.width+left; i < dst.width; ++i) + for (uint32_t i = cloud.width+left; i < dst.width; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (cloud.width-1,cloud.height-1)); } } @@ -128,19 +128,19 @@ TEST (CopyPointCloud, reflect) for (int i = 0, l = left-1; i < left; ++i, --l) EXPECT_XYZ_EQ (dst (i,j), cloud (l, k)); - for (int i = left; i < cloud.width+left; ++i) + for (unsigned int i = left; i < cloud.width+left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (i-left,k)); for (int i = cloud.width+left, l = cloud.width-left; i < left; ++i, --l) EXPECT_XYZ_EQ (dst (i,j), cloud (l, k)); } - for (int j = top; j < cloud.height+top; ++j) + for (unsigned int j = top; j < cloud.height+top; ++j) { for (int i = 0, l = left-1; i < left; ++i, --l) EXPECT_XYZ_EQ (dst (i,j), cloud (l, j-top)); - for (int i = left; i < cloud.width + left; ++i) + for (unsigned int i = left; i < cloud.width + left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (i-left,j-top)); for (int i = cloud.width+left, l = cloud.width-left; i < left; ++i, --l) @@ -152,7 +152,7 @@ TEST (CopyPointCloud, reflect) for (int i = 0, l = left-1; i < left; ++i, --l) EXPECT_XYZ_EQ (dst (i,j), cloud (l, k)); - for (int i = left; i < cloud.width+left; ++i) + for (unsigned int i = left; i < cloud.width+left; ++i) EXPECT_XYZ_EQ (dst (i,j), cloud (i-left,k)); for (int i = cloud.width+left, l = cloud.width-left; i < left; ++i, --l) From 06fec61ef45160dde23221364e84187546ce5317 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 15:58:49 +0100 Subject: [PATCH 05/14] Fix warnings in test/geometry/test_quad_mesh.cpp > test_quad_mesh.cpp:372:13: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] --- test/geometry/test_quad_mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/geometry/test_quad_mesh.cpp b/test/geometry/test_quad_mesh.cpp index 272c9b69c6a..1b46f4c0cc1 100644 --- a/test/geometry/test_quad_mesh.cpp +++ b/test/geometry/test_quad_mesh.cpp @@ -369,7 +369,7 @@ TYPED_TEST (TestQuadMesh, NineQuads) { const FaceIndex index = mesh.addFace (ordered_faces [j]); - if (j < non_manifold [i] || !Mesh::IsManifold::value) + if (j < static_cast (non_manifold [i]) || !Mesh::IsManifold::value) { EXPECT_TRUE (index.isValid ()); } From 31d1cf190a7b153e4e1099b3082f704241c66942 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 15:59:54 +0100 Subject: [PATCH 06/14] Fix warnings in test/io/test_io.cpp > test_io.cpp:799:17: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare] --- test/io/test_io.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/io/test_io.cpp b/test/io/test_io.cpp index e167506a965..aa4573c1b9a 100644 --- a/test/io/test_io.cpp +++ b/test/io/test_io.cpp @@ -796,7 +796,7 @@ TEST (PCL, ASCIIReader) EXPECT_GE(reader.read("test_pcd.txt", rcloud), 0); EXPECT_EQ(cloud.points.size(), rcloud.points.size() ); - for(int i=0;i < rcloud.points.size(); i++){ + for(size_t i=0;i < rcloud.points.size(); i++){ EXPECT_FLOAT_EQ(cloud.points[i].x, rcloud.points[i].x); EXPECT_FLOAT_EQ(cloud.points[i].y,rcloud.points[i].y); EXPECT_FLOAT_EQ(cloud.points[i].z, rcloud.points[i].z); From 0a21e14a9220294a26e310a87a6403d4c57fcfc3 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:09:15 +0100 Subject: [PATCH 07/14] Fix warnings in segmentation/grabcut_segmentation.hpp > grabcut_segmentation.hpp:272:25: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare] --- .../include/pcl/segmentation/impl/grabcut_segmentation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp index 3d8ebe96f0d..f0cf0e510d0 100644 --- a/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp @@ -269,7 +269,7 @@ pcl::GrabCut::initGraph () graph_nodes_.clear (); graph_nodes_.resize (indices_->size ()); int start = graph_.addNodes (indices_->size ()); - for (int idx = 0; idx < indices_->size (); ++idx) + for (size_t idx = 0; idx < indices_->size (); ++idx) { graph_nodes_[idx] = start; ++start; From 9ec7c44bc5d493c29f17cb3ce40c057f87317bd7 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:10:31 +0100 Subject: [PATCH 08/14] Fix warnings in apps/ni_agast.cpp > ni_agast.cpp:233:13: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] --- apps/src/ni_agast.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/src/ni_agast.cpp b/apps/src/ni_agast.cpp index a47ee7cc631..d57722302ea 100644 --- a/apps/src/ni_agast.cpp +++ b/apps/src/ni_agast.cpp @@ -216,7 +216,7 @@ class AGASTDemo keypoints3d.height = keypoints->height; keypoints3d.is_dense = true; - int j = 0; + size_t j = 0; for (size_t i = 0; i < keypoints->size (); ++i) { const PointT &pt = (*cloud)(static_cast (keypoints->points[i].u), From 325a038fe796f3dfd9331dd9c2868ed17a760f47 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:11:54 +0100 Subject: [PATCH 09/14] Fix warnings in apps/ni_brisk.cpp > ni_brisk.cpp:193:13: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] --- apps/src/ni_brisk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/src/ni_brisk.cpp b/apps/src/ni_brisk.cpp index 2c4b39d4c54..891a183d27f 100644 --- a/apps/src/ni_brisk.cpp +++ b/apps/src/ni_brisk.cpp @@ -179,7 +179,7 @@ class BRISKDemo keypoints3d.height = keypoints->height; keypoints3d.is_dense = true; - int j = 0; + size_t j = 0; for (size_t i = 0; i < keypoints->size (); ++i) { PointT pt = bilinearInterpolation (cloud, keypoints->points[i].x, keypoints->points[i].y); From e5eb8175860b75a69c96d900c6948df6dd4a8b95 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:13:14 +0100 Subject: [PATCH 10/14] Fix warnings in keypoints/trajkovic_3d.h > trajkovic_3d.h:142:42: warning: unused parameter 'normals' [-Wunused-parameter] --- keypoints/include/pcl/keypoints/trajkovic_3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keypoints/include/pcl/keypoints/trajkovic_3d.h b/keypoints/include/pcl/keypoints/trajkovic_3d.h index 31ecbfa3744..8a58e464b85 100644 --- a/keypoints/include/pcl/keypoints/trajkovic_3d.h +++ b/keypoints/include/pcl/keypoints/trajkovic_3d.h @@ -139,7 +139,7 @@ namespace pcl /// \brief \return points normals as calculated or given inline void - getNormals (const NormalsConstPtr &normals) const { return (normals_); } + getNormals () const { return (normals_); } /** \brief Initialize the scheduler and set the number of threads to use. * \param nr_threads the number of hardware threads to use, 0 for automatic. From 75619912e1f213189b7be06985adf19fbefd6724 Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:15:02 +0100 Subject: [PATCH 11/14] Fix warnings in keypoints/trajkovic_3d.hpp > trajkovic_3d.hpp:237:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare] --- keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp b/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp index a191a99ab8b..4e3f7d6ead8 100644 --- a/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp +++ b/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp @@ -234,7 +234,7 @@ pcl::TrajkovicKeypoint3D::detectKeypoints (PointCl #ifdef _OPENMP #pragma omp parallel for shared (output) num_threads (threads_) #endif - for (int i = 0; i < indices.size (); ++i) + for (size_t i = 0; i < indices.size (); ++i) { int idx = indices[i]; if ((response_->points[idx] < second_threshold_) || occupency_map[idx]) From 8dd1a9a3941682147414617bfb21dce917bcb92b Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:15:47 +0100 Subject: [PATCH 12/14] Fix warnings in keypoints/trajkovic_2d.hpp > trajkovic_2d.hpp:223:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare] --- keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp b/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp index 7f58df3ff96..ae0ba65624d 100644 --- a/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp +++ b/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp @@ -220,7 +220,7 @@ pcl::TrajkovicKeypoint2D::detectKeypoints (Poin #ifdef _OPENMP #pragma omp parallel for shared (output) num_threads (threads_) #endif - for (int i = 0; i < indices.size (); ++i) + for (size_t i = 0; i < indices.size (); ++i) { int idx = indices[i]; if ((response_->points[idx] < second_threshold_) || occupency_map[idx]) From 04f4be678a05baeb33ea22c9cdb1791af83d86ff Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:26:55 +0100 Subject: [PATCH 13/14] Fix warnings in apps/openni_tracking.cpp > openni_tracking.cpp:452:72: warning: unused parameter 'normals' [-Wunused-parameter] --- apps/src/openni_tracking.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/src/openni_tracking.cpp b/apps/src/openni_tracking.cpp index 4fd0d13839b..75f9fe95511 100644 --- a/apps/src/openni_tracking.cpp +++ b/apps/src/openni_tracking.cpp @@ -449,7 +449,7 @@ class OpenNISegmentTracking } void addNormalToCloud (const CloudConstPtr &cloud, - const pcl::PointCloud::ConstPtr &normals, + const pcl::PointCloud::ConstPtr &, RefCloud &result) { result.width = cloud->width; From 02bcbe1e0a83fe048057e265fe7679f26a22740a Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Sun, 18 Jan 2015 16:43:54 +0100 Subject: [PATCH 14/14] Fix warnings in apps/stereo_ground_segmentation.cpp > stereo_ground_segmentation.cpp:269:25: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare] ... and 5 more. --- apps/src/stereo_ground_segmentation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/src/stereo_ground_segmentation.cpp b/apps/src/stereo_ground_segmentation.cpp index 8bef8006ab0..e14bbf68dc8 100755 --- a/apps/src/stereo_ground_segmentation.cpp +++ b/apps/src/stereo_ground_segmentation.cpp @@ -266,12 +266,12 @@ class HRCSSegmentation std::vector > covariances; std::vector inlier_indices; - for (int i = 0; i < region_indices.size (); i++) + for (size_t i = 0; i < region_indices.size (); i++) { if (region_indices[i].indices.size () > 1000) { - for (int j = 0; j < region_indices[i].indices.size (); j++) + for (size_t j = 0; j < region_indices[i].indices.size (); j++) { pcl::PointXYZ ground_pt (cloud->points[region_indices[i].indices[j]].x, cloud->points[region_indices[i].indices[j]].y, @@ -354,11 +354,11 @@ class HRCSSegmentation //Note the regions that have been extended pcl::PointCloud extended_ground_cloud; - for (int i = 0; i < region_indices.size (); i++) + for (size_t i = 0; i < region_indices.size (); i++) { if (region_indices[i].indices.size () > 1000) { - for (int j = 0; j < region_indices[i].indices.size (); j++) + for (size_t j = 0; j < region_indices[i].indices.size (); j++) { // Check to see if it has already been labeled if (ground_image->points[region_indices[i].indices[j]].g == ground_image->points[region_indices[i].indices[j]].b) @@ -434,7 +434,7 @@ class HRCSSegmentation if ((ptp_dist > 0.5) && (ptp_dist < 3.0)) { - for (int j = 0; j < euclidean_label_indices[i].indices.size (); j++) + for (size_t j = 0; j < euclidean_label_indices[i].indices.size (); j++) { ground_image->points[euclidean_label_indices[i].indices[j]].r = 255; label_image->points[euclidean_label_indices[i].indices[j]].r = 255; @@ -451,7 +451,7 @@ class HRCSSegmentation } // note the NAN points in the image as well - for (int i = 0; i < cloud->points.size (); i++) + for (size_t i = 0; i < cloud->points.size (); i++) { if (!pcl::isFinite (cloud->points[i])) {