From 0ff3bbe293ca4e3741b12cbd7055b264e6b2d5b6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 11 Jun 2015 17:18:19 +0200 Subject: Mark unused parameters with Q_UNUSED This prevents compiler warnings on less common branches of certain ifdefs. Change-Id: I89bae68491151b21cf6887a854cc4c9f68838cf9 Reviewed-by: Marc Mutz --- src/corelib/tools/qharfbuzz.cpp | 3 +++ src/gui/kernel/qguiapplication.cpp | 2 ++ src/gui/kernel/qplatformintegrationfactory.cpp | 7 +++++++ src/gui/kernel/qplatformthemefactory.cpp | 4 ++++ src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp | 4 ++++ .../platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp | 4 ++++ src/widgets/kernel/qwidget.cpp | 2 ++ 7 files changed, 26 insertions(+) diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/tools/qharfbuzz.cpp index afc8b23473..fa279949ea 100644 --- a/src/corelib/tools/qharfbuzz.cpp +++ b/src/corelib/tools/qharfbuzz.cpp @@ -65,6 +65,9 @@ HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch) void (*HB_Library_Resolve(const char *library, int version, const char *symbol))() { #ifdef QT_NO_LIBRARY + Q_UNUSED(library); + Q_UNUSED(version); + Q_UNUSED(symbol); return 0; #else return QLibrary::resolve(QLatin1String(library), version, symbol); diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 024578ccdd..eb275f2c81 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1346,6 +1346,8 @@ void QGuiApplicationPrivate::init() qCritical() << "Library qttestability load failed:" << testLib.errorString(); } } +#else + Q_UNUSED(loadTestability); #endif // QT_NO_LIBRARY } diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp index d58ac3a33f..5a1fb3ca83 100644 --- a/src/gui/kernel/qplatformintegrationfactory.cpp +++ b/src/gui/kernel/qplatformintegrationfactory.cpp @@ -72,6 +72,12 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor } if (QPlatformIntegration *ret = loadIntegration(loader(), platform, paramList, argc, argv)) return ret; +#else + Q_UNUSED(platform); + Q_UNUSED(paramList); + Q_UNUSED(argc); + Q_UNUSED(argv); + Q_UNUSED(platformPluginPath); #endif return 0; } @@ -102,6 +108,7 @@ QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath) list.append(loader()->keyMap().values()); return list; #else + Q_UNUSED(platformPluginPath); return QStringList(); #endif } diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp index d4902ac163..bcc37dad06 100644 --- a/src/gui/kernel/qplatformthemefactory.cpp +++ b/src/gui/kernel/qplatformthemefactory.cpp @@ -63,6 +63,9 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString } if (QPlatformTheme *ret = qLoadPlugin1(loader(), platform, paramList)) return ret; +#else + Q_UNUSED(key); + Q_UNUSED(platformPluginPath); #endif return 0; } @@ -93,6 +96,7 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath) list += loader()->keyMap().values(); return list; #else + Q_UNUSED(platformPluginPath); return QStringList(); #endif } diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp index 359b90f205..7771c981dd 100644 --- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp @@ -99,6 +99,7 @@ QStringList QEGLDeviceIntegrationFactory::keys(const QString &pluginPath) qCDebug(qLcEglDevDebug) << "EGL device integration plugin keys:" << list; return list; #else + Q_UNUSED(pluginPath); return QStringList(); #endif } @@ -117,6 +118,9 @@ QEGLDeviceIntegration *QEGLDeviceIntegrationFactory::create(const QString &key, qCDebug(qLcEglDevDebug) << "Using EGL device integration" << key; else qCWarning(qLcEglDevDebug) << "Failed to load EGL device integration" << key; +#else + Q_UNUSED(key); + Q_UNUSED(pluginPath); #endif return integration; } diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp index 10411e72e2..508f5e82e6 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp @@ -78,6 +78,7 @@ QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath) list.append(loader()->keyMap().values()); return list; #else + Q_UNUSED(pluginPath); return QStringList(); #endif } @@ -93,6 +94,9 @@ QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, con } if (QXcbGlIntegration *ret = loadIntegration(loader(), platform)) return ret; +#else + Q_UNUSED(platform); + Q_UNUSED(pluginPath); #endif return Q_NULLPTR; } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b4943bbe05..f57d180e3b 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -9730,6 +9730,8 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints) d->imHints = hints; if (this == QGuiApplication::focusObject()) QGuiApplication::inputMethod()->update(Qt::ImHints); +#else + Q_UNUSED(hints); #endif //QT_NO_IM } -- cgit v1.2.3