egl: fix _eglMatchDriver() return type
authorEric Engestrom <eric@engestrom.ch>
Tue, 21 Jul 2020 22:51:51 +0000 (00:51 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 30 Jul 2020 23:24:30 +0000 (23:24 +0000)
The one caller only ever checks if the return value is NULL or not, so
let's simplify the function by only returning that information.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6037>

src/egl/main/egldriver.c
src/egl/main/egldriver.h

index 0a4dae7588e4eabcca437d2282761073c1c31e21..e6d5098472755000df9ca513e808815982c56a40 100644 (file)
@@ -61,7 +61,7 @@ _eglMatchAndInitialize(_EGLDisplay *disp)
  * Match a display to a driver.  The matching is done by finding the first
  * driver that can initialize the display.
  */
-_EGLDriver *
+bool
 _eglMatchDriver(_EGLDisplay *disp)
 {
    _EGLDriver *best_drv;
@@ -85,7 +85,7 @@ _eglMatchDriver(_EGLDisplay *disp)
       disp->Initialized = EGL_TRUE;
    }
 
-   return best_drv;
+   return best_drv != NULL;
 }
 
 __eglMustCastToProperFunctionPointerType
index 513903321572f889e53e0c00b97010404ab9ef5f..0d0f50726b190c9ecb414ddc41e6e77b0951250d 100644 (file)
@@ -35,6 +35,7 @@
 #include "c99_compat.h"
 
 #include "egltypedefs.h"
+#include <stdbool.h>
 #include <stddef.h>
 
 
@@ -223,7 +224,7 @@ struct _egl_driver
 };
 
 
-extern _EGLDriver *
+extern bool
 _eglMatchDriver(_EGLDisplay *disp);