Cppcheck warnings.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-18 13:24:19 +02:00
parent 726d8614dc
commit d38f318569
2 changed files with 10 additions and 10 deletions

View File

@ -53,7 +53,7 @@ class VSAPoint : public QPointF
public: public:
Q_DECL_CONSTEXPR VSAPoint(); Q_DECL_CONSTEXPR VSAPoint();
Q_DECL_CONSTEXPR VSAPoint(qreal xpos, qreal ypos); Q_DECL_CONSTEXPR VSAPoint(qreal xpos, qreal ypos);
Q_DECL_CONSTEXPR VSAPoint(const QPointF &p); Q_DECL_CONSTEXPR explicit VSAPoint(const QPointF &p);
Q_DECL_CONSTEXPR qreal GetSABefore() const; Q_DECL_CONSTEXPR qreal GetSABefore() const;
void SetSABefore(qreal value); void SetSABefore(qreal value);

View File

@ -214,7 +214,7 @@ QVector<QPointF> VPiece::SeamAllowancePoints(const VContainer *data) const
QVector<VSAPoint> pointsEkv; QVector<VSAPoint> pointsEkv;
for (int i = 0; i< CountNodes(); ++i) for (int i = 0; i< CountNodes(); ++i)
{ {
const VPieceNode node = at(i); const VPieceNode &node = at(i);
switch (node.GetTypeTool()) switch (node.GetTypeTool())
{ {
case (Tool::NodePoint): case (Tool::NodePoint):
@ -460,7 +460,7 @@ VSAPoint VPiece::StartSegment(const VContainer *data, int i, bool reverse) const
{ {
if (i < 0 && i > CountNodes()-1) if (i < 0 && i > CountNodes()-1)
{ {
return QPointF(); return VSAPoint();
} }
const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(at(i).GetId()); const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(at(i).GetId());
@ -471,14 +471,14 @@ VSAPoint VPiece::StartSegment(const VContainer *data, int i, bool reverse) const
points = VGObject::GetReversePoints(points); points = VGObject::GetReversePoints(points);
} }
VSAPoint begin = points.first(); VSAPoint begin = VSAPoint(points.first());
if (CountNodes() > 1) if (CountNodes() > 1)
{ {
if (i == 0) if (i == 0)
{ {
if (at(CountNodes()-1).GetTypeTool() == Tool::NodePoint) if (at(CountNodes()-1).GetTypeTool() == Tool::NodePoint)
{ {
const VPieceNode node = at(CountNodes()-1); const VPieceNode &node = at(CountNodes()-1);
const QPointF p = *data->GeometricObject<VPointF>(node.GetId()); const QPointF p = *data->GeometricObject<VPointF>(node.GetId());
if (curve->IsPointOnCurve(p)) if (curve->IsPointOnCurve(p))
{ {
@ -492,7 +492,7 @@ VSAPoint VPiece::StartSegment(const VContainer *data, int i, bool reverse) const
{ {
if (at(i-1).GetTypeTool() == Tool::NodePoint) if (at(i-1).GetTypeTool() == Tool::NodePoint)
{ {
const VPieceNode node = at(i-1); const VPieceNode &node = at(i-1);
const QPointF p = *data->GeometricObject<VPointF>(node.GetId()); const QPointF p = *data->GeometricObject<VPointF>(node.GetId());
if (curve->IsPointOnCurve(p)) if (curve->IsPointOnCurve(p))
{ {
@ -511,7 +511,7 @@ VSAPoint VPiece::EndSegment(const VContainer *data, int i, bool reverse) const
{ {
if (i < 0 && i > CountNodes()-1) if (i < 0 && i > CountNodes()-1)
{ {
return QPointF(); return VSAPoint();
} }
const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(at(i).GetId()); const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(at(i).GetId());
@ -522,14 +522,14 @@ VSAPoint VPiece::EndSegment(const VContainer *data, int i, bool reverse) const
points = VGObject::GetReversePoints(points); points = VGObject::GetReversePoints(points);
} }
VSAPoint end = points.last(); VSAPoint end = VSAPoint(points.last());
if (CountNodes() > 2) if (CountNodes() > 2)
{ {
if (i == CountNodes() - 1) if (i == CountNodes() - 1)
{ {
if (at(0).GetTypeTool() == Tool::NodePoint) if (at(0).GetTypeTool() == Tool::NodePoint)
{ {
const VPieceNode node = at(0); const VPieceNode &node = at(0);
const QPointF p = *data->GeometricObject<VPointF>(node.GetId()); const QPointF p = *data->GeometricObject<VPointF>(node.GetId());
if (curve->IsPointOnCurve(p)) if (curve->IsPointOnCurve(p))
{ {
@ -543,7 +543,7 @@ VSAPoint VPiece::EndSegment(const VContainer *data, int i, bool reverse) const
{ {
if (at(i+1).GetTypeTool() == Tool::NodePoint) if (at(i+1).GetTypeTool() == Tool::NodePoint)
{ {
const VPieceNode node = at(i+1); const VPieceNode &node = at(i+1);
const QPointF p = *data->GeometricObject<VPointF>(node.GetId()); const QPointF p = *data->GeometricObject<VPointF>(node.GetId());
if (curve->IsPointOnCurve(p)) if (curve->IsPointOnCurve(p))
{ {