Mesa (master): gallivm: silence uninitialized variable warnings

Brian Paul brianp at kemper.freedesktop.org
Tue Jul 17 21:17:22 UTC 2012


Module: Mesa
Branch: master
Commit: c4d2a14d6e98dae29a9a04da122521e25eaf7986
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4d2a14d6e98dae29a9a04da122521e25eaf7986

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jul 17 14:41:29 2012 -0600

gallivm: silence uninitialized variable warnings

---

 src/gallium/auxiliary/gallivm/lp_bld_arit.c       |    4 ++--
 src/gallium/auxiliary/gallivm/lp_bld_sample.c     |    3 +++
 src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index d226dab..7878544 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -77,7 +77,7 @@ lp_build_min_simple(struct lp_build_context *bld,
 {
    const struct lp_type type = bld->type;
    const char *intrinsic = NULL;
-   unsigned intr_size;
+   unsigned intr_size = 0;
    LLVMValueRef cond;
 
    assert(lp_check_value(type, a));
@@ -167,7 +167,7 @@ lp_build_max_simple(struct lp_build_context *bld,
 {
    const struct lp_type type = bld->type;
    const char *intrinsic = NULL;
-   unsigned intr_size;
+   unsigned intr_size = 0;
    LLVMValueRef cond;
 
    assert(lp_check_value(type, a));
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index 8521116..1ea59ea 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -214,6 +214,9 @@ lp_build_rho(struct lp_build_sample_context *bld,
    if (dims > 2) {
       abs_ddx_ddy[1] = lp_build_abs(coord_bld, ddx_ddy[1]);
    }
+   else {
+      abs_ddx_ddy[1] = NULL;
+   }
 
    if (dims == 1) {
       static const unsigned char swizzle1[] = {
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
index ad1b29c..d81033f 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
@@ -655,7 +655,7 @@ lp_build_sample_image_nearest_afloat(struct lp_build_sample_context *bld,
    LLVMValueRef width_vec, height_vec, depth_vec;
    LLVMValueRef offset;
    LLVMValueRef x_subcoord, y_subcoord;
-   LLVMValueRef x_icoord, y_icoord, z_icoord;
+   LLVMValueRef x_icoord = NULL, y_icoord = NULL, z_icoord = NULL;
    LLVMValueRef flt_size;
 
    flt_size = lp_build_int_to_float(&bld->float_size_bld, int_size);




More information about the mesa-commit mailing list