From a77050c03459689f8ea59e51da31c954006ce6ae Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 22 Jul 2020 00:51:51 +0200 Subject: [PATCH] egl: fix _eglMatchDriver() return type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marcin Ślusarz Reviewed-by: Emil Velikov Part-of: --- 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 #include @@ -223,7 +224,7 @@ struct _egl_driver }; -extern _EGLDriver * +extern bool _eglMatchDriver(_EGLDisplay *disp); -- 2.30.2