diff options
author | jaseg <git@jaseg.de> | 2023-04-16 14:04:53 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-16 14:04:53 +0200 |
commit | 3fbb56c3ae6731854d0377b824583a86f90f29c7 (patch) | |
tree | dd1df06cc8d57a91ec328b4847640c27b886487f /svg-flatten | |
parent | da315879ccd1d9b464f8983953b3b0f1dc1b671b (diff) | |
download | gerbolyze-3fbb56c3ae6731854d0377b824583a86f90f29c7.tar.gz gerbolyze-3fbb56c3ae6731854d0377b824583a86f90f29c7.tar.bz2 gerbolyze-3fbb56c3ae6731854d0377b824583a86f90f29c7.zip |
Fix clang build and warnings
Diffstat (limited to 'svg-flatten')
-rw-r--r-- | svg-flatten/Makefile | 2 | ||||
-rw-r--r-- | svg-flatten/include/geom2d.hpp | 2 | ||||
-rw-r--r-- | svg-flatten/src/svg_path.cpp | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/svg-flatten/Makefile b/svg-flatten/Makefile index e8d4dad..7dab263 100644 --- a/svg-flatten/Makefile +++ b/svg-flatten/Makefile @@ -53,7 +53,7 @@ STB_INCLUDES ?= -isystem$(UPSTREAM_DIR)/stb INCLUDES := -Iinclude -Isrc $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES) $(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES) $(MINUNIT_INCLUDES) $(STB_INCLUDES) -CXXFLAGS := -std=c++2a -g -Wall -Wextra -O2 +CXXFLAGS := -std=c++20 -g -Wall -Wextra -O2 LDFLAGS := -lm -lstdc++ ifdef USE_SYSTEM_PUGIXML diff --git a/svg-flatten/include/geom2d.hpp b/svg-flatten/include/geom2d.hpp index 33f2dd8..7c3b5ba 100644 --- a/svg-flatten/include/geom2d.hpp +++ b/svg-flatten/include/geom2d.hpp @@ -279,7 +279,7 @@ namespace gerbolyze { } std::transform(path.begin(), path.end(), path.begin(), - [this, ©](ClipperLib::IntPoint p) -> ClipperLib::IntPoint { + [©](ClipperLib::IntPoint p) -> ClipperLib::IntPoint { d2p out(copy.doc2phys(d2p{p.X / clipper_scale, p.Y / clipper_scale})); return { (ClipperLib::cInt)round(out[0] * clipper_scale), diff --git a/svg-flatten/src/svg_path.cpp b/svg-flatten/src/svg_path.cpp index e2ed370..70d346d 100644 --- a/svg-flatten/src/svg_path.cpp +++ b/svg-flatten/src/svg_path.cpp @@ -188,13 +188,11 @@ void gerbolyze::dash_path(const ClipperLib::Path &in, ClipperLib::Paths &out, co ClipperLib::Path current_dash; current_dash.push_back(in[0]); - double dbg_total_len = 0.0; for (size_t i=1; i<in.size(); i++) { ClipperLib::IntPoint p1(in[i-1]), p2(in[i]); double x1 = p1.X / clipper_scale, y1 = p1.Y / clipper_scale, x2 = p2.X / clipper_scale, y2 = p2.Y / clipper_scale; double dist = sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)); - dbg_total_len += dist; if (dist < dash_remaining) { /* dash extends beyond this segment, append this segment and continue. */ |