mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 05:07:51 -06:00
Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
b40853af94
commit
b83e16dbdd
187 changed files with 494 additions and 1101 deletions
|
@ -298,7 +298,6 @@ bool PrusaFileParser::check_3mf_from_prusa(const std::string filename)
|
|||
const std::string model_file = "3D/3dmodel.model";
|
||||
int model_file_index = mz_zip_reader_locate_file(&archive, model_file.c_str(), nullptr, 0);
|
||||
if (model_file_index != -1) {
|
||||
int depth = 0;
|
||||
m_parser = XML_ParserCreate(nullptr);
|
||||
XML_SetUserData(m_parser, (void *) this);
|
||||
XML_SetElementHandler(m_parser, start_element_handler, nullptr);
|
||||
|
|
|
@ -100,7 +100,6 @@ bool load_obj(const char *path, TriangleMesh *meshptr, ObjInfo& obj_info, std::s
|
|||
obj_info.is_single_mtl = data.usemtls.size() == 1 && mtl_data.new_mtl_unmap.size() == 1;
|
||||
obj_info.face_colors.reserve(num_faces + num_quads);
|
||||
}
|
||||
bool has_color = data.has_vertex_color;
|
||||
for (size_t i = 0; i < num_vertices; ++ i) {
|
||||
size_t j = i * OBJ_VERTEX_LENGTH;
|
||||
its.vertices.emplace_back(data.coordinates[j], data.coordinates[j + 1], data.coordinates[j + 2]);
|
||||
|
|
|
@ -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)) {
|
||||
|
@ -1617,9 +1616,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
}
|
||||
else {
|
||||
_extract_xml_from_archive(archive, sub_rels, _handle_start_relationships_element, _handle_end_relationships_element);
|
||||
int index = 0;
|
||||
|
||||
#if 0
|
||||
int index = 0;
|
||||
for (auto path : m_sub_model_paths) {
|
||||
if (proFn) {
|
||||
proFn(IMPORT_STAGE_READ_FILES, ++index, 3 + m_sub_model_paths.size(), cb_cancel);
|
||||
|
@ -2219,7 +2218,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
|
||||
bool _BBS_3MF_Importer::_extract_from_archive(mz_zip_archive& archive, std::string const & path, std::function<bool (mz_zip_archive& archive, const mz_zip_archive_file_stat& stat)> extract, bool restore)
|
||||
{
|
||||
mz_uint num_entries = mz_zip_reader_get_num_files(&archive);
|
||||
mz_zip_archive_file_stat stat;
|
||||
std::string path2 = path;
|
||||
if (path2.front() == '/') path2 = path2.substr(1);
|
||||
|
@ -3319,9 +3317,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
// Adjust backup object/volume id
|
||||
std::istringstream iss(m_curr_object->uuid);
|
||||
int backup_id;
|
||||
bool need_replace = false;
|
||||
// bool need_replace = false;
|
||||
if (iss >> std::hex >> backup_id) {
|
||||
need_replace = (m_curr_object->id != backup_id);
|
||||
// need_replace = (m_curr_object->id != backup_id);
|
||||
m_curr_object->id = backup_id;
|
||||
}
|
||||
if (!m_curr_object->components.empty())
|
||||
|
@ -4994,9 +4992,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
if (is_bbl_3mf && boost::ends_with(current_object->uuid, OBJECT_UUID_SUFFIX) && top_importer->m_load_restore) {
|
||||
std::istringstream iss(current_object->uuid);
|
||||
int backup_id;
|
||||
bool need_replace = false;
|
||||
// bool need_replace = false;
|
||||
if (iss >> std::hex >> backup_id) {
|
||||
need_replace = (current_object->id != backup_id);
|
||||
// need_replace = (current_object->id != backup_id);
|
||||
current_object->id = backup_id;
|
||||
}
|
||||
//if (need_replace)
|
||||
|
@ -5991,8 +5989,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
auto src_gcode_file = plate_data->gcode_file;
|
||||
boost::filesystem::ifstream ifs(src_gcode_file, std::ios::binary);
|
||||
std::string buf(64 * 1024, 0);
|
||||
const std::size_t & size = boost::filesystem::file_size(src_gcode_file);
|
||||
std::size_t left_size = size;
|
||||
while (ifs) {
|
||||
ifs.read(buf.data(), buf.size());
|
||||
int read_bytes = ifs.gcount();
|
||||
|
@ -6230,7 +6226,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
|
||||
bool _BBS_3MF_Exporter::_add_bbox_file_to_archive(mz_zip_archive& archive, const PlateBBoxData& id_bboxes, int index)
|
||||
{
|
||||
bool res = false;
|
||||
nlohmann::json j;
|
||||
id_bboxes.to_json(j);
|
||||
std::string out = j.dump();
|
||||
|
@ -6620,7 +6615,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
auto iter = objects_data.find(objects[i]);
|
||||
ObjectToObjectDataMap objects_data2;
|
||||
objects_data2.insert(*iter);
|
||||
auto & object = *iter->second.object;
|
||||
mz_zip_archive archive;
|
||||
mz_zip_zero_struct(&archive);
|
||||
mz_zip_writer_init_heap(&archive, 0, 1024 * 1024);
|
||||
|
@ -7537,7 +7531,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
|
||||
if (!m_skip_model && instance_size > 0)
|
||||
{
|
||||
for (unsigned int j = 0; j < instance_size; ++j)
|
||||
for (int j = 0; j < instance_size; ++j)
|
||||
{
|
||||
stream << " <" << INSTANCE_TAG << ">\n";
|
||||
int obj_id = plate_data->objects_and_instances[j].first;
|
||||
|
|
|
@ -113,9 +113,6 @@ double get_profile_area(std::vector<std::pair<gp_Pnt, gp_Pnt>> profile_line_poin
|
|||
|
||||
double area = 0;
|
||||
for (auto line_points : profile_line_points) {
|
||||
bool flag = true;
|
||||
if (line_points.second.Y() < line_points.first.Y()) flag = false;
|
||||
|
||||
area += (line_points.second.X() + line_points.first.X() - 2 * min_x) * (line_points.second.Y() - line_points.first.Y()) / 2;
|
||||
}
|
||||
|
||||
|
@ -137,8 +134,6 @@ bool get_svg_profile(const char *path, std::vector<Element_Info> &element_infos,
|
|||
|
||||
int name_index = 1;
|
||||
for (NSVGshape *shape = svg_data->shapes; shape; shape = shape->next) {
|
||||
char * id = shape->id;
|
||||
|
||||
int interpolation_precision = 10; // Number of interpolation points
|
||||
float step = 1.0f / float(interpolation_precision - 1);
|
||||
|
||||
|
@ -384,7 +379,6 @@ bool load_svg(const char *path, Model *model, std::string &message)
|
|||
ModelObject *new_object = model->add_object();
|
||||
// new_object->name ?
|
||||
new_object->input_file = path;
|
||||
auto stage_unit3 = stl.size() / LOAD_STEP_STAGE_UNIT_NUM + 1;
|
||||
for (size_t i = 0; i < stl.size(); i++) {
|
||||
// BBS: maybe mesh is empty from step file. Don't add
|
||||
if (stl[i].stats.number_of_facets > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue