Cppcheck warnings.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2016-08-15 21:06:04 +03:00
parent ba36ab3c71
commit dde8f9638e
13 changed files with 60 additions and 52 deletions

View file

@ -219,7 +219,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress uninitMemberVar
MApplication::MApplication(int &argc, char **argv) MApplication::MApplication(int &argc, char **argv)
:VAbstractApplication(argc, argv), :VAbstractApplication(argc, argv),
mainWindows(), mainWindows(),

View file

@ -587,9 +587,7 @@ QStringList VApplication::LabelLanguages()
void VApplication::StartLogging() void VApplication::StartLogging()
{ {
CreateLogDir(); CreateLogDir();
// cppcheck-suppress leakReturnValNotUsed
BeginLogging(); BeginLogging();
// cppcheck-suppress leakReturnValNotUsed
ClearOldLogs(); ClearOldLogs();
#if defined(Q_OS_WIN) && defined(Q_CC_GNU) #if defined(Q_OS_WIN) && defined(Q_CC_GNU)
ClearOldReports(); ClearOldReports();
@ -847,7 +845,6 @@ void VApplication::CollectReport(const QString &reportName) const
reportFile.remove(); // Clear after yourself reportFile.remove(); // Clear after yourself
filename = QString("%1/reports/log-%2.log").arg(qApp->applicationDirPath()).arg(timestamp); filename = QString("%1/reports/log-%2.log").arg(qApp->applicationDirPath()).arg(timestamp);
// cppcheck-suppress leakReturnValNotUsed
GatherLogs(); GatherLogs();
QFile logFile(QString("%1/valentina.log").arg(LogDirPath())); QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
logFile.copy(filename); // Collect log logFile.copy(filename); // Collect log
@ -911,7 +908,6 @@ void VApplication::SendReport(const QString &reportName) const
content.append(QString("\r\n-------------------------------\r\n")); content.append(QString("\r\n-------------------------------\r\n"));
content.append(QString("Log:")+"\r\n"); content.append(QString("Log:")+"\r\n");
// cppcheck-suppress leakReturnValNotUsed
GatherLogs(); GatherLogs();
QFile logFile(QString("%1/valentina.log").arg(LogDirPath())); QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
if (logFile.open(QIODevice::ReadOnly | QIODevice::Text)) if (logFile.open(QIODevice::ReadOnly | QIODevice::Text))

View file

@ -379,7 +379,7 @@ quint32 VDomDocument::GetParametrId(const QDomElement &domElement) const
try try
{ {
id = GetParametrUInt(domElement, VDomDocument::AttrId, NULL_ID_STR); id = GetParametrUInt(domElement, VDomDocument::AttrId, NULL_ID_STR);
if (id <= 0) if (id == 0)
{ {
throw VExceptionWrongId(message, domElement); throw VExceptionWrongId(message, domElement);
} }
@ -467,6 +467,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
{ {
qCDebug(vXML, "Validation xml file %s.", qUtf8Printable(fileName)); qCDebug(vXML, "Validation xml file %s.", qUtf8Printable(fileName));
QFile pattern(fileName); QFile pattern(fileName);
// cppcheck-suppress ConfigurationNotChecked
if (pattern.open(QIODevice::ReadOnly) == false) if (pattern.open(QIODevice::ReadOnly) == false)
{ {
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(pattern.errorString())); const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(pattern.errorString()));
@ -474,6 +475,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
} }
QFile fileSchema(schema); QFile fileSchema(schema);
// cppcheck-suppress ConfigurationNotChecked
if (fileSchema.open(QIODevice::ReadOnly) == false) if (fileSchema.open(QIODevice::ReadOnly) == false)
{ {
pattern.close(); pattern.close();
@ -524,6 +526,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
void VDomDocument::setXMLContent(const QString &fileName) void VDomDocument::setXMLContent(const QString &fileName)
{ {
QFile file(fileName); QFile file(fileName);
// cppcheck-suppress ConfigurationNotChecked
if (file.open(QIODevice::ReadOnly) == false) if (file.open(QIODevice::ReadOnly) == false)
{ {
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(file.errorString())); const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(file.errorString()));
@ -662,6 +665,7 @@ bool VDomDocument::SaveDocument(const QString &fileName, QString &error) const
} }
bool success = false; bool success = false;
QSaveFile file(fileName); QSaveFile file(fileName);
// cppcheck-suppress ConfigurationNotChecked
if (file.open(QIODevice::WriteOnly)) if (file.open(QIODevice::WriteOnly))
{ {
const int indent = 4; const int indent = 4;
@ -790,6 +794,7 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q
QTemporaryFile destFile(destination + QLatin1Literal(".XXXXXX")); QTemporaryFile destFile(destination + QLatin1Literal(".XXXXXX"));
destFile.setAutoRemove(false); destFile.setAutoRemove(false);
// cppcheck-suppress ConfigurationNotChecked
if (not destFile.open()) if (not destFile.open())
{ {
error = destFile.errorString(); error = destFile.errorString();
@ -798,6 +803,7 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q
else else
{ {
QFile sourceFile(source); QFile sourceFile(source);
// cppcheck-suppress ConfigurationNotChecked
if (sourceFile.open(QIODevice::ReadOnly)) if (sourceFile.open(QIODevice::ReadOnly))
{ {
result = true; result = true;

View file

@ -50,7 +50,7 @@ class QMUPARSERSHARED_EXPORT QmuParserTester : public QObject // final
public: public:
typedef int ( QmuParserTester::*testfun_type ) (); typedef int ( QmuParserTester::*testfun_type ) ();
QmuParserTester(QObject *parent = nullptr); explicit QmuParserTester(QObject *parent = nullptr);
public slots: public slots:
void Run(); void Run();

View file

@ -172,6 +172,7 @@ bool DL_Dxf::in(std::stringstream& stream,
*/ */
bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface) bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface)
{ {
// cppcheck-suppress variableScope
static int line = 1; static int line = 1;
// Read one group of the DXF file and strip the lines: // Read one group of the DXF file and strip the lines:
@ -196,11 +197,12 @@ bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface)
bool DL_Dxf::readDxfGroups(std::stringstream& stream, bool DL_Dxf::readDxfGroups(std::stringstream& stream,
DL_CreationInterface* creationInterface) DL_CreationInterface* creationInterface)
{ {
// cppcheck-suppress variableScope
static int line = 1; static int line = 1;
// Read one group of the DXF file and chop the lines: // Read one group of the DXF file and chop the lines:
if (DL_Dxf::getStrippedLine(groupCodeTmp, DL_DXF_MAXLINE, stream) && if (DL_Dxf::getStrippedLine(groupCodeTmp, DL_DXF_MAXLINE, stream) &&
DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, stream, false) ) DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, stream, false) )
{ {
groupCode = static_cast<quint32>(toInt(groupCodeTmp)); groupCode = static_cast<quint32>(toInt(groupCodeTmp));
@ -230,7 +232,7 @@ bool DL_Dxf::readDxfGroups(std::stringstream& stream,
* @todo Is it a problem if line is blank (i.e., newline only)? * @todo Is it a problem if line is blank (i.e., newline only)?
* Then, when function returns, (s==NULL). * Then, when function returns, (s==NULL).
*/ */
bool DL_Dxf::getStrippedLine(std::string& s, quint32 size, FILE *fp, bool stripSpace) bool DL_Dxf::getStrippedLine(std::string& s, quint32 size, FILE *fp, bool stripSpace)
{ {
if (!feof(fp)) if (!feof(fp))
{ {
@ -270,7 +272,7 @@ bool DL_Dxf::getStrippedLine(std::string& s, quint32 size, FILE *fp, bool stripS
* Same as above but for stringstreams. * Same as above but for stringstreams.
*/ */
bool DL_Dxf::getStrippedLine(std::string &s, quint32 size, bool DL_Dxf::getStrippedLine(std::string &s, quint32 size,
std::stringstream& stream, bool stripSpace) std::stringstream& stream, bool stripSpace)
{ {
if (!stream.eof()) if (!stream.eof())
@ -312,21 +314,21 @@ bool DL_Dxf::stripWhiteSpace(char** s, bool stripSpace)
// Is last character CR or LF? // Is last character CR or LF?
while ( (lastChar >= 0) && while ( (lastChar >= 0) &&
(((*s)[lastChar] == 10) || ((*s)[lastChar] == 13) || (((*s)[lastChar] == 10) || ((*s)[lastChar] == 13) ||
(stripSpace && ((*s)[lastChar] == ' ' || ((*s)[lastChar] == '\t')))) ) (stripSpace && ((*s)[lastChar] == ' ' || ((*s)[lastChar] == '\t')))) )
{ {
(*s)[lastChar] = '\0'; (*s)[lastChar] = '\0';
lastChar--; lastChar--;
} }
// Skip whitespace, excluding \n, at beginning of line // Skip whitespace, excluding \n, at beginning of line
if (stripSpace) if (stripSpace)
{ {
while ((*s)[0]==' ' || (*s)[0]=='\t') while ((*s)[0]==' ' || (*s)[0]=='\t')
{ {
++(*s); ++(*s);
} }
} }
return ((*s) ? true : false); return ((*s) ? true : false);
} }
@ -1481,7 +1483,7 @@ bool DL_Dxf::handleXRecordData(DL_CreationInterface* creationInterface)
if (groupCode<=9 || if (groupCode<=9 ||
groupCode==100 || groupCode==102 || groupCode==105 || groupCode==100 || groupCode==102 || groupCode==105 ||
(groupCode>=300 && groupCode<=369) || (groupCode>=300 && groupCode<=369) ||
(groupCode>=1000 && groupCode<=1009)) (groupCode>=1000 && groupCode<=1009))
{ {
creationInterface->addXRecordString(static_cast<int>(groupCode), groupValue); creationInterface->addXRecordString(static_cast<int>(groupCode), groupValue);
@ -2272,7 +2274,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
default: default:
break; break;
} }
} }
@ -2581,7 +2583,7 @@ void DL_Dxf::writeHeader(DL_WriterA& dw) const
break; break;
case DL_Codes::AC1015: case DL_Codes::AC1015:
dw.dxfString(1, "AC1015"); dw.dxfString(1, "AC1015");
break; break;
case DL_Codes::AC1009_MIN: case DL_Codes::AC1009_MIN:
// minimalistic DXF version is unidentified in file: // minimalistic DXF version is unidentified in file:
break; break;
@ -3050,11 +3052,11 @@ void DL_Dxf::writeInsert(DL_WriterA& dw,
if (version==DL_VERSION_2000) if (version==DL_VERSION_2000)
{ {
dw.dxfString(100, "AcDbEntity"); dw.dxfString(100, "AcDbEntity");
if (data.cols!=1 || data.rows!=1) if (data.cols!=1 || data.rows!=1)
{ {
dw.dxfString(100, "AcDbMInsertBlock"); dw.dxfString(100, "AcDbMInsertBlock");
} }
else else
{ {
dw.dxfString(100, "AcDbBlockReference"); dw.dxfString(100, "AcDbBlockReference");
} }
@ -3992,7 +3994,7 @@ int DL_Dxf::writeImage(DL_WriterA& dw,
const DL_Attributes& attrib) const DL_Attributes& attrib)
{ {
/*if (data.file.empty()) /*if (data.file.empty())
{ {
std::cerr << "DL_Dxf::writeImage: " std::cerr << "DL_Dxf::writeImage: "
<< "Image file must not be empty\n"; << "Image file must not be empty\n";
@ -4055,7 +4057,7 @@ void DL_Dxf::writeImageDef(DL_WriterA& dw,
const DL_ImageData& data) const const DL_ImageData& data) const
{ {
/*if (data.file.empty()) /*if (data.file.empty())
{ {
std::cerr << "DL_Dxf::writeImage: " std::cerr << "DL_Dxf::writeImage: "
<< "Image file must not be empty\n"; << "Image file must not be empty\n";
@ -4065,7 +4067,7 @@ void DL_Dxf::writeImageDef(DL_WriterA& dw,
dw.dxfString(0, "IMAGEDEF"); dw.dxfString(0, "IMAGEDEF");
if (version==DL_VERSION_2000) if (version==DL_VERSION_2000)
{ {
dw.dxfHex(5, handle); dw.dxfHex(5, handle);
} }
if (version==DL_VERSION_2000) //-V581 if (version==DL_VERSION_2000) //-V581

View file

@ -53,8 +53,8 @@ VArc::VArc ()
* @param f1 start angle (degree). * @param f1 start angle (degree).
* @param f2 end angle (degree). * @param f2 end angle (degree).
*/ */
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2, VArc::VArc (const VPointF &center, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1,
QString formulaF2, quint32 idObject, Draw mode) qreal f2, const QString &formulaF2, quint32 idObject, Draw mode)
: VAbstractCurve(GOType::Arc, idObject, mode), : VAbstractCurve(GOType::Arc, idObject, mode),
d (new VArcData(center, radius, formulaRadius, f1, formulaF1, f2, formulaF2)) d (new VArcData(center, radius, formulaRadius, f1, formulaF1, f2, formulaF2))
{ {
@ -62,15 +62,15 @@ VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QStri
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VArc::VArc(VPointF center, qreal radius, qreal f1, qreal f2) VArc::VArc(const VPointF &center, qreal radius, qreal f1, qreal f2)
: VAbstractCurve(GOType::Arc, NULL_ID, Draw::Calculation), d (new VArcData(center, radius, f1, f2)) : VAbstractCurve(GOType::Arc, NULL_ID, Draw::Calculation), d (new VArcData(center, radius, f1, f2))
{ {
ArcName(); ArcName();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VArc::VArc(qreal length, QString formulaLength, VPointF center, qreal radius, QString formulaRadius, qreal f1, VArc::VArc(qreal length, const QString &formulaLength, const VPointF &center, qreal radius,
QString formulaF1, quint32 idObject, Draw mode) const QString &formulaRadius, qreal f1, const QString &formulaF1, quint32 idObject, Draw mode)
: VAbstractCurve(GOType::Arc, idObject, mode), : VAbstractCurve(GOType::Arc, idObject, mode),
d (new VArcData(formulaLength, center, radius, formulaRadius, f1, formulaF1)) d (new VArcData(formulaLength, center, radius, formulaRadius, f1, formulaF1))
{ {
@ -79,7 +79,7 @@ VArc::VArc(qreal length, QString formulaLength, VPointF center, qreal radius, QS
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VArc::VArc(qreal length, VPointF center, qreal radius, qreal f1) VArc::VArc(qreal length, const VPointF &center, qreal radius, qreal f1)
: VAbstractCurve(GOType::Arc, NULL_ID, Draw::Calculation), d (new VArcData(center, radius, f1)) : VAbstractCurve(GOType::Arc, NULL_ID, Draw::Calculation), d (new VArcData(center, radius, f1))
{ {
ArcName(); ArcName();

View file

@ -44,12 +44,12 @@ class VArc: public VAbstractCurve
Q_DECLARE_TR_FUNCTIONS(VArc) Q_DECLARE_TR_FUNCTIONS(VArc)
public: public:
VArc (); VArc ();
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2, VArc (const VPointF &center, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1,
QString formulaF2, quint32 idObject = 0, Draw mode = Draw::Calculation); qreal f2, const QString &formulaF2, quint32 idObject = 0, Draw mode = Draw::Calculation);
VArc (VPointF center, qreal radius, qreal f1, qreal f2); VArc (const VPointF &center, qreal radius, qreal f1, qreal f2);
VArc (qreal length, QString formulaLength, VPointF center, qreal radius, QString formulaRadius, qreal f1, VArc (qreal length, const QString &formulaLength, const VPointF &center, qreal radius, const QString &formulaRadius,
QString formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation); qreal f1, const QString &formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation);
VArc (qreal length, VPointF center, qreal radius, qreal f1); VArc (qreal length, const VPointF &center, qreal radius, qreal f1);
VArc(const VArc &arc); VArc(const VArc &arc);
VArc& operator= (const VArc &arc); VArc& operator= (const VArc &arc);
virtual ~VArc() Q_DECL_OVERRIDE; virtual ~VArc() Q_DECL_OVERRIDE;

View file

@ -47,23 +47,24 @@ public:
center(VPointF()), isFlipped(false), formulaLength() center(VPointF()), isFlipped(false), formulaLength()
{} {}
VArcData (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2, VArcData (const VPointF &center, qreal radius,const QString &formulaRadius, qreal f1, const QString &formulaF1,
QString formulaF2) qreal f2, const QString &formulaF2)
: f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius), formulaRadius(formulaRadius), : f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius), formulaRadius(formulaRadius),
center(center), isFlipped(false), formulaLength() center(center), isFlipped(false), formulaLength()
{} {}
VArcData(VPointF center, qreal radius, qreal f1, qreal f2) VArcData(const VPointF &center, qreal radius, qreal f1, qreal f2)
: f1(f1), formulaF1(QString("%1").arg(f1)), f2(f2), formulaF2(QString("%1").arg(f2)), radius(radius), : f1(f1), formulaF1(QString("%1").arg(f1)), f2(f2), formulaF2(QString("%1").arg(f2)), radius(radius),
formulaRadius(QString("%1").arg(radius)), center(center), isFlipped(false), formulaLength() formulaRadius(QString("%1").arg(radius)), center(center), isFlipped(false), formulaLength()
{} {}
VArcData (QString formulaLength, VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1 ) VArcData (const QString &formulaLength, const VPointF &center, qreal radius, const QString &formulaRadius, qreal f1,
QString formulaF1 )
: f1(f1), formulaF1(formulaF1), f2(0), formulaF2("0"), radius(radius), formulaRadius(formulaRadius), : f1(f1), formulaF1(formulaF1), f2(0), formulaF2("0"), radius(radius), formulaRadius(formulaRadius),
center(center), isFlipped(false), formulaLength(formulaLength) center(center), isFlipped(false), formulaLength(formulaLength)
{} {}
VArcData(VPointF center, qreal radius, qreal f1) VArcData(const VPointF &center, qreal radius, qreal f1)
: f1(f1), formulaF1(QString("%1").arg(f1)), f2(0), formulaF2("0"), radius(radius), : f1(f1), formulaF1(QString("%1").arg(f1)), f2(0), formulaF2("0"), radius(radius),
formulaRadius(QString("%1").arg(radius)), center(center), isFlipped(false), formulaLength() formulaRadius(QString("%1").arg(radius)), center(center), isFlipped(false), formulaLength()
{} {}

View file

@ -60,8 +60,8 @@ VSpline::VSpline ( const VSpline & spline )
* @param kAsm1 coefficient of length first control line. * @param kAsm1 coefficient of length first control line.
* @param kAsm2 coefficient of length second control line. * @param kAsm2 coefficient of length second control line.
*/ */
VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve, VSpline::VSpline (const VPointF &p1, const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2,
quint32 idObject, Draw mode) qreal kCurve, quint32 idObject, Draw mode)
:VAbstractCurve(GOType::Spline, idObject, mode), d(new VSplineData(p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve)) :VAbstractCurve(GOType::Spline, idObject, mode), d(new VSplineData(p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve))
{ {
CreateName(); CreateName();
@ -75,7 +75,8 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
* @param p3 second control point. * @param p3 second control point.
* @param p4 second point spline. * @param p4 second point spline.
*/ */
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Draw mode) VSpline::VSpline (const VPointF &p1, const QPointF &p2, const QPointF &p3, const VPointF &p4, qreal kCurve,
quint32 idObject, Draw mode)
:VAbstractCurve(GOType::Spline, idObject, mode), d(new VSplineData(p1, p2, p3, p4, kCurve)) :VAbstractCurve(GOType::Spline, idObject, mode), d(new VSplineData(p1, p2, p3, p4, kCurve))
{ {
CreateName(); CreateName();

View file

@ -47,10 +47,10 @@ class VSpline :public VAbstractCurve
public: public:
VSpline(); VSpline();
VSpline (const VSpline &spline ); VSpline (const VSpline &spline );
VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve, VSpline (const VPointF &p1, const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
quint32 idObject = 0, Draw mode = Draw::Calculation);
VSpline (const VPointF &p1, const QPointF &p2, const QPointF &p3, const VPointF &p4, qreal kCurve,
quint32 idObject = 0, Draw mode = Draw::Calculation); quint32 idObject = 0, Draw mode = Draw::Calculation);
VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject = 0,
Draw mode = Draw::Calculation);
virtual ~VSpline() Q_DECL_OVERRIDE; virtual ~VSpline() Q_DECL_OVERRIDE;
VSpline &operator=(const VSpline &spl); VSpline &operator=(const VSpline &spl);
VPointF GetP1 () const; VPointF GetP1 () const;

View file

@ -51,7 +51,8 @@ public:
angle2(spline.angle2), kAsm1(spline.kAsm1), kAsm2(spline.kAsm2), kCurve(spline.kCurve) angle2(spline.angle2), kAsm1(spline.kAsm1), kAsm2(spline.kAsm2), kCurve(spline.kCurve)
{} {}
VSplineData (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve) VSplineData (const VPointF &p1, const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2,
qreal kCurve)
:p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), :p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2),
kCurve(kCurve) kCurve(kCurve)
{ {
@ -68,7 +69,7 @@ public:
this->p3 = p4p3.p2(); this->p3 = p4p3.p2();
} }
VSplineData (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve) VSplineData (const VPointF &p1, const QPointF &p2, const QPointF &p3, const VPointF &p4, qreal kCurve)
:p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1), kCurve(1) :p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1), kCurve(1)
{ {
this->angle1 = QLineF ( this->p1.toQPointF(), this->p2 ).angle(); this->angle1 = QLineF ( this->p1.toQPointF(), this->p2 ).angle();

View file

@ -44,13 +44,13 @@ QString compilerString()
#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them
QString iccCompact; QString iccCompact;
#ifdef __INTEL_CLANG_COMPILER #ifdef __INTEL_CLANG_COMPILER
iccCompact = QLatin1Literal("Clang"); iccCompact = QLatin1String("Clang");
#elif defined(__INTEL_MS_COMPAT_LEVEL) #elif defined(__INTEL_MS_COMPAT_LEVEL)
iccCompact = QLatin1Literal("Microsoft"); iccCompact = QLatin1String("Microsoft");
#elif defined(__GNUC__) #elif defined(__GNUC__)
iccCompact = QLatin1Literal("GCC"); iccCompact = QLatin1String("GCC");
#else #else
iccCompact = QLatin1Literal("no"); iccCompact = QLatin1String("no");
#endif #endif
QString iccVersion; QString iccVersion;
if (__INTEL_COMPILER >= 1300) if (__INTEL_COMPILER >= 1300)
@ -88,8 +88,9 @@ QString compilerString()
{ {
return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15)); return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
} }
#else
return QStringLiteral("<unknown compiler>");
#endif #endif
return QLatin1String("<unknown compiler>");
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View file

@ -134,6 +134,7 @@ static point2d_t* point_alloc()
p = (point2d_t*)malloc(sizeof(point2d_t)); p = (point2d_t*)malloc(sizeof(point2d_t));
assert( p != NULL ); assert( p != NULL );
// cppcheck-suppress memsetClassFloat
memset(p, 0, sizeof(point2d_t)); memset(p, 0, sizeof(point2d_t));
return p; return p;