From 3fbb56c3ae6731854d0377b824583a86f90f29c7 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 16 Apr 2023 14:04:53 +0200 Subject: Fix clang build and warnings --- svg-flatten/Makefile | 2 +- svg-flatten/include/geom2d.hpp | 2 +- svg-flatten/src/svg_path.cpp | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'svg-flatten') 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