From 70f27955f5380778b834c26ae8ad17c3cea1b696 Mon Sep 17 00:00:00 2001 From: Jeremy Friesner Date: Tue, 3 Mar 2026 20:39:48 -0800 Subject: [PATCH] Minor fixes to avoid annoying compilation-time warnings whenever any code includes the Clipper2 headers --- CPP/Clipper2Lib/include/clipper2/clipper.core.h | 2 +- CPP/Clipper2Lib/include/clipper2/clipper.engine.h | 4 ++-- CPP/Clipper2Lib/include/clipper2/clipper.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index 557c76b9d..dca19eb8d 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -888,7 +888,7 @@ namespace Clipper2Lib // be constrained to seg1. However, it's possible that 'ip' won't be inside // seg2, even when 'ip' hasn't been constrained (ie 'ip' is inside seg1). -#if CLIPPER2_HI_PRECISION +#if defined(CLIPPER2_HI_PRECISION) && CLIPPER2_HI_PRECISION // caution: this will compromise performance // https://github.com/AngusJohnson/Clipper2/issues/317#issuecomment-1314023253 // See also CPP/BenchMark/GetIntersectPtBenchmark.cpp diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.engine.h b/CPP/Clipper2Lib/include/clipper2/clipper.engine.h index f4e1e1838..a6d96da7c 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.engine.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.engine.h @@ -339,7 +339,7 @@ namespace Clipper2Lib { explicit PolyPath64(PolyPath64* parent = nullptr) : PolyPath(parent) {} explicit PolyPath64(PolyPath64* parent, const Path64& path) : PolyPath(parent) { polygon_ = path; } - ~PolyPath64() { + ~PolyPath64() override { childs_.resize(0); } @@ -406,7 +406,7 @@ namespace Clipper2Lib { polygon_ = path; } - ~PolyPathD() { + ~PolyPathD() override { childs_.resize(0); } diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.h b/CPP/Clipper2Lib/include/clipper2/clipper.h index 06392759d..fe1e299ef 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.h @@ -134,7 +134,7 @@ namespace Clipper2Lib { JoinType jt, EndType et, double miter_limit = 2.0, double arc_tolerance = 0.0) { - if (!delta) return paths; + if (delta==0.0) return paths; ClipperOffset clip_offset(miter_limit, arc_tolerance); clip_offset.AddPaths(paths, jt, et); Paths64 solution; @@ -148,7 +148,7 @@ namespace Clipper2Lib { { int error_code = 0; CheckPrecisionRange(precision, error_code); - if (!delta) return paths; + if (delta==0.0) return paths; if (error_code) return PathsD(); const double scale = std::pow(10, precision); ClipperOffset clip_offset(miter_limit, arc_tolerance * scale);