Skip to content

Commit 46f6391

Browse files
authored
Minor fixes to avoid annoying compilation-time warnings whenever any code includes the Clipper2 headers (#1072)
1 parent 458dd85 commit 46f6391

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CPP/Clipper2Lib/include/clipper2/clipper.core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ namespace Clipper2Lib
888888
// be constrained to seg1. However, it's possible that 'ip' won't be inside
889889
// seg2, even when 'ip' hasn't been constrained (ie 'ip' is inside seg1).
890890

891-
#if CLIPPER2_HI_PRECISION
891+
#if defined(CLIPPER2_HI_PRECISION) && CLIPPER2_HI_PRECISION
892892
// caution: this will compromise performance
893893
// https://github.com/AngusJohnson/Clipper2/issues/317#issuecomment-1314023253
894894
// See also CPP/BenchMark/GetIntersectPtBenchmark.cpp

CPP/Clipper2Lib/include/clipper2/clipper.engine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ namespace Clipper2Lib {
339339
explicit PolyPath64(PolyPath64* parent = nullptr) : PolyPath(parent) {}
340340
explicit PolyPath64(PolyPath64* parent, const Path64& path) : PolyPath(parent) { polygon_ = path; }
341341

342-
~PolyPath64() {
342+
~PolyPath64() override {
343343
childs_.resize(0);
344344
}
345345

@@ -406,7 +406,7 @@ namespace Clipper2Lib {
406406
polygon_ = path;
407407
}
408408

409-
~PolyPathD() {
409+
~PolyPathD() override {
410410
childs_.resize(0);
411411
}
412412

CPP/Clipper2Lib/include/clipper2/clipper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ namespace Clipper2Lib {
134134
JoinType jt, EndType et, double miter_limit = 2.0,
135135
double arc_tolerance = 0.0)
136136
{
137-
if (!delta) return paths;
137+
if (delta==0.0) return paths;
138138
ClipperOffset clip_offset(miter_limit, arc_tolerance);
139139
clip_offset.AddPaths(paths, jt, et);
140140
Paths64 solution;
@@ -148,7 +148,7 @@ namespace Clipper2Lib {
148148
{
149149
int error_code = 0;
150150
CheckPrecisionRange(precision, error_code);
151-
if (!delta) return paths;
151+
if (delta==0.0) return paths;
152152
if (error_code) return PathsD();
153153
const double scale = std::pow(10, precision);
154154
ClipperOffset clip_offset(miter_limit, arc_tolerance * scale);

0 commit comments

Comments
 (0)