egl: remove unnecessary eglGetProcAddress() fallback
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 10 Jan 2019 16:41:38 +0000 (16:41 +0000)
committerEric Engestrom <eric@engestrom.ch>
Sat, 22 Jun 2019 15:17:42 +0000 (15:17 +0000)
No need to add a function that returns `false` only to be cast into
a pointer, we can just use the existing `return NULL` :)

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/main/egldriver.c
src/egl/main/eglfallbacks.c

index e294c8c..4dc46b3 100644 (file)
@@ -109,7 +109,7 @@ _eglMatchDriver(_EGLDisplay *disp)
 __eglMustCastToProperFunctionPointerType
 _eglGetDriverProc(const char *procname)
 {
-   if (_eglGetDriver())
+   if (_eglGetDriver() && _eglDriver->API.GetProcAddress)
       return _eglDriver->API.GetProcAddress(_eglDriver, procname);
 
    return NULL;
index bf667af..336ca7a 100644 (file)
@@ -76,7 +76,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
 
    drv->API.WaitClient = (void*) _eglReturnFalse;
    drv->API.WaitNative = (void*) _eglReturnFalse;
-   drv->API.GetProcAddress = (void*) _eglReturnFalse;
 
    drv->API.GetSyncAttrib = _eglGetSyncAttrib;
 }