diff options
author | Emil Velikov <[email protected]> | 2017-06-20 15:40:28 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-06-26 12:41:00 +0100 |
commit | c58af5cbb295760687b23428f8ac240459e5cf56 (patch) | |
tree | 0bf1c53aedde3010b4254c12531c6249e85d13ca /src/egl/main/egldisplay.c | |
parent | d42b09580a5270e8906dad4b923f320d1de18167 (diff) |
egl: fold _eglError() + return EGL_FALSE
The function _eglError() already explicitly returns EGL_FALSE,
explicitly to simplify the callers. Make use of it.
While EGL_FALSE is numerically identical to false, NULL, EGL_NO_FOO,
storage is not the same so we cannot use it for "everything".
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r-- | src/egl/main/egldisplay.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 6eeaa35eb63..7aaab3c2c94 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -495,12 +495,10 @@ _eglParseX11DisplayAttribList(_EGLDisplay *display, const EGLint *attrib_list) /* EGL_EXT_platform_x11 recognizes exactly one attribute, * EGL_PLATFORM_X11_SCREEN_EXT, which is optional. */ - if (attrib == EGL_PLATFORM_X11_SCREEN_EXT) { - display->Options.Platform = (void *)(uintptr_t)value; - } else { - _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay"); - return EGL_FALSE; - } + if (attrib != EGL_PLATFORM_X11_SCREEN_EXT) + return _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay"); + + display->Options.Platform = (void *)(uintptr_t)value; } return EGL_TRUE; |