[Mesa-dev] [PATCH 5/6] egl/dri2: silence uninitialized variable warnings

Matt Turner mattst88 at gmail.com
Mon Jun 1 11:29:27 PDT 2015


On Mon, Jun 1, 2015 at 6:20 AM, Brian Paul <brianp at vmware.com> wrote:
> And update assertions to be more informative.
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index fe5cbc8..8b915ef 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1256,7 +1256,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
>        format = __DRI_TEXTURE_FORMAT_RGBA;
>        break;
>     default:
> -      assert(0);
> +      assert(!"Unexpected texture format in dri2_bind_tex_image()");
> +      format = __DRI_TEXTURE_FORMAT_RGBA;
>     }
>
>     switch (dri2_surf->base.TextureTarget) {
> @@ -1264,7 +1265,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
>        target = GL_TEXTURE_2D;
>        break;
>     default:
> -      assert(0);
> +      target = GL_TEXTURE_2D;
> +      assert(!"Unexpected texture target in dri2_bind_tex_image()");

Use unreachable()? With that,

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list