Fixed QGLContext::getProcAddress() to return a function pointer.
authorSamuel Rødal <samuel.rodal@nokia.com>
Mon, 16 Jan 2012 09:01:01 +0000 (10:01 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 16 Jan 2012 10:47:32 +0000 (11:47 +0100)
Task-number: QTBUG-5729
Change-Id: I57e71f89a2c5ca7f74f73c66adcbf4a6cc073813
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
src/opengl/qgl.cpp
src/opengl/qgl.h
src/opengl/qgl_qpa.cpp
src/opengl/qglextensions.cpp

index 0ef2a0b..7afbaa9 100644 (file)
@@ -3582,7 +3582,7 @@ QGLWidget::~QGLWidget()
 */
 
 /*!
-    \fn void *QGLContext::getProcAddress(const QString &proc) const
+    \fn QFunctionPointer QGLContext::getProcAddress() const
 
     Returns a function pointer to the GL extension function passed in
     \a proc. 0 is returned if a pointer to the function could not be
index 3af7411..85c4eb9 100644 (file)
@@ -322,7 +322,7 @@ public:
     static void setTextureCacheLimit(int size);
     static int textureCacheLimit();
 
-    void *getProcAddress(const QString &proc) const;
+    QFunctionPointer getProcAddress(const QString &proc) const;
     QPaintDevice* device() const;
     QColor overlayTransparentColor() const;
 
index ae46fc9..009b43d 100644 (file)
@@ -231,10 +231,10 @@ void QGLContext::swapBuffers() const
     d->guiGlContext->swapBuffers(widget->windowHandle());
 }
 
-void *QGLContext::getProcAddress(const QString &procName) const
+QFunctionPointer QGLContext::getProcAddress(const QString &procName) const
 {
     Q_D(const QGLContext);
-    return (void *)d->guiGlContext->getProcAddress(procName.toAscii());
+    return d->guiGlContext->getProcAddress(procName.toAscii());
 }
 
 void QGLWidget::setContext(QGLContext *context,
index 906fd4d..34196b6 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
-static void *qt_gl_getProcAddress_search
+static QFunctionPointer qt_gl_getProcAddress_search
     (QGLContext *ctx, const char *name1, const char *name2,
      const char *name3, const char *name4)
 {
-    void *addr;
-
-    addr = ctx->getProcAddress(QLatin1String(name1));
+    QFunctionPointer addr = ctx->getProcAddress(QLatin1String(name1));
     if (addr)
         return addr;