Fixing GCC warnings 2

This commit is contained in:
Lukas Matena 2021-01-14 13:00:03 +01:00
parent b5280fbed9
commit 2d32c80b75
13 changed files with 61 additions and 81 deletions

View file

@ -512,7 +512,6 @@ void Layer::make_ironing()
};
std::vector<IroningParams> by_extruder;
bool extruder_dont_care = this->object()->config().wipe_into_objects;
double default_layer_height = this->object()->config().layer_height;
for (LayerRegion *layerm : m_regions)

View file

@ -166,7 +166,7 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
(float)perimeter_generator.layer_height);
// get overhang paths by checking what parts of this loop fall
// outside the grown lower slices (thus where the distance between
// outside the grown lower slices (thus where the distance between
// the loop centerline and original lower slices is >= half nozzle diameter
extrusion_paths_append(
paths,
@ -396,8 +396,8 @@ void PerimeterGenerator::process()
}
// fuzzy skin configuration
double fuzzy_skin_thickness;
double fuzzy_skin_point_dist;
double fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness);
double fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist);
//FuzzyShape fuzzy_skin_shape;
if (this->object_config->fuzzy_skin_perimeter_mode != FuzzySkinPerimeterMode::None) {
/*
@ -419,8 +419,6 @@ void PerimeterGenerator::process()
break;
}
*/
fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness);
fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist);
}
// we need to process each island separately because we might have different

View file

@ -304,8 +304,6 @@ void SupportPointGenerator::add_support_points(SupportPointGenerator::Structure
float tp = m_config.tear_pressure();
float current = s.supports_force_total();
static constexpr float DANGL_DAMPING = .5f;
static constexpr float SLOPE_DAMPING = .1f;
if (s.islands_below.empty()) {
// completely new island - needs support no doubt

View file

@ -21,7 +21,7 @@ template<typename EndPointType, typename KDTreeType, typename CouldReverseFunc>
std::vector<std::pair<size_t, bool>> chain_segments_closest_point(std::vector<EndPointType> &end_points, KDTreeType &kdtree, CouldReverseFunc &could_reverse_func, EndPointType &first_point)
{
assert((end_points.size() & 1) == 0);
size_t num_segments = end_points.size() / 2;
size_t num_segments = end_points.size() / 2;
assert(num_segments >= 2);
for (EndPointType &ep : end_points)
ep.chain_id = 0;
@ -1553,9 +1553,7 @@ static inline void reorder_by_two_exchanges_with_segment_flipping(std::vector<Fl
size_t crossover1_pos_final = std::numeric_limits<size_t>::max();
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
size_t crossover_flip_final = 0;
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
double longest_connection_length = first_crossover_candidate.first;
size_t longest_connection_idx = first_crossover_candidate.second;
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
connection_tried[longest_connection_idx] = true;
// Find the second crossover connection with the lowest total chain cost.
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
@ -1630,12 +1628,9 @@ static inline void reorder_by_three_exchanges_with_segment_flipping(std::vector<
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
size_t crossover3_pos_final = std::numeric_limits<size_t>::max();
size_t crossover_flip_final = 0;
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
double longest_connection_length = first_crossover_candidate.first;
size_t longest_connection_idx = first_crossover_candidate.second;
connection_tried[longest_connection_idx] = true;
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
connection_tried[longest_connection_idx] = true;
// Find the second crossover connection with the lowest total chain cost.
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
double crossover_cost_min = connections.back().cost;
for (size_t j = 1; j < connections.size(); ++ j)
if (! connection_tried[j]) {
@ -1789,12 +1784,9 @@ static inline void reorder_by_three_exchanges_with_segment_flipping2(std::vector
#else /* NDEBUG */
Matrixd segment_end_point_distance_matrix = Matrixd::Constant(4 * 4, 4 * 4, std::numeric_limits<double>::max());
#endif /* NDEBUG */
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
double longest_connection_length = first_crossover_candidate.first;
size_t longest_connection_idx = first_crossover_candidate.second;
connection_tried[longest_connection_idx] = true;
// Find the second crossover connection with the lowest total chain cost.
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
connection_tried[longest_connection_idx] = true;
// Find the second crossover connection with the lowest total chain cost.
double crossover_cost_min = connections.back().cost;
for (size_t j = 1; j < connections.size(); ++ j)
if (! connection_tried[j]) {

View file

@ -561,9 +561,11 @@ Polygons voronoi_offset(
const Point &pt = cell->contains_point() ?
((cell->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line0.a : line0.b) :
((cell2->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line1.a : line1.b);
#ifndef NDEBUG
const Line &line = cell->contains_segment() ? line0 : line1;
assert(pt == line.a || pt == line.b);
assert((pt.cast<double>() - Vec2d(v0->x(), v0->y())).norm() < SCALED_EPSILON);
#endif // NDEBUG
Vec2d dir(v1->x() - v0->x(), v1->y() - v0->y());
double l2 = dir.squaredNorm();
if (offset_distance2 <= l2) {