Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors, warnings on Linux Debug build #13366

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c055469
CMakeLists.txt: bump version of OpenCASCADE to 7.6.2
themanyone Sep 13, 2024
f83edaf
CoolingBuffer.cpp: fix warning suggest parentheses around comparison
themanyone Sep 13, 2024
678759e
WipeTowerIntegration.hpp: use size_t instead of int to fix warning ab…
themanyone Sep 13, 2024
146fc44
TreeModelVolumes.cpp: fix warning about parentheses around ‘&&’ withi…
themanyone Sep 13, 2024
9903d35
SquareGrid.cpp: fix warning about comparing int and unsigned int
themanyone Sep 13, 2024
1555db8
OCCTWrapper.cpp: warning: unused variable ‘aTriangleOffet’
themanyone Sep 13, 2024
d361cd1
WebViewDialog.cpp: fix warnings about comparing int and size_t
themanyone Sep 13, 2024
cda3095
CoolingBuffer.cpp: fix warnings about parenthesis around comparison
themanyone Sep 13, 2024
ca33657
ConfigManipulation.cpp: use non-reference type to prevent copying
themanyone Sep 13, 2024
0b5163e
GLGizmoSVG.cpp: include <boost/nowide/fstream.hpp>
themanyone Sep 13, 2024
0b21fb3
Http.cpp: include <boost/nowide/fstream.hpp>
themanyone Sep 13, 2024
9e8b1e2
PresetArchiveDatabase.cpp: include <boost/nowide/fstream.hpp>
themanyone Sep 13, 2024
1e4f76c
PresetArchiveDatabase.cpp: remove unused function, deserialize_string
themanyone Sep 13, 2024
330c535
PrusaConnect.cpp: remove unused function, escape_path_by_element
themanyone Sep 13, 2024
cf04b77
WebViewPlatformUtilsLinux.cpp: remove unused variabl, b
themanyone Sep 13, 2024
0f0d9cd
WebViewPlatformUtilsLinux.cpp: remove unused variable, cookie_manager
themanyone Sep 13, 2024
50bcd35
slic3r/CMakeLists.txt: upgrade WebKitGTK to 6.0
themanyone Sep 13, 2024
8f8f01e
Merge branch 'master' into debug
themanyone Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libslic3r/Arachne/utils/SquareGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace Slic3r::Arachne;

SquareGrid::SquareGrid(coord_t cell_size) : cell_size(cell_size)
{
assert(cell_size > 0U);
assert(cell_size > 0);
}


Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/CoolingBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
}
if ((line.type & CoolingLine::TYPE_G92) == 0) {
// G0, G1, G2, G3. Calculate the duration.
assert((line.type & CoolingLine::TYPE_G0) != 0 + (line.type & CoolingLine::TYPE_G1) != 0 + (line.type & CoolingLine::TYPE_G2G3) != 0 == 1);
assert(((line.type & CoolingLine::TYPE_G0) != 0) + ((line.type & CoolingLine::TYPE_G1) != 0) + (line.type & CoolingLine::TYPE_G2G3) != (0 == 1));
if (m_config.use_relative_e_distances.value)
// Reset extruder accumulator.
current_pos[AxisIdx::E] = 0.f;
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/GCode/WipeTowerIntegration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class WipeTowerIntegration {
const std::vector<std::vector<WipeTower::ToolChangeResult>> &m_tool_changes;
const WipeTower::ToolChangeResult &m_final_purge;
// Current layer index.
int m_layer_idx;
int m_tool_change_idx;
size_t m_layer_idx;
size_t m_tool_change_idx;
double m_last_wipe_tower_print_z;
};

Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Support/TreeModelVolumes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ std::vector<std::pair<TreeModelVolumes::RadiusLayerPair, std::reference_wrapper<
for (auto &radius_polygons : layer)
out.emplace_back(std::make_pair(radius_polygons.first, layer_idx), radius_polygons.second);
}
assert(std::is_sorted(out.begin(), out.end(), [](auto &l, auto &r){ return l.first.second < r.first.second || (l.first.second == r.first.second) && l.first.first < r.first.first; }));
assert(std::is_sorted(out.begin(), out.end(), [](auto &l, auto &r){ return l.first.second < r.first.second || ((l.first.second == r.first.second) && l.first.first < r.first.first); }));
return out;
}

Expand Down
2 changes: 1 addition & 1 deletion src/occt_wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(GenerateExportHeader)

generate_export_header(OCCTWrapper)

find_package(OpenCASCADE 7.6.1 REQUIRED)
find_package(OpenCASCADE 7.6.2 REQUIRED)

set(OCCT_LIBS
TKXDESTEP
Expand Down
1 change: 0 additions & 1 deletion src/occt_wrapper/OCCTWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ try {
// Now copy the facets.
const TopAbs_Orientation anOrientation = anExpSF.Current().Orientation();
for (Standard_Integer aTriIter = 1; aTriIter <= aTriangulation->NbTriangles(); ++aTriIter) {
const int aTriangleOffet = int(facets.size());
Poly_Triangle aTri = aTriangulation->Triangle(aTriIter);

Standard_Integer anId[3];
Expand Down
4 changes: 2 additions & 2 deletions src/slic3r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ if (UNIX AND NOT APPLE)
find_package(GTK${SLIC3R_GTK} REQUIRED)
find_package(PkgConfig REQUIRED)

pkg_search_module(WEBKIT2GTK REQUIRED IMPORTED_TARGET webkit2gtk-4.0 webkit2gtk-4.1)
target_link_libraries(libslic3r_gui PUBLIC ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig PkgConfig::WEBKIT2GTK)
pkg_search_module(WebKitGTK REQUIRED IMPORTED_TARGET webkitgtk-6.0)
target_link_libraries(libslic3r_gui PUBLIC ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig PkgConfig::WebKitGTK)
endif ()

# Add a definition so that we can tell we are compiling slic3r.
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/ConfigManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
const bool has_organic_supports = support_material_style == smsOrganic &&
(config->opt_bool("support_material") ||
config->opt_int("support_material_enforce_layers") > 0);
for (const std::string& key : { "support_tree_angle", "support_tree_angle_slow", "support_tree_branch_diameter",
for (const std::string key : { "support_tree_angle", "support_tree_angle_slow", "support_tree_branch_diameter",
"support_tree_branch_diameter_angle", "support_tree_branch_diameter_double_wall",
"support_tree_tip_diameter", "support_tree_branch_distance", "support_tree_top_rate" })
toggle_field(key, has_organic_supports);
Expand Down
5 changes: 3 additions & 2 deletions src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "slic3r/GUI/Jobs/EmbossJob.hpp"
#include "slic3r/Utils/UndoRedo.hpp"

#include "libslic3r/Point.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/SVG.hpp" // debug store
#include "libslic3r/Geometry.hpp" // covex hull 2d
#include "libslic3r/Timer.hpp" // covex hull 2d
Expand All @@ -27,7 +27,8 @@

#include <wx/display.h> // detection of change DPI
#include <boost/log/trivial.hpp>
#include <boost/nowide/fstream.hpp>

#include <boost/nowide/fstream.hpp> // boost::nowide::ofstream stream

#include <GL/glew.h>
#include <chrono> // measure enumeration of fonts
Expand Down
21 changes: 2 additions & 19 deletions src/slic3r/GUI/PresetArchiveDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

#include <boost/log/trivial.hpp>
#include <boost/filesystem/fstream.hpp>

#include <boost/nowide/fstream.hpp> // IWYU pragma: keep

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/uuid/uuid.hpp>
Expand Down Expand Up @@ -154,25 +156,6 @@ bool extract_local_archive_repository( ArchiveRepository::RepositoryManifest& ma
return true;
}

void deserialize_string(const std::string& opt, std::vector<std::string>& result)
{
std::string val;
for (size_t i = 0; i < opt.length(); i++) {
if (std::isspace(opt[i])) {
continue;
}
if (opt[i] != ';') {
val += opt[i];
}
else {
result.emplace_back(std::move(val));
}
}
if (!val.empty()) {
result.emplace_back(std::move(val));
}
}

std::string escape_string(const std::string& unescaped)
{
std::string ret_val;
Expand Down
8 changes: 4 additions & 4 deletions src/slic3r/GUI/WebViewDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ void PrinterPickWebViewDialog::request_compatible_printers_SLA()
{
const Preset& selected_printer = wxGetApp().preset_bundle->printers.get_selected_preset();
std::string printer_model_serialized = selected_printer.config.option("printer_model")->serialize();

std::string vendor_repo_prefix;
if (selected_printer.vendor) {
vendor_repo_prefix = selected_printer.vendor->repo_prefix;
Expand Down Expand Up @@ -1531,9 +1531,9 @@ void LoginWebViewDialog::on_navigation_request(wxWebViewEvent &evt)
evt.Veto();
m_ret_val = into_u8(url);
EndModal(wxID_OK);
} else if (url.Find(L"accounts.google.com") != wxString::npos
|| url.Find(L"appleid.apple.com") != wxString::npos
|| url.Find(L"facebook.com") != wxString::npos) {
} else if ((size_t)url.Find(L"accounts.google.com") != wxString::npos
|| (size_t)url.Find(L"appleid.apple.com") != wxString::npos
|| (size_t)url.Find(L"facebook.com") != wxString::npos) {
auto& sc = Utils::ServiceConfig::instance();
if (!m_evt_sent && !url.starts_with(GUI::from_u8(sc.account_url()))) {
wxCommandEvent* evt = new wxCommandEvent(EVT_OPEN_EXTERNAL_LOGIN);
Expand Down
2 changes: 0 additions & 2 deletions src/slic3r/GUI/WebViewPlatformUtilsLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ void remove_webview_credentials(wxWebView* web_view)
namespace {
void delete_cookie_callback (GObject* source_object, GAsyncResult* result, void* user_data)
{
WebKitCookieManager *cookie_manager = WEBKIT_COOKIE_MANAGER(source_object);
GError* err = nullptr;
gboolean b = webkit_cookie_manager_delete_cookie_finish(cookie_manager, result, &err);
if (err) {
BOOST_LOG_TRIVIAL(error) << "Error deleting cookies: " << err->message;
g_error_free(err);
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/Utils/Http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifdef OPENSSL_CERT_OVERRIDE
#include <openssl/x509.h>
#endif

#include <boost/nowide/fstream.hpp> // boost::nowide::ifstream file
#include <libslic3r/libslic3r.h>
#include <libslic3r/Utils.hpp>
#include <slic3r/GUI/I18N.hpp>
Expand Down
11 changes: 0 additions & 11 deletions src/slic3r/Utils/PrusaConnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ std::string escape_string(const std::string& unescaped)
}
return ret_val;
}
std::string escape_path_by_element(const boost::filesystem::path& path)
{
std::string ret_val = escape_string(path.filename().string());
boost::filesystem::path parent(path.parent_path());
while (!parent.empty() && parent.string() != "/") // "/" check is for case "/file.gcode" was inserted. Then boost takes "/" as parent_path.
{
ret_val = escape_string(parent.filename().string()) + "/" + ret_val;
parent = parent.parent_path();
}
return ret_val;
}

boost::optional<std::string> get_error_message_from_response_body(const std::string& body)
{
Expand Down