summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-06-17 14:51:29 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-06-19 15:51:52 +0000
commitffe8db538f9d190c84bf56f024b876de518affa5 (patch)
tree027bdcf9140c41eb693ddfd0ab7ff0a2cbfc220b /src/plugins/platforms/windows/qwindowsglcontext.cpp
parentfdb956a3ede6cb0a25112c1e1af6c93fd2051de1 (diff)
Fix ICC warning about comparing pointers of different types
error #3781: comparing a pointer to void and a pointer to a function is nonstandard Change-Id: Ib57b52598e2f452985e9fffd1458fd651d3985d2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index cc2f05b6d1..0a2d30319e 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -149,12 +149,12 @@ QT_BEGIN_NAMESPACE
QWindowsOpengl32DLL QOpenGLStaticContext::opengl32;
-void *QWindowsOpengl32DLL::resolve(const char *name)
+PROC QWindowsOpengl32DLL::resolve(const char *name)
{
#ifndef Q_OS_WINCE
- void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, name) : 0;
+ PROC proc = m_lib ? ::GetProcAddress(m_lib, name) : 0;
#else
- void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, (const wchar_t *) QString::fromLatin1(name).utf16()) : 0;
+ PROC proc = m_lib ? ::GetProcAddress(m_lib, (const wchar_t *) QString::fromLatin1(name).utf16()) : 0;
#endif
return proc;
@@ -1339,21 +1339,21 @@ 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));
+ PROC procAddress = 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
// normally from opengl32.dll. wglGetProcAddress() is not guaranteed to work for such
// functions, however in QT_OPENGL_DYNAMIC builds QOpenGLFunctions will just blindly
// call into here for _any_ OpenGL function.
- if (!procAddress || procAddress == reinterpret_cast<void *>(0x1) || procAddress == reinterpret_cast<void *>(0x2)
- || procAddress == reinterpret_cast<void *>(0x3) || procAddress == reinterpret_cast<void *>(-1))
- procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.resolve(procName));
+ if (!procAddress || procAddress == reinterpret_cast<PROC>(0x1) || procAddress == reinterpret_cast<PROC>(0x2)
+ || procAddress == reinterpret_cast<PROC>(0x3) || procAddress == reinterpret_cast<PROC>(-1))
+ procAddress = QOpenGLStaticContext::opengl32.resolve(procName);
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaGl) << __FUNCTION__ << procName << QOpenGLStaticContext::opengl32.wglGetCurrentContext() << "returns" << procAddress;
- return procAddress;
+ return reinterpret_cast<QFunctionPointer>(procAddress);
}
QT_END_NAMESPACE