Function arguments passed by reference

This commit is contained in:
ntfshard 2015-08-06 03:28:33 +03:00 committed by Alessandro Ranellucci
parent dbcd1e2df6
commit e1d663c0ce

View File

@ -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());