Skip to content

Commit

Permalink
Fix unused-but-set-variable warnings of Clang 15
Browse files Browse the repository at this point in the history
  • Loading branch information
SunBlack committed Dec 2, 2022
1 parent 58f9cfb commit 9f99947
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 50 deletions.
5 changes: 0 additions & 5 deletions common/src/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1,
cloud_out.height = cloud2.height;
cloud_out.is_bigendian = cloud2.is_bigendian;

//We need to find how many fields overlap between the two clouds
std::size_t total_fields = cloud2.fields.size ();

//for the non-matching fields in cloud1, we need to store the offset
//from the beginning of the point
std::vector<const pcl::PCLPointField*> cloud1_unique_fields;
Expand Down Expand Up @@ -142,8 +139,6 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1,
size = cloud1.point_step - cloud1_fields_sorted[i]->offset;

field_sizes.push_back (size);

total_fields++;
}
}

Expand Down
4 changes: 0 additions & 4 deletions gpu/people/src/face_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ pcl::gpu::people::FaceDetector::loadFromXML2(const std::string
haar.bHasStumpsOnly = true;
haar.bNeedsTiltedII = false;

Ncv32u cur_max_tree_depth;

std::vector<HaarClassifierNode128> host_temp_classifier_not_root_nodes;
haar_stages.resize(0);
haarClassifierNodes.resize(0);
Expand Down Expand Up @@ -258,15 +256,13 @@ pcl::gpu::people::FaceDetector::loadFromXML2(const std::string
{
//root node
haarClassifierNodes.push_back(current_node);
cur_max_tree_depth = 1;
}
else
{
//other node
host_temp_classifier_not_root_nodes.push_back(current_node);
// TODO replace with PCL_DEBUG in the future
PCL_INFO("[pcl::gpu::people::FaceDetector::loadFromXML2] : (I) : Found non root node number %d", host_temp_classifier_not_root_nodes.size());
cur_max_tree_depth++;
}
node_identifier++;
}
Expand Down
2 changes: 0 additions & 2 deletions io/src/obj_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ pcl::OBJReader::read (const std::string &file_name, pcl::TextureMesh &mesh,
try
{
std::size_t vn_idx = 0;
std::size_t vt_idx = 0;

while (!fs.eof ())
{
Expand Down Expand Up @@ -747,7 +746,6 @@ pcl::OBJReader::read (const std::string &file_name, pcl::TextureMesh &mesh,
coordinates.emplace_back(c[0], c[1]);
else
coordinates.emplace_back(c[0]/c[2], c[1]/c[2]);
++vt_idx;
}
catch (const boost::bad_lexical_cast&)
{
Expand Down
7 changes: 0 additions & 7 deletions io/src/ply/ply_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)

std::size_t number_of_format_statements = 0;
std::size_t number_of_element_statements = 0;
std::size_t number_of_property_statements = 0;
std::size_t number_of_obj_info_statements = 0;
std::size_t number_of_comment_statements = 0;

format_type format = pcl::io::ply::unknown;
std::vector<std::shared_ptr<element>> elements;
Expand Down Expand Up @@ -262,7 +259,6 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
error_callback_ (line_number_, "parse error: unknown type");
return false;
}
++number_of_property_statements;
}
else
{
Expand Down Expand Up @@ -418,22 +414,19 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
error_callback_ (line_number_, "parse error: unknown list size type");
return false;
}
++number_of_property_statements;
}
}

// comment
else if (keyword == "comment")
{
comment_callback_ (line);
++number_of_comment_statements;
}

// obj_info
else if (keyword == "obj_info")
{
obj_info_callback_ (line);
++number_of_obj_info_statements;
}

// end_header
Expand Down
6 changes: 0 additions & 6 deletions ml/src/svm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3365,8 +3365,6 @@ svm_load_model(const char* model_file_name)
model->sv_coef[k][i] = strtod(p, nullptr);
}

int jj = 0;

while (true) {
char* idx = strtok(nullptr, ":");
char* val = strtok(nullptr, " \t");
Expand All @@ -3378,10 +3376,6 @@ svm_load_model(const char* model_file_name)

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

// printf("i=%d, j=%d, %f ,%d e %f\n",i,j,model->sv_coef[0][i],
// model->SV[i][jj].index, model->SV[i][jj].value);
jj++;

++j;
}

Expand Down
4 changes: 0 additions & 4 deletions ml/src/svm_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,6 @@ pcl::SVMClassify::classification()
getClassName().c_str());
}

// int correct = 0;
int total = 0;
int svm_type = svm_get_svm_type(&model_);
int nr_class = svm_get_nr_class(&model_);

Expand Down Expand Up @@ -724,8 +722,6 @@ pcl::SVMClassify::classification()
prediction_[ii].push_back(predict_label);
}

++total;

ii++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ namespace pcl
std::vector < std::vector<ExampleIndex> > positive_examples;
positive_examples.resize (num_of_branches + 1);

std::size_t pos = 0;
for (std::size_t example_index = 0; example_index < num_of_examples; ++example_index)
{
unsigned char branch_index;
Expand All @@ -383,7 +382,6 @@ namespace pcl

positive_examples[branch_index].push_back (examples[example_index]);
positive_examples[num_of_branches].push_back (examples[example_index]);
pos++;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ pcl::CPCSegmentation<PointT>::applyCuttingPlane (std::uint32_t depth_levels_left
for (const auto &cluster_index : cluster_indices)
{
// get centroids of vertices
int cluster_concave_pts = 0;
float cluster_score = 0;
// std::cout << "Cluster has " << cluster_indices[cc].indices.size () << " points" << std::endl;
for (const auto &current_index : cluster_index.indices)
Expand All @@ -208,8 +207,6 @@ pcl::CPCSegmentation<PointT>::applyCuttingPlane (std::uint32_t depth_levels_left
if (use_directed_weights_)
index_score *= 1.414 * (std::abs (plane_normal.dot (edge_cloud_cluster->at (current_index).getNormalVector3fMap ())));
cluster_score += index_score;
if (weights[current_index] > 0)
++cluster_concave_pts;
}
// check if the score is below the threshold. If that is the case this segment should not be split
cluster_score /= cluster_index.indices.size ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ pcl::LCCPSegmentation<PointT>::mergeSmallSegments ()
while (continue_filtering)
{
continue_filtering = false;
unsigned int nr_filtered = 0;

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

// Find largest neighbor
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)
Expand Down
6 changes: 1 addition & 5 deletions surface/include/pcl/surface/impl/gp3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
}

// Initializing
int is_free=0, nr_parts=0, increase_nnn4fn=0, increase_nnn4s=0, increase_dist=0, nr_touched = 0;
int is_free=0, nr_parts=0, increase_nnn4fn=0, increase_nnn4s=0, increase_dist=0;
angles_.resize(nnn_);
std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > uvn_nn (nnn_);
Eigen::Vector2f uvn_s;
Expand Down Expand Up @@ -909,10 +909,6 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
prev_is_sfn_ = (sfn_[current_index_] == angles_[*(it-1)].index) && (!gaps[*(it-1)]);
next_is_ffn_ = (ffn_[current_index_] == angles_[*(it+1)].index) && (!gaps[*it]);
next_is_sfn_ = (sfn_[current_index_] == angles_[*(it+1)].index) && (!gaps[*it]);
if (!prev_is_ffn_ && !next_is_sfn_ && !prev_is_sfn_ && !next_is_ffn_)
{
nr_touched++;
}
}

if (gaps[*it])
Expand Down
2 changes: 0 additions & 2 deletions surface/include/pcl/surface/impl/grid_projection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ pcl::GridProjection<PointNT>::reconstructPolygons (std::vector<pcl::Vertices> &p
}

Eigen::Vector3i index;
int numOfFilledPad = 0;

for (int i = 0; i < data_size_; ++i)
{
Expand All @@ -665,7 +664,6 @@ pcl::GridProjection<PointNT>::reconstructPolygons (std::vector<pcl::Vertices> &p
if (occupied_cell_list_[getIndexIn1D (index)])
{
fillPad (index);
numOfFilledPad++;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions surface/src/on_nurbs/sequential_fitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ SequentialFitter::grow (float max_dist, float max_angle, unsigned min_length, un
}

float angle = std::cos (max_angle);
unsigned bnd_moved (0);

for (unsigned i = 0; i < num_bnd; i++)
{
Expand Down Expand Up @@ -584,7 +583,6 @@ SequentialFitter::grow (float max_dist, float max_angle, unsigned min_length, un
this->m_data.boundary[i] (0) = point.x;
this->m_data.boundary[i] (1) = point.y;
this->m_data.boundary[i] (2) = point.z;
bnd_moved++;
}

} // i
Expand Down
6 changes: 0 additions & 6 deletions tools/virtual_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ main (int argc, char** argv)
if (single_view)
number_of_points = 1;

int sid = -1;
for (int i = 0; i < number_of_points; i++)
{
// Clear cloud for next view scan
Expand Down Expand Up @@ -334,18 +333,13 @@ main (int argc, char** argv)
// Sweep vertically
for (double vert = vert_start; vert <= vert_end; vert += sp.vert_res)
{
sid++;

tr1->Identity ();
tr1->RotateWXYZ (vert, right);
tr1->InternalTransformPoint (viewray, temp_beam);

// Sweep horizontally
int pid = -1;
for (double hor = hor_start; hor <= hor_end; hor += sp.hor_res)
{
pid ++;

// Create a beam vector with (lat,long) angles (vert, hor) with the viewray
tr2->Identity ();
tr2->RotateWXYZ (hor, up);
Expand Down

0 comments on commit 9f99947

Please sign in to comment.