Windows QPA: Remove dead code as detected by Clang.

Task-number: QTBUG-50804
Change-Id: Id87ca4ac98eb17b1e743a10080554da38d609588
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
bb10
Friedemann Kleint 2016-02-03 16:36:38 +01:00
parent 798e0064e9
commit 73c062d605
12 changed files with 6 additions and 97 deletions

View File

@ -51,9 +51,6 @@
QT_BEGIN_NAMESPACE
static const char formatTextPlainC[] = "text/plain";
static const char formatTextHtmlC[] = "text/html";
/*!
\class QWindowsClipboard
\brief Clipboard implementation.

View File

@ -89,20 +89,6 @@ Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility")
int QWindowsContext::verbose = 0;
// Get verbosity of components from "foo:2,bar:3"
static inline int componentVerbose(const char *v, const char *keyWord)
{
if (const char *k = strstr(v, keyWord)) {
k += qstrlen(keyWord);
if (*k == ':') {
++k;
if (isdigit(*k))
return *k - '0';
}
}
return 0;
}
#if !defined(LANG_SYRIAC)
# define LANG_SYRIAC 0x5a
#endif

View File

@ -246,9 +246,10 @@ static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR)
return primaryScreenCursorSize;
}
#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG)
static inline QSize standardCursorSize() { return QSize(32, 32); }
#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG)
// Create pixmap cursors from data and scale the image if the cursor size is
// higher than the standard 32. Note that bitmap cursors as produced by
// createBitmapCursor() only work for standard sizes (32,48,64...), which does

View File

@ -1584,11 +1584,6 @@ QWindowsNativeFileDialogBase *QWindowsNativeFileDialogBase::create(QFileDialogOp
return result;
}
static inline bool isQQuickWindow(const QWindow *w = 0)
{
return w && w->inherits("QQuickWindow");
}
/*!
\class QWindowsFileDialogHelper
\brief Helper for native Windows file dialogs

View File

@ -342,8 +342,8 @@ bool QWindowsLibGLESv2::init()
return glBindTexture && glCreateShader && glClearDepthf;
}
QWindowsEGLStaticContext::QWindowsEGLStaticContext(EGLDisplay display, int version)
: m_display(display), m_version(version)
QWindowsEGLStaticContext::QWindowsEGLStaticContext(EGLDisplay display)
: m_display(display)
{
}
@ -410,7 +410,7 @@ QWindowsEGLStaticContext *QWindowsEGLStaticContext::create(QWindowsOpenGLTester:
}
qCDebug(lcQpaGl) << __FUNCTION__ << "Created EGL display" << display << 'v' <<major << '.' << minor;
return new QWindowsEGLStaticContext(display, (major << 8) | minor);
return new QWindowsEGLStaticContext(display);
}
QWindowsEGLStaticContext::~QWindowsEGLStaticContext()

View File

@ -270,10 +270,9 @@ public:
static QWindowsLibGLESv2 libGLESv2;
private:
QWindowsEGLStaticContext(EGLDisplay display, int version);
explicit QWindowsEGLStaticContext(EGLDisplay display);
const EGLDisplay m_display;
const int m_version; //! majorVersion<<8 + minorVersion
};
class QWindowsEGLContext : public QWindowsOpenGLContext

View File

@ -103,17 +103,6 @@ static void resolveGetCharWidthI()
ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QStringLiteral("gdi32"), "GetCharWidthI");
}
static inline quint32 getUInt(unsigned char *p)
{
quint32 val;
val = *p++ << 24;
val |= *p++ << 16;
val |= *p++ << 8;
val |= *p;
return val;
}
static inline quint16 getUShort(unsigned char *p)
{
quint16 val;
@ -265,7 +254,6 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
m_logfont(lf),
ttf(0),
hasOutline(0),
lw(0),
cmap(0),
cmapSize(0),
lbearing(SHRT_MIN),

View File

@ -144,7 +144,6 @@ private:
uint hasUnreliableOutline : 1;
uint cffTable : 1;
TEXTMETRIC tm;
int lw;
const unsigned char *cmap;
int cmapSize;
QByteArray cmapTable;

View File

@ -614,10 +614,6 @@ static inline int asciiToKeycode(char a, int state)
return a & 0xff;
}
static inline bool isModifierKey(int code)
{
return (code >= Qt::Key_Shift) && (code <= Qt::Key_ScrollLock);
}
// Key translation -----------------------------------------------------------------------[ end ]---

View File

@ -77,22 +77,6 @@ static inline QDpi monitorDPI(HMONITOR hMonitor)
#endif // !Q_OS_WINCE
static inline QSizeF deviceSizeMM(const QSize &pixels, const QDpi &dpi)
{
const qreal inchToMM = 25.4;
const qreal h = qreal(pixels.width()) / qreal(dpi.first) * inchToMM;
const qreal v = qreal(pixels.height()) / qreal(dpi.second) * inchToMM;
return QSizeF(h, v);
}
static inline QDpi deviceDPI(const QSize &pixels, const QSizeF &physicalSizeMM)
{
const qreal inchToMM = 25.4;
const qreal h = qreal(pixels.width()) / (qreal(physicalSizeMM.width()) / inchToMM);
const qreal v = qreal(pixels.height()) / (qreal(physicalSizeMM.height()) / inchToMM);
return QDpi(h, v);
}
typedef QList<QWindowsScreenData> WindowsScreenDataList;
static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data)

View File

@ -78,11 +78,6 @@
QT_BEGIN_NAMESPACE
static inline COLORREF qColorToCOLORREF(const QColor &color)
{
return RGB(color.red(), color.green(), color.blue());
}
static inline QColor COLORREFToQColor(COLORREF cr)
{
return QColor(GetRValue(cr), GetGValue(cr), GetBValue(cr));
@ -99,30 +94,6 @@ static inline QTextStream& operator<<(QTextStream &str, const QColor &c)
return str;
}
static inline void paletteRoleToString(const QPalette &palette,
const QPalette::ColorRole role,
QTextStream &str)
{
str << "Role: ";
str.setFieldWidth(2);
str.setPadChar(QLatin1Char('0'));
str << role;
str.setFieldWidth(0);
str << " Active: " << palette.color(QPalette::Active, role)
<< " Disabled: " << palette.color(QPalette::Disabled, role)
<< " Inactive: " << palette.color(QPalette::Inactive, role)
<< '\n';
}
static inline QString paletteToString(const QPalette &palette)
{
QString result;
QTextStream str(&result);
for (int r = 0; r < QPalette::NColorRoles; ++r)
paletteRoleToString(palette, static_cast<QPalette::ColorRole>(r), str);
return result;
}
static inline bool booleanSystemParametersInfo(UINT what, bool defaultValue)
{
BOOL result;

View File

@ -248,13 +248,6 @@ static QWindow::Visibility windowVisibility_sys(HWND hwnd)
return QWindow::Windowed;
}
static inline QSize clientSize(HWND hwnd)
{
RECT rect = { 0, 0, 0, 0 };
GetClientRect(hwnd, &rect); // Always returns point 0,0, thus unusable for geometry.
return qSizeOfRect(rect);
}
static inline bool windowIsOpenGL(const QWindow *w)
{
switch (w->surfaceType()) {