From 5eabedccb3e454c66a81821af4eeadaebb9487f0 Mon Sep 17 00:00:00 2001 From: Jeremy Friesner Date: Wed, 4 Mar 2026 17:33:57 -0800 Subject: [PATCH] Removed unnecessary semicolons to avoid -Wextra-semi warnings --- .../include/clipper2/clipper.core.h | 10 ++++---- .../include/clipper2/clipper.engine.h | 24 +++++++++---------- .../include/clipper2/clipper.minkowski.h | 2 +- .../include/clipper2/clipper.offset.h | 8 +++---- .../include/clipper2/clipper.rectclip.h | 2 +- CPP/Utils/Colors.h | 4 ++-- CPP/Utils/clipper.svg.h | 8 +++---- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index 557c76b9d..abf885f91 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -138,7 +138,7 @@ namespace Clipper2Lib } } - explicit Point() : x(0), y(0), z(0) {}; + explicit Point() : x(0), y(0), z(0) {} template Point(const T2 x_, const T2 y_, const z_type z_ = 0) @@ -190,7 +190,7 @@ namespace Clipper2Lib } } - explicit Point() : x(0), y(0) {}; + explicit Point() : x(0), y(0) {} template Point(const T2 x_, const T2 y_) { Init(x_, y_); } @@ -367,13 +367,13 @@ namespace Clipper2Lib bottom *= scale; } - bool IsEmpty() const { return bottom <= top || right <= left; }; + bool IsEmpty() const { return bottom <= top || right <= left; } bool Intersects(const Rect& rec) const { return ((std::max)(left, rec.left) <= (std::min)(right, rec.right)) && ((std::max)(top, rec.top) <= (std::min)(bottom, rec.bottom)); - }; + } bool operator==(const Rect& other) const { return left == other.left && right == other.right && @@ -707,7 +707,7 @@ namespace Clipper2Lib bool operator==(const UInt128Struct& other) const { return lo == other.lo && hi == other.hi; - }; + } }; diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.engine.h b/CPP/Clipper2Lib/include/clipper2/clipper.engine.h index f4e1e1838..a506823ba 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.engine.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.engine.h @@ -93,7 +93,7 @@ namespace Clipper2Lib { if (splits) delete splits; // nb: don't delete the split pointers // as these are owned by ClipperBase's outrec_list_ - }; + } }; /////////////////////////////////////////////////////////////////// @@ -156,7 +156,7 @@ namespace Clipper2Lib { struct HorzJoin { OutPt* op1 = nullptr; OutPt* op2 = nullptr; - HorzJoin() {}; + HorzJoin() {} explicit HorzJoin(OutPt* ltr, OutPt* rtl) : op1(ltr), op2(rtl) { } }; @@ -276,11 +276,11 @@ namespace Clipper2Lib { void AddPaths(const Paths64& paths, PathType polytype, bool is_open); public: virtual ~ClipperBase(); - int ErrorCode() const { return error_code_; }; - void PreserveCollinear(bool val) { preserve_collinear_ = val; }; - bool PreserveCollinear() const { return preserve_collinear_;}; - void ReverseSolution(bool val) { reverse_solution_ = val; }; - bool ReverseSolution() const { return reverse_solution_; }; + int ErrorCode() const { return error_code_; } + void PreserveCollinear(bool val) { preserve_collinear_ = val; } + bool PreserveCollinear() const { return preserve_collinear_;} + void ReverseSolution(bool val) { reverse_solution_ = val; } + bool ReverseSolution() const { return reverse_solution_; } void Clear(); void AddReuseableData(const ReuseableDataContainer64& reuseable_data); #ifdef USINGZ @@ -300,7 +300,7 @@ namespace Clipper2Lib { PolyPath* parent_; public: PolyPath(PolyPath* parent = nullptr): parent_(parent){} - virtual ~PolyPath() {}; + virtual ~PolyPath() {} //https://en.cppreference.com/w/cpp/language/rule_of_three PolyPath(const PolyPath&) = delete; PolyPath& operator=(const PolyPath&) = delete; @@ -371,7 +371,7 @@ namespace Clipper2Lib { return childs_.size(); } - const Path64& Polygon() const { return polygon_; }; + const Path64& Polygon() const { return polygon_; } double Area() const { @@ -446,7 +446,7 @@ namespace Clipper2Lib { return childs_.size(); } - const PathD& Polygon() const { return polygon_; }; + const PathD& Polygon() const { return polygon_; } double Area() const { @@ -537,7 +537,7 @@ namespace Clipper2Lib { } #ifdef USINGZ - void SetZCallback(ZCallbackD cb) { zCallbackD_ = cb; }; + void SetZCallback(ZCallbackD cb) { zCallbackD_ = cb; } void ZCB(const Point64& e1bot, const Point64& e1top, const Point64& e2bot, const Point64& e2top, Point64& pt) @@ -553,7 +553,7 @@ namespace Clipper2Lib { PointD e2t = PointD(e2top) * invScale_; zCallbackD_(e1b,e1t, e2b, e2t, tmp); pt.z = tmp.z; // only update 'z' - }; + } void CheckCallback() { diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.minkowski.h b/CPP/Clipper2Lib/include/clipper2/clipper.minkowski.h index 3a85ba5d1..f1803ff3d 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.minkowski.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.minkowski.h @@ -60,7 +60,7 @@ namespace Clipper2Lib quad.emplace_back(tmp[i][h]); quad.emplace_back(tmp[i][j]); quad.emplace_back(tmp[g][j]); - }; + } if (!IsPositive(quad)) std::reverse(quad.begin(), quad.end()); result.emplace_back(std::move(quad)); diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.offset.h b/CPP/Clipper2Lib/include/clipper2/clipper.offset.h index 560af8a3c..d4f7e49f8 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.offset.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.offset.h @@ -88,14 +88,14 @@ class ClipperOffset { bool reverse_solution = false) : miter_limit_(miter_limit), arc_tolerance_(arc_tolerance), preserve_collinear_(preserve_collinear), - reverse_solution_(reverse_solution) { }; + reverse_solution_(reverse_solution) { } - ~ClipperOffset() { Clear(); }; + ~ClipperOffset() { Clear(); } - int ErrorCode() const { return error_code_; }; + int ErrorCode() const { return error_code_; } void AddPath(const Path64& path, JoinType jt_, EndType et_); void AddPaths(const Paths64& paths, JoinType jt_, EndType et_); - void Clear() { groups_.clear(); norms.clear(); }; + void Clear() { groups_.clear(); norms.clear(); } void Execute(double delta, Paths64& sols_64); void Execute(double delta, PolyTree64& polytree); diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.rectclip.h b/CPP/Clipper2Lib/include/clipper2/clipper.rectclip.h index e7cf2f454..6b6886ba7 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.rectclip.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.rectclip.h @@ -72,7 +72,7 @@ namespace Clipper2Lib void ExecuteInternal(const Path64& path); Path64 GetPath(OutPt2*& op); public: - explicit RectClipLines64(const Rect64& rect) : RectClip64(rect) {}; + explicit RectClipLines64(const Rect64& rect) : RectClip64(rect) {} Paths64 Execute(const Paths64& paths); }; diff --git a/CPP/Utils/Colors.h b/CPP/Utils/Colors.h index c98734cbb..9d3925b5a 100644 --- a/CPP/Utils/Colors.h +++ b/CPP/Utils/Colors.h @@ -8,9 +8,9 @@ struct Hsl { uint8_t hue = 0; uint8_t sat = 0; uint8_t lum = 0; - Hsl() {}; + Hsl() {} Hsl(uint8_t a, uint8_t h, uint8_t s, uint8_t l) : - alpha(a), hue(h), sat(s), lum(l) {}; + alpha(a), hue(h), sat(s), lum(l) {} }; union Color32 { diff --git a/CPP/Utils/clipper.svg.h b/CPP/Utils/clipper.svg.h index 5b80e2e36..4bd8f33f7 100644 --- a/CPP/Utils/clipper.svg.h +++ b/CPP/Utils/clipper.svg.h @@ -30,7 +30,7 @@ namespace Clipper2Lib { paths_(paths), is_open_path(is_open), fillrule_(fillrule), brush_color_(brush_clr), pen_color_(pen_clr), pen_width_(pen_width), show_coords_(show_coords) { - }; + } friend class SvgWriter; friend class SvgReader; }; @@ -63,7 +63,7 @@ namespace Clipper2Lib { unsigned weight, unsigned size, double coord_x, double coord_y) : text(txt), font_name(fnt_name), font_color(color), font_weight(weight), font_size(size), x(coord_x), y(coord_y) { - }; + } friend class SvgWriter; }; @@ -84,9 +84,9 @@ namespace Clipper2Lib { coords_style.font_color = 0xFF000000; coords_style.font_size = 11; scale_ = std::pow(10, precision); - }; + } - ~SvgWriter() { Clear(); }; + ~SvgWriter() { Clear(); } void Clear(); FillRule Fill_Rule() const { return fill_rule_; }