[Mesa-dev] [PATCH 1/2] gallivm: silence a couple compiler warnings

Jose Fonseca jfonseca at vmware.com
Fri Dec 19 08:54:41 PST 2014


On 19/12/14 16:37, Brian Paul wrote:
> Silence warnings about possibly uninitialized variables when making a
> release build.
> ---
>   src/gallium/auxiliary/gallivm/lp_bld_sample.c   | 3 +++
>   src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 2 +-
>   2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
> index 8cee994..093c8fc 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
> @@ -411,6 +411,9 @@ lp_build_rho(struct lp_build_sample_context *bld,
>            if (dims > 2) {
>               ddx_ddy[1] = lp_build_abs(coord_bld, ddx_ddy[1]);
>            }
> +         else {
> +            ddx_ddy[1] = NULL; /* silence compiler warning */
> +         }
>
>            if (dims < 2) {
>               rho_xvec = lp_build_swizzle_aos(coord_bld, ddx_ddy[0], swizzle0);
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
> index 3dfff05..3b2097f 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
> @@ -952,7 +952,7 @@ build_gather(struct lp_build_context *bld,
>      LLVMBuilderRef builder = bld->gallivm->builder;
>      LLVMValueRef res = bld->undef;
>      unsigned i;
> -   LLVMValueRef temp_ptr;
> +   LLVMValueRef temp_ptr = NULL;
>
>      if (overflow_mask) {
>         temp_ptr = lp_build_alloca(
>

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-dev mailing list