From 4d90589f018553057b07f492a0ce247014ba262d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 19 Oct 2015 16:21:06 +0300 Subject: [PATCH] Clang warnings. --HG-- branch : develop --- common.pri | 3 +- src/app/tape/mapplication.cpp | 9 + src/app/tape/tape.pro | 18 +- src/app/tape/tmainwindow.cpp | 9 + src/app/valentina/core/vcmdexport.cpp | 4 +- .../dialogs/dialoglayoutsettings.cpp | 4 +- src/app/valentina/mainwindow.cpp | 2 +- src/app/valentina/valentina.pro | 26 +- src/app/valentina/xml/vpattern.cpp | 4 +- src/libs/ifc/ifc.pro | 3 +- src/libs/vdxf/dxflib/dl_creationadapter.h | 5 +- src/libs/vdxf/dxflib/dl_creationinterface.h | 11 +- src/libs/vdxf/dxflib/dl_dxf.cpp | 105 ++- src/libs/vdxf/dxflib/dl_entities.h | 40 +- src/libs/vdxf/dxflib/dl_extrusion.h | 21 +- src/libs/vdxf/dxflib/dl_writer.cpp | 638 +++++++++++++++++ src/libs/vdxf/dxflib/dl_writer.h | 650 ++---------------- src/libs/vdxf/dxflib/dl_writer_ascii.cpp | 4 +- src/libs/vdxf/dxflib/dl_writer_ascii.h | 13 +- src/libs/vdxf/vdxf.pri | 3 +- src/libs/vformat/vmeasurements.cpp | 12 +- src/libs/vlayout/vlayout.pro | 22 +- src/libs/vlayout/vposter.cpp | 37 +- src/libs/vobj/vobjengine.cpp | 2 +- src/libs/vpatterndb/calculator.cpp | 1 - src/libs/vpatterndb/variables/vincrement.cpp | 1 - .../vpatterndb/variables/vmeasurement.cpp | 2 +- src/libs/vpatterndb/vcontainer.cpp | 9 + src/libs/vtools/dialogs/tools/dialogtool.cpp | 1 - .../toolsinglepoint/vtoolsinglepoint.cpp | 11 +- src/libs/vtools/vtools.pro | 5 + src/libs/vwidgets/vwidgets.pro | 5 + src/test/ValentinaTest/ValentinaTest.pro | 3 +- 33 files changed, 923 insertions(+), 760 deletions(-) create mode 100644 src/libs/vdxf/dxflib/dl_writer.cpp diff --git a/common.pri b/common.pri index d4ee7e96a..70407853d 100644 --- a/common.pri +++ b/common.pri @@ -288,7 +288,7 @@ CLANG_DEBUG_CXXFLAGS += \ -Wdeprecated-register \ -Wdeprecated-writable-strings \ -Wdirect-ivar-access \ - -Wdisabled-macro-expansion \ +# -Wdisabled-macro-expansion \ Disabled -Wdisabled-optimization \ -Wdiscard-qual \ -Wdistributed-object-modifiers \ @@ -414,6 +414,7 @@ CLANG_DEBUG_CXXFLAGS += \ -Wnon-virtual-dtor \ -Wnonnull \ -Wnonportable-cfstrings \ + -Wno-c++98-compat \ -WNSObject-attribute \ -Wnull-arithmetic \ -Wnull-character \ diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 3951dc374..ba0e81df3 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -51,8 +51,17 @@ #include #include +#ifdef Q_CC_CLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmissing-prototypes" +#endif + Q_LOGGING_CATEGORY(mApp, "m.application") +#ifdef Q_CC_CLANG + #pragma clang diagnostic pop +#endif + #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) # include "../vmisc/backport/qcommandlineparser.h" #else diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 3773686b4..b5a17091b 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -93,12 +93,18 @@ CONFIG(debug, debug|release){ } } clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast \ + -Wmissing-prototypes # rcc folder } } else { *-g++{ diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 395c1d98d..16b91b983 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -53,8 +53,17 @@ #define DIALOG_MAX_FORMULA_HEIGHT 64 +#ifdef Q_CC_CLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmissing-prototypes" +#endif + Q_LOGGING_CATEGORY(tMainWindow, "t.mainwindow") +#ifdef Q_CC_CLANG + #pragma clang diagnostic pop +#endif + // We need this enum in case we will add or delete a column. And also make code more readable. enum {ColumnName = 0, ColumnFullName, ColumnCalcValue, ColumnFormula, ColumnBaseValue, ColumnInSizes, ColumnInHeights}; diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 6968da47a..a0bbb3d84 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -309,12 +309,12 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const if (parser.isSet(*optionsUsed.value(LONG_OPTION_SHIFTLENGTH))) { - diag.SetShift(Lo2Px(parser.value(*optionsUsed.value(LONG_OPTION_SHIFTLENGTH)), diag)); + diag.SetShift(static_cast(Lo2Px(parser.value(*optionsUsed.value(LONG_OPTION_SHIFTLENGTH)), diag))); } if (parser.isSet(*optionsUsed.value(LONG_OPTION_GAPWIDTH))) { - diag.SetLayoutWidth(Lo2Px(parser.value(*optionsUsed.value(LONG_OPTION_GAPWIDTH)), diag)); + diag.SetLayoutWidth(static_cast(Lo2Px(parser.value(*optionsUsed.value(LONG_OPTION_GAPWIDTH)), diag))); } diag.SetAutoCrop(parser.isSet(*optionsUsed.value(LONG_OPTION_CROP))); diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index 64a7a5445..5990dab8f 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -316,13 +316,13 @@ bool DialogLayoutSettings::SelectLayoutUnit(const QString &units) //--------------------------------------------------------------------------------------------------------------------- int DialogLayoutSettings::LayoutToPixels(qreal value) const { - return static_cast(qFloor(UnitConvertor(value, LayoutUnit(), Unit::Px))); + return qFloor(UnitConvertor(value, LayoutUnit(), Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- int DialogLayoutSettings::PageToPixels(qreal value) const { - return static_cast(qFloor(UnitConvertor(value, PaperUnit(), Unit::Px))); + return qFloor(UnitConvertor(value, PaperUnit(), Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 7d08d4337..5f62847cf 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3707,7 +3707,7 @@ void MainWindow::DoExport(const VCommandLinePtr &expParams) { DialogSaveLayout dialog(scenes.size(), expParams->OptBaseName(), this); dialog.SetDestinationPath(expParams->OptDestinationPath()); - dialog.SelectFormate(expParams->OptExportType()); + dialog.SelectFormate(static_cast(expParams->OptExportType())); ExportLayout(dialog); } catch (const VException &e) diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index a75a7fc91..72fde4229 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -92,20 +92,20 @@ CONFIG(debug, debug|release){ } } clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${UI_DIR}" \ - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${UI_DIR}" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + -isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes \ - -Wundefined-reinterpret-cast - } + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wmissing-prototypes \ + -Wundefined-reinterpret-cast + } } else { *-g++{ QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 8da18b930..67bcbe8df 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -2052,6 +2052,7 @@ qreal VPattern::EvalFormula(VContainer *data, const QString &formula, bool *ok) } catch (qmu::QmuParserError &e) { + Q_UNUSED(e) *ok = false; return 0; } @@ -2247,7 +2248,8 @@ void VPattern::ParseIncrementsElement(const QDomNode &node) bool ok = false; const qreal value = EvalFormula(data, formula, &ok); - data->AddVariable(name, new VIncrement(data, name, index, value, formula, ok, desc)); + data->AddVariable(name, new VIncrement(data, name, static_cast(index), value, formula, ok, + desc)); ++index; } } diff --git a/src/libs/ifc/ifc.pro b/src/libs/ifc/ifc.pro index 4d0030ebc..2de44c6ac 100644 --- a/src/libs/ifc/ifc.pro +++ b/src/libs/ifc/ifc.pro @@ -82,7 +82,8 @@ CONFIG(debug, debug|release){ # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and # want them in global list. Compromise decision delete them from local list. QMAKE_CXXFLAGS -= \ - -Wmissing-prototypes + -Wmissing-prototypes \ + -Wundefined-reinterpret-cast } } else { *-g++{ diff --git a/src/libs/vdxf/dxflib/dl_creationadapter.h b/src/libs/vdxf/dxflib/dl_creationadapter.h index 8efe738e6..3724303d0 100644 --- a/src/libs/vdxf/dxflib/dl_creationadapter.h +++ b/src/libs/vdxf/dxflib/dl_creationadapter.h @@ -40,7 +40,7 @@ class DXFLIB_EXPORT DL_CreationAdapter : public DL_CreationInterface { public: DL_CreationAdapter() {} - virtual ~DL_CreationAdapter() {} + virtual ~DL_CreationAdapter(); virtual void processCodeValuePair(unsigned int, const std::string&) {} virtual void endSection() {} virtual void addLayer(const DL_LayerData&) {} @@ -135,4 +135,7 @@ public: virtual void endSequence() {} }; +DL_CreationAdapter::~DL_CreationAdapter() +{} + #endif diff --git a/src/libs/vdxf/dxflib/dl_creationinterface.h b/src/libs/vdxf/dxflib/dl_creationinterface.h index 67590e97f..72f506b18 100644 --- a/src/libs/vdxf/dxflib/dl_creationinterface.h +++ b/src/libs/vdxf/dxflib/dl_creationinterface.h @@ -50,10 +50,8 @@ public: DL_CreationInterface() : extrusion(new DL_Extrusion), attributes() { } - virtual ~DL_CreationInterface() - { - delete extrusion; - } + + virtual ~DL_CreationInterface(); /** * Called for every code / value tuple of the DXF file. The complete DXF file @@ -372,4 +370,9 @@ protected: DL_Attributes attributes; }; +DL_CreationInterface::~DL_CreationInterface() +{ + delete extrusion; +} + #endif diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp index a6a00fbfc..80d09042a 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.cpp +++ b/src/libs/vdxf/dxflib/dl_dxf.cpp @@ -196,7 +196,7 @@ bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface) groupCode = static_cast(toInt(groupCodeTmp)); creationInterface->processCodeValuePair(groupCode, groupValue); - processDXFGroup(creationInterface, groupCode, groupValue); + processDXFGroup(creationInterface, static_cast(groupCode), groupValue); } return !feof(fp); @@ -216,7 +216,7 @@ bool DL_Dxf::readDxfGroups(std::stringstream& stream, { groupCode = static_cast(toInt(groupCodeTmp)); - processDXFGroup(creationInterface, groupCode, groupValue); + processDXFGroup(creationInterface, static_cast(groupCode), groupValue); } return !stream.eof(); } @@ -249,7 +249,7 @@ bool DL_Dxf::getStrippedLine(std::string& s, unsigned int size, FILE *fp) // Only the useful part of the line char* line; - line = fgets(wholeLine, size, fp); + line = fgets(wholeLine, static_cast(size), fp); if (line!=NULL && line[0] != '\0') // Evaluates to fgets() retval { @@ -288,7 +288,7 @@ bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size, // Only the useful part of the line char* line = new char[size+1]; char* oriLine = line; - stream.getline(line, size); + stream.getline(line, static_cast(size)); stripWhiteSpace(&line); s = line; assert(size > s.length()); @@ -1497,28 +1497,32 @@ bool DL_Dxf::handleXRecordData(DL_CreationInterface* creationInterface) (groupCode>=1000 && groupCode<=1009)) { - creationInterface->addXRecordString(groupCode, groupValue); + creationInterface->addXRecordString(static_cast(groupCode), groupValue); return true; } // int: - else if ((groupCode>=60 && groupCode<=99) || (groupCode>=160 && groupCode<=179) || (groupCode>=270 && groupCode<=289)) + else if ((groupCode>=60 && groupCode<=99) || + (groupCode>=160 && groupCode<=179) || + (groupCode>=270 && groupCode<=289)) { - creationInterface->addXRecordInt(groupCode, toInt(groupValue)); + creationInterface->addXRecordInt(static_cast(groupCode), toInt(groupValue)); return true; } // bool: else if (groupCode>=290 && groupCode<=299) { - creationInterface->addXRecordBool(groupCode, toBool(groupValue)); + creationInterface->addXRecordBool(static_cast(groupCode), toBool(groupValue)); return true; } // double: - else if ((groupCode>=10 && groupCode<=59) || (groupCode>=110 && groupCode<=149) || (groupCode>=210 && groupCode<=239)) + else if ((groupCode>=10 && groupCode<=59) || + (groupCode>=110 && groupCode<=149) || + (groupCode>=210 && groupCode<=239)) { - creationInterface->addXRecordReal(groupCode, toReal(groupValue)); + creationInterface->addXRecordReal(static_cast(groupCode), toReal(groupValue)); return true; } @@ -1563,22 +1567,22 @@ bool DL_Dxf::handleXData(DL_CreationInterface* creationInterface) } else if (groupCode>=1000 && groupCode<=1009) { - creationInterface->addXDataString(groupCode, groupValue); + creationInterface->addXDataString(static_cast(groupCode), groupValue); return true; } else if (groupCode>=1010 && groupCode<=1059) { - creationInterface->addXDataReal(groupCode, toReal(groupValue)); + creationInterface->addXDataReal(static_cast(groupCode), toReal(groupValue)); return true; } else if (groupCode>=1060 && groupCode<=1070) { - creationInterface->addXDataInt(groupCode, toInt(groupValue)); + creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue)); return true; } else if (groupCode==1071) { - creationInterface->addXDataInt(groupCode, toInt(groupValue)); + creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue)); return true; } @@ -1644,7 +1648,7 @@ bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/) { if (vertexIndex>=0 && vertexIndex(vertexIndex) + (groupCode/10-1)] = toReal(groupValue); } } else if (groupCode==42 && vertexIndex=0 && controlPointIndex(controlPointIndex) + (groupCode/10-1)] = toReal(groupValue); } return true; } @@ -1772,7 +1776,7 @@ bool DL_Dxf::handleSplineData(DL_CreationInterface* /*creationInterface*/) if (fitPointIndex>=0 && fitPointIndex(fitPointIndex) + ((groupCode-1)/10-1)] = toReal(groupValue); } return true; } @@ -1838,7 +1842,7 @@ bool DL_Dxf::handleLeaderData(DL_CreationInterface* /*creationInterface*/) if (leaderVertexIndex>=0 && leaderVertexIndex(leaderVertexIndex) + (groupCode/10-1)] = toReal(groupValue); } } @@ -2177,7 +2181,7 @@ void DL_Dxf::addHatch(DL_CreationInterface* creationInterface) for (unsigned int i=0; iaddHatchLoop(DL_HatchLoopData(static_cast(hatchEdges[i].size()))); + creationInterface->addHatchLoop(DL_HatchLoopData(static_cast(hatchEdges[i].size()))); for (unsigned int k=0; kaddHatchEdge(DL_HatchEdgeData(hatchEdges[i][k])); @@ -2373,7 +2377,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface) switch (groupCode) { case 94: - hatchEdge.degree = toInt(groupValue); + hatchEdge.degree = static_cast(toInt(groupValue)); return true; case 73: hatchEdge.rational = toBool(groupValue); @@ -2382,13 +2386,13 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface) hatchEdge.periodic = toBool(groupValue); return true; case 95: - hatchEdge.nKnots = toInt(groupValue); + hatchEdge.nKnots = static_cast(toInt(groupValue)); return true; case 96: - hatchEdge.nControl = toInt(groupValue); + hatchEdge.nControl = static_cast(toInt(groupValue)); return true; case 97: - hatchEdge.nFit = toInt(groupValue); + hatchEdge.nFit = static_cast(toInt(groupValue)); return true; case 40: if (hatchEdge.knots.size() < hatchEdge.nKnots) @@ -2761,7 +2765,6 @@ void DL_Dxf::writePolyline(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data from the file - * @param attrib Attributes */ void DL_Dxf::writeVertex(DL_WriterA& dw, const DL_VertexData& data) @@ -2829,10 +2832,10 @@ void DL_Dxf::writeSpline(DL_WriterA& dw, dw.dxfString(100, "AcDbSpline"); } dw.dxfInt(70, data.flags); - dw.dxfInt(71, data.degree); - dw.dxfInt(72, data.nKnots); // number of knots - dw.dxfInt(73, data.nControl); // number of control points - dw.dxfInt(74, data.nFit); // number of fit points + dw.dxfInt(71, static_cast(data.degree)); + dw.dxfInt(72, static_cast(data.nKnots)); // number of knots + dw.dxfInt(73, static_cast(data.nControl)); // number of control points + dw.dxfInt(74, static_cast(data.nFit)); // number of fit points } @@ -2842,7 +2845,6 @@ void DL_Dxf::writeSpline(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data from the file - * @param attrib Attributes */ void DL_Dxf::writeControlPoint(DL_WriterA& dw, const DL_ControlPointData& data) @@ -2860,7 +2862,6 @@ void DL_Dxf::writeControlPoint(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data from the file - * @param attrib Attributes */ void DL_Dxf::writeFitPoint(DL_WriterA& dw, const DL_FitPointData& data) @@ -2878,7 +2879,6 @@ void DL_Dxf::writeFitPoint(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data from the file - * @param attrib Attributes */ void DL_Dxf::writeKnot(DL_WriterA& dw, const DL_KnotData& data) @@ -3264,7 +3264,7 @@ void DL_Dxf::writeDimStyleOverrides(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific aligned dimension data from the file + * @param edata Specific aligned dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimAligned(DL_WriterA& dw, @@ -3330,7 +3330,7 @@ void DL_Dxf::writeDimAligned(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific linear dimension data from the file + * @param edata Specific linear dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimLinear(DL_WriterA& dw, @@ -3403,7 +3403,7 @@ void DL_Dxf::writeDimLinear(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific radial dimension data from the file + * @param edata Specific radial dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimRadial(DL_WriterA& dw, @@ -3467,7 +3467,7 @@ void DL_Dxf::writeDimRadial(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific diametric dimension data from the file + * @param edata Specific diametric dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimDiametric(DL_WriterA& dw, @@ -3531,7 +3531,7 @@ void DL_Dxf::writeDimDiametric(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific angular dimension data from the file + * @param edata Specific angular dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimAngular(DL_WriterA& dw, @@ -3603,7 +3603,7 @@ void DL_Dxf::writeDimAngular(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific angular dimension data from the file + * @param edata Specific angular dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimAngular3P(DL_WriterA& dw, @@ -3672,7 +3672,7 @@ void DL_Dxf::writeDimAngular3P(DL_WriterA& dw, * * @param dw DXF writer * @param data Generic dimension data for from the file - * @param data Specific ordinate dimension data from the file + * @param edata Specific ordinate dimension data from the file * @param attrib Attributes */ void DL_Dxf::writeDimOrdinate(DL_WriterA& dw, @@ -3839,9 +3839,11 @@ void DL_Dxf::writeHatch1(DL_WriterA& dw, */ void DL_Dxf::writeHatch2(DL_WriterA& dw, const DL_HatchData& data, - const DL_Attributes& /*attrib*/) const + const DL_Attributes& attrib) const { + Q_UNUSED(attrib); + dw.dxfInt(75, 0); // odd parity dw.dxfInt(76, 1); // pattern type if (data.solid==false) @@ -3877,7 +3879,6 @@ void DL_Dxf::writeHatch2(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data. - * @param attrib Attributes */ void DL_Dxf::writeHatchLoop1(DL_WriterA& dw, const DL_HatchLoopData& data) @@ -3895,12 +3896,11 @@ void DL_Dxf::writeHatchLoop1(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data. - * @param attrib Attributes */ void DL_Dxf::writeHatchLoop2(DL_WriterA& dw, - const DL_HatchLoopData& /*data*/) + const DL_HatchLoopData& data) { - + Q_UNUSED(data); dw.dxfInt(97, 0); } @@ -3910,7 +3910,6 @@ void DL_Dxf::writeHatchLoop2(DL_WriterA& dw, * * @param dw DXF writer * @param data Entity data. - * @param attrib Attributes */ void DL_Dxf::writeHatchEdge(DL_WriterA& dw, const DL_HatchEdgeData& data) @@ -3957,11 +3956,11 @@ void DL_Dxf::writeHatchEdge(DL_WriterA& dw, // spline: case 4: - dw.dxfInt(94, data.degree); + dw.dxfInt(94, static_cast(data.degree)); dw.dxfBool(73, data.rational); dw.dxfBool(74, data.periodic); - dw.dxfInt(95, data.nKnots); - dw.dxfInt(96, data.nControl); + dw.dxfInt(95, static_cast(data.nKnots)); + dw.dxfInt(96, static_cast(data.nControl)); for (unsigned int i=0; i0) { - dw.dxfInt(97, data.nFit); + dw.dxfInt(97, static_cast(data.nFit)); for (unsigned int i=0; i(i); idx++; } } @@ -5827,12 +5826,12 @@ int DL_Dxf::getLibVersion(const std::string& str) std::string v[4]; - v[0] = str.substr(0, d[0]); - v[1] = str.substr(d[0]+1, d[1]-d[0]-1); - v[2] = str.substr(d[1]+1, d[2]-d[1]-1); + v[0] = str.substr(0, static_cast(d[0])); + v[1] = str.substr(static_cast(d[0]+1), static_cast(d[1]-d[0]-1)); + v[2] = str.substr(static_cast(d[1]+1), static_cast(d[2]-d[1]-1)); if (idx>=3) { - v[3] = str.substr(d[2]+1, d[3]-d[2]-1); + v[3] = str.substr(static_cast(d[2]+1), static_cast(d[3]-d[2]-1)); } else { diff --git a/src/libs/vdxf/dxflib/dl_entities.h b/src/libs/vdxf/dxflib/dl_entities.h index 4ff6c270c..4eb698d9c 100644 --- a/src/libs/vdxf/dxflib/dl_entities.h +++ b/src/libs/vdxf/dxflib/dl_entities.h @@ -390,7 +390,9 @@ struct DXFLIB_EXPORT DL_PolylineData * Parameters: see member variables. */ DL_PolylineData(int pNumber, int pMVerteces, int pNVerteces, int pFlags) - : number(pNumber), m(pMVerteces), n(pNVerteces), flags(pFlags) + : number(static_cast(pNumber)), + m(static_cast(pMVerteces)), + n(static_cast(pNVerteces)), flags(pFlags) { } @@ -519,10 +521,10 @@ struct DXFLIB_EXPORT DL_SplineData int nControl, int nFit, int flags) : - degree(degree), - nKnots(nKnots), - nControl(nControl), - nFit(nFit), + degree(static_cast(degree)), + nKnots(static_cast(nKnots)), + nControl(static_cast(nControl)), + nFit(static_cast(nFit)), flags(flags), tangentStartX(0.0), tangentStartY(0.0), @@ -837,10 +839,22 @@ struct DXFLIB_EXPORT DL_TextData text(text), style(style), angle(angle) - { - } + {} - virtual ~DL_TextData(){} + ~DL_TextData() + {} + + DL_TextData(const DL_TextData &data) + :ipx(data.ipx), ipy(data.ipy), ipz(data.ipz), + apx(data.apx), apy(data.apy), apz(data.apz), + height(data.height), xScaleFactor(data.xScaleFactor), + textGenerationFlags(data.textGenerationFlags), + hJustification(data.hJustification), + vJustification(data.vJustification), + text(data.text), + style(data.style), + angle(data.angle) + {} /*! X Coordinate of insertion point. */ double ipx; @@ -892,8 +906,7 @@ struct DXFLIB_EXPORT DL_AttributeData : public DL_TextData { DL_AttributeData(const DL_TextData& tData, const std::string& tag) : DL_TextData(tData), tag(tag) - { - } + {} /** * Constructor. @@ -919,14 +932,15 @@ struct DXFLIB_EXPORT DL_AttributeData : public DL_TextData style, angle), tag(tag) - { - } + {} + + ~DL_AttributeData() + {} /*! Tag. */ std::string tag; }; - /** * Generic Dimension Data. */ diff --git a/src/libs/vdxf/dxflib/dl_extrusion.h b/src/libs/vdxf/dxflib/dl_extrusion.h index c96886474..718e04def 100644 --- a/src/libs/vdxf/dxflib/dl_extrusion.h +++ b/src/libs/vdxf/dxflib/dl_extrusion.h @@ -65,12 +65,7 @@ public: } /** - * Constructor for DXF extrusion. - * - * @param direction Vector of axis along which the entity shall be extruded - * this is also the Z axis of the Entity coordinate system - * @param elevation Distance of the entities XY plane from the origin of the - * world coordinate system + * @brief DL_Extrusion Constructor for DXF extrusion. */ DL_Extrusion(double dx, double dy, double dz, double elevation) : direction(new double[3]), elevation(elevation) @@ -81,7 +76,7 @@ public: /** - * Sets the direction vector. + * @brief setDirection Sets the direction vector. */ void setDirection(double dx, double dy, double dz) { @@ -100,11 +95,6 @@ public: return direction; } - - - /** - * @return direction vector. - */ void getDirection(double dir[]) const { dir[0]=direction[0]; @@ -152,7 +142,14 @@ public: private: + /** + * @brief direction Vector of axis along which the entity shall be extruded this is also the Z axis of the Entity + * coordinate system + */ double *direction; + /** + * @brief elevation Distance of the entities XY plane from the origin of the world coordinate system + */ double elevation; }; diff --git a/src/libs/vdxf/dxflib/dl_writer.cpp b/src/libs/vdxf/dxflib/dl_writer.cpp new file mode 100644 index 000000000..68df5a23b --- /dev/null +++ b/src/libs/vdxf/dxflib/dl_writer.cpp @@ -0,0 +1,638 @@ +/**************************************************************************** + ** Copyright (C) 2015 Roman Telezhynskyi + ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. + ** Copyright (C) 2001 Robert J. Campbell Jr. + ** + ** This file is part of the dxflib project. + ** + ** This file is free software; you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation; either version 2 of the License, or + ** (at your option) any later version. + ** + ** Licensees holding valid dxflib Professional Edition licenses may use + ** this file in accordance with the dxflib Commercial License + ** Agreement provided with the Software. + ** + ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** +**********************************************************************/ + +#include "dl_writer.h" + +/** + * @param version DXF version. Defaults to DL_VERSION_2002. + */ +DL_Writer::DL_Writer(DL_Codes::version version) + : m_handle(0x30), modelSpaceHandle(0), paperSpaceHandle(0), paperSpace0Handle(0), version(version) +{} + +DL_Writer::~DL_Writer() +{} + +/** Generic section for section 'name'. + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  name
+ * 
+ */ +void DL_Writer::section(const char *name) const +{ + dxfString(0, "SECTION"); + dxfString(2, name); +} + +/** + * Section HEADER + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  HEADER
+ * 
+ */ +void DL_Writer::sectionHeader() const +{ + section("HEADER"); +} + +/** + * Section TABLES + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  TABLES
+ * 
+ */ +void DL_Writer::sectionTables() const +{ + section("TABLES"); +} + +/** + * Section BLOCKS + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  BLOCKS
+ * 
+ */ +void DL_Writer::sectionBlocks() const +{ + section("BLOCKS"); +} + +/** + * Section ENTITIES + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  ENTITIES
+ * 
+ */ +void DL_Writer::sectionEntities() const +{ + section("ENTITIES"); +} + +/** + * Section CLASSES + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  CLASSES
+ * 
+ */ +void DL_Writer::sectionClasses() const +{ + section("CLASSES"); +} + +/** + * Section OBJECTS + * + *
+ *   0
+ *  SECTION
+ *   2
+ *  OBJECTS
+ * 
+ */ +void DL_Writer::sectionObjects() const +{ + section("OBJECTS"); +} + +/** + * End of a section. + * + *
+ *   0
+ *  ENDSEC
+ * 
+ */ +void DL_Writer::sectionEnd() const +{ + dxfString(0, "ENDSEC"); +} + +/** + * Generic table for table 'name' with 'num' entries: + * + *
+ *   0
+ *  TABLE
+ *   2
+ *  name
+ *  70
+ *   num
+ * 
+ */ +void DL_Writer::table(const char *name, int num, int h) const +{ + dxfString(0, "TABLE"); + dxfString(2, name); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, h); + } + dxfString(100, "AcDbSymbolTable"); + } + dxfInt(70, num); +} + +/** Table for layers. + * + * @param num Number of layers in total. + * + *
+ *   0
+ *  TABLE
+ *   2
+ *  LAYER
+ *   70
+ *      num
+ * 
+ */ +void DL_Writer::tableLayers(int num) const +{ + table("LAYER", num, 2); +} + +/** Table for line types. + * + * @param num Number of line types in total. + * + *
+ *   0
+ *  TABLE
+ *   2
+ *  LTYPE
+ *   70
+ *      num
+ * 
+ */ +void DL_Writer::tableLinetypes(int num) const +{ + //linetypeHandle = 5; + table("LTYPE", num, 5); +} + +/** Table for application id. + * + * @param num Number of registered applications in total. + * + *
+ *   0
+ *  TABLE
+ *   2
+ *  APPID
+ *   70
+ *      num
+ * 
+ */ +void DL_Writer::tableAppid(int num) const +{ + table("APPID", num, 9); +} + +/** Table for text style. + * + * @param num Number of text styles. + * + *
+ *   0
+ *  TABLE
+ *   2
+ *  STYLE
+ *   70
+ *      num
+ * 
+ */ +void DL_Writer::tableStyle(int num) const +{ + table("STYLE", num, 3); +} + +/** + * End of a table. + * + *
+ *   0
+ *  ENDTAB
+ * 
+ */ +void DL_Writer::tableEnd() const +{ + dxfString(0, "ENDTAB"); +} + +/** + * End of the DXF file. + * + *
+ *   0
+ *  EOF
+ * 
+ */ +void DL_Writer::dxfEOF() const +{ + dxfString(0, "EOF"); +} + +/** + * Comment. + * + *
+ *  999
+ *  text
+ * 
+ */ +void DL_Writer::comment(const char *text) const +{ + dxfString(999, text); +} + +/** + * Entity. + * + *
+ *   0
+ *  entTypeName
+ * 
+ * + */ +void DL_Writer::entity(const char *entTypeName) const +{ + dxfString(0, entTypeName); + if (version>=DL_VERSION_2000) + { + handle(); + } +} + +/** + * Attributes of an entity. + * + *
+ *   8
+ *  layer
+ *  62
+ *  color
+ *  39
+ *  width
+ *   6
+ *  linetype
+ * 
+ */ +void DL_Writer::entityAttributes(const DL_Attributes &attrib) const +{ + + // layer name: + dxfString(8, attrib.getLayer()); + + // R12 doesn't accept BYLAYER values. The value has to be missing + // in that case. + if (version>=DL_VERSION_2000 || attrib.getColor()!=256) + { + dxfInt(62, attrib.getColor()); + } + if (version>=DL_VERSION_2000 && attrib.getColor24()!=-1) + { + dxfInt(420, attrib.getColor24()); + } + if (version>=DL_VERSION_2000) + { + dxfInt(370, attrib.getWidth()); + } + if (version>=DL_VERSION_2000) + { + dxfReal(48, attrib.getLinetypeScale()); + } + std::string linetype = attrib.getLinetype(); + std::transform(linetype.begin(), linetype.end(), linetype.begin(), ::toupper); + if (version>=DL_VERSION_2000 || linetype=="BYLAYER") + { + dxfString(6, attrib.getLinetype()); + } +} + +/** + * Subclass. + */ +void DL_Writer::subClass(const char *sub) const +{ + dxfString(100, sub); +} + +/** + * Layer (must be in the TABLES section LAYER). + * + *
+ *   0
+ *  LAYER
+ * 
+ */ +void DL_Writer::tableLayerEntry(unsigned long h) const +{ + dxfString(0, "LAYER"); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, static_cast(h)); + } + dxfString(100, "AcDbSymbolTableRecord"); + dxfString(100, "AcDbLayerTableRecord"); + } +} + +/** + * Line type (must be in the TABLES section LTYPE). + * + *
+ *   0
+ *  LTYPE
+ * 
+ */ +void DL_Writer::tableLinetypeEntry(unsigned long h) const +{ + dxfString(0, "LTYPE"); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, static_cast(h)); + } + //dxfHex(330, 0x5); + dxfString(100, "AcDbSymbolTableRecord"); + dxfString(100, "AcDbLinetypeTableRecord"); + } +} + +/** + * Appid (must be in the TABLES section APPID). + * + *
+ *   0
+ *  APPID
+ * 
+ */ +void DL_Writer::tableAppidEntry(unsigned long h) const +{ + dxfString(0, "APPID"); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, static_cast(h)); + } + //dxfHex(330, 0x9); + dxfString(100, "AcDbSymbolTableRecord"); + dxfString(100, "AcDbRegAppTableRecord"); + } +} + +/** + * Block (must be in the section BLOCKS). + * + *
+ *   0
+ *  BLOCK
+ * 
+ */ +void DL_Writer::sectionBlockEntry(unsigned long h) const +{ + dxfString(0, "BLOCK"); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, static_cast(h)); + } + //dxfHex(330, blockHandle); + dxfString(100, "AcDbEntity"); + if (h==0x1C) + { + dxfInt(67, 1); + } + dxfString(8, "0"); // TODO: Layer for block + dxfString(100, "AcDbBlockBegin"); + } +} + +/** + * End of Block (must be in the section BLOCKS). + * + *
+ *   0
+ *  ENDBLK
+ * 
+ */ +void DL_Writer::sectionBlockEntryEnd(unsigned long h) const +{ + dxfString(0, "ENDBLK"); + if (version>=DL_VERSION_2000) + { + if (h==0) + { + handle(); + } + else + { + dxfHex(5, static_cast(h)); + } + //dxfHex(330, blockHandle); + dxfString(100, "AcDbEntity"); + if (h==0x1D) + { + dxfInt(67, 1); + } + dxfString(8, "0"); // TODO: Layer for block + dxfString(100, "AcDbBlockEnd"); + } +} + +void DL_Writer::color(int col) const +{ + dxfInt(62, col); +} + +void DL_Writer::linetype(const char *lt) const +{ + dxfString(6, lt); +} + +void DL_Writer::linetypeScale(double scale) const +{ + dxfReal(48, scale); +} + +void DL_Writer::lineWeight(int lw) const +{ + dxfInt(370, lw); +} + +void DL_Writer::coord(int gc, double x, double y, double z) const +{ + dxfReal(gc, x); + dxfReal(gc+10, y); + dxfReal(gc+20, z); +} + +void DL_Writer::coordTriplet(int gc, const double *value) const +{ + if (value) + { + dxfReal(gc, *value++); + dxfReal(gc+10, *value++); + dxfReal(gc+20, *value++); + } +} + +void DL_Writer::resetHandle() const +{ + m_handle = 1; +} + +/** + * Writes a unique handle and returns it. + */ +unsigned long DL_Writer::handle(int gc) const +{ + // handle has to be hex + dxfHex(gc, static_cast(m_handle)); + return m_handle++; +} + +/** + * @return Next handle that will be written. + */ +unsigned long DL_Writer::getNextHandle() const +{ + return m_handle; +} + +/** + * Increases handle, so that the handle returned remains available. + */ +unsigned long DL_Writer::incHandle() const +{ + return m_handle++; +} + +/** + * Sets the handle of the model space. Entities refer to + * this handle. + */ +void DL_Writer::setModelSpaceHandle(unsigned long h) const +{ + modelSpaceHandle = h; +} + +unsigned long DL_Writer::getModelSpaceHandle() const +{ + return modelSpaceHandle; +} + +/** + * Sets the handle of the paper space. Some special blocks refer to + * this handle. + */ +void DL_Writer::setPaperSpaceHandle(unsigned long h) const +{ + paperSpaceHandle = h; +} + +unsigned long DL_Writer::getPaperSpaceHandle() const +{ + return paperSpaceHandle; +} + +/** + * Sets the handle of the paper space 0. Some special blocks refer to + * this handle. + */ +void DL_Writer::setPaperSpace0Handle(unsigned long h) const +{ + paperSpace0Handle = h; +} + +/** + * Sets the handle of the paper space 0. Some special blocks refer to + * this handle. + */ +unsigned long DL_Writer::getPaperSpace0Handle() const +{ + return paperSpace0Handle; +} + +/** + * Can be overwritten by the implementing class to write a + * bool value to the file. + * + * @param gc Group code. + * @param value The bool value. + */ +void DL_Writer::dxfBool(int gc, bool value) const +{ + dxfInt(gc, static_cast(value)); +} diff --git a/src/libs/vdxf/dxflib/dl_writer.h b/src/libs/vdxf/dxflib/dl_writer.h index 69264fd8b..536f0ae0e 100644 --- a/src/libs/vdxf/dxflib/dl_writer.h +++ b/src/libs/vdxf/dxflib/dl_writer.h @@ -1,4 +1,5 @@ /**************************************************************************** +** Copyright (C) 2015 Roman Telezhynskyi ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. ** Copyright (C) 2001 Robert J. Campbell Jr. ** @@ -59,604 +60,53 @@ class DXFLIB_EXPORT DL_Writer { public: - /** - * @param version DXF version. Defaults to DL_VERSION_2002. - */ - explicit DL_Writer(DL_Codes::version version) - : m_handle(0x30), modelSpaceHandle(0), paperSpaceHandle(0), paperSpace0Handle(0), version(version) - { - } + explicit DL_Writer(DL_Codes::version version); + virtual ~DL_Writer(); - virtual ~DL_Writer() {} - ; + void section(const char* name) const; + void sectionHeader() const; + void sectionTables() const; + void sectionBlocks() const; + void sectionEntities() const; + void sectionClasses() const; + void sectionObjects() const; + void sectionEnd() const; + void table(const char* name, int num, int h=0) const; + void tableLayers(int num) const; + void tableLinetypes(int num) const; + void tableAppid(int num) const; + void tableStyle(int num) const; + void tableEnd() const; + void dxfEOF() const; + void comment(const char* text) const; + void entity(const char* entTypeName) const; + void entityAttributes(const DL_Attributes& attrib) const; + void subClass(const char* sub) const; + void tableLayerEntry(unsigned long int h=0) const; + void tableLinetypeEntry(unsigned long int h=0) const; + void tableAppidEntry(unsigned long int h=0) const; + void sectionBlockEntry(unsigned long int h=0) const; + void sectionBlockEntryEnd(unsigned long int h=0) const; + void color(int col=256) const; + void linetype(const char *lt) const; + void linetypeScale(double scale) const; + void lineWeight(int lw) const; + void coord(int gc, double x, double y, double z=0) const; + void coordTriplet(int gc, const double* value) const; + void resetHandle() const; - /** Generic section for section 'name'. - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  name
-     * 
- */ - void section(const char* name) const - { - dxfString(0, "SECTION"); - dxfString(2, name); - } + unsigned long handle(int gc=5) const; + unsigned long getNextHandle() const; + unsigned long incHandle() const; - /** - * Section HEADER - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  HEADER
-     * 
- */ - void sectionHeader() const - { - section("HEADER"); - } + void setModelSpaceHandle(unsigned long h) const; + unsigned long getModelSpaceHandle() const; - /** - * Section TABLES - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  TABLES
-     * 
- */ - void sectionTables() const - { - section("TABLES"); - } + void setPaperSpaceHandle(unsigned long h) const; + unsigned long getPaperSpaceHandle() const; - /** - * Section BLOCKS - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  BLOCKS
-     * 
- */ - void sectionBlocks() const - { - section("BLOCKS"); - } - - /** - * Section ENTITIES - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  ENTITIES
-     * 
- */ - void sectionEntities() const - { - section("ENTITIES"); - } - - /** - * Section CLASSES - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  CLASSES
-     * 
- */ - void sectionClasses() const - { - section("CLASSES"); - } - - /** - * Section OBJECTS - * - *
-     *   0
-     *  SECTION
-     *   2
-     *  OBJECTS
-     * 
- */ - void sectionObjects() const - { - section("OBJECTS"); - } - - /** - * End of a section. - * - *
-     *   0
-     *  ENDSEC
-     * 
- */ - void sectionEnd() const - { - dxfString(0, "ENDSEC"); - } - - /** - * Generic table for table 'name' with 'num' entries: - * - *
-     *   0
-     *  TABLE
-     *   2
-     *  name
-     *  70
-     *   num
-     * 
- */ - void table(const char* name, int num, int h=0) const - { - dxfString(0, "TABLE"); - dxfString(2, name); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, h); - } - dxfString(100, "AcDbSymbolTable"); - } - dxfInt(70, num); - } - - /** Table for layers. - * - * @param num Number of layers in total. - * - *
-     *   0
-     *  TABLE
-     *   2
-     *  LAYER
-     *   70
-     *      num
-     * 
- */ - void tableLayers(int num) const - { - table("LAYER", num, 2); - } - - /** Table for line types. - * - * @param num Number of line types in total. - * - *
-     *   0
-     *  TABLE
-     *   2
-     *  LTYPE
-     *   70
-     *      num
-     * 
- */ - void tableLinetypes(int num) const - { - //linetypeHandle = 5; - table("LTYPE", num, 5); - } - - /** Table for application id. - * - * @param num Number of registered applications in total. - * - *
-     *   0
-     *  TABLE
-     *   2
-     *  APPID
-     *   70
-     *      num
-     * 
- */ - void tableAppid(int num) const - { - table("APPID", num, 9); - } - - /** Table for text style. - * - * @param num Number of text styles. - * - *
-     *   0
-     *  TABLE
-     *   2
-     *  STYLE
-     *   70
-     *      num
-     * 
- */ - void tableStyle(int num) const - { - table("STYLE", num, 3); - } - - /** - * End of a table. - * - *
-     *   0
-     *  ENDTAB
-     * 
- */ - void tableEnd() const - { - dxfString(0, "ENDTAB"); - } - - /** - * End of the DXF file. - * - *
-     *   0
-     *  EOF
-     * 
- */ - void dxfEOF() const - { - dxfString(0, "EOF"); - } - - /** - * Comment. - * - *
-     *  999
-     *  text
-     * 
- */ - void comment(const char* text) const - { - dxfString(999, text); - } - - /** - * Entity. - * - *
-     *   0
-     *  entTypeName
-     * 
- * - * @return Unique handle or 0. - */ - void entity(const char* entTypeName) const - { - dxfString(0, entTypeName); - if (version>=DL_VERSION_2000) - { - handle(); - } - } - - /** - * Attributes of an entity. - * - *
-     *   8
-     *  layer
-     *  62
-     *  color
-     *  39
-     *  width
-     *   6
-     *  linetype
-     * 
- */ - void entityAttributes(const DL_Attributes& attrib) const - { - - // layer name: - dxfString(8, attrib.getLayer()); - - // R12 doesn't accept BYLAYER values. The value has to be missing - // in that case. - if (version>=DL_VERSION_2000 || attrib.getColor()!=256) - { - dxfInt(62, attrib.getColor()); - } - if (version>=DL_VERSION_2000 && attrib.getColor24()!=-1) - { - dxfInt(420, attrib.getColor24()); - } - if (version>=DL_VERSION_2000) - { - dxfInt(370, attrib.getWidth()); - } - if (version>=DL_VERSION_2000) - { - dxfReal(48, attrib.getLinetypeScale()); - } - std::string linetype = attrib.getLinetype(); - std::transform(linetype.begin(), linetype.end(), linetype.begin(), ::toupper); - if (version>=DL_VERSION_2000 || linetype=="BYLAYER") - { - dxfString(6, attrib.getLinetype()); - } - } - - /** - * Subclass. - */ - void subClass(const char* sub) const - { - dxfString(100, sub); - } - - /** - * Layer (must be in the TABLES section LAYER). - * - *
-     *   0
-     *  LAYER
-     * 
- */ - void tableLayerEntry(unsigned long int h=0) const - { - dxfString(0, "LAYER"); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, static_cast(h)); - } - dxfString(100, "AcDbSymbolTableRecord"); - dxfString(100, "AcDbLayerTableRecord"); - } - } - - /** - * Line type (must be in the TABLES section LTYPE). - * - *
-     *   0
-     *  LTYPE
-     * 
- */ - void tableLinetypeEntry(unsigned long int h=0) const - { - dxfString(0, "LTYPE"); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, static_cast(h)); - } - //dxfHex(330, 0x5); - dxfString(100, "AcDbSymbolTableRecord"); - dxfString(100, "AcDbLinetypeTableRecord"); - } - } - - /** - * Appid (must be in the TABLES section APPID). - * - *
-     *   0
-     *  APPID
-     * 
- */ - void tableAppidEntry(unsigned long int h=0) const - { - dxfString(0, "APPID"); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, static_cast(h)); - } - //dxfHex(330, 0x9); - dxfString(100, "AcDbSymbolTableRecord"); - dxfString(100, "AcDbRegAppTableRecord"); - } - } - - /** - * Block (must be in the section BLOCKS). - * - *
-     *   0
-     *  BLOCK
-     * 
- */ - void sectionBlockEntry(unsigned long int h=0) const - { - dxfString(0, "BLOCK"); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, static_cast(h)); - } - //dxfHex(330, blockHandle); - dxfString(100, "AcDbEntity"); - if (h==0x1C) - { - dxfInt(67, 1); - } - dxfString(8, "0"); // TODO: Layer for block - dxfString(100, "AcDbBlockBegin"); - } - } - - /** - * End of Block (must be in the section BLOCKS). - * - *
-     *   0
-     *  ENDBLK
-     * 
- */ - void sectionBlockEntryEnd(unsigned long int h=0) const - { - dxfString(0, "ENDBLK"); - if (version>=DL_VERSION_2000) - { - if (h==0) - { - handle(); - } - else - { - dxfHex(5, static_cast(h)); - } - //dxfHex(330, blockHandle); - dxfString(100, "AcDbEntity"); - if (h==0x1D) - { - dxfInt(67, 1); - } - dxfString(8, "0"); // TODO: Layer for block - dxfString(100, "AcDbBlockEnd"); - } - } - - void color(int col=256) const - { - dxfInt(62, col); - } - void linetype(const char *lt) const - { - dxfString(6, lt); - } - void linetypeScale(double scale) const - { - dxfReal(48, scale); - } - void lineWeight(int lw) const - { - dxfInt(370, lw); - } - - void coord(int gc, double x, double y, double z=0) const - { - dxfReal(gc, x); - dxfReal(gc+10, y); - dxfReal(gc+20, z); - } - - void coordTriplet(int gc, const double* value) const - { - if (value) - { - dxfReal(gc, *value++); - dxfReal(gc+10, *value++); - dxfReal(gc+20, *value++); - } - } - - void resetHandle() const - { - m_handle = 1; - } - - /** - * Writes a unique handle and returns it. - */ - unsigned long handle(int gc=5) const - { - // handle has to be hex - dxfHex(gc, static_cast(m_handle)); - return m_handle++; - } - - /** - * @return Next handle that will be written. - */ - unsigned long getNextHandle() const - { - return m_handle; - } - - /** - * Increases handle, so that the handle returned remains available. - */ - unsigned long incHandle() const - { - return m_handle++; - } - - /** - * Sets the handle of the model space. Entities refer to - * this handle. - */ - // cppcheck-suppress functionConst - void setModelSpaceHandle(unsigned long h) - { - modelSpaceHandle = h; - } - - unsigned long getModelSpaceHandle() const - { - return modelSpaceHandle; - } - - /** - * Sets the handle of the paper space. Some special blocks refer to - * this handle. - */ - // cppcheck-suppress functionConst - void setPaperSpaceHandle(unsigned long h) - { - paperSpaceHandle = h; - } - - unsigned long getPaperSpaceHandle() const - { - return paperSpaceHandle; - } - - /** - * Sets the handle of the paper space 0. Some special blocks refer to - * this handle. - */ - // cppcheck-suppress functionConst - void setPaperSpace0Handle(unsigned long h) - { - paperSpace0Handle = h; - } - - unsigned long getPaperSpace0Handle() const - { - return paperSpace0Handle; - } + void setPaperSpace0Handle(unsigned long h) const; + unsigned long getPaperSpace0Handle() const; /** * Must be overwritten by the implementing class to write a @@ -676,17 +126,8 @@ public: */ virtual void dxfInt(int gc, int value) const = 0; - /** - * Can be overwritten by the implementing class to write a - * bool value to the file. - * - * @param gc Group code. - * @param value The bool value. - */ - virtual void dxfBool(int gc, bool value) const - { - dxfInt(gc, static_cast(value)); - } + + virtual void dxfBool(int gc, bool value) const; /** * Must be overwritten by the implementing class to write an @@ -725,7 +166,6 @@ protected: * DXF version to be created. */ DL_Codes::version version; -private: }; #endif diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp index 147d8b9de..a2365b05f 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp @@ -76,12 +76,12 @@ void DL_WriterA::dxfReal(int gc, double value) const if (str[i]=='.') { dot = true; - end = i+2; + end = static_cast(i)+2; continue; } else if (dot && str[i]!='0') { - end = i+1; + end = static_cast(i)+1; } } if (end>0 && end(strlen(str))) diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.h b/src/libs/vdxf/dxflib/dl_writer_ascii.h index 51686de8c..b6141d9a9 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.h +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.h @@ -41,16 +41,17 @@ /** * Implements functions defined in DL_Writer for writing low * level DXF constructs to an ASCII format DXF file. - * - * @para fname File name of the file to be created. - * @para version DXF version. Defaults to DL_VERSION_2002. - * - * @todo What if \c fname is NULL? Or \c fname can't be opened for - * another reason? */ class DXFLIB_EXPORT DL_WriterA : public DL_Writer { public: + /** + * @param fname fname File name of the file to be created. + * @param version version DXF version. Defaults to DL_VERSION_2002. + * + * @todo What if \c fname is NULL? Or \c fname can't be opened for + * another reason? + */ DL_WriterA(const char* fname, DL_Codes::version version=DL_VERSION_2000) : DL_Writer(version), m_ofile(fname) {} virtual ~DL_WriterA() {} diff --git a/src/libs/vdxf/vdxf.pri b/src/libs/vdxf/vdxf.pri index f8f6d19ff..b2eb8ce71 100644 --- a/src/libs/vdxf/vdxf.pri +++ b/src/libs/vdxf/vdxf.pri @@ -5,7 +5,8 @@ SOURCES += \ $$PWD/dxflib/dl_dxf.cpp \ $$PWD/dxflib/dl_writer_ascii.cpp \ $$PWD/vdxfengine.cpp \ - $$PWD/vdxfpaintdevice.cpp + $$PWD/vdxfpaintdevice.cpp \ + $$PWD/dxflib/dl_writer.cpp win32-msvc*:SOURCES += $$PWD/stable.cpp diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index ad5e401a8..a96c51db0 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -253,7 +253,8 @@ void VMeasurements::ReadMeasurements() const qreal ksize = GetParametrDouble(dom, AttrSizeIncrease, "0"); qreal kheight = GetParametrDouble(dom, AttrHeightIncrease, "0"); - tempMeash = new VMeasurement(i, name, BaseSize(), BaseHeight(), base, ksize, kheight); + tempMeash = new VMeasurement(static_cast(i), name, BaseSize(), BaseHeight(), base, ksize, + kheight); base = UnitConvertor(base, MUnit(), *data->GetPatternUnit()); ksize = UnitConvertor(ksize, MUnit(), *data->GetPatternUnit()); @@ -262,7 +263,8 @@ void VMeasurements::ReadMeasurements() const const qreal baseSize = UnitConvertor(BaseSize(), MUnit(), *data->GetPatternUnit()); const qreal baseHeight = UnitConvertor(BaseHeight(), MUnit(), *data->GetPatternUnit()); - meash = new VMeasurement(i, name, baseSize, baseHeight, base, ksize, kheight, fullName, description); + meash = new VMeasurement(static_cast(i), name, baseSize, baseHeight, base, ksize, kheight, + fullName, description); } else { @@ -270,10 +272,11 @@ void VMeasurements::ReadMeasurements() const bool ok = false; qreal value = EvalFormula(tempData, formula, &ok); - tempMeash = new VMeasurement(tempData, i, name, value, formula, ok); + tempMeash = new VMeasurement(tempData, static_cast(i), name, value, formula, ok); value = UnitConvertor(value, MUnit(), *data->GetPatternUnit()); - meash = new VMeasurement(data, i, name, value, formula, ok, fullName, description); + meash = new VMeasurement(data, static_cast(i), name, value, formula, ok, fullName, + description); } tempData->AddVariable(name, tempMeash); data->AddVariable(name, meash); @@ -883,6 +886,7 @@ qreal VMeasurements::EvalFormula(VContainer *data, const QString &formula, bool } catch (qmu::QmuParserError &e) { + Q_UNUSED(e) *ok = false; return 0; } diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index aacfbe2ed..0230abb59 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -39,6 +39,9 @@ MOC_DIR = moc # objecs files OBJECTS_DIR = obj +# Directory for files created rcc +RCC_DIR = rcc + # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() @@ -53,6 +56,7 @@ CONFIG(debug, debug|release){ QMAKE_CXXFLAGS += \ # Key -isystem disable checking errors in system headers. -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer @@ -66,15 +70,17 @@ CONFIG(debug, debug|release){ } } clang*{ - QMAKE_CXXFLAGS += \ - # Key -isystem disable checking errors in system headers. - -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + -isystem "$${OUT_PWD}/$${RCC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. - # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and - # want them in global list. Compromise decision delete them from local list. - QMAKE_CXXFLAGS -= \ - -Wundefined-reinterpret-cast + # -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast \ + -Wmissing-prototypes # rcc folder } } else { *-g++{ diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index e71ce77f1..78b63b8cd 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -40,7 +40,7 @@ //--------------------------------------------------------------------------------------------------------------------- VPoster::VPoster(const QPrinter *printer) - :printer(printer), allowence(qRound(10./25.4*printer->resolution()))//1 cm + :printer(printer), allowence(static_cast(qRound(10./25.4*printer->resolution())))//1 cm { } @@ -109,13 +109,14 @@ int VPoster::CountRows(int height) const // Calculate how many pages will be after using allowence. // We know start pages count. This number not enought because // each n-1 pages add (n-1)*allowence length to page (1). - const qreal addionalLength = (pCount-1)*allowence; + const qreal addionalLength = (pCount-1)*static_cast(allowence); // Calculate additional length form pages that will cover this length (2). // In the end add page length (3). // Bottom page have mandatory border (4) return qCeil((addionalLength + - qCeil(addionalLength/pageLength)*allowence + allowence + imgLength)/pageLength); + qCeil(addionalLength/pageLength)*static_cast(allowence) + static_cast(allowence) + + imgLength)/pageLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -138,18 +139,19 @@ int VPoster::CountColomns(int width) const // Calculate how many pages will be after using allowence. // We know start pages count. This number not enought because // each n-1 pages add (n-1)*allowence length to page (1). - const qreal addionalLength = (pCount-1)*allowence; + const qreal addionalLength = (pCount-1)*static_cast(allowence); // Calculate additional length form pages that will cover this length (2). // In the end add page length (3). - return qCeil((addionalLength + qCeil(addionalLength/pageLength)*allowence + imgLength)/pageLength); + return qCeil((addionalLength + qCeil(addionalLength/pageLength)*static_cast(allowence) + + imgLength)/pageLength); } //--------------------------------------------------------------------------------------------------------------------- QImage VPoster::Cut(int i, int j, const QImage &image) const { - const int x = j*PageRect().width() - j*allowence; - const int y = i*PageRect().height() - i*allowence; + const int x = j*PageRect().width() - j*static_cast(allowence); + const int y = i*PageRect().height() - i*static_cast(allowence); SCASSERT(x <= image.rect().width()); SCASSERT(y <= image.rect().height()); @@ -191,29 +193,32 @@ QImage VPoster::Borders(int rows, int colomns, int i, int j, QImage &image, int if (j != 0 && PageRect().x() > 0) {// Left border painter.drawLine(QLine(0, 0, 0, image.rect().height())); - painter.drawImage(QPoint(0, image.rect().height()-allowence), QImage("://scissors_vertical.png")); + painter.drawImage(QPoint(0, image.rect().height()-static_cast(allowence)), + QImage("://scissors_vertical.png")); } if (j != colomns-1) {// Right border - painter.drawLine(QLine(image.rect().width()-allowence, 0, - image.rect().width()-allowence, image.rect().height())); + painter.drawLine(QLine(image.rect().width()-static_cast(allowence), 0, + image.rect().width()-static_cast(allowence), image.rect().height())); } if (i != 0 && PageRect().y() > 0) {// Top border painter.drawLine(QLine(0, 0, image.rect().width(), 0)); - painter.drawImage(QPoint(image.rect().width()-allowence, 0), QImage("://scissors_horizontal.png")); + painter.drawImage(QPoint(image.rect().width()-static_cast(allowence), 0), + QImage("://scissors_horizontal.png")); } if (rows*colomns > 1) { // Don't show bottom border if only one page need // Bottom border (mandatory) - painter.drawLine(QLine(0, image.rect().height()-allowence, - image.rect().width(), image.rect().height()-allowence)); + painter.drawLine(QLine(0, image.rect().height()-static_cast(allowence), + image.rect().width(), image.rect().height()-static_cast(allowence))); if (i == rows-1) { - painter.drawImage(QPoint(image.rect().width()-allowence, image.rect().height()-allowence), + painter.drawImage(QPoint(image.rect().width()-static_cast(allowence), + image.rect().height()-static_cast(allowence)), QImage("://scissors_horizontal.png")); } } @@ -221,8 +226,8 @@ QImage VPoster::Borders(int rows, int colomns, int i, int j, QImage &image, int // Labels const int layoutX = 15; const int layoutY = 5; - QRect labels(layoutX, image.rect().height()-allowence+layoutY, - image.rect().width()-(allowence+layoutX), allowence-layoutY); + QRect labels(layoutX, image.rect().height()-static_cast(allowence)+layoutY, + image.rect().width()-(static_cast(allowence)+layoutX), static_cast(allowence)-layoutY); painter.drawText(labels, Qt::AlignLeft, tr("Grid ( %1 , %2 )").arg(i+1).arg(j+1)); painter.drawText(labels, Qt::AlignHCenter, tr("Page %1 of %2").arg(i*(colomns)+j+1).arg(rows*colomns)); if (sheets > 1) diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index 66d9c2bbf..aa182b1ef 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -216,7 +216,7 @@ void VObjEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawM for (int i = 0; i < pointCount; ++i) { - *stream << QString(" %1").arg(globalPointsCount - static_cast(pointCount) + i + 1); + *stream << QString(" %1").arg(static_cast(globalPointsCount) - pointCount + i + 1); } *stream << endl; } diff --git a/src/libs/vpatterndb/calculator.cpp b/src/libs/vpatterndb/calculator.cpp index b8eaae764..b00062276 100644 --- a/src/libs/vpatterndb/calculator.cpp +++ b/src/libs/vpatterndb/calculator.cpp @@ -46,7 +46,6 @@ using namespace qmu; * const qreal result = cal->EvalFormula(data->PlainVariables(), formula); * delete cal; * - * @param data pointer to a variable container. */ Calculator::Calculator() :QmuFormulaBase() diff --git a/src/libs/vpatterndb/variables/vincrement.cpp b/src/libs/vpatterndb/variables/vincrement.cpp index 8c7f60718..3dbb4d20d 100644 --- a/src/libs/vpatterndb/variables/vincrement.cpp +++ b/src/libs/vpatterndb/variables/vincrement.cpp @@ -43,7 +43,6 @@ VIncrement::VIncrement() /** * @brief VIncrementTableRow create increment * @param name increment's name - * @param id id * @param base value * @param description description of increment */ diff --git a/src/libs/vpatterndb/variables/vmeasurement.cpp b/src/libs/vpatterndb/variables/vmeasurement.cpp index 2cde882ea..750729f3d 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.cpp +++ b/src/libs/vpatterndb/variables/vmeasurement.cpp @@ -277,7 +277,7 @@ bool VMeasurement::IsCustom() const //--------------------------------------------------------------------------------------------------------------------- int VMeasurement::Index() const { - return d->index; + return static_cast(d->index); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index bb45c86fb..1fdc01c28 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -37,8 +37,17 @@ #include #include +#ifdef Q_CC_CLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmissing-prototypes" +#endif + Q_LOGGING_CATEGORY(vCon, "v.container") +#ifdef Q_CC_CLANG + #pragma clang diagnostic pop +#endif + quint32 VContainer::_id = NULL_ID; qreal VContainer::_size = 50; qreal VContainer::_height = 176; diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index cf0e6306d..206ec395e 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -446,7 +446,6 @@ void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, FillCombo * @brief setCurrentSplinePathId set current splinePath id in combobox * @param box combobox * @param value splinePath id - * @param cut if set to ComboMode::CutSpline don't show id+1 and id+2 */ void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value, FillComboBox rule, const quint32 &ch1, const quint32 &ch2) const diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 65aca2dc7..7cf485c7d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -34,8 +34,17 @@ #include +#ifdef Q_CC_CLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmissing-prototypes" +#endif + Q_LOGGING_CATEGORY(vToolSinglePoint, "v.toolSinglePoint") +#ifdef Q_CC_CLANG + #pragma clang diagnostic pop +#endif + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VToolSinglePoint constructor. @@ -109,8 +118,6 @@ void VToolSinglePoint::NameChangePosition(const QPointF &pos) //--------------------------------------------------------------------------------------------------------------------- /** * @brief UpdateNamePosition save new position label to the pattern file. - * @param mx label bias x axis. - * @param my label bias y axis. */ void VToolSinglePoint::UpdateNamePosition(quint32 id) { diff --git a/src/libs/vtools/vtools.pro b/src/libs/vtools/vtools.pro index 6437c3a4d..2e7878d5e 100644 --- a/src/libs/vtools/vtools.pro +++ b/src/libs/vtools/vtools.pro @@ -80,6 +80,11 @@ CONFIG(debug, debug|release){ # Key -isystem disable checking errors in system headers. -isystem "$${OUT_PWD}/$${MOC_DIR}" \ $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast } } else { *-g++{ diff --git a/src/libs/vwidgets/vwidgets.pro b/src/libs/vwidgets/vwidgets.pro index 2877402b3..2b6eb1795 100644 --- a/src/libs/vwidgets/vwidgets.pro +++ b/src/libs/vwidgets/vwidgets.pro @@ -70,6 +70,11 @@ CONFIG(debug, debug|release){ # Key -isystem disable checking errors in system headers. -isystem "$${OUT_PWD}/$${MOC_DIR}" \ $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in global list. Compromise decision delete them from local list. + QMAKE_CXXFLAGS -= \ + -Wundefined-reinterpret-cast } } else { *-g++{ diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 8d64bb5d7..4cd8d70ed 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -100,7 +100,8 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + $$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details. + -Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP } } else { *-g++{