From 2f501f8a92204e8c2c3f1d48ed5e8e1d5849b49a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 1 Jun 2019 12:07:02 +0000 Subject: [PATCH] compiler warning fixes Signed-off-by: Ivailo Monev --- src/core/kernel/qcore_unix_p.h | 2 +- src/core/tools/qbytearraymatcher.cpp | 5 +---- src/core/tools/qbytearraymatcher.h | 3 --- src/gui/kernel/qapplication.cpp | 1 - src/gui/kernel/qevent.cpp | 4 ++-- src/gui/qguicommon_p.h | 8 ++++---- src/script/bridge/qscriptdeclarativeclass_p.h | 2 -- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/core/kernel/qcore_unix_p.h b/src/core/kernel/qcore_unix_p.h index 773edec4b..7a77ff25c 100644 --- a/src/core/kernel/qcore_unix_p.h +++ b/src/core/kernel/qcore_unix_p.h @@ -343,7 +343,7 @@ union qt_semun { Returns the difference between msecs and elapsed. If msecs is -1, however, -1 is returned. */ -static int qt_timeout_value(int msecs, int elapsed) +inline static int qt_timeout_value(int msecs, int elapsed) { if (msecs == -1) return -1; diff --git a/src/core/tools/qbytearraymatcher.cpp b/src/core/tools/qbytearraymatcher.cpp index c2b15e4e2..daf501f7b 100644 --- a/src/core/tools/qbytearraymatcher.cpp +++ b/src/core/tools/qbytearraymatcher.cpp @@ -117,7 +117,6 @@ static inline int bm_find(const uchar *cc, int l, int index, const uchar *puc, u Call setPattern() to give it a pattern to match. */ QByteArrayMatcher::QByteArrayMatcher() - : d(0) { p.p = 0; p.l = 0; @@ -130,7 +129,6 @@ QByteArrayMatcher::QByteArrayMatcher() the destructor does not delete \a pattern. */ QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length) - : d(0) { p.p = reinterpret_cast(pattern); p.l = length; @@ -142,7 +140,7 @@ QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length) Call indexIn() to perform a search. */ QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern) - : d(0), q_pattern(pattern) + : q_pattern(pattern) { p.p = reinterpret_cast(pattern.constData()); p.l = pattern.size(); @@ -153,7 +151,6 @@ QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern) Copies the \a other byte array matcher to this byte array matcher. */ QByteArrayMatcher::QByteArrayMatcher(const QByteArrayMatcher &other) - : d(0) { operator=(other); } diff --git a/src/core/tools/qbytearraymatcher.h b/src/core/tools/qbytearraymatcher.h index 6b942bb54..4a7b6a93d 100644 --- a/src/core/tools/qbytearraymatcher.h +++ b/src/core/tools/qbytearraymatcher.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QByteArrayMatcherPrivate; - class Q_CORE_EXPORT QByteArrayMatcher { public: @@ -73,7 +71,6 @@ public: } private: - QByteArrayMatcherPrivate *d; QByteArray q_pattern; struct Data { uchar q_skiptable[256]; diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index bd6e546d3..5e6927cc0 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -439,7 +439,6 @@ void QApplicationPrivate::process_cmdline() continue; } QByteArray arg = argv[i]; - arg = arg; QString s; if (arg.indexOf("-style=", 0) != -1) { s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower()); diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 812dc6ee7..619281834 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -706,9 +706,9 @@ QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text, bool autorep, int count) - : QInputEvent(type, modifiers), txt(text), k(key), + : QInputEvent(type, modifiers), txt(text), k(key), c(count), nScanCode(nativeScanCode), nVirtualKey(nativeVirtualKey), nModifiers(nativeModifiers), - c(count), autor(autorep) + autor(autorep) { } diff --git a/src/gui/qguicommon_p.h b/src/gui/qguicommon_p.h index b6a7ef4a5..154766239 100644 --- a/src/gui/qguicommon_p.h +++ b/src/gui/qguicommon_p.h @@ -9,7 +9,7 @@ QT_BEGIN_NAMESPACE -static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50) +inline static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50) { const int maxFactor = 100; QColor tmp = colorA; @@ -42,7 +42,7 @@ inline static bool verticalTabs(QTabBar::Shape shape) #endif // QT_NO_TABBAR #ifndef QT_NO_DOCKWIDGET -static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos) +inline static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos) { switch (pos) { case QInternal::LeftDock: return Qt::LeftDockWidgetArea; @@ -56,7 +56,7 @@ static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos) #endif #ifndef QT_NO_TABWIDGET -static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) +inline static QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) { const bool rounded = (shape == QTabWidget::Rounded); if (position == QTabWidget::North) @@ -72,7 +72,7 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid #endif // QT_NO_TABWIDGET // Returns position of lowest set bit in 'v' as an integer (0-31), or -1 -static int lowest_bit(uint v) +inline static int lowest_bit(uint v) { int i; ulong lb; diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h index 825e400f4..7a13d40d8 100644 --- a/src/script/bridge/qscriptdeclarativeclass_p.h +++ b/src/script/bridge/qscriptdeclarativeclass_p.h @@ -71,8 +71,6 @@ public: ~Value(); QScriptValue toScriptValue(QScriptEngine *) const; - private: - char dummy[8]; }; typedef void* Identifier; -- 2.11.0