Skip to content

Commit

Permalink
remove warnings (int -> size_t & cast)
Browse files Browse the repository at this point in the history
remove unsafe "auto" from SupportMaterial.cpp
remove unneeded copies (inside for-loop) from SupportMaterial.cpp
  • Loading branch information
supermerill committed Dec 3, 2018
1 parent cf2ceec commit 76b6f45
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 145 deletions.
4 changes: 2 additions & 2 deletions xs/src/libslic3r/GCode/CoolingBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ CoolingBuffer::flush()
gcode = new_gcode;
}
}
if (this->_layer_id < gg.config.disable_fan_first_layers)
if (this->_layer_id < static_cast<size_t>(gg.config.disable_fan_first_layers.value))
fan_speed = 0;

gcode = gg.writer.set_fan(fan_speed) + gcode;

// bridge fan speed
if (!gg.config.cooling || gg.config.bridge_fan_speed == 0 || this->_layer_id < gg.config.disable_fan_first_layers) {
if (!gg.config.cooling || gg.config.bridge_fan_speed == 0 || this->_layer_id < static_cast<size_t>(gg.config.disable_fan_first_layers)) {
boost::replace_all(gcode, ";_BRIDGE_FAN_START", "");
boost::replace_all(gcode, ";_BRIDGE_FAN_END", "");
} else {
Expand Down
4 changes: 2 additions & 2 deletions xs/src/libslic3r/IO/AMF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ AMF::write(const Model& model, std::string output_file)
for (ModelVolume *volume : object->volumes) {
volume->mesh.require_shared_vertices();
vertices_offsets.push_back(num_vertices);
const auto &stl = volume->mesh.stl;
for (size_t i = 0; i < stl.stats.shared_vertices; ++i)
const stl_file &stl = volume->mesh.stl;
for (int i = 0; i < stl.stats.shared_vertices; ++i)
// Subtract origin_translation in order to restore the coordinates of the parts
// before they were imported. Otherwise, when this AMF file is reimported parts
// will be placed in the plater correctly, but we will have lost origin_translation
Expand Down
4 changes: 2 additions & 2 deletions xs/src/libslic3r/PrintGCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ PrintGCode::process_layer(size_t idx, const Layer* layer, const Points& copies)
// check for usage of spiralvase logic.
this->_spiral_vase.enable = (
layer->id() > 0
&& (_print.config.skirts == 0 || (layer->id() >= _print.config.skirt_height && !_print.has_infinite_skirt()))
&& (_print.config.skirts == 0 || (layer->id() >= static_cast<size_t>(_print.config.skirt_height.value) && !_print.has_infinite_skirt()))
&& std::find_if(layer->regions.cbegin(), layer->regions.cend(), [layer] (const LayerRegion* l)
{ return l->region()->config.bottom_solid_layers > layer->id()
{ return static_cast<size_t>(l->region()->config.bottom_solid_layers) > layer->id()
|| l->perimeters.items_count() > 1
|| l->fills.items_count() > 0;
}) == layer->regions.cend()
Expand Down
Loading

0 comments on commit 76b6f45

Please sign in to comment.