From b20548f9999d8c111268f3f2287c0801c6c5cbb0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 18 Feb 2016 13:13:49 +0100 Subject: Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model. Code except font, accessibility and file qwindowswindow.cpp. Task-number: QTBUG-50804 Change-Id: I40848264f9fa16eea00cf70d7be009c484c49e92 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowsopengltester.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsopengltester.cpp') diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp index fcbe488f93..438aa8752a 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.cpp +++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp @@ -75,10 +75,10 @@ GpuDescription GpuDescription::detect() const HRESULT hr = direct3D9->GetAdapterIdentifier(0, 0, &adapterIdentifier); direct3D9->Release(); if (SUCCEEDED(hr)) { - result.vendorId = int(adapterIdentifier.VendorId); - result.deviceId = int(adapterIdentifier.DeviceId); - result.revision = int(adapterIdentifier.Revision); - result.subSysId = int(adapterIdentifier.SubSysId); + result.vendorId = adapterIdentifier.VendorId; + result.deviceId = adapterIdentifier.DeviceId; + result.revision = adapterIdentifier.Revision; + result.subSysId = adapterIdentifier.SubSysId; QVector version(4, 0); version[0] = HIWORD(adapterIdentifier.DriverVersion.HighPart); // Product version[1] = LOWORD(adapterIdentifier.DriverVersion.HighPart); // Version @@ -329,10 +329,10 @@ bool QWindowsOpenGLTester::testDesktopGL() WNDCLASS wclass; wclass.cbClsExtra = 0; wclass.cbWndExtra = 0; - wclass.hInstance = (HINSTANCE) GetModuleHandle(0); + wclass.hInstance = static_cast(GetModuleHandle(0)); wclass.hIcon = 0; wclass.hCursor = 0; - wclass.hbrBackground = (HBRUSH) (COLOR_BACKGROUND); + wclass.hbrBackground = HBRUSH(COLOR_BACKGROUND); wclass.lpszMenuName = 0; wclass.lpfnWndProc = DefWindowProc; wclass.lpszClassName = className; @@ -371,8 +371,7 @@ bool QWindowsOpenGLTester::testDesktopGL() typedef const GLubyte * (APIENTRY * GetString_t)(GLenum name); GetString_t GetString = reinterpret_cast(::GetProcAddress(lib, "glGetString")); if (GetString) { - const char *versionStr = (const char *) GetString(GL_VERSION); - if (versionStr) { + if (const char *versionStr = reinterpret_cast(GetString(GL_VERSION))) { const QByteArray version(versionStr); const int majorDot = version.indexOf('.'); if (majorDot != -1) { -- cgit v1.2.3