diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-17 14:51:29 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-19 15:51:52 +0000 |
commit | ffe8db538f9d190c84bf56f024b876de518affa5 (patch) | |
tree | 027bdcf9140c41eb693ddfd0ab7ff0a2cbfc220b /src/plugins/platforms/windows | |
parent | fdb956a3ede6cb0a25112c1e1af6c93fd2051de1 (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')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.cpp | 16 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.h | 2 |
2 files changed, 9 insertions, 9 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 diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h index e8c78860f2..2944ab7192 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.h +++ b/src/plugins/platforms/windows/qwindowsglcontext.h @@ -122,7 +122,7 @@ struct QWindowsOpengl32DLL void (APIENTRY * glGetIntegerv)(GLenum pname, GLint* params); const GLubyte * (APIENTRY * glGetString)(GLenum name); - void *resolve(const char *name); + PROC resolve(const char *name); private: HMODULE m_lib; bool m_nonOpengl32; |