From e1d663c0cecce9f036483aa507e557158a1d806a Mon Sep 17 00:00:00 2001 From: ntfshard Date: Thu, 6 Aug 2015 03:28:33 +0300 Subject: [PATCH] Function arguments passed by reference --- xs/src/clipper.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xs/src/clipper.cpp b/xs/src/clipper.cpp index 83153c996..bfdcd5d98 100644 --- a/xs/src/clipper.cpp +++ b/xs/src/clipper.cpp @@ -542,8 +542,8 @@ bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range) } //------------------------------------------------------------------------------ -bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, - const IntPoint pt3, bool UseFullInt64Range) +bool SlopesEqual(const IntPoint &pt1, const IntPoint &pt2, + const IntPoint &pt3, bool UseFullInt64Range) { #ifndef use_int32 if (UseFullInt64Range) @@ -554,8 +554,8 @@ bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, } //------------------------------------------------------------------------------ -bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, - const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range) +bool SlopesEqual(const IntPoint &pt1, const IntPoint &pt2, + const IntPoint &pt3, const IntPoint &pt4, bool UseFullInt64Range) { #ifndef use_int32 if (UseFullInt64Range) @@ -572,7 +572,7 @@ inline bool IsHorizontal(TEdge &e) } //------------------------------------------------------------------------------ -inline double GetDx(const IntPoint pt1, const IntPoint pt2) +inline double GetDx(const IntPoint &pt1, const IntPoint &pt2) { return (pt1.Y == pt2.Y) ? HORIZONTAL : (double)(pt2.X - pt1.X) / (pt2.Y - pt1.Y); @@ -845,8 +845,8 @@ OutPt* GetBottomPt(OutPt *pp) } //------------------------------------------------------------------------------ -bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1, - const IntPoint pt2, const IntPoint pt3) +bool Pt2IsBetweenPt1AndPt3(const IntPoint &pt1, + const IntPoint &pt2, const IntPoint &pt3) { if ((pt1 == pt3) || (pt1 == pt2) || (pt3 == pt2)) return false; @@ -1814,7 +1814,7 @@ void Clipper::CopyAELToSEL() } //------------------------------------------------------------------------------ -void Clipper::AddJoin(OutPt *op1, OutPt *op2, const IntPoint OffPt) +void Clipper::AddJoin(OutPt *op1, OutPt *op2, const IntPoint &OffPt) { Join* j = new Join; j->OutPt1 = op1; @@ -1840,7 +1840,7 @@ void Clipper::ClearGhostJoins() } //------------------------------------------------------------------------------ -void Clipper::AddGhostJoin(OutPt *op, const IntPoint OffPt) +void Clipper::AddGhostJoin(OutPt *op, const IntPoint &OffPt) { Join* j = new Join; j->OutPt1 = op; @@ -3323,7 +3323,7 @@ OutPt* DupOutPt(OutPt* outPt, bool InsertAfter) //------------------------------------------------------------------------------ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b, - const IntPoint Pt, bool DiscardLeft) + const IntPoint &Pt, bool DiscardLeft) { Direction Dir1 = (op1->Pt.X > op1b->Pt.X ? dRightToLeft : dLeftToRight); Direction Dir2 = (op2->Pt.X > op2b->Pt.X ? dRightToLeft : dLeftToRight); @@ -4462,7 +4462,7 @@ void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool p } //------------------------------------------------------------------------------ -void TranslatePath(const Path& input, Path& output, const IntPoint delta) +void TranslatePath(const Path& input, Path& output, const IntPoint& delta) { //precondition: input != output output.resize(input.size());