summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_x11.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <[email protected]>2011-07-21 18:47:26 +0200
committerQt by Nokia <[email protected]>2011-07-25 12:58:23 +0200
commitb949b17c3cb7b6752bc8daf2834415163792a76c (patch)
treef4d7d0eb7c3a1a71cb12e2d5a5c6c667449c6358 /src/opengl/qgl_x11.cpp
parent8d762c9caea4f8b9ff589b6c23564f4e37242745 (diff)
Changed QLibrary::resolve() to return a function pointer.
According to the C++ standard, there is no guarantee that you can cast between function pointers and void pointers without data loss (section 5.2.10-6). Change-Id: I27f4d835e4c8ca8ecca0d76cfea9ce34491956bd Reviewed-on: http://codereview.qt.nokia.com/1995 Reviewed-by: Qt Sanity Bot <[email protected]> Reviewed-by: João Abecasis <[email protected]>
Diffstat (limited to 'src/opengl/qgl_x11.cpp')
-rw-r--r--src/opengl/qgl_x11.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 18b6eaaf918..22a222eb1b1 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -347,13 +347,13 @@ static void find_trans_colors()
QGLFormat UNIX/GLX-specific code
*****************************************************************************/
-void* qglx_getProcAddress(const char* procName)
+void (*qglx_getProcAddress(const char* procName))()
{
// On systems where the GL driver is pluggable (like Mesa), we have to use
// the glXGetProcAddressARB extension to resolve other function pointers as
// the symbols wont be in the GL library, but rather in a plugin loaded by
// the GL library.
- typedef void* (*qt_glXGetProcAddressARB)(const char *);
+ typedef void (*(*qt_glXGetProcAddressARB)(const char *))();
static qt_glXGetProcAddressARB glXGetProcAddressARB = 0;
static bool triedResolvingGlxGetProcAddress = false;
if (!triedResolvingGlxGetProcAddress) {
@@ -378,7 +378,7 @@ void* qglx_getProcAddress(const char* procName)
}
}
- void *procAddress = 0;
+ void (*procAddress)() = 0;
if (glXGetProcAddressARB)
procAddress = glXGetProcAddressARB(procName);
@@ -387,7 +387,7 @@ void* qglx_getProcAddress(const char* procName)
if (!procAddress) {
void *handle = dlopen(NULL, RTLD_LAZY);
if (handle) {
- procAddress = dlsym(handle, procName);
+ procAddress = (void (*)())dlsym(handle, procName);
dlclose(handle);
}
}