Fixed some more warnings

This commit is contained in:
Lukas Matena 2020-03-03 14:52:16 +01:00
parent 6918f11100
commit 7589e4ebfc
16 changed files with 21 additions and 22 deletions

View file

@ -62,7 +62,8 @@ std::vector<std::pair<double, unsigned int>> custom_tool_changes(const Info& cus
for (const Item& custom_gcode : custom_gcode_per_print_z.gcodes)
if (custom_gcode.gcode == ToolChangeCode) {
// If extruder count in PrinterSettings was changed, use default (0) extruder for extruders, more than num_extruders
custom_tool_changes.emplace_back(custom_gcode.print_z, static_cast<unsigned int>(custom_gcode.extruder > num_extruders ? 1 : custom_gcode.extruder));
assert(custom_gcode.extruder >= 0);
custom_tool_changes.emplace_back(custom_gcode.print_z, static_cast<unsigned int>(size_t(custom_gcode.extruder) > num_extruders ? 1 : custom_gcode.extruder));
}
return custom_tool_changes;
}

View file

@ -1722,7 +1722,7 @@ namespace Slic3r {
}
// Added because of github #3435, currently not used by PrusaSlicer
int instances_count_id = get_attribute_value_int(attributes, num_attributes, INSTANCESCOUNT_ATTR);
// int instances_count_id = get_attribute_value_int(attributes, num_attributes, INSTANCESCOUNT_ATTR);
m_objects_metadata.insert(IdToMetadataMap::value_type(object_id, ObjectMetadata()));
m_curr_config.object_id = object_id;

View file

@ -1749,7 +1749,6 @@ std::vector<GCode::InstanceToPrint> GCode::sort_print_object_instances(
std::sort(sorted.begin(), sorted.end());
if (! sorted.empty()) {
const Print &print = *sorted.front().first->print();
out.reserve(sorted.size());
for (const PrintInstance *instance : *ordering) {
const PrintObject &print_object = *instance->print_object;
@ -1795,13 +1794,14 @@ namespace ProcessLayer
// we should add or not colorprint_change in respect to nozzle_diameter count instead of really used extruders count
if (color_change || tool_change)
{
assert(m600_extruder_before_layer >= 0);
// Color Change or Tool Change as Color Change.
// add tag for analyzer
gcode += "; " + GCodeAnalyzer::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
// add tag for time estimator
gcode += "; " + GCodeTimeEstimator::Color_Change_Tag + "\n";
if (!single_extruder_printer && m600_extruder_before_layer >= 0 && first_extruder_id != m600_extruder_before_layer
if (!single_extruder_printer && m600_extruder_before_layer >= 0 && first_extruder_id != (unsigned)m600_extruder_before_layer
// && !MMU1
) {
//! FIXME_in_fw show message during print pause

View file

@ -644,7 +644,7 @@ bool GCodeAnalyzer::_process_tags(const GCodeReader::GCodeLine& line)
if (pos != comment.npos)
{
pos = comment.find_last_of(",T");
int extruder = pos == comment.npos ? 0 : std::atoi(comment.substr(pos + 1, comment.npos).c_str());
unsigned extruder = pos == comment.npos ? 0 : std::stoi(comment.substr(pos + 1, comment.npos));
_process_color_change_tag(extruder);
return true;
}
@ -702,7 +702,7 @@ void GCodeAnalyzer::_process_height_tag(const std::string& comment, size_t pos)
_set_height((float)::strtod(comment.substr(pos + Height_Tag.length()).c_str(), nullptr));
}
void GCodeAnalyzer::_process_color_change_tag(int extruder)
void GCodeAnalyzer::_process_color_change_tag(unsigned extruder)
{
m_extruder_color[extruder] = m_extruders_count + m_state.cp_color_counter; // color_change position in list of color for preview
m_state.cp_color_counter++;

View file

@ -220,7 +220,7 @@ private:
void _process_height_tag(const std::string& comment, size_t pos);
// Processes color change tag
void _process_color_change_tag(int extruder);
void _process_color_change_tag(unsigned extruder);
// Processes pause print and custom gcode tag
void _process_pause_print_or_custom_code_tag();

View file

@ -1298,7 +1298,7 @@ void GLCanvas3D::Labels::render(const std::vector<const ModelInstance*>& sorted_
// updates print order strings
if (sorted_instances.size() > 1) {
for (int i = 0; i < sorted_instances.size(); ++i) {
for (size_t i = 0; i < sorted_instances.size(); ++i) {
size_t id = sorted_instances[i]->id().id;
std::vector<Owner>::iterator it = std::find_if(owners.begin(), owners.end(), [id](const Owner& owner) {
return owner.model_instance_id == id;

View file

@ -1543,7 +1543,7 @@ wxMenuItem* ObjectList::append_menu_item_settings(wxMenu* menu_)
// If there are selected more then one instance but not all of them
// don't add settings menu items
const Selection& selection = scene_selection();
if (selection.is_multiple_full_instance() && !selection.is_single_full_object() ||
if ((selection.is_multiple_full_instance() && !selection.is_single_full_object()) ||
selection.is_multiple_volume() || selection.is_mixed() ) // more than one volume(part) is selected on the scene
return nullptr;

View file

@ -1012,7 +1012,7 @@ const std::string& PresetCollection::get_preset_name_by_alias(const std::string&
it != m_map_alias_to_profile_name.end() && it->first == alias; ++ it)
if (auto it_preset = this->find_preset_internal(it->second);
it_preset != m_presets.end() && it_preset->name == it->second &&
it_preset->is_visible && (it_preset->is_compatible || (it_preset - m_presets.begin()) == m_idx_selected))
it_preset->is_visible && (it_preset->is_compatible || size_t(it_preset - m_presets.begin()) == m_idx_selected))
return it_preset->name;
return alias;
}

View file

@ -1316,7 +1316,7 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla
// Derive the profile logical name aka alias from the preset name if the alias was not stated explicitely.
if (alias_name.empty()) {
int end_pos = preset_name.find_first_of("@");
size_t end_pos = preset_name.find_first_of("@");
if (end_pos != std::string::npos) {
alias_name = preset_name.substr(0, end_pos);
if (renamed_from.empty())

View file

@ -182,8 +182,6 @@ std::string FlashAir::timestamp_str() const
auto t = std::time(nullptr);
auto tm = *std::localtime(&t);
const char *name = get_name();
unsigned long fattime = ((tm.tm_year - 80) << 25) |
((tm.tm_mon + 1) << 21) |
(tm.tm_mday << 16) |

View file

@ -526,8 +526,8 @@ Updates PresetUpdater::priv::get_config_updates(const Semver &old_slic3r_version
existing_idx.load(bundle_path_idx);
// Find a recommended config bundle version for the slic3r version last executed. This makes sure that a config bundle update will not be missed
// when upgrading an application. On the other side, the user will be bugged every time he will switch between slic3r versions.
const auto existing_recommended = existing_idx.recommended(old_slic3r_version);
/*if (existing_recommended != existing_idx.end() && recommended->config_version == existing_recommended->config_version) {
/*const auto existing_recommended = existing_idx.recommended(old_slic3r_version);
if (existing_recommended != existing_idx.end() && recommended->config_version == existing_recommended->config_version) {
// The user has already seen (and presumably rejected) this update
BOOST_LOG_TRIVIAL(info) << boost::format("Downloaded index for `%1%` is the same as installed one, not offering an update.") % idx.vendor();
continue;