gallivm: silence a couple compiler warnings
authorBrian Paul <brianp@vmware.com>
Fri, 19 Dec 2014 16:36:51 +0000 (09:36 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 5 Jan 2015 20:50:54 +0000 (13:50 -0700)
Silence warnings about possibly uninitialized variables when making a
release build.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_sample.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index 8cee994ee6d2fb0fc3167b4a39d317d7bce058e4..093c8fcc7482456a9381e05c90cca62e9800a99f 100644 (file)
@@ -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);
index 3dfff05c22baa129bac280eb99addc77dac505a6..3b2097f8521bac5cf1c88edfeb5e3c9e1d879884 100644 (file)
@@ -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(