[Mesa-dev] [PATCH] u_vbuf: Silence uninitialized variable warnings.

Brian Paul brianp at vmware.com
Thu Dec 1 06:35:14 PST 2011


On 11/30/2011 04:35 PM, Vinson Lee wrote:
> Fixes these GCC warnings.
> u_vbuf.c: In function ‘u_vbuf_draw_begin’:
> u_vbuf.c:839:20: warning: ‘max_index’ may be used uninitialized in this function [-Wuninitialized]
> u_vbuf.c:838:20: warning: ‘min_index’ may be used uninitialized in this function [-Wuninitialized]
>
> Signed-off-by: Vinson Lee<vlee at vmware.com>
> ---
>   src/gallium/auxiliary/util/u_vbuf.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
> index f6da912..5b0e26e 100644
> --- a/src/gallium/auxiliary/util/u_vbuf.c
> +++ b/src/gallium/auxiliary/util/u_vbuf.c
> @@ -808,6 +808,8 @@ static void u_vbuf_get_minmax_index(struct pipe_context *pipe,
>      }
>      default:
>         assert(0);
> +      *out_min_index = 0;
> +      *out_max_index = 0;
>      }
>
>      if (transfer) {


Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list