Fixed warnings in Linux

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-10-01 05:05:21 +03:00
parent 92a7f21621
commit 15834562af
5 changed files with 41 additions and 29 deletions

View file

@ -65,7 +65,10 @@ public:
extrusion = L.extrusion; extrusion = L.extrusion;
attributes = L.attributes; attributes = L.attributes;
return *this; if ( &L == this )
{
return *this;
}
} }
/** /**

View file

@ -43,26 +43,26 @@
DL_Dxf::DL_Dxf() DL_Dxf::DL_Dxf()
: version(DL_VERSION_2000), : version(DL_VERSION_2000),
polylineLayer(), polylineLayer(),
vertices(NULL), vertices(nullptr),
maxVertices(0), maxVertices(0),
vertexIndex(0), vertexIndex(0),
knots(NULL), knots(nullptr),
maxKnots(0), maxKnots(0),
knotIndex(0), knotIndex(0),
weights(NULL), weights(nullptr),
weightIndex(0), weightIndex(0),
controlPoints(NULL), controlPoints(nullptr),
maxControlPoints(0), maxControlPoints(0),
controlPointIndex(0), controlPointIndex(0),
fitPoints(NULL), fitPoints(nullptr),
maxFitPoints(0), maxFitPoints(0),
fitPointIndex(0), fitPointIndex(0),
leaderVertices(NULL), leaderVertices(nullptr),
maxLeaderVertices(0), maxLeaderVertices(0),
leaderVertexIndex(0), leaderVertexIndex(0),
@ -80,27 +80,27 @@ DL_Dxf::DL_Dxf()
*/ */
DL_Dxf::~DL_Dxf() DL_Dxf::~DL_Dxf()
{ {
if (vertices!=NULL) if (vertices!=nullptr)
{ {
delete[] vertices; delete[] vertices;
} }
if (knots!=NULL) if (knots!=nullptr)
{ {
delete[] knots; delete[] knots;
} }
if (controlPoints!=NULL) if (controlPoints!=nullptr)
{ {
delete[] controlPoints; delete[] controlPoints;
} }
if (fitPoints!=NULL) if (fitPoints!=nullptr)
{ {
delete[] fitPoints; delete[] fitPoints;
} }
if (weights!=NULL) if (weights!=nullptr)
{ {
delete[] weights; delete[] weights;
} }
if (leaderVertices!=NULL) if (leaderVertices!=nullptr)
{ {
delete[] leaderVertices; delete[] leaderVertices;
} }
@ -1617,7 +1617,7 @@ bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/)
maxVertices = toInt(groupValue); maxVertices = toInt(groupValue);
if (maxVertices>0) if (maxVertices>0)
{ {
if (vertices!=NULL) if (vertices!=nullptr)
{ {
delete[] vertices; delete[] vertices;
} }
@ -1673,7 +1673,7 @@ bool DL_Dxf::handleSplineData(DL_CreationInterface* /*creationInterface*/)
maxKnots = toInt(groupValue); maxKnots = toInt(groupValue);
if (maxKnots>0) if (maxKnots>0)
{ {
if (knots!=NULL) if (knots!=nullptr)
{ {
delete[] knots; delete[] knots;
} }
@ -1693,11 +1693,11 @@ bool DL_Dxf::handleSplineData(DL_CreationInterface* /*creationInterface*/)
maxControlPoints = toInt(groupValue); maxControlPoints = toInt(groupValue);
if (maxControlPoints>0) if (maxControlPoints>0)
{ {
if (controlPoints!=NULL) if (controlPoints!=nullptr)
{ {
delete[] controlPoints; delete[] controlPoints;
} }
if (weights!=NULL) if (weights!=nullptr)
{ {
delete[] weights; delete[] weights;
} }
@ -1722,7 +1722,7 @@ bool DL_Dxf::handleSplineData(DL_CreationInterface* /*creationInterface*/)
maxFitPoints = toInt(groupValue); maxFitPoints = toInt(groupValue);
if (maxFitPoints>0) if (maxFitPoints>0)
{ {
if (fitPoints!=NULL) if (fitPoints!=nullptr)
{ {
delete[] fitPoints; delete[] fitPoints;
} }
@ -1812,7 +1812,7 @@ bool DL_Dxf::handleLeaderData(DL_CreationInterface* /*creationInterface*/)
maxLeaderVertices = toInt(groupValue); maxLeaderVertices = toInt(groupValue);
if (maxLeaderVertices>0) if (maxLeaderVertices>0)
{ {
if (leaderVertices!=NULL) if (leaderVertices!=nullptr)
{ {
delete[] leaderVertices; delete[] leaderVertices;
} }
@ -2279,7 +2279,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
} }
return true; return true;
default: default:
return true; return false;
} }
} }
else else
@ -2303,7 +2303,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
default: default:
return true; return false;
} }
} }
@ -2332,7 +2332,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
default: default:
return true; return false;
} }
} }
@ -2367,7 +2367,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
default: default:
return true; return false;
} }
} }
@ -2449,7 +2449,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.endTangentY = toReal(groupValue); hatchEdge.endTangentY = toReal(groupValue);
return true; return true;
default: default:
return true; return false;
} }
} }
} }

View file

@ -210,7 +210,10 @@ public:
appDictionaryHandle = L.appDictionaryHandle; appDictionaryHandle = L.appDictionaryHandle;
styleHandleStd = L.styleHandleStd; styleHandleStd = L.styleHandleStd;
return *this; if ( &L == this )
{
return *this;
}
} }
bool in(const std::string& file, bool in(const std::string& file,

View file

@ -95,7 +95,7 @@ struct DXFLIB_EXPORT DL_LinetypeData
int flags, int flags,
int numberOfDashes, int numberOfDashes,
double patternLength, double patternLength,
double* pattern = NULL double* pattern = nullptr
) )
: name(name), : name(name),
description(description), description(description),
@ -129,7 +129,10 @@ struct DXFLIB_EXPORT DL_LinetypeData
patternLength = L.patternLength; patternLength = L.patternLength;
pattern = L.pattern; pattern = L.pattern;
return *this; if ( &L == this )
{
return *this;
}
} }
/** Linetype name */ /** Linetype name */
@ -1279,7 +1282,7 @@ struct DXFLIB_EXPORT DL_DimOrdinateData
DL_DimOrdinateData(double ddpx1, double ddpy1, double ddpz1, DL_DimOrdinateData(double ddpx1, double ddpy1, double ddpz1,
double ddpx2, double ddpy2, double ddpz2, double ddpx2, double ddpy2, double ddpz2,
bool dxtype) bool dxtype)
: dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1), : dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1),
dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2), dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2),
xtype(dxtype) xtype(dxtype)
{ {

View file

@ -144,7 +144,10 @@ public:
setDirection(extru.direction[0], extru.direction[1], extru.direction[2]); setDirection(extru.direction[0], extru.direction[1], extru.direction[2]);
setElevation(extru.elevation); setElevation(extru.elevation);
return *this; if ( &extru == this )
{
return *this;
}
} }