Skip to content

Commit e9de29d

Browse files
authored
Merge pull request #5541 from SunBlack/unused-but-set-variable
Fix unused-but-set-variable warnings
2 parents f64e7ac + 9f99947 commit e9de29d

File tree

13 files changed

+1
-50
lines changed

13 files changed

+1
-50
lines changed

common/src/io.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1,
9393
cloud_out.height = cloud2.height;
9494
cloud_out.is_bigendian = cloud2.is_bigendian;
9595

96-
//We need to find how many fields overlap between the two clouds
97-
std::size_t total_fields = cloud2.fields.size ();
98-
9996
//for the non-matching fields in cloud1, we need to store the offset
10097
//from the beginning of the point
10198
std::vector<const pcl::PCLPointField*> cloud1_unique_fields;
@@ -142,8 +139,6 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1,
142139
size = cloud1.point_step - cloud1_fields_sorted[i]->offset;
143140

144141
field_sizes.push_back (size);
145-
146-
total_fields++;
147142
}
148143
}
149144

gpu/people/src/face_detector.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ pcl::gpu::people::FaceDetector::loadFromXML2(const std::string
120120
haar.bHasStumpsOnly = true;
121121
haar.bNeedsTiltedII = false;
122122

123-
Ncv32u cur_max_tree_depth;
124-
125123
std::vector<HaarClassifierNode128> host_temp_classifier_not_root_nodes;
126124
haar_stages.resize(0);
127125
haarClassifierNodes.resize(0);
@@ -258,15 +256,13 @@ pcl::gpu::people::FaceDetector::loadFromXML2(const std::string
258256
{
259257
//root node
260258
haarClassifierNodes.push_back(current_node);
261-
cur_max_tree_depth = 1;
262259
}
263260
else
264261
{
265262
//other node
266263
host_temp_classifier_not_root_nodes.push_back(current_node);
267264
// TODO replace with PCL_DEBUG in the future
268265
PCL_INFO("[pcl::gpu::people::FaceDetector::loadFromXML2] : (I) : Found non root node number %d", host_temp_classifier_not_root_nodes.size());
269-
cur_max_tree_depth++;
270266
}
271267
node_identifier++;
272268
}

io/src/obj_io.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ pcl::OBJReader::read (const std::string &file_name, pcl::TextureMesh &mesh,
678678
try
679679
{
680680
std::size_t vn_idx = 0;
681-
std::size_t vt_idx = 0;
682681

683682
while (!fs.eof ())
684683
{
@@ -747,7 +746,6 @@ pcl::OBJReader::read (const std::string &file_name, pcl::TextureMesh &mesh,
747746
coordinates.emplace_back(c[0], c[1]);
748747
else
749748
coordinates.emplace_back(c[0]/c[2], c[1]/c[2]);
750-
++vt_idx;
751749
}
752750
catch (const boost::bad_lexical_cast&)
753751
{

io/src/ply/ply_parser.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
5252

5353
std::size_t number_of_format_statements = 0;
5454
std::size_t number_of_element_statements = 0;
55-
std::size_t number_of_property_statements = 0;
56-
std::size_t number_of_obj_info_statements = 0;
57-
std::size_t number_of_comment_statements = 0;
5855

5956
format_type format = pcl::io::ply::unknown;
6057
std::vector<std::shared_ptr<element>> elements;
@@ -262,7 +259,6 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
262259
error_callback_ (line_number_, "parse error: unknown type");
263260
return false;
264261
}
265-
++number_of_property_statements;
266262
}
267263
else
268264
{
@@ -418,22 +414,19 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
418414
error_callback_ (line_number_, "parse error: unknown list size type");
419415
return false;
420416
}
421-
++number_of_property_statements;
422417
}
423418
}
424419

425420
// comment
426421
else if (keyword == "comment")
427422
{
428423
comment_callback_ (line);
429-
++number_of_comment_statements;
430424
}
431425

432426
// obj_info
433427
else if (keyword == "obj_info")
434428
{
435429
obj_info_callback_ (line);
436-
++number_of_obj_info_statements;
437430
}
438431

439432
// end_header

ml/src/svm.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -3365,8 +3365,6 @@ svm_load_model(const char* model_file_name)
33653365
model->sv_coef[k][i] = strtod(p, nullptr);
33663366
}
33673367

3368-
int jj = 0;
3369-
33703368
while (true) {
33713369
char* idx = strtok(nullptr, ":");
33723370
char* val = strtok(nullptr, " \t");
@@ -3378,10 +3376,6 @@ svm_load_model(const char* model_file_name)
33783376

33793377
x_space[j].value = strtod(val, nullptr);
33803378

3381-
// printf("i=%d, j=%d, %f ,%d e %f\n",i,j,model->sv_coef[0][i],
3382-
// model->SV[i][jj].index, model->SV[i][jj].value);
3383-
jj++;
3384-
33853379
++j;
33863380
}
33873381

ml/src/svm_wrapper.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,6 @@ pcl::SVMClassify::classification()
681681
getClassName().c_str());
682682
}
683683

684-
// int correct = 0;
685-
int total = 0;
686684
int svm_type = svm_get_svm_type(&model_);
687685
int nr_class = svm_get_nr_class(&model_);
688686

@@ -725,8 +723,6 @@ pcl::SVMClassify::classification()
725723
prediction_[ii].push_back(predict_label);
726724
}
727725

728-
++total;
729-
730726
ii++;
731727
}
732728

recognition/include/pcl/recognition/face_detection/rf_face_utils.h

-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ namespace pcl
368368
std::vector < std::vector<ExampleIndex> > positive_examples;
369369
positive_examples.resize (num_of_branches + 1);
370370

371-
std::size_t pos = 0;
372371
for (std::size_t example_index = 0; example_index < num_of_examples; ++example_index)
373372
{
374373
unsigned char branch_index;
@@ -383,7 +382,6 @@ namespace pcl
383382

384383
positive_examples[branch_index].push_back (examples[example_index]);
385384
positive_examples[num_of_branches].push_back (examples[example_index]);
386-
pos++;
387385
}
388386
}
389387

segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ pcl::CPCSegmentation<PointT>::applyCuttingPlane (std::uint32_t depth_levels_left
199199
for (const auto &cluster_index : cluster_indices)
200200
{
201201
// get centroids of vertices
202-
int cluster_concave_pts = 0;
203202
float cluster_score = 0;
204203
// std::cout << "Cluster has " << cluster_indices[cc].indices.size () << " points" << std::endl;
205204
for (const auto &current_index : cluster_index.indices)
@@ -208,8 +207,6 @@ pcl::CPCSegmentation<PointT>::applyCuttingPlane (std::uint32_t depth_levels_left
208207
if (use_directed_weights_)
209208
index_score *= 1.414 * (std::abs (plane_normal.dot (edge_cloud_cluster->at (current_index).getNormalVector3fMap ())));
210209
cluster_score += index_score;
211-
if (weights[current_index] > 0)
212-
++cluster_concave_pts;
213210
}
214211
// check if the score is below the threshold. If that is the case this segment should not be split
215212
cluster_score /= cluster_index.indices.size ();

segmentation/include/pcl/segmentation/impl/lccp_segmentation.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ pcl::LCCPSegmentation<PointT>::mergeSmallSegments ()
177177
while (continue_filtering)
178178
{
179179
continue_filtering = false;
180-
unsigned int nr_filtered = 0;
181180

182181
VertexIterator sv_itr, sv_itr_end;
183182
// Iterate through all supervoxels, check if they are in a "small" segment -> change label to largest neighborID
@@ -195,7 +194,6 @@ pcl::LCCPSegmentation<PointT>::mergeSmallSegments ()
195194
if (seg_label_to_sv_list_map_[current_seg_label].size () <= min_segment_size_)
196195
{
197196
continue_filtering = true;
198-
nr_filtered++;
199197

200198
// Find largest neighbor
201199
for (auto neighbors_itr = seg_label_to_neighbor_set_map_[current_seg_label].cbegin (); neighbors_itr != seg_label_to_neighbor_set_map_[current_seg_label].cend (); ++neighbors_itr)

surface/include/pcl/surface/impl/gp3.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
134134
}
135135

136136
// Initializing
137-
int is_free=0, nr_parts=0, increase_nnn4fn=0, increase_nnn4s=0, increase_dist=0, nr_touched = 0;
137+
int is_free=0, nr_parts=0, increase_nnn4fn=0, increase_nnn4s=0, increase_dist=0;
138138
angles_.resize(nnn_);
139139
std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > uvn_nn (nnn_);
140140
Eigen::Vector2f uvn_s;
@@ -909,10 +909,6 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
909909
prev_is_sfn_ = (sfn_[current_index_] == angles_[*(it-1)].index) && (!gaps[*(it-1)]);
910910
next_is_ffn_ = (ffn_[current_index_] == angles_[*(it+1)].index) && (!gaps[*it]);
911911
next_is_sfn_ = (sfn_[current_index_] == angles_[*(it+1)].index) && (!gaps[*it]);
912-
if (!prev_is_ffn_ && !next_is_sfn_ && !prev_is_sfn_ && !next_is_ffn_)
913-
{
914-
nr_touched++;
915-
}
916912
}
917913

918914
if (gaps[*it])

surface/include/pcl/surface/impl/grid_projection.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,6 @@ pcl::GridProjection<PointNT>::reconstructPolygons (std::vector<pcl::Vertices> &p
651651
}
652652

653653
Eigen::Vector3i index;
654-
int numOfFilledPad = 0;
655654

656655
for (int i = 0; i < data_size_; ++i)
657656
{
@@ -665,7 +664,6 @@ pcl::GridProjection<PointNT>::reconstructPolygons (std::vector<pcl::Vertices> &p
665664
if (occupied_cell_list_[getIndexIn1D (index)])
666665
{
667666
fillPad (index);
668-
numOfFilledPad++;
669667
}
670668
}
671669
}

surface/src/on_nurbs/sequential_fitter.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ SequentialFitter::grow (float max_dist, float max_angle, unsigned min_length, un
493493
}
494494

495495
float angle = std::cos (max_angle);
496-
unsigned bnd_moved (0);
497496

498497
for (unsigned i = 0; i < num_bnd; i++)
499498
{
@@ -584,7 +583,6 @@ SequentialFitter::grow (float max_dist, float max_angle, unsigned min_length, un
584583
this->m_data.boundary[i] (0) = point.x;
585584
this->m_data.boundary[i] (1) = point.y;
586585
this->m_data.boundary[i] (2) = point.z;
587-
bnd_moved++;
588586
}
589587

590588
} // i

tools/virtual_scanner.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ main (int argc, char** argv)
255255
if (single_view)
256256
number_of_points = 1;
257257

258-
int sid = -1;
259258
for (int i = 0; i < number_of_points; i++)
260259
{
261260
// Clear cloud for next view scan
@@ -334,18 +333,13 @@ main (int argc, char** argv)
334333
// Sweep vertically
335334
for (double vert = vert_start; vert <= vert_end; vert += sp.vert_res)
336335
{
337-
sid++;
338-
339336
tr1->Identity ();
340337
tr1->RotateWXYZ (vert, right);
341338
tr1->InternalTransformPoint (viewray, temp_beam);
342339

343340
// Sweep horizontally
344-
int pid = -1;
345341
for (double hor = hor_start; hor <= hor_end; hor += sp.hor_res)
346342
{
347-
pid ++;
348-
349343
// Create a beam vector with (lat,long) angles (vert, hor) with the viewray
350344
tr2->Identity ();
351345
tr2->RotateWXYZ (hor, up);

0 commit comments

Comments
 (0)