egl/dri2: silence uninitialized variable warnings
authorBrian Paul <brianp@vmware.com>
Fri, 29 May 2015 22:01:37 +0000 (16:01 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 1 Jun 2015 13:42:04 +0000 (07:42 -0600)
And update assertions to be more informative.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/egl/drivers/dri2/egl_dri2.c

index fe5cbc8815d9230f742b5c11793b89f5d7a6f313..8b915ef54d0c7f83b0824d82b4520ccd818d6c60 100644 (file)
@@ -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()");
    }
 
    (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,