ENH:fix warning

jira: none
Change-Id: I889983f87cbeabcaff6475e2b40d35e90e774e20
(cherry picked from commit 447c2d1f4081bf3f2fb784ec06ec05672748446b)
This commit is contained in:
zhou.xu 2024-10-18 10:37:58 +08:00 committed by lane.wei
parent ae5df57d38
commit bc56a321ad
15 changed files with 96 additions and 94 deletions

View File

@ -138,7 +138,7 @@ static FILE *stl_open_count_facets(stl_file *stl, const char *file, unsigned int
rewind(fp);
// Get the header.
int i = 0;
unsigned int i = 0;
for (; i < custom_header_length && (stl->stats.header[i] = getc(fp)) != '\n'; ++ i) ;
stl->stats.header[i] = '\0'; // Lose the '\n'
stl->stats.header[custom_header_length] = '\0';

View File

@ -2134,7 +2134,7 @@ bool ImGui::BBLBeginCombo(const char *label, const char *preview_value, ImGuiCom
bool hovered, held;
bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held);
bool push_color_count = 0;
unsigned int push_color_count = 0;
if (hovered || g.ActiveId == id) {
ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive));
push_color_count = 1;
@ -4170,7 +4170,7 @@ bool ImGui::BBLInputScalar(const char *label, ImGuiDataType data_type, void *p_d
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState *state = GetInputTextState(id);
bool push_color_count = 0;
unsigned int push_color_count = 0;
if (hovered || g.ActiveId == id) {
ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive));
push_color_count = 1;

View File

@ -754,6 +754,12 @@ public:
void set_z_range(float min_z, float max_z) { m_z_range[0] = min_z; m_z_range[1] = max_z; }
void set_clipping_plane(const double* coeffs) { m_clipping_plane[0] = coeffs[0]; m_clipping_plane[1] = coeffs[1]; m_clipping_plane[2] = coeffs[2]; m_clipping_plane[3] = coeffs[3]; }
void set_clipping_plane(double coeffs[4]){
m_clipping_plane[0] = coeffs[0];
m_clipping_plane[1] = coeffs[1];
m_clipping_plane[2] = coeffs[2];
m_clipping_plane[3] = coeffs[3];
}
bool is_slope_GlobalActive() const { return m_slope.isGlobalActive; }
bool is_slope_active() const { return m_slope.active; }

View File

@ -4302,8 +4302,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
while (p->GetParent())
p = p->GetParent();
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status())
;// m_canvas->SetFocus();
if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status()) {
// m_canvas->SetFocus();
}
m_mouse.position = pos.cast<double>();
m_tooltip_enabled = false;
// 1) forces a frame render to ensure that m_hover_volume_idxs is updated even when the user right clicks while
@ -8840,7 +8841,6 @@ void GLCanvas3D::_render_assemble_info() const
auto canvas_h = float(get_canvas_size().get_height());
float space_size = imgui->get_style_scaling() * 8.0f;
float caption_max = imgui->calc_text_size(_L("Total Volume:")).x + 3 * space_size;
char buf[3][64];
ImGuiIO& io = ImGui::GetIO();
ImFont* font = io.Fonts->Fonts[0];

View File

@ -473,7 +473,6 @@ void GLTexture::reset()
bool GLTexture::generate_from_text_string(const std::string& text_str, wxFont &font, wxColor background, wxColor foreground)
{
int w,h,hl;
return generate_from_text(text_str, font, background, foreground);
}

View File

@ -688,9 +688,9 @@ wxMenuItem* MenuFactory::append_menu_item_settings(wxMenu* menu_)
// Create new items for settings popupmenu
if (printer_technology() == ptFFF ||
(menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator()))
;// menu->SetFirstSeparator();
if (printer_technology() == ptFFF || (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())) {
// menu->SetFirstSeparator();
}
// detect itemm for adding of the setting
ObjectList* object_list = obj_list();
@ -1920,7 +1920,6 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu)
for (wxDataViewItem item : sels) {
ItemType type = list->GetModel()->GetItemType(item);
bool check;
if (type != itInstance && type != itObject)
continue;
else {

View File

@ -2166,8 +2166,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
model = Model::read_from_file(input_file, nullptr, nullptr, LoadStrategy::LoadModel);
}
catch (std::exception& e) {
// auto msg = _L("Error!") + " " + input_file + " : " + e.what() + ".";
auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file.");
auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file.") + e.what();
show_error(parent, msg);
return;
}

View File

@ -578,7 +578,7 @@ public:
std::vector<wxString> m_filaments_name;
std::vector<wxColour> m_filaments_colors;
int m_filaments_count{ 1 };
unsigned int m_filaments_count{ 1 };
void set_default_filaments_and_colors()
{
m_filaments_count = 1;

View File

@ -1965,7 +1965,7 @@ void GLGizmoAdvancedCut::render_cut_plane_input_window(float x, float y, float b
m_imgui->text(_L("Rotation") + " ");
ImGui::SameLine(caption_size + 1 * space_size);
ImGui::PushItemWidth(unit_size);
for (size_t i = 0; i < m_buffered_rotation.size(); i++) {
for (int i = 0; i < m_buffered_rotation.size(); i++) {
if (abs(m_buffered_rotation[i]) < 1e-3) {
m_buffered_rotation[i] = 0;
}

View File

@ -36,6 +36,7 @@ GLGizmoMove3D::GLGizmoMove3D(GLCanvas3D& parent, const std::string& icon_filenam
float value = std::stof(wxGetApp().app_config->get("grabber_size_factor"));
GLGizmoBase::Grabber::GrabberSizeFactor = value;
} catch (const std::invalid_argument &e) {
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << e.what();
GLGizmoBase::Grabber::GrabberSizeFactor = 1.0f;
}
}

View File

@ -14,7 +14,7 @@
#include "libslic3r/Shape/TextShape.hpp"
#include <numeric>
#include <codecvt>
#include <boost/log/trivial.hpp>
#include <GL/glew.h>

View File

@ -468,7 +468,7 @@ void GizmoObjectManipulation::do_scale(int axis, const Vec3d &scale) const
void GizmoObjectManipulation::limit_scaling_ratio(Vec3d &scaling_factor) const{
for (size_t i = 0; i < scaling_factor.size(); i++) { // range protect //scaling_factor too big has problem
for (unsigned int i = 0; i < scaling_factor.size(); i++) { // range protect //scaling_factor too big has problem
if (scaling_factor[i] * m_unscale_size[i] > MAX_NUM) {
scaling_factor[i] = MAX_NUM / m_unscale_size[i];
}

View File

@ -499,8 +499,8 @@ HintData* HintDatabase::get_hint(HintDataNavigation nav)
m_hint_id = get_next_hint_id();
if(nav == HintDataNavigation::Prev)
m_hint_id = get_prev_hint_id();
if (nav == HintDataNavigation::Curr)
;
if (nav == HintDataNavigation::Curr) {
}
if (nav == HintDataNavigation::Random)
init_random_hint_id();
}

View File

@ -712,13 +712,13 @@ static struct DynamicFilamentList : DynamicList
if (items.empty())
update(true);
auto cb = dynamic_cast<ComboBox *>(c->window);
auto n = cb->GetSelection();
int n = cb->GetSelection();
cb->Clear();
cb->Append(_L("Default"));
for (auto i : items) {
cb->Append(i.first, *i.second);
}
if (n < cb->GetCount())
if ((unsigned int)n < cb->GetCount())
cb->SetSelection(n);
}
wxString get_value(int index) override
@ -10475,9 +10475,8 @@ void Plater::import_model_id(wxString download_info)
}
}
catch (const std::exception& error)
{
//wxString sError = error.what();
catch (const std::exception& error){
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << error.what();
}
bool download_ok = false;
@ -10516,7 +10515,7 @@ void Plater::import_model_id(wxString download_info)
if (!m_agent) return;
int res = 0;
unsigned int http_code;
//unsigned int http_code;
std::string http_body;
msg = _L("prepare 3mf file...");
@ -10555,9 +10554,8 @@ void Plater::import_model_id(wxString download_info)
if (sFile == filename) is_already_exist = true;
}
}
catch (const std::exception& error)
{
//wxString sError = error.what();
catch (const std::exception& error) {
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << error.what();
}
//update filename
@ -13986,7 +13984,7 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn)
p->m_print_job_data._3mf_path.replace_extension("3mf");
}
catch (std::exception& e) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"<< e.what();
return -1;
}
@ -14019,7 +14017,7 @@ int Plater::export_config_3mf(int plate_idx, Export3mfProgressFn proFn)
p->m_print_job_data._3mf_config_path = fs::path(plate->get_temp_config_3mf_path());
}
catch (std::exception& e) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed" << e.what();
return -1;
}