Deal with unused functions, as found by the Intel compiler
Use Q_DECL_UNUSED for the one that is possibly unused (we have two overloads so that one gets selected): qglobal.cpp(2069): warning #177: function "<unnamed>::fromstrerror_helper(int, const QByteArray &)" was declared but never referenced Remove functions really not used: qbezier.cpp(153): warning #177: function "findInflections" was declared but never referenced qbezier.cpp(534): warning #177: function "splitBezierAt" was declared but never referenced qpathclipper.cpp(1039): warning #177: function "midPoint" was declared but never referenced qpainter.cpp(119): warning #177: function "check_gradient" was declared but never referenced qdockarealayout.cpp(2580): warning #177: function "qMin(int, int, int)" was declared but never referenced qmainwindowlayout.cpp(1019): warning #177: function "validateDockWidgetArea" was declared but never referenced qgraphicsanchorlayout_p.cpp(670): warning #177: function "checkAdd" was declared but never referenced qcups.cpp(481): warning #177: function "paperSize2String" was declared but never referenced complexwidgets.cpp(373): warning #177: function "removeInvisibleWidgetsFromList" was declared but never referenced Change-Id: I1e5558e206b04edea381442030dc69536198d966 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>bb10
parent
4bc450408c
commit
64a7ac344e
|
|
@ -2066,11 +2066,11 @@ namespace {
|
|||
// version in portable code. However, it's impossible to do that if
|
||||
// _GNU_SOURCE is defined so we use C++ overloading to decide what to do
|
||||
// depending on the return type
|
||||
static inline QString fromstrerror_helper(int, const QByteArray &buf)
|
||||
static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf)
|
||||
{
|
||||
return QString::fromLocal8Bit(buf);
|
||||
}
|
||||
static inline QString fromstrerror_helper(const char *str, const QByteArray &)
|
||||
static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &)
|
||||
{
|
||||
return QString::fromLocal8Bit(str);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,33 +150,6 @@ static inline int quadraticRoots(qreal a, qreal b, qreal c,
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool findInflections(qreal a, qreal b, qreal c,
|
||||
qreal *t1 , qreal *t2, qreal *tCups)
|
||||
{
|
||||
qreal r1 = 0, r2 = 0;
|
||||
|
||||
short rootsCount = quadraticRoots(a, b, c, &r1, &r2);
|
||||
|
||||
if (rootsCount >= 1) {
|
||||
if (r1 < r2) {
|
||||
*t1 = r1;
|
||||
*t2 = r2;
|
||||
} else {
|
||||
*t1 = r2;
|
||||
*t2 = r1;
|
||||
}
|
||||
if (!qFuzzyIsNull(a))
|
||||
*tCups = qreal(0.5) * (-b / a);
|
||||
else
|
||||
*tCups = 2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold) const
|
||||
{
|
||||
QBezier beziers[10];
|
||||
|
|
@ -531,34 +504,6 @@ static QDebug operator<<(QDebug dbg, const QBezier &bz)
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline void splitBezierAt(const QBezier &bez, qreal t,
|
||||
QBezier *left, QBezier *right)
|
||||
{
|
||||
left->x1 = bez.x1;
|
||||
left->y1 = bez.y1;
|
||||
|
||||
left->x2 = bez.x1 + t * ( bez.x2 - bez.x1 );
|
||||
left->y2 = bez.y1 + t * ( bez.y2 - bez.y1 );
|
||||
|
||||
left->x3 = bez.x2 + t * ( bez.x3 - bez.x2 ); // temporary holding spot
|
||||
left->y3 = bez.y2 + t * ( bez.y3 - bez.y2 ); // temporary holding spot
|
||||
|
||||
right->x3 = bez.x3 + t * ( bez.x4 - bez.x3 );
|
||||
right->y3 = bez.y3 + t * ( bez.y4 - bez.y3 );
|
||||
|
||||
right->x2 = left->x3 + t * ( right->x3 - left->x3);
|
||||
right->y2 = left->y3 + t * ( right->y3 - left->y3);
|
||||
|
||||
left->x3 = left->x2 + t * ( left->x3 - left->x2 );
|
||||
left->y3 = left->y2 + t * ( left->y3 - left->y2 );
|
||||
|
||||
left->x4 = right->x1 = left->x3 + t * (right->x2 - left->x3);
|
||||
left->y4 = right->y1 = left->y3 + t * (right->y2 - left->y3);
|
||||
|
||||
right->x4 = bez.x4;
|
||||
right->y4 = bez.y4;
|
||||
}
|
||||
|
||||
qreal QBezier::length(qreal error) const
|
||||
{
|
||||
qreal length = qreal(0.0);
|
||||
|
|
|
|||
|
|
@ -1036,16 +1036,6 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
|
|||
return result;
|
||||
}
|
||||
|
||||
static inline QPointF midPoint(const QWingedEdge &list, int ei)
|
||||
{
|
||||
const QPathEdge *ep = list.edge(ei);
|
||||
Q_ASSERT(ep);
|
||||
|
||||
const QPointF a = *list.vertex(ep->first);
|
||||
const QPointF b = *list.vertex(ep->second);
|
||||
return a + 0.5 * (b - a);
|
||||
}
|
||||
|
||||
QWingedEdge::TraversalStatus QWingedEdge::findInsertStatus(int vi, int ei) const
|
||||
{
|
||||
const QPathVertex *vp = vertex(vi);
|
||||
|
|
|
|||
|
|
@ -370,18 +370,6 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam
|
|||
|
||||
#endif // QT_NO_COMBOBOX
|
||||
|
||||
static inline void removeInvisibleWidgetsFromList(QWidgetList *list)
|
||||
{
|
||||
if (!list || list->isEmpty())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < list->count(); ++i) {
|
||||
QWidget *widget = list->at(i);
|
||||
if (!widget->isVisible())
|
||||
list->removeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_SCROLLAREA
|
||||
// ======================= QAccessibleAbstractScrollArea =======================
|
||||
QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)
|
||||
|
|
|
|||
|
|
@ -478,15 +478,6 @@ static inline QPrinter::PaperSize string2PaperSize(const char *name)
|
|||
return QPrinter::Custom;
|
||||
}
|
||||
|
||||
static inline const char *paperSize2String(QPrinter::PaperSize size)
|
||||
{
|
||||
for (int i = 0; i < QPrinter::NPageSize; ++i) {
|
||||
if (size == named_sizes_map[i].size)
|
||||
return named_sizes_map[i].name;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<QPrinter::PaperSize> QCUPSSupport::getCupsPrinterPaperSizes(int cupsPrinterIndex)
|
||||
{
|
||||
QList<QPrinter::PaperSize> result;
|
||||
|
|
|
|||
|
|
@ -660,20 +660,6 @@ Qt::AnchorPoint QGraphicsAnchorLayoutPrivate::oppositeEdge(Qt::AnchorPoint edge)
|
|||
}
|
||||
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*
|
||||
* helper function in order to avoid overflowing anchor sizes
|
||||
* the returned size will never be larger than FLT_MAX
|
||||
*
|
||||
*/
|
||||
inline static qreal checkAdd(qreal a, qreal b)
|
||||
{
|
||||
if (FLT_MAX - b < a)
|
||||
return FLT_MAX;
|
||||
return a + b;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
|
|
|
|||
|
|
@ -2577,7 +2577,6 @@ void QDockAreaLayout::remove(const QList<int> &path)
|
|||
docks[index].remove(path.mid(1));
|
||||
}
|
||||
|
||||
static inline int qMin(int i1, int i2, int i3) { return qMin(i1, qMin(i2, i3)); }
|
||||
static inline int qMax(int i1, int i2, int i3) { return qMax(i1, qMax(i2, i3)); }
|
||||
|
||||
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
|
||||
|
|
|
|||
|
|
@ -1016,19 +1016,6 @@ void QMainWindowLayout::toggleToolBarsVisible()
|
|||
|
||||
#ifndef QT_NO_DOCKWIDGET
|
||||
|
||||
static inline void validateDockWidgetArea(Qt::DockWidgetArea &area)
|
||||
{
|
||||
switch (area) {
|
||||
case Qt::LeftDockWidgetArea:
|
||||
case Qt::RightDockWidgetArea:
|
||||
case Qt::TopDockWidgetArea:
|
||||
case Qt::BottomDockWidgetArea:
|
||||
break;
|
||||
default:
|
||||
area = Qt::LeftDockWidgetArea;
|
||||
}
|
||||
}
|
||||
|
||||
static QInternal::DockPosition toDockPos(Qt::DockWidgetArea area)
|
||||
{
|
||||
switch (area) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue