Fixing clang compiler warnings
This commit is contained in:
parent
f72d83993e
commit
5fd279cbc8
18 changed files with 27 additions and 23 deletions
src
libslic3r
slic3r
tests/libslic3r
|
@ -920,7 +920,7 @@ static PrintObjectRegions* generate_print_object_regions(
|
||||||
const PrintObjectRegions::VolumeRegion &parent_region = layer_range.volume_regions[parent_region_id];
|
const PrintObjectRegions::VolumeRegion &parent_region = layer_range.volume_regions[parent_region_id];
|
||||||
const ModelVolume &parent_volume = *parent_region.model_volume;
|
const ModelVolume &parent_volume = *parent_region.model_volume;
|
||||||
if (parent_volume.is_model_part() || parent_volume.is_modifier())
|
if (parent_volume.is_model_part() || parent_volume.is_modifier())
|
||||||
if (PrintObjectRegions::BoundingBox parent_bbox = find_modifier_volume_extents(layer_range, parent_region_id); parent_bbox.intersects(*bbox))
|
if (PrintObjectRegions::BoundingBox parent_bbox = find_modifier_volume_extents(layer_range, parent_region_id); parent_bbox.intersects(*bbox)) {
|
||||||
// Only create new region for a modifier, which actually modifies config of it's parent.
|
// Only create new region for a modifier, which actually modifies config of it's parent.
|
||||||
if (PrintRegionConfig config = region_config_from_model_volume(parent_region.region->config(), nullptr, volume, num_extruders);
|
if (PrintRegionConfig config = region_config_from_model_volume(parent_region.region->config(), nullptr, volume, num_extruders);
|
||||||
config != parent_region.region->config()) {
|
config != parent_region.region->config()) {
|
||||||
|
@ -928,6 +928,7 @@ static PrintObjectRegions* generate_print_object_regions(
|
||||||
layer_range.volume_regions.push_back({ &volume, parent_region_id, get_create_region(std::move(config)), bbox });
|
layer_range.volume_regions.push_back({ &volume, parent_region_id, get_create_region(std::move(config)), bbox });
|
||||||
} else if (parent_model_part_id == -1 && parent_volume.is_model_part())
|
} else if (parent_model_part_id == -1 && parent_volume.is_model_part())
|
||||||
parent_model_part_id = parent_region_id;
|
parent_model_part_id = parent_region_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (! added && parent_model_part_id >= 0)
|
if (! added && parent_model_part_id >= 0)
|
||||||
// This modifier does not override any printable volume's configuration, however it may in the future.
|
// This modifier does not override any printable volume's configuration, however it may in the future.
|
||||||
|
|
|
@ -2355,7 +2355,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
|
||||||
Polygons *layer_buildplate_covered = buildplate_covered.empty() ? nullptr : &buildplate_covered[layer_id];
|
Polygons *layer_buildplate_covered = buildplate_covered.empty() ? nullptr : &buildplate_covered[layer_id];
|
||||||
// Filtering the propagated support columns to two extrusions, overlapping by maximum 20%.
|
// Filtering the propagated support columns to two extrusions, overlapping by maximum 20%.
|
||||||
float column_propagation_filtering_radius = scaled<float>(0.8 * 0.5 * (m_support_params.support_material_flow.spacing() + m_support_params.support_material_flow.width()));
|
float column_propagation_filtering_radius = scaled<float>(0.8 * 0.5 * (m_support_params.support_material_flow.spacing() + m_support_params.support_material_flow.width()));
|
||||||
task_group.run([&grid_params, &overhangs_projection, &overhangs_projection_raw, &layer, &layer_support_area, layer_buildplate_covered, column_propagation_filtering_radius
|
task_group.run([&grid_params, &overhangs_projection, &overhangs_projection_raw, &layer, &layer_support_area, layer_buildplate_covered /* , column_propagation_filtering_radius */
|
||||||
#ifdef SLIC3R_DEBUG
|
#ifdef SLIC3R_DEBUG
|
||||||
, iRun, layer_id
|
, iRun, layer_id
|
||||||
#endif /* SLIC3R_DEBUG */
|
#endif /* SLIC3R_DEBUG */
|
||||||
|
|
|
@ -1090,7 +1090,7 @@ indexed_triangle_set its_convex_hull(const std::vector<Vec3f> &pts)
|
||||||
centroid += pt;
|
centroid += pt;
|
||||||
centroid /= float(pts.size());
|
centroid /= float(pts.size());
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
for (const orgQhull::QhullFacet facet : qhull.facetList()) {
|
for (const orgQhull::QhullFacet &facet : qhull.facetList()) {
|
||||||
// Collect face vertices first, allocate unique vertices in dst_vertices based on QHull's vertex ID.
|
// Collect face vertices first, allocate unique vertices in dst_vertices based on QHull's vertex ID.
|
||||||
Vec3i indices;
|
Vec3i indices;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
|
@ -560,9 +560,9 @@ void slice_facet_with_slabs(
|
||||||
// Save the open edge for sure.
|
// Save the open edge for sure.
|
||||||
type = FacetSliceType::Slicing;
|
type = FacetSliceType::Slicing;
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef NDEBUG
|
||||||
const stl_triangle_vertex_indices &neighbor = mesh_triangles[neighbor_idx];
|
const stl_triangle_vertex_indices &neighbor = mesh_triangles[neighbor_idx];
|
||||||
float z = *it;
|
float z = *it;
|
||||||
#ifndef NDEBUG
|
|
||||||
int num_on_plane = (mesh_vertices[neighbor(0)].z() == z) + (mesh_vertices[neighbor(1)].z() == z) + (mesh_vertices[neighbor(2)].z() == z);
|
int num_on_plane = (mesh_vertices[neighbor(0)].z() == z) + (mesh_vertices[neighbor(1)].z() == z) + (mesh_vertices[neighbor(2)].z() == z);
|
||||||
assert(num_on_plane == 2 || num_on_plane == 3);
|
assert(num_on_plane == 2 || num_on_plane == 3);
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
|
@ -115,7 +115,7 @@ class TickCodeInfo
|
||||||
bool m_suppress_plus = false;
|
bool m_suppress_plus = false;
|
||||||
bool m_suppress_minus = false;
|
bool m_suppress_minus = false;
|
||||||
bool m_use_default_colors= false;
|
bool m_use_default_colors= false;
|
||||||
int m_default_color_idx = 0;
|
// int m_default_color_idx = 0;
|
||||||
|
|
||||||
std::vector<std::string>* m_colors {nullptr};
|
std::vector<std::string>* m_colors {nullptr};
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,8 @@ bool BitmapTextRenderer::GetValueFromEditorCtrl(wxWindow* ctrl, wxVariant& value
|
||||||
if (!text_editor || text_editor->GetValue().IsEmpty())
|
if (!text_editor || text_editor->GetValue().IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_was_unusable_symbol = Slic3r::GUI::Plater::has_illegal_filename_characters(text_editor->GetValue()))
|
m_was_unusable_symbol = Slic3r::GUI::Plater::has_illegal_filename_characters(text_editor->GetValue());
|
||||||
|
if (m_was_unusable_symbol)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// The icon can't be edited so get its old value and reuse it.
|
// The icon can't be edited so get its old value and reuse it.
|
||||||
|
|
|
@ -535,7 +535,7 @@ wxString file_wildcards(FileType file_type, const std::string &custom_extension)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const std::string_view ext : data.file_extensions)
|
for (const std::string_view &ext : data.file_extensions)
|
||||||
// Only add an extension if it was not added first as the custom extension.
|
// Only add an extension if it was not added first as the custom extension.
|
||||||
if (ext != custom_ext_lower) {
|
if (ext != custom_ext_lower) {
|
||||||
if (title.empty()) {
|
if (title.empty()) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
// will be also extended to support additional states, requiring at least one state to remain free out of 19 states.
|
// will be also extended to support additional states, requiring at least one state to remain free out of 19 states.
|
||||||
static const constexpr size_t EXTRUDERS_LIMIT = 16;
|
static const constexpr size_t EXTRUDERS_LIMIT = 16;
|
||||||
|
|
||||||
virtual const float get_cursor_radius_min() const { return CursorRadiusMin; }
|
const float get_cursor_radius_min() const override { return CursorRadiusMin; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::array<float, 4> get_cursor_sphere_left_button_color() const override;
|
std::array<float, 4> get_cursor_sphere_left_button_color() const override;
|
||||||
|
|
|
@ -39,7 +39,7 @@ protected:
|
||||||
virtual void on_render() override;
|
virtual void on_render() override;
|
||||||
virtual void on_render_for_picking() override{};
|
virtual void on_render_for_picking() override{};
|
||||||
|
|
||||||
virtual CommonGizmosDataID on_get_requirements() const;
|
CommonGizmosDataID on_get_requirements() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void apply_simplify();
|
void apply_simplify();
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return true; }
|
bool has_auto_discovery() const override { return true; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
|
||||||
std::string get_host() const override { return host; }
|
std::string get_host() const override { return host; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return false; }
|
bool has_auto_discovery() const override { return false; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint | PrintHostPostUploadAction::StartSimulation; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint | PrintHostPostUploadAction::StartSimulation; }
|
||||||
std::string get_host() const override { return host; }
|
std::string get_host() const override { return host; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return false; }
|
bool has_auto_discovery() const override { return false; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return {}; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return {}; }
|
||||||
std::string get_host() const override { return host; }
|
std::string get_host() const override { return host; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return false; }
|
bool has_auto_discovery() const override { return false; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
|
||||||
std::string get_host() const override { return m_host; }
|
std::string get_host() const override { return m_host; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return true; }
|
bool has_auto_discovery() const override { return true; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
|
||||||
std::string get_host() const override { return m_host; }
|
std::string get_host() const override { return m_host; }
|
||||||
const std::string& get_apikey() const { return m_apikey; }
|
const std::string& get_apikey() const { return m_apikey; }
|
||||||
const std::string& get_cafile() const { return m_cafile; }
|
const std::string& get_cafile() const { return m_cafile; }
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
|
|
||||||
wxString get_test_ok_msg() const override;
|
wxString get_test_ok_msg() const override;
|
||||||
wxString get_test_failed_msg(wxString &msg) const override;
|
wxString get_test_failed_msg(wxString &msg) const override;
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return {}; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return {}; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool validate_version_text(const boost::optional<std::string> &version_text) const override;
|
bool validate_version_text(const boost::optional<std::string> &version_text) const override;
|
||||||
|
@ -82,7 +82,7 @@ public:
|
||||||
|
|
||||||
wxString get_test_ok_msg() const override;
|
wxString get_test_ok_msg() const override;
|
||||||
wxString get_test_failed_msg(wxString& msg) const override;
|
wxString get_test_failed_msg(wxString& msg) const override;
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool validate_version_text(const boost::optional<std::string>& version_text) const override;
|
bool validate_version_text(const boost::optional<std::string>& version_text) const override;
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return false; }
|
bool has_auto_discovery() const override { return false; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
PrintHostPostUploadActions get_post_upload_actions() const { return PrintHostPostUploadAction::StartPrint; }
|
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
|
||||||
bool supports_multiple_printers() const override { return true; }
|
bool supports_multiple_printers() const override { return true; }
|
||||||
std::string get_host() const override { return host; }
|
std::string get_host() const override { return host; }
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,6 @@ bool TCPConsole::is_deadline_over() const
|
||||||
|
|
||||||
bool TCPConsole::run_queue()
|
bool TCPConsole::run_queue()
|
||||||
{
|
{
|
||||||
auto now = std::chrono::steady_clock::now();
|
|
||||||
try {
|
try {
|
||||||
// TODO: Add more resets and initializations after previous run (reset() method?..)
|
// TODO: Add more resets and initializations after previous run (reset() method?..)
|
||||||
set_deadline_in(m_connect_timeout);
|
set_deadline_in(m_connect_timeout);
|
||||||
|
|
|
@ -220,8 +220,8 @@ SCENARIO("DynamicPrintConfig serialization", "[Config]") {
|
||||||
cereal::BinaryOutputArchive oarchive(ss);
|
cereal::BinaryOutputArchive oarchive(ss);
|
||||||
oarchive(cfg);
|
oarchive(cfg);
|
||||||
serialized = ss.str();
|
serialized = ss.str();
|
||||||
} catch (std::runtime_error &e) {
|
} catch (const std::runtime_error & /* e */) {
|
||||||
e.what();
|
// e.what();
|
||||||
}
|
}
|
||||||
|
|
||||||
THEN("Config object contains ini file options.") {
|
THEN("Config object contains ini file options.") {
|
||||||
|
@ -230,8 +230,8 @@ SCENARIO("DynamicPrintConfig serialization", "[Config]") {
|
||||||
std::stringstream ss(serialized);
|
std::stringstream ss(serialized);
|
||||||
cereal::BinaryInputArchive iarchive(ss);
|
cereal::BinaryInputArchive iarchive(ss);
|
||||||
iarchive(cfg2);
|
iarchive(cfg2);
|
||||||
} catch (std::runtime_error &e) {
|
} catch (const std::runtime_error & /* e */) {
|
||||||
e.what();
|
// e.what();
|
||||||
}
|
}
|
||||||
REQUIRE(cfg == cfg2);
|
REQUIRE(cfg == cfg2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,15 +117,18 @@ static float triangle_area(const Vec3crd &triangle_inices, const std::vector<Vec
|
||||||
vertices[triangle_inices[2]]);
|
vertices[triangle_inices[2]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// clang complains about unused functions
|
||||||
static std::mt19937 create_random_generator() {
|
static std::mt19937 create_random_generator() {
|
||||||
std::random_device rd;
|
std::random_device rd;
|
||||||
std::mt19937 gen(rd());
|
std::mt19937 gen(rd());
|
||||||
return gen;
|
return gen;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::vector<Vec3f> its_sample_surface(const indexed_triangle_set &its,
|
std::vector<Vec3f> its_sample_surface(const indexed_triangle_set &its,
|
||||||
double sample_per_mm2,
|
double sample_per_mm2,
|
||||||
std::mt19937 random_generator = create_random_generator())
|
std::mt19937 random_generator) // = create_random_generator())
|
||||||
{
|
{
|
||||||
std::vector<Vec3f> samples;
|
std::vector<Vec3f> samples;
|
||||||
std::uniform_real_distribution<float> rand01(0.f, 1.f);
|
std::uniform_real_distribution<float> rand01(0.f, 1.f);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue