mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
Fix some errors uncovered via compiler warnings (#7954)
* fix: tray_exist_bits != tray_exist_bits comparison * fix: title == GetTitle() == title comparison * fix: possibly dangling reference to a temporary ``` OrcaSlicer/src/libslic3r/calib.cpp:456:17: warning: possibly dangling reference to a temporary [-Wdangling-reference] 456 | const auto &w = bed_ext.size().x(); OrcaSlicer/src/libslic3r/calib.cpp:456:45: note: the temporary was destroyed at the end of the full expression ‘((Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 2>, 1>*)(& Slic3r::BoundingBoxBase<PointClass>::size() const [with PointClass = Eigen::Matrix<double, 2, 1, 2>]()))->Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 2>, 1>::x()’ 456 | const auto &w = bed_ext.size().x(); ``` * fix: mixup of | and || in this case I think it actually does not change the semantics it just means that both comparison have to be evaluated. * fix: multi-character character constants need " OrcaSlicer/src/slic3r/GUI/MediaPlayCtrl.cpp:392: warning: multi-character character constant [-Wmultichar] 392 | if (auto n = tunnel.find_first_of('/_'); n != std::string::npos) OrcaSlicer/src/slic3r/GUI/MediaPlayCtrl.cpp: In member function ‘void Slic3r::GUI::MediaPlayCtrl::Stop(const wxString&)’: OrcaSlicer/src/slic3r/GUI/MediaPlayCtrl.cpp:392: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘12127’ to ‘95’ [-Woverflow] * fix: missing paranthesis - skips null check * NFC: Remove this check it can never be false * NFC: fix warning: statement has no effect
This commit is contained in:
parent
7834f78c90
commit
2b95ef4e3b
12 changed files with 26 additions and 33 deletions
|
@ -3873,10 +3873,10 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
}
|
||||
}
|
||||
if (ams_exist_bits != last_ams_exist_bits
|
||||
|| last_tray_exist_bits != last_tray_exist_bits
|
||||
|| tray_exist_bits != last_tray_exist_bits
|
||||
|| tray_is_bbl_bits != last_is_bbl_bits
|
||||
|| tray_read_done_bits != last_read_done_bits
|
||||
|| last_ams_version != ams_version) {
|
||||
|| ams_version != last_ams_version) {
|
||||
is_ams_need_update = true;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -915,7 +915,7 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
|||
}
|
||||
else if (m_current == FdmSupports) {
|
||||
GLGizmoFdmSupports* fdm_support = dynamic_cast<GLGizmoFdmSupports*>(get_current());
|
||||
if (fdm_support != nullptr && keyCode == 'F' || keyCode == 'S' || keyCode == 'C' || keyCode == 'G') {
|
||||
if (fdm_support != nullptr && (keyCode == 'F' || keyCode == 'S' || keyCode == 'C' || keyCode == 'G')) {
|
||||
processed = fdm_support->on_key_down_select_tool_type(keyCode);
|
||||
}
|
||||
if (processed) {
|
||||
|
@ -925,7 +925,7 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
|||
}
|
||||
else if (m_current == Seam) {
|
||||
GLGizmoSeam* seam = dynamic_cast<GLGizmoSeam*>(get_current());
|
||||
if (seam != nullptr && keyCode == 'S' || keyCode == 'C') {
|
||||
if (seam != nullptr && (keyCode == 'S' || keyCode == 'C')) {
|
||||
processed = seam->on_key_down_select_tool_type(keyCode);
|
||||
}
|
||||
if (processed) {
|
||||
|
|
|
@ -47,12 +47,10 @@ void PrintJob::prepare()
|
|||
{
|
||||
if (job_data.is_from_plater)
|
||||
m_plater->get_print_job_data(&job_data);
|
||||
if (&job_data) {
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
}
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
}
|
||||
|
||||
void PrintJob::on_success(std::function<void()> success)
|
||||
|
|
|
@ -38,12 +38,10 @@ SendJob::SendJob(std::string dev_id)
|
|||
void SendJob::prepare()
|
||||
{
|
||||
m_plater->get_print_job_data(&job_data);
|
||||
if (&job_data) {
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
}
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
}
|
||||
|
||||
wxString SendJob::get_http_error_msg(unsigned int status, std::string body)
|
||||
|
|
|
@ -916,7 +916,6 @@ void MainFrame::update_title_colour_after_set_title()
|
|||
|
||||
void MainFrame::show_option(bool show)
|
||||
{
|
||||
if (!this) { return; }
|
||||
if (!show) {
|
||||
if (m_slice_btn->IsShown()) {
|
||||
m_slice_btn->Hide();
|
||||
|
|
|
@ -389,7 +389,7 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
|||
}
|
||||
|
||||
auto tunnel = m_url.empty() ? "" : into_u8(wxURI(m_url).GetPath()).substr(1);
|
||||
if (auto n = tunnel.find_first_of('/_'); n != std::string::npos)
|
||||
if (auto n = tunnel.find_first_of("/_"); n != std::string::npos)
|
||||
tunnel = tunnel.substr(0, n);
|
||||
if (last_state != wxMEDIASTATE_PLAYING && m_failed_code != 0
|
||||
&& m_last_failed_codes.find(m_failed_code) == m_last_failed_codes.end()
|
||||
|
|
|
@ -786,7 +786,7 @@ void SecondaryCheckDialog::on_hide()
|
|||
|
||||
void SecondaryCheckDialog::update_title_style(wxString title, SecondaryCheckDialog::ButtonStyle style, wxWindow* parent)
|
||||
{
|
||||
if (m_button_style == style && title == GetTitle() == title) return;
|
||||
if (m_button_style == style && title == GetTitle()) return;
|
||||
|
||||
SetTitle(title);
|
||||
|
||||
|
|
|
@ -473,12 +473,10 @@ BBL::PrintParams SendMultiMachinePage::request_params(MachineObject* obj)
|
|||
PrintPrepareData job_data;
|
||||
m_plater->get_print_job_data(&job_data);
|
||||
|
||||
if (&job_data) {
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
}
|
||||
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
|
||||
auto check_access_code_path = temp_file.c_str();
|
||||
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
|
||||
job_data._temp_path = fs::path(check_access_code_path);
|
||||
|
||||
int curr_plate_idx;
|
||||
if (job_data.plate_idx >= 0)
|
||||
|
|
|
@ -881,7 +881,7 @@ void TabPrinter::init_options_list()
|
|||
|
||||
for (const std::string& opt_key : m_config->keys())
|
||||
{
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" | opt_key == "thumbnails") {
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails") {
|
||||
m_options_list.emplace(opt_key, m_opt_status_value);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue