Fixed Clang warnings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-05-03 19:50:37 +03:00
parent acb8b57b24
commit 6f56b46d26
40 changed files with 59 additions and 56 deletions

View File

@ -301,6 +301,7 @@ CLANG_DEBUG_CXXFLAGS += \
-Wbad-array-new-length \
-Wbad-function-cast \
-Wbind-to-temporary-copy \
-Wno-c++98-compat-bind-to-temporary-copy \
-Wbitfield-constant-conversion \
-Wbitwise-op-parentheses \
-Wbool-conversion \
@ -446,6 +447,7 @@ CLANG_DEBUG_CXXFLAGS += \
-Wliteral-conversion \
-Wliteral-range \
-Wlocal-type-template-args \
-Wno-c++98-compat-local-type-template-args \
-Wlogical-not-parentheses \
-Wlogical-op-parentheses \
-Wlong-long \

View File

@ -57,7 +57,7 @@ public:
virtual bool notify(QObject * receiver, QEvent * event) Q_DECL_OVERRIDE;
bool IsTestMode() const;
virtual bool IsAppInGUIMode() const;
virtual bool IsAppInGUIMode() const Q_DECL_OVERRIDE;
TMainWindow *MainWindow();
QList<TMainWindow*> MainWindows();

View File

@ -71,14 +71,14 @@ public:
void StartLogging();
QTextStream *LogFile();
virtual const VTranslateVars *TrVars();
virtual const VTranslateVars *TrVars() Q_DECL_OVERRIDE;
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
static void DrMingw();
void CollectReports() const;
#endif // defined(Q_OS_WIN) && defined(Q_CC_GNU)
bool static IsGUIMode();
virtual bool IsAppInGUIMode() const;
virtual bool IsAppInGUIMode() const Q_DECL_OVERRIDE;
virtual void OpenSettings() Q_DECL_OVERRIDE;
VSettings *ValentinaSettings();

View File

@ -43,7 +43,7 @@ public:
virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
//! Returns item flags
Qt::ItemFlags flags(int column = DPC_Name) const;
virtual Qt::ItemFlags flags(int column = DPC_Name) const Q_DECL_OVERRIDE;
//! Returns an editor widget, or NULL if it doesn't supply one
//! \param parent The widget to which the editor will be added as a child

View File

@ -52,7 +52,7 @@ public:
VFormula GetFormula() const;
//! Needed for proper event handling
bool eventFilter(QObject *obj, QEvent *ev);
virtual bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
signals:
//! This is emitted, when the user changes the color

View File

@ -93,7 +93,7 @@ public:
static const QString AttrReadOnly;
public slots:
void LiteParseTree(const Document &parse);
virtual void LiteParseTree(const Document &parse) Q_DECL_OVERRIDE;
protected:
virtual void customEvent(QEvent * event) Q_DECL_OVERRIDE;

View File

@ -54,7 +54,7 @@ public:
QString WhatUtf8() const V_NOEXCEPT_EXPR (true);
void AddMoreInformation(const QString &info);
QString MoreInformation() const;
virtual const char* what() const V_NOEXCEPT_EXPR (true);
virtual const char* what() const V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE;
protected:
/** @brief error string with error */

View File

@ -48,7 +48,7 @@ protected:
virtual QString MinVerStr() const Q_DECL_OVERRIDE;
virtual QString MaxVerStr() const Q_DECL_OVERRIDE;
QString XSDSchema(int ver) const;
virtual QString XSDSchema(int ver) const Q_DECL_OVERRIDE;
virtual void ApplyPatches() Q_DECL_OVERRIDE;
virtual void DowngradeToCurrentMaxVersion() Q_DECL_OVERRIDE;

View File

@ -48,7 +48,7 @@ protected:
virtual QString MinVerStr() const Q_DECL_OVERRIDE;
virtual QString MaxVerStr() const Q_DECL_OVERRIDE;
QString XSDSchema(int ver) const;
virtual QString XSDSchema(int ver) const Q_DECL_OVERRIDE;
virtual void ApplyPatches() Q_DECL_OVERRIDE;
virtual void DowngradeToCurrentMaxVersion() Q_DECL_OVERRIDE;

View File

@ -48,7 +48,7 @@ protected:
virtual QString MinVerStr() const Q_DECL_OVERRIDE;
virtual QString MaxVerStr() const Q_DECL_OVERRIDE;
QString XSDSchema(int ver) const;
virtual QString XSDSchema(int ver) const Q_DECL_OVERRIDE;
virtual void ApplyPatches() Q_DECL_OVERRIDE;
virtual void DowngradeToCurrentMaxVersion() Q_DECL_OVERRIDE;

View File

@ -844,6 +844,19 @@ struct DXFLIB_EXPORT DL_TextData
angle(angle)
{}
DL_TextData(const DL_TextData &d)
: ipx(d.ipx), ipy(d.ipy), ipz(d.ipz),
apx(d.apx), apy(d.apy), apz(d.apz),
height(d.height), xScaleFactor(d.xScaleFactor),
textGenerationFlags(d.textGenerationFlags),
hJustification(d.hJustification),
vJustification(d.vJustification),
text(d.text),
style(d.style),
angle(d.angle)
{
}
virtual ~DL_TextData()
{}

View File

@ -67,8 +67,6 @@ 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
*/
@ -103,7 +101,7 @@ public:
/**
* @return direction vector.
* @param dir vector.
*/
void getDirection(double dir[]) const
{

View File

@ -79,7 +79,7 @@ void DL_WriterA::dxfReal(int gc, double value) const
// Cut away those zeros at the end:
bool dot = false;
int end = -1;
for (quint32 i=0, sz = strlen(str); i<sz; ++i)
for (quint32 i=0, sz = static_cast<quint32>(strlen(str)); i<sz; ++i)
{
if (str[i]=='.')
{

View File

@ -43,7 +43,7 @@ public:
VMeasurements(Unit unit, int baseSize, int baseHeight, VContainer *data);
virtual ~VMeasurements() Q_DECL_OVERRIDE;
void setXMLContent(const QString &fileName);
virtual void setXMLContent(const QString &fileName) Q_DECL_OVERRIDE;
void AddEmpty(const QString &name, const QString &formula = QString());
void AddEmptyAfter(const QString &after, const QString &name, const QString &formula = QString());

View File

@ -71,12 +71,12 @@ public:
QString GetFormulaLength () const;
void SetFormulaLength (const QString &formula, qreal value);
qreal GetLength () const;
virtual qreal GetLength () const Q_DECL_OVERRIDE;
QPointF GetP1() const;
QPointF GetP2 () const;
qreal AngleArc() const;
QVector<QPointF> GetPoints () const;
virtual QVector<QPointF> GetPoints () const Q_DECL_OVERRIDE;
QPointF CutArc (const qreal &length, VArc &arc1, VArc &arc2) const;
QPointF CutArc (const qreal &length) const;
virtual void setId(const quint32 &id) Q_DECL_OVERRIDE;

View File

@ -81,14 +81,14 @@ public:
QString GetFormulaLength () const;
void SetFormulaLength (const QString &formula, qreal value);
qreal GetLength () const;
virtual qreal GetLength () const Q_DECL_OVERRIDE;
QPointF GetP1() const;
QPointF GetP2 () const;
qreal AngleArc() const;
QVector<qreal> GetAngles () const;
QVector<QPointF> GetPoints () const;
virtual QVector<QPointF> GetPoints () const Q_DECL_OVERRIDE;
QPointF CutArc (const qreal &length, VEllipticalArc &arc1, VEllipticalArc &arc2) const;
QPointF CutArc (const qreal &length) const;
virtual void setId(const quint32 &id) Q_DECL_OVERRIDE;

View File

@ -96,8 +96,6 @@ VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, quint32 idObje
* @param c1LengthFormula formula length from first point to first control point.
* @param c2Length length from second point to first control point.
* @param c2LengthFormula formula length from second point to first control point.
* @param idObject
* @param mode
*/
VSpline::VSpline(VPointF p1, VPointF p4, qreal angle1, const QString &angle1Formula, qreal angle2,
const QString &angle2Formula, qreal c1Length, const QString &c1LengthFormula, qreal c2Length,

View File

@ -299,7 +299,7 @@ void VLayoutGenerator::GatherPages()
VLayoutPaper paper(PageHeight(), PageWidth());
paper.SetShift(shift);
paper.SetLayoutWidth(bank->GetLayoutWidth());
paper.SetPaperIndex(i);
paper.SetPaperIndex(static_cast<quint32>(i));
paper.SetRotate(rotate);
paper.SetRotationIncrease(rotationIncrease);
paper.SetSaveLength(saveLength);
@ -361,7 +361,7 @@ void VLayoutGenerator::UnitePages()
VLayoutPaper paper(qFloor(papersLength.at(i)), PageWidth());
paper.SetShift(shift);
paper.SetLayoutWidth(bank->GetLayoutWidth());
paper.SetPaperIndex(i);
paper.SetPaperIndex(static_cast<quint32>(i));
paper.SetRotate(rotate);
paper.SetRotationIncrease(rotationIncrease);
paper.SetSaveLength(saveLength);

View File

@ -61,7 +61,7 @@ public:
virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
//! Returns item flags
Qt::ItemFlags flags(int column = DPC_Name) const;
virtual Qt::ItemFlags flags(int column = DPC_Name) const Q_DECL_OVERRIDE;
//! Returns the Vector3d
virtual Vector3D getVector() const;

View File

@ -59,7 +59,7 @@ public:
static QString GetColorString(const QColor& color);
//! Needed for proper event handling
bool eventFilter(QObject *obj, QEvent *ev);
virtual bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
signals:
//! This is emitted, when the user changes the color

View File

@ -45,7 +45,7 @@ public:
QString getFile() const;
//! Needed for proper event handling
bool eventFilter(QObject* obj, QEvent* ev);
virtual bool eventFilter(QObject* obj, QEvent* ev) Q_DECL_OVERRIDE;
//! Returns the directory/file setting
//! \return True, if a directory dialog is being shown, false if a file dialog
@ -82,10 +82,10 @@ private slots:
void onToolButtonClicked();
protected:
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void dragLeaveEvent(QDragLeaveEvent* event);
void dropEvent(QDropEvent* event);
virtual void dragEnterEvent(QDragEnterEvent* event) Q_DECL_OVERRIDE;
virtual void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE;
virtual void dragLeaveEvent(QDragLeaveEvent* event) Q_DECL_OVERRIDE;
virtual void dropEvent(QDropEvent* event) Q_DECL_OVERRIDE;
//! This function checks the mime data, if it is compatible with the filters
virtual bool checkMimeData(const QMimeData* data, QString& getFile) const;

View File

@ -41,7 +41,7 @@ public:
virtual ~VShortcutEditWidget() Q_DECL_OVERRIDE;
//! Needed for proper event handling
bool eventFilter(QObject* obj, QEvent* evenvt);
virtual bool eventFilter(QObject* obj, QEvent* evenvt) Q_DECL_OVERRIDE;
//! Returns the currently set shortcut
QString getShortcutAsString() const;

View File

@ -84,7 +84,7 @@ private slots:
void dataSubmitted(VProperty* property);
protected:
void showEvent(QShowEvent* event);
virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
//! Rebuilds the widegt only if it is visible
void updatePropertyList();

View File

@ -75,7 +75,7 @@ public:
virtual VProperty* getProperty(const QString& id);
//! Returns the item flags for the given index
virtual Qt::ItemFlags flags (const QModelIndex& index) const;
virtual Qt::ItemFlags flags (const QModelIndex& index) const Q_DECL_OVERRIDE;
//! Sets the role data for the item at index to value
virtual bool setData (const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE;

View File

@ -192,8 +192,8 @@ void DialogCubicBezier::PointNameChanged()
if (not data->IsUnique(spline.name()))
{
newDuplicate = DNumber(spline.name());
spline.SetDuplicate(newDuplicate);
newDuplicate = static_cast<qint32>(DNumber(spline.name()));
spline.SetDuplicate(static_cast<quint32>(newDuplicate));
}
ui->lineEditSplineName->setText(spline.name());
}

View File

@ -229,8 +229,8 @@ void DialogCubicBezierPath::currentPointChanged(int index)
if (not data->IsUnique(newPath.name()))
{
newDuplicate = DNumber(newPath.name());
newPath.SetDuplicate(newDuplicate);
newDuplicate = static_cast<qint32>(DNumber(newPath.name()));
newPath.SetDuplicate(static_cast<quint32>(newDuplicate));
}
ui->lineEditSplPathName->setText(newPath.name());

View File

@ -483,8 +483,8 @@ void DialogSpline::PointNameChanged()
if (not data->IsUnique(spline.name()))
{
newDuplicate = DNumber(spline.name());
spline.SetDuplicate(newDuplicate);
newDuplicate = static_cast<qint32>(DNumber(spline.name()));
spline.SetDuplicate(static_cast<quint32>(newDuplicate));
}
ui->lineEditSplineName->setText(spline.name());
}

View File

@ -677,8 +677,8 @@ void DialogSplinePath::currentPointChanged(int index)
if (not data->IsUnique(newPath.name()))
{
newDuplicate = DNumber(newPath.name());
newPath.SetDuplicate(newDuplicate);
newDuplicate = static_cast<qint32>(DNumber(newPath.name()));
newPath.SetDuplicate(static_cast<quint32>(newDuplicate));
}
ui->lineEditSplPathName->setText(newPath.name());

View File

@ -250,7 +250,7 @@ protected:
*/
virtual void SaveData() {}
void MoveCursorToEnd(QPlainTextEdit *plainTextEdit);
bool eventFilter(QObject *object, QEvent *event);
virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
quint32 DNumber(const QString &baseName) const;
private:
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;

View File

@ -63,7 +63,7 @@ public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
virtual void PointNameChanged() Q_DECL_OVERRIDE;
protected:
virtual void ShowVisualization();
virtual void ShowVisualization() Q_DECL_OVERRIDE;
/**
* @brief SaveData Put dialog data in local variables
*/

View File

@ -51,7 +51,7 @@ public:
int getIndexD1() const;
int getIndexD2() const;
public slots:
void ChosenObject(quint32 id, const SceneObject &type);
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(DialogUnionDetails)

View File

@ -289,7 +289,7 @@ void VToolSplinePath::SetSplinePathAttributes(QDomElement &domElement, const VSp
/**
* @brief UpdatePathPoints update spline path in pattern file.
* @param doc dom document container.
* @param node tag in file.
* @param element tag in file.
* @param path spline path.
*/
void VToolSplinePath::UpdatePathPoints(VAbstractPattern *doc, QDomElement &element, const VSplinePath &path)

View File

@ -63,7 +63,7 @@ signals:
protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
virtual void AddToFile() Q_DECL_OVERRIDE;
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
virtual void DeleteTool(bool ask = true) Q_DECL_OVERRIDE;
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;

View File

@ -69,7 +69,7 @@ protected:
QColor currentColor;
void AddToModeling(const QDomElement &domElement);
virtual void SetVisualization() {}
virtual void SetVisualization() Q_DECL_OVERRIDE {}
virtual void ShowNode()=0;
virtual void HideNode()=0;

View File

@ -44,7 +44,6 @@ const QString VNodeArc::ToolType = QStringLiteral("modeling");
* @param typeCreation way we create this tool.
* @param idTool tool id.
* @param qoParent QObject parent
* @param parent parent object.
*/
VNodeArc::VNodeArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation,
const quint32 &idTool, QObject *qoParent)
@ -63,7 +62,6 @@ VNodeArc::VNodeArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32
* @param parse parser file mode.
* @param typeCreation way we create this tool.
* @param idTool tool id.
* @param parent QObject parent
*/
void VNodeArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc,
const Document &parse, const Source &typeCreation, const quint32 &idTool)

View File

@ -77,7 +77,6 @@ VNodePoint::VNodePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quin
* @param parse parser file mode.
* @param typeCreation way we create this tool.
* @param idTool tool id.
* @param parent QObject parent
*/
void VNodePoint::Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsScene *scene,
quint32 id, quint32 idPoint, const Document &parse,

View File

@ -44,7 +44,6 @@ const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline");
* @param typeCreation way we create this tool.
* @param idTool id node.
* @param qoParent QObject parent.
* @param parent QGraphicsItem parent.
*/
VNodeSpline::VNodeSpline(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
const Source &typeCreation, const quint32 &idTool, QObject *qoParent)

View File

@ -45,7 +45,6 @@ const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath");
* @param typeCreation way we create this tool.
* @param idTool tool id.
* @param qoParent QObject parent.
* @param parent parent object.
*/
VNodeSplinePath::VNodeSplinePath(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
const Source &typeCreation, const quint32 &idTool, QObject *qoParent)
@ -64,7 +63,6 @@ VNodeSplinePath::VNodeSplinePath(VAbstractPattern *doc, VContainer *data, quint3
* @param parse parser file mode.
* @param typeCreation way we create this tool.
* @param idTool tool id.
* @param parent QObject parent.
*/
void VNodeSplinePath::Create(VAbstractPattern *doc, VContainer *data, quint32 id,
quint32 idSpline, const Document &parse, const Source &typeCreation, const quint32 &idTool)

View File

@ -90,7 +90,6 @@ VToolUnionDetails::VToolUnionDetails(VAbstractPattern *doc, VContainer *data, co
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief AddToNewDetail create united detail adding one node per time.
* @param tool tool that make union.
* @param doc dom document container.
* @param data container with variables.
* @param newDetail united detail.
@ -278,7 +277,6 @@ void VToolUnionDetails::AddToNewDetail(VMainGraphicsScene *scene, VAbstractPatte
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief UpdatePoints update data for united details.
* @param idDetail id united detail.
* @param data container with variables.
* @param det detail what we union.
* @param i index node in detail.

View File

@ -65,7 +65,7 @@ signals:
void PointChoosed();
void PointSelected(bool selected);
protected:
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent *event ) Q_DECL_OVERRIDE;