diff --git a/xs/src/libslic3r/PlaceholderParser.cpp b/xs/src/libslic3r/PlaceholderParser.cpp index 060252387b9..06a378ed7f7 100644 --- a/xs/src/libslic3r/PlaceholderParser.cpp +++ b/xs/src/libslic3r/PlaceholderParser.cpp @@ -622,7 +622,7 @@ namespace client spirit::double_type double_; spirit::ascii::string_type string; spirit::repository::qi::iter_pos_type iter_pos; - auto kw = spirit::repository::qi::distinct(qi::copy(alnum | '_')); + auto kw = spirit::repository::qi::distinct(boost::proto::deep_copy(alnum | '_')); qi::_val_type _val; qi::_1_type _1; diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index 63cc7749d46..9166f111ce6 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -98,11 +98,14 @@ std::vector scan_serial_ports() #else // UNIX and OS X std::initializer_list prefixes { "ttyUSB" , "ttyACM", "tty.", "cu.", "rfcomm" }; - for (auto &dir_entry : boost::filesystem::directory_iterator(boost::filesystem::path("/dev"))) { - std::string name = dir_entry.path().filename().string(); + boost::filesystem::directory_iterator end_iter; + for (boost::filesystem::directory_iterator dir_entry(boost::filesystem::path("/dev")); + dir_entry != end_iter; + ++dir_entry) { + std::string name = dir_entry->path().filename().string(); for (const char *prefix : prefixes) { if (boost::starts_with(name, prefix)) { - out.emplace_back(dir_entry.path().string()); + out.emplace_back(dir_entry->path().string()); break; } } diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index e4b0448cf29..51e4ed1ef81 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -251,14 +251,17 @@ void PresetCollection::load_presets(const std::string &dir_path, const std::stri m_presets.erase(m_presets.begin()+1, m_presets.end()); t_config_option_keys keys = this->default_preset().config.keys(); std::string errors_cummulative; - for (auto &dir_entry : boost::filesystem::directory_iterator(dir)) - if (boost::filesystem::is_regular_file(dir_entry.status()) && boost::algorithm::iends_with(dir_entry.path().filename().string(), ".ini")) { - std::string name = dir_entry.path().filename().string(); + boost::filesystem::directory_iterator end_iter; + for (boost::filesystem::directory_iterator dir_entry(dir); + dir_entry != end_iter; + ++dir_entry) + if (boost::filesystem::is_regular_file(dir_entry->status()) && boost::algorithm::iends_with(dir_entry->path().filename().string(), ".ini")) { + std::string name = dir_entry->path().filename().string(); // Remove the .ini suffix. name.erase(name.size() - 4); try { Preset preset(m_type, name, false); - preset.file = dir_entry.path().string(); + preset.file = dir_entry->path().string(); preset.load(keys); m_presets.emplace_back(preset); } catch (const std::runtime_error &err) {