summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-24 16:08:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-13 10:04:44 +0200
commit38f1a36f608f729f47d880eb8389e88159bda7a4 (patch)
tree7e1a41a20a24a62f13855c660c1c51f11edccfcf /src/plugins/platforms/windows/qwindowsglcontext.cpp
parent7f7eaf1cad2681e361d365ce3c602105338603d1 (diff)
Windows QPA: Fix clang warnings about repetitive type names
Fix warning like: warning: use auto when initializing with new/reinterpret_cast to avoid duplicating the type name [modernize-use-auto] Change-Id: Ieb7f052919173f6923e68de9f9e849dee45e36e7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 66dd32d05e..24526bad2c 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -1009,7 +1009,7 @@ QOpenGLStaticContext *QOpenGLStaticContext::create(bool softwareRendering)
QScopedPointer<QOpenGLTemporaryContext> temporaryContext;
if (!QOpenGLStaticContext::opengl32.wglGetCurrentContext())
temporaryContext.reset(new QOpenGLTemporaryContext);
- QOpenGLStaticContext *result = new QOpenGLStaticContext;
+ auto *result = new QOpenGLStaticContext;
qCDebug(lcQpaGl) << __FUNCTION__ << *result;
return result;
}
@@ -1051,7 +1051,7 @@ QWindowsGLContext::QWindowsGLContext(QOpenGLStaticContext *staticContext,
qWarning("QWindowsGLContext: Requires a QWGLNativeContext");
return;
}
- QWGLNativeContext handle = nativeHandle.value<QWGLNativeContext>();
+ auto handle = nativeHandle.value<QWGLNativeContext>();
HGLRC wglcontext = handle.context();
HWND wnd = handle.window();
if (!wglcontext || !wnd) {
@@ -1233,7 +1233,7 @@ bool QWindowsGLContext::updateObtainedParams(HDC hdc, int *obtainedSwapInterval)
hasRobustness = exts && strstr(exts, "GL_ARB_robustness");
} else {
typedef const GLubyte * (APIENTRY *glGetStringi_t)(GLenum, GLuint);
- glGetStringi_t glGetStringi = reinterpret_cast<glGetStringi_t>(
+ auto glGetStringi = reinterpret_cast<glGetStringi_t>(
reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress("glGetStringi")));
if (glGetStringi) {
GLint n = 0;
@@ -1305,7 +1305,7 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface)
Q_ASSERT(surface->surface()->supportsOpenGL());
// Do we already have a DC entry for that window?
- QWindowsWindow *window = static_cast<QWindowsWindow *>(surface);
+ auto *window = static_cast<QWindowsWindow *>(surface);
window->aboutToMakeCurrent();
const HWND hwnd = window->handle();
if (const QOpenGLContextData *contextData = findByHWND(m_windowContexts, hwnd)) {
@@ -1374,7 +1374,7 @@ QFunctionPointer QWindowsGLContext::getProcAddress(const char *procName)
// Even though we use QFunctionPointer, it does not mean the function can be called.
// It will need to be cast to the proper function type with the correct calling
// convention. QFunctionPointer is nothing more than a glorified void* here.
- QFunctionPointer procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
+ auto procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
// We support AllGLFunctionsQueryable, which means this function must be able to
// return a function pointer even for functions that are in GL.h and exported