New gcc warnings.

--HG--
branch : develop
This commit is contained in:
dismine 2013-11-12 20:29:03 +02:00
parent 2621e70645
commit fab9fa4bfb
14 changed files with 39 additions and 12 deletions

View file

@ -76,9 +76,16 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \ QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \ -isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
-isystem "/usr/include/qt5/QtCore" -isystem "$$OUT_PWD/uic" -isystem "$$OUT_PWD/moc/" \ -isystem "/usr/include/qt5/QtCore" -isystem "$$OUT_PWD/uic" -isystem "$$OUT_PWD/moc/" \
-isystem "$$OUT_PWD/rcc/" \
-Og -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \ -Og -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self \ -Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self \
-Wunreachable-code -gdwarf-3 -Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
-Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k\
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
-Wmissing-include-dirs -Wpacked -Wredundant-decls \
-Wswitch-default -Wswitch-enum -Wuninitialized -Wunused-parameter -Wvariadic-macros \
-Wlogical-op -Wnoexcept \
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3
}else{ }else{
# Release # Release
TARGET = $$RELEASE_TARGET TARGET = $$RELEASE_TARGET

View file

@ -195,6 +195,8 @@ void Calculator::arith(QChar o, qreal *r, qreal *h)
// for(t=*h-1; t>0; --t) // for(t=*h-1; t>0; --t)
// *r = (*r) * ex; // *r = (*r) * ex;
break; break;
default:
break;
} }
} }

View file

@ -424,6 +424,8 @@ QVector<QPointF> VContainer::EkvPoint(const QLineF &line1, const QLineF &line2,
points.append(bigLine1.p2()); points.append(bigLine1.p2());
return points; return points;
break; break;
default:
break;
} }
return points; return points;
} }

View file

@ -125,6 +125,8 @@ void DialogHeight::ChoosedObject(qint64 id, const Scene::Scenes &type)
this->show(); this->show();
} }
break; break;
default:
break;
} }
} }
} }

View file

@ -499,6 +499,8 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
emit haveLiteChange(); emit haveLiteChange();
} }
break; break;
default:
break;
} }
} }

View file

@ -100,6 +100,8 @@ void DialogTriangle::ChoosedObject(qint64 id, const Scene::Scenes &type)
this->show(); this->show();
} }
break; break;
default:
break;
} }
} }
} }

View file

@ -364,7 +364,7 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
// All collinear OR p1==p4 // All collinear OR p1==p4
//---------------------- //----------------------
k = dx*dx + dy*dy; k = dx*dx + dy*dy;
if (k == 0) if (k < 0.000000001)
{ {
d2 = CalcSqDistance(x1, y1, x2, y2); d2 = CalcSqDistance(x1, y1, x2, y2);
d3 = CalcSqDistance(x4, y4, x3, y3); d3 = CalcSqDistance(x4, y4, x3, y3);
@ -468,7 +468,7 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
return; return;
} }
if (m_cusp_limit != 0.0) if (m_cusp_limit > 0.0 || m_cusp_limit < 0.0)
{ {
if (da1 > m_cusp_limit) if (da1 > m_cusp_limit)
{ {
@ -517,7 +517,7 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
return; return;
} }
if (m_cusp_limit != 0.0) if (m_cusp_limit > 0.0 || m_cusp_limit < 0.0)
{ {
if (da1 > m_cusp_limit) if (da1 > m_cusp_limit)
{ {
@ -573,7 +573,7 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
return; return;
} }
if (m_cusp_limit != 0.0) if (m_cusp_limit > 0.0 || m_cusp_limit < 0.0)
{ {
if (da1 > m_cusp_limit) if (da1 > m_cusp_limit)
{ {
@ -591,6 +591,8 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
} }
} }
break; break;
default:
break;
} }
// Continue subdivision // Continue subdivision

View file

@ -45,6 +45,8 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS
fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line,
context.function); context.function);
abort(); abort();
default:
break;
} }
} }

View file

@ -775,6 +775,8 @@ void MainWindow::keyPressEvent ( QKeyEvent * event )
case Qt::Key_Escape: case Qt::Key_Escape:
ArrowTool(); ArrowTool();
break; break;
default:
break;
} }
QMainWindow::keyPressEvent ( event ); QMainWindow::keyPressEvent ( event );
} }

View file

@ -330,7 +330,7 @@ void TableWindow::AddLength()
void TableWindow::RemoveLength() void TableWindow::RemoveLength()
{ {
if (sceneRect.height()<=currentScene->sceneRect().height()-100) if (sceneRect.height() <= currentScene->sceneRect().height() - 100)
{ {
QRectF rect = currentScene->sceneRect(); QRectF rect = currentScene->sceneRect();
rect.setHeight(rect.height()-toPixel(279)); rect.setHeight(rect.height()-toPixel(279));
@ -341,7 +341,7 @@ void TableWindow::RemoveLength()
rect = paper->rect(); rect = paper->rect();
rect.setHeight(rect.height()-toPixel(279)); rect.setHeight(rect.height()-toPixel(279));
paper->setRect(rect); paper->setRect(rect);
if (sceneRect.height()==currentScene->sceneRect().height()) if (fabs(sceneRect.height() - currentScene->sceneRect().height()) < 0.01)
{ {
ui->actionRemove->setDisabled(true); ui->actionRemove->setDisabled(true);
} }

View file

@ -58,7 +58,7 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF &cente
s_x = secondPoint.x()-(qAbs(secondPoint.x()-firstPoint.x()))*s; s_x = secondPoint.x()-(qAbs(secondPoint.x()-firstPoint.x()))*s;
s_y = secondPoint.y()-(qAbs(secondPoint.y()-firstPoint.y()))*s; s_y = secondPoint.y()-(qAbs(secondPoint.y()-firstPoint.y()))*s;
distans = QLineF(center.x(), center.y(), s_x, s_y).length(); distans = QLineF(center.x(), center.y(), s_x, s_y).length();
if (ceil(distans*10) == ceil(radius*10)) if (fabs(distans*10 - radius*10) < 0.1)
{ {
pArc.rx() = s_x; pArc.rx() = s_x;
pArc.ry() = s_y; pArc.ry() = s_y;

View file

@ -59,7 +59,7 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
qDebug()<<"A3П2="<<toMM(length)<<"А30П ="<<toMM(dist); qDebug()<<"A3П2="<<toMM(length)<<"А30П ="<<toMM(dist);
throw "Не можу знайти точку плеча. Довжина А3П2 < А3П."; throw "Не можу знайти точку плеча. Довжина А3П2 < А3П.";
} }
if (dist==length) if (fabs(dist - length) < 0.1)
{ {
return line.p2(); return line.p2();
} }

View file

@ -107,11 +107,11 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c
qreal c = QLineF(firstPoint, secondPoint).length(); qreal c = QLineF(firstPoint, secondPoint).length();
qreal a = QLineF(axisP2, firstPoint).length(); qreal a = QLineF(axisP2, firstPoint).length();
qreal b = QLineF(axisP2, secondPoint).length(); qreal b = QLineF(axisP2, secondPoint).length();
if (c*c == a*a + b*b) if (fabs(c*c - (a*a + b*b)) < 0.0001)
{ {
QLineF l1(axisP2, firstPoint); QLineF l1(axisP2, firstPoint);
QLineF l2(axisP2, secondPoint); QLineF l2(axisP2, secondPoint);
if (l1.angleTo(l2) == 90 || l2.angleTo(l1) == 90) if (fabs(l1.angleTo(l2) - 90) < 0.1 || fabs(l2.angleTo(l1) - 90) < 0.1)
{ {
return axisP2; return axisP2;
} }
@ -128,7 +128,7 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c
{ {
QLineF l1(axisP2, firstPoint); QLineF l1(axisP2, firstPoint);
QLineF l2(axisP2, secondPoint); QLineF l2(axisP2, secondPoint);
if (l1.angleTo(l2) == 90 || l2.angleTo(l1) == 90) if (fabs(l1.angleTo(l2) - 90) < 0.1 || fabs(l2.angleTo(l1) - 90) < 0.1)
{ {
return line.p2(); return line.p2();
} }

View file

@ -145,6 +145,8 @@ void VTableGraphicsView::keyPressEvent(QKeyEvent *event)
case Qt::Key_Down: case Qt::Key_Down:
MoveItem(VTableGraphicsView::Down); MoveItem(VTableGraphicsView::Down);
break; break;
default:
break;
} }
QGraphicsView::keyPressEvent ( event ); QGraphicsView::keyPressEvent ( event );
} }
@ -185,6 +187,8 @@ void VTableGraphicsView::MoveItem(VTableGraphicsView::typeMove_e move)
dx = 0; dx = 0;
dy = 3; dy = 3;
break; break;
default:
break;
} }
QList<QGraphicsItem *> listSelectedItems = scene()->selectedItems(); QList<QGraphicsItem *> listSelectedItems = scene()->selectedItems();
if (listSelectedItems.size()>0) if (listSelectedItems.size()>0)