Reduce warnings: remove unused variables (#6499)

Removed unused variables
This commit is contained in:
Vovodroid 2024-08-22 19:02:58 +03:00 committed by GitHub
parent c6065d54fc
commit 2eb1adb719
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 21 additions and 32 deletions

View file

@ -1190,7 +1190,6 @@ int CLI::run(int argc, char **argv)
//BBS: add plate data related logic
PlateDataPtrs plate_data_src;
std::vector<plate_obj_size_info_t> plate_obj_size_infos;
int arrange_option;
int plate_to_slice = 0, filament_count = 0, duplicate_count = 0, real_duplicate_count = 0;
bool first_file = true, is_bbl_3mf = false, need_arrange = true, has_thumbnails = false, up_config_to_date = false, normative_check = true, duplicate_single_object = false, use_first_fila_as_default = false, minimum_save = false, enable_timelapse = false;
bool allow_rotations = true, skip_modified_gcodes = false, avoid_extrusion_cali_region = false, skip_useless_pick = false, allow_newer_file = false;

View file

@ -878,7 +878,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
bool extract_object_model()
{
mz_zip_archive archive;
mz_zip_archive_file_stat stat;
mz_zip_zero_struct(&archive);
if (!open_zip_reader(&archive, zip_path)) {

View file

@ -5662,7 +5662,7 @@ void DeviceManager::parse_user_print_info(std::string body)
}
}
}
catch (std::exception& e) {
catch (std::exception&) {
;
}
}

View file

@ -8434,7 +8434,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

@ -470,7 +470,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

@ -1026,7 +1026,7 @@ void GUI_App::post_init()
try {
std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ;
files_vec.push_back({ lw_t, temp_path.filename().string() });
} catch (const std::exception &ex) {
} catch (const std::exception &) {
}
}
std::sort(files_vec.begin(), files_vec.end(), [](
@ -3365,7 +3365,7 @@ if (res) {
mainframe->refresh_plugin_tips();
// BBS: remove SLA related message
}
} catch (std::exception &e) {
} catch (std::exception &) {
// wxMessageBox(e.what(), "", MB_OK);
}
}
@ -3379,7 +3379,7 @@ void GUI_App::ShowDownNetPluginDlg() {
return;
DownloadProgressDialog dlg(_L("Downloading Bambu Network Plug-in"));
dlg.ShowModal();
} catch (std::exception &e) {
} catch (std::exception &) {
;
}
}
@ -3396,7 +3396,7 @@ void GUI_App::ShowUserLogin(bool show)
login_dlg = new ZUserLogin();
}
login_dlg->ShowModal();
} catch (std::exception &e) {
} catch (std::exception &) {
;
}
} else {
@ -3418,7 +3418,7 @@ void GUI_App::ShowOnlyFilament() {
// BBS: remove SLA related message
}
} catch (std::exception &e) {
} catch (std::exception &) {
// wxMessageBox(e.what(), "", MB_OK);
}
}
@ -6507,8 +6507,6 @@ static bool del_win_registry(HKEY hkeyHive, const wchar_t *pszVar, const wchar_t
return false;
if (!bDidntExist) {
DWORD dwDisposition;
HKEY hkey;
iRC = ::RegDeleteKeyExW(hkeyHive, pszVar, KEY_ALL_ACCESS, 0);
if (iRC == ERROR_SUCCESS) {
return true;

View file

@ -1977,7 +1977,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

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

View file

@ -150,7 +150,6 @@ void PrintJob::process(Ctl &ctl)
ctl.call_on_main_thread([this] { prepare(); }).wait();
int result = -1;
unsigned int http_code;
std::string http_body;
int total_plate_num = plate_data.plate_count;
@ -312,7 +311,7 @@ void PrintJob::process(Ctl &ctl)
try {
stl_design_id = std::stoi(wxGetApp().model().stl_design_id);
}
catch (const std::exception& e) {
catch (const std::exception&) {
stl_design_id = 0;
}
params.stl_design_id = stl_design_id;

View file

@ -111,7 +111,6 @@ void SendJob::process(Ctl &ctl)
NetworkAgent* m_agent = wxGetApp().getAgent();
AppConfig* config = wxGetApp().app_config;
int result = -1;
unsigned int http_code;
std::string http_body;
if (this->connection_type == "lan") {

View file

@ -133,7 +133,7 @@ namespace GUI {
}
}
catch (std::exception& e) {
catch (std::exception&) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -2522,7 +2522,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon)
{
auto compute_points = [&print_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count)
{
double angle, angle_steps;
double angle_steps;
angle_steps = (stop_angle - start_angle) / (count - 1);
for(int j = 0; j < count; j++ )
{
@ -2541,7 +2541,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon)
{
const Vec2d& p = m_shape[i];
Vec2d center;
double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius;
double start_angle, stop_angle, radius_x, radius_y, radius;
switch (i) {
case 0:
radius = 5.f;
@ -2592,7 +2592,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
{
auto compute_exclude_points = [&exclude_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count)
{
double angle, angle_steps;
double angle_steps;
angle_steps = (stop_angle - start_angle) / (count - 1);
for(int j = 0; j < count; j++ )
{
@ -2611,7 +2611,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
{
const Vec2d& p = m_exclude_area[i];
Vec2d center;
double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius;
double start_angle, stop_angle, radius;
switch (i) {
case 0:
radius = 5.f;

View file

@ -9083,7 +9083,7 @@ void Plater::import_model_id(wxString download_info)
}
}
catch (const std::exception& error)
catch (const std::exception&)
{
//wxString sError = error.what();
}
@ -9125,7 +9125,6 @@ void Plater::import_model_id(wxString download_info)
// if (!m_agent) return;
int res = 0;
unsigned int http_code;
std::string http_body;
msg = _L("prepare 3mf file...");
@ -9164,7 +9163,7 @@ void Plater::import_model_id(wxString download_info)
if (sFile == filename) is_already_exist = true;
}
}
catch (const std::exception& error)
catch (const std::exception&)
{
//wxString sError = error.what();
}
@ -12604,7 +12603,7 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn)
p->m_print_job_data._3mf_path = fs::path(plate->get_tmp_gcode_path());
p->m_print_job_data._3mf_path.replace_extension("3mf");
}
catch (std::exception& e) {
catch (std::exception&) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
return -1;
}
@ -12637,7 +12636,7 @@ int Plater::export_config_3mf(int plate_idx, Export3mfProgressFn proFn)
try {
p->m_print_job_data._3mf_config_path = fs::path(plate->get_temp_config_3mf_path());
}
catch (std::exception& e) {
catch (std::exception&) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
return -1;
}

View file

@ -266,7 +266,7 @@ void ProjectPanel::OnScriptMessage(wxWebViewEvent& evt)
}
}
catch (std::exception& e) {
catch (std::exception&) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -816,7 +816,6 @@ void SearchDialog::OnCheck(wxCommandEvent &event)
void SearchDialog::OnMotion(wxMouseEvent &event)
{
wxDataViewItem item;
wxDataViewColumn *col;
wxWindow * win = this;
// search_list->HitTest(wxGetMousePosition() - win->GetScreenPosition(), item, col);

View file

@ -41,7 +41,7 @@ int UserManager::parse_json(std::string payload)
//bind
if (j_pre["bind"]["command"].get<std::string>() == "bind") {
std::string dev_id;
std:; string result;
std::string result;
if (j_pre["bind"].contains("dev_id")) {
dev_id = j_pre["bind"]["dev_id"].get<std::string>();

View file

@ -227,7 +227,7 @@ void DownPluginFrame::OnScriptMessage(wxWebViewEvent &evt)
auto plugin_folder = (boost::filesystem::path(wxStandardPaths::Get().GetUserDataDir().ToUTF8().data()) / "plugins").make_preferred().string();
desktop_open_any_folder(plugin_folder);
}
} catch (std::exception &e) {
} catch (std::exception &) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -373,7 +373,7 @@ bool WebView::RunScript(wxWebView *webView, wxString const &javascript)
}, NULL);
return true;
#endif
} catch (std::exception &e) {
} catch (std::exception &) {
return false;
}
}