Mesa (master): egl: fix _eglMatchDriver() return type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 30 23:44:57 UTC 2020


Module: Mesa
Branch: master
Commit: a77050c03459689f8ea59e51da31c954006ce6ae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a77050c03459689f8ea59e51da31c954006ce6ae

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Wed Jul 22 00:51:51 2020 +0200

egl: fix _eglMatchDriver() return type

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 at engestrom.ch>
Reviewed-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6037>

---

 src/egl/main/egldriver.c | 4 ++--
 src/egl/main/egldriver.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 0a4dae7588e..e6d50984727 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -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
diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h
index 51390332157..0d0f50726b1 100644
--- a/src/egl/main/egldriver.h
+++ b/src/egl/main/egldriver.h
@@ -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);
 
 



More information about the mesa-commit mailing list