mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-09 10:16:50 +00:00
fixes compiler warnings (#9619)
* compiler warnings: adds SYSTEM to [target_]include_directories to skip warnings originating from dependencies * compiler warnings: uninitialized/unused variables, missing parenthesis, pragma * compiler warnings: redundant template type, missing curly braces, pass 0 instead of NULL as int argument * compiler warnings: removes fclose(fp) where fp==nullptr since fclose() has attribute __nonnull((1)) * compiler warnings: uninitialized variables, missing parentheses, missing curly braces * compiler warnings: ? as lower precedence than << * compiler warnings: unused variable * compiler warnings: unused result * compiler warnings: undefined/unused variable * compiler warnings: uninitialized variable
This commit is contained in:
committed by
GitHub
parent
9569841091
commit
3ecca6116d
@@ -200,7 +200,7 @@ SplittedLine do_split_line(const ClipperZUtils::ZPath& path, const ExPolygons& c
|
||||
|
||||
// Chain segment back to the original path
|
||||
ClipperZUtils::ZPoint& front = segment.front();
|
||||
const ClipperZUtils::ZPoint* previous_src_point;
|
||||
const ClipperZUtils::ZPoint* previous_src_point = nullptr;
|
||||
if (is_src(front)) {
|
||||
// The segment starts with a point from src path, which means apart from the last point,
|
||||
// all other points on this segment should come from the src path or the clip polygon
|
||||
|
||||
@@ -587,9 +587,9 @@ double getadhesionCoeff(const PrintObject* printObject)
|
||||
}
|
||||
double adhesionCoeff = 1;
|
||||
for (const ModelVolume* modelVolume : objectVolumes) {
|
||||
for (auto iter = extrudersFirstLayer.begin(); iter != extrudersFirstLayer.end(); iter++)
|
||||
for (auto iter = extrudersFirstLayer.begin(); iter != extrudersFirstLayer.end(); iter++) {
|
||||
if (modelVolume->extruder_id() == *iter) {
|
||||
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end())
|
||||
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end()) {
|
||||
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG" ||
|
||||
Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PCTG") {
|
||||
adhesionCoeff = 2;
|
||||
@@ -597,11 +597,13 @@ double getadhesionCoeff(const PrintObject* printObject)
|
||||
else if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "TPU") {
|
||||
adhesionCoeff = 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return adhesionCoeff;
|
||||
/*
|
||||
/*
|
||||
def->enum_values.push_back("PLA");
|
||||
def->enum_values.push_back("PET");
|
||||
def->enum_values.push_back("ABS");
|
||||
@@ -1653,7 +1655,7 @@ ExtrusionEntityCollection makeBrimInfill(const ExPolygons& singleBrimArea, const
|
||||
Polylines loops_pl = to_polylines(loops);
|
||||
loops_pl_by_levels.assign(loops_pl.size(), Polylines());
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, loops_pl.size()),
|
||||
[&loops_pl_by_levels, &loops_pl, &islands_area](const tbb::blocked_range<size_t>& range) {
|
||||
[&loops_pl_by_levels, &loops_pl /*, &islands_area*/](const tbb::blocked_range<size_t>& range) {
|
||||
for (size_t i = range.begin(); i < range.end(); ++i) {
|
||||
loops_pl_by_levels[i] = chain_polylines({ std::move(loops_pl[i]) });
|
||||
//loops_pl_by_levels[i] = chain_polylines(intersection_pl({ std::move(loops_pl[i]) }, islands_area));
|
||||
|
||||
@@ -513,7 +513,7 @@ encoding_check(libslic3r)
|
||||
|
||||
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB -DTBB_USE_CAPTURED_EXCEPTION=0)
|
||||
target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
target_include_directories(libslic3r PUBLIC ${EXPAT_INCLUDE_DIRS})
|
||||
target_include_directories(libslic3r SYSTEM PUBLIC ${EXPAT_INCLUDE_DIRS})
|
||||
|
||||
# Find the OCCT and related libraries
|
||||
set(OpenCASCADE_DIR "${CMAKE_PREFIX_PATH}/lib/cmake/occt")
|
||||
|
||||
@@ -94,10 +94,10 @@ template<typename PointType> inline void clip_clipper_polygon_with_subject_bbox_
|
||||
}
|
||||
|
||||
// Never produce just a single point output polygon.
|
||||
if (!out.empty())
|
||||
if(get_entire_polygons){
|
||||
if (!out.empty()) {
|
||||
if (get_entire_polygons) {
|
||||
out=src;
|
||||
}else{
|
||||
} else {
|
||||
if (int sides_next = sides(out.front());
|
||||
// The last point is inside. Take it.
|
||||
sides_this == 0 ||
|
||||
@@ -106,7 +106,7 @@ template<typename PointType> inline void clip_clipper_polygon_with_subject_bbox_
|
||||
(sides_prev & sides_this & sides_next) == 0)
|
||||
out.emplace_back(src.back());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void clip_clipper_polygon_with_subject_bbox(const Points &src, const BoundingBox &bbox, Points &out, const bool get_entire_polygons) { clip_clipper_polygon_with_subject_bbox_templ(src, bbox, out, get_entire_polygons); }
|
||||
|
||||
@@ -257,7 +257,7 @@ ColorRGBA complementary(const ColorRGBA& color)
|
||||
|
||||
ColorRGB saturate(const ColorRGB& color, float factor)
|
||||
{
|
||||
float h, s, v;
|
||||
float h = 0.0, s = 0.0, v = 0.0;
|
||||
RGBtoHSV(color.r(), color.g(), color.b(), h, s, v);
|
||||
s = std::clamp(s * factor, 0.0f, 1.0f);
|
||||
float r, g, b;
|
||||
@@ -272,7 +272,7 @@ ColorRGBA saturate(const ColorRGBA& color, float factor)
|
||||
|
||||
ColorRGB opposite(const ColorRGB& color)
|
||||
{
|
||||
float h, s, v;
|
||||
float h = 0.0, s = 0.0, v = 0.0;
|
||||
RGBtoHSV(color.r(), color.g(), color.b(), h, s, v);
|
||||
|
||||
h += 65.0f; // 65 instead 60 to avoid circle values
|
||||
|
||||
@@ -61,8 +61,8 @@ void FillConcentric::_fill_surface_single(
|
||||
size_t iPathFirst = polylines_out.size();
|
||||
Point last_pos(0, 0);
|
||||
|
||||
double min_nozzle_diameter;
|
||||
bool dir;
|
||||
double min_nozzle_diameter = 0.0;
|
||||
bool dir = false;
|
||||
if (this->print_config != nullptr && params.density >= STAGGER_SEAM_THRESHOLD) {
|
||||
min_nozzle_diameter = *std::min_element(print_config->nozzle_diameter.values.begin(), print_config->nozzle_diameter.values.end());
|
||||
dir = rand() % 2;
|
||||
|
||||
@@ -421,11 +421,12 @@ void FanMover::_process_gcode_line(GCodeReader& reader, const GCodeReader::GCode
|
||||
current_role = ExtrusionEntity::string_to_role(extrusion_string);
|
||||
}
|
||||
if (line.raw().size() > 16) {
|
||||
if (line.raw().rfind("; custom gcode", 0) != std::string::npos)
|
||||
if (line.raw().rfind("; custom gcode", 0) != std::string::npos) {
|
||||
if (line.raw().rfind("; custom gcode end", 0) != std::string::npos)
|
||||
m_is_custom_gcode = false;
|
||||
else
|
||||
m_is_custom_gcode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3200,7 +3200,7 @@ double getadhesionCoeff(const ModelVolumePtrs objectVolumes)
|
||||
{
|
||||
double adhesionCoeff = 1;
|
||||
for (const ModelVolume* modelVolume : objectVolumes) {
|
||||
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end())
|
||||
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end()) {
|
||||
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG" ||
|
||||
Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PCTG") {
|
||||
adhesionCoeff = 2;
|
||||
@@ -3208,6 +3208,7 @@ double getadhesionCoeff(const ModelVolumePtrs objectVolumes)
|
||||
else if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "TPU") {
|
||||
adhesionCoeff = 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return adhesionCoeff;
|
||||
}
|
||||
|
||||
@@ -2474,7 +2474,7 @@ void cut_mesh(const indexed_triangle_set& mesh, float z, indexed_triangle_set* u
|
||||
// intersect v0-v1 and v2-v0 with cutting plane and make new vertices
|
||||
auto new_vertex = [upper, lower, &upper_slice_vertices, &lower_slice_vertices](const Vec3f &a, const int ia, const Vec3f &b, const int ib, const Vec3f &c,
|
||||
const int ic, const Vec3f &new_pt, bool &is_new_vertex) {
|
||||
int iupper, ilower;
|
||||
int iupper = 0, ilower = 0;
|
||||
is_new_vertex = false;
|
||||
if (is_equal(new_pt, a))
|
||||
iupper = ilower = ia;
|
||||
|
||||
Reference in New Issue
Block a user