From dad83c695e968d7c9fb0be2f4636cf14d34fb8a1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 26 Aug 2009 11:25:08 +0200 Subject: fix warnings on Windows CE Lots of warnings in the qreal == float case. Some Q_UNUSED added. Reviewed-by: thartman --- src/corelib/io/qfsfileengine_win.cpp | 2 ++ src/gui/effects/qgraphicseffect_p.h | 2 +- src/gui/graphicsview/qsimplex_p.cpp | 2 +- src/gui/kernel/qwidget.cpp | 5 ++++- src/gui/widgets/qmenu.cpp | 2 ++ src/gui/widgets/qplaintextedit.cpp | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index a8de17b..e1fc804 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1289,6 +1289,8 @@ static QString readSymLink(const QString &link) qFree(rdb); CloseHandle(handle); } +#else + Q_UNUSED(link); #endif // Q_OS_WINCE return result; } diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 175bd99..6ce5cda 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -164,7 +164,7 @@ class QGraphicsOpacityEffectPrivate : public QGraphicsEffectPrivate { Q_DECLARE_PUBLIC(QGraphicsOpacityEffect) public: - QGraphicsOpacityEffectPrivate() : opacity(0.7) {} + QGraphicsOpacityEffectPrivate() : opacity(qreal(0.7)) {} ~QGraphicsOpacityEffectPrivate() {} qreal opacity; diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp index dbd8d4f..30a7d5d 100644 --- a/src/gui/graphicsview/qsimplex_p.cpp +++ b/src/gui/graphicsview/qsimplex_p.cpp @@ -293,7 +293,7 @@ int QSimplex::findPivotColumn() int QSimplex::pivotRowForColumn(int column) { - qreal min = 999999999999.0; // ### + qreal min = qreal(999999999999.0); // ### int minIndex = -1; for (int i = 1; i < rows; ++i) { diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 6ffac2c..7e88e9f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -971,7 +971,10 @@ struct QWidgetExceptionCleaner /* this cleans up when the constructor throws an exception */ static inline void cleanup(QWidget *that, QWidgetPrivate *d) { -#ifndef QT_NO_EXCEPTIONS +#ifdef QT_NO_EXCEPTIONS + Q_UNUSED(that); + Q_UNUSED(d); +#else QWidgetPrivate::allWidgets->remove(that); if (d->focus_next != that) { if (d->focus_next) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index f0f425f..4734d22 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -368,7 +368,9 @@ QRect QMenuPrivate::actionRect(QAction *act) const return actionRects.at(index); } +#if defined(Q_WS_MAC) static const qreal MenuFadeTimeInSec = 0.150; +#endif void QMenuPrivate::hideUpToMenuBar() { diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index e025876..4ea18f8 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -379,7 +379,7 @@ void QPlainTextDocumentLayout::layoutBlock(const QTextBlock &block) tl->beginLayout(); qreal availableWidth = d->width; if (availableWidth <= 0) { - availableWidth = INT_MAX; // similar to text edit with pageSize.width == 0 + availableWidth = qreal(INT_MAX); // similar to text edit with pageSize.width == 0 } availableWidth -= 2*margin + extraMargin; while (1) { -- cgit v0.12