[Mesa-dev] [PATCH v2] egl/dri2: Fix GCC maybe-uninitialized warning.
Mark Janes
mark.a.janes at intel.com
Wed Mar 25 15:29:30 PDT 2015
This was never pushed, so
Reviewed-by: Mark Janes <mark.a.janes at intel.com>
Vinson Lee <vlee at freedesktop.org> writes:
> egl_dri2.c: In function ‘dri2_bind_tex_image’:
> egl_dri2.c:1240:4: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
> ^
>
> Suggested-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> 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 d503196..c5c475d 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1226,7 +1226,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
> format = __DRI_TEXTURE_FORMAT_RGBA;
> break;
> default:
> - assert(0);
> + _eglError(EGL_BAD_SURFACE, "unrecognized format");
> + return EGL_FALSE;
> }
>
> switch (dri2_surf->base.TextureTarget) {
> @@ -1234,7 +1235,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
> target = GL_TEXTURE_2D;
> break;
> default:
> - assert(0);
> + _eglError(EGL_BAD_SURFACE, "unrecognized target");
> + return EGL_FALSE;
> }
>
> (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
> --
> 2.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list