From: Eric Engestrom Date: Sun, 28 Oct 2018 18:20:20 +0000 (+0000) Subject: egl: add messages to a few assert() and turn a couple into unreachable() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea738a91de4f418d371b76d93de2d326ab613b42;p=mesa.git egl: add messages to a few assert() and turn a couple into unreachable() Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index c5fa935657e..8b482c90be0 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -341,7 +341,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, _eglLinkConfig(&conf->base); } else { - assert(0); + unreachable("duplicates should not be possible"); return NULL; } @@ -1108,7 +1108,7 @@ dri2_create_context_attribs_error(int dri_error) break; default: - assert(0); + assert(!"unknown dri_error code"); egl_error = EGL_BAD_MATCH; break; } @@ -1815,7 +1815,7 @@ dri2_release_tex_image(_EGLDriver *drv, target = GL_TEXTURE_2D; break; default: - assert(0); + assert(!"missing texture target"); } if (dri2_dpy->tex_buffer->base.version >= 3 && @@ -1878,7 +1878,7 @@ egl_error_from_dri_image_error(int dri_error) case __DRI_IMAGE_ERROR_BAD_ACCESS: return EGL_BAD_ACCESS; default: - assert(0); + assert(!"unknown dri_error code"); return EGL_BAD_ALLOC; } } diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 0456adf3caa..a346f937bf3 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -327,7 +327,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching) valid = EGL_FALSE; break; default: - assert(0); + unreachable("check _eglValidationTable[]"); break; } break; @@ -353,7 +353,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching) EGL_OPENGL_BIT; break; default: - assert(0); + unreachable("check _eglValidationTable[]"); mask = 0; break; }