Mesa (master): gallivm: fix 5 warnings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 28 05:07:07 UTC 2020


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Feb 26 17:00:19 2020 -0500

gallivm: fix 5 warnings

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3970>

---

 src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | 4 ++--
 src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c    | 2 +-
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c   | 3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
index 673ba2af001..69e3185f4fa 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
@@ -873,7 +873,7 @@ lp_build_insert_soa_chan(struct lp_build_context *bld,
     struct lp_type type = bld->type;
     const unsigned width = chan_desc.size;
     const unsigned start = chan_desc.shift;
-    const unsigned stop = start + width;
+    ASSERTED const unsigned stop = start + width;
     LLVMValueRef chan = NULL;
     switch(chan_desc.type) {
     case UTIL_FORMAT_TYPE_UNSIGNED:
@@ -985,7 +985,7 @@ lp_build_store_rgba_soa(struct gallivm_state *gallivm,
 {
    enum pipe_format format = format_desc->format;
    LLVMValueRef packed[4];
-   unsigned num_stores;
+   unsigned num_stores = 0;
 
    memset(packed, 0, sizeof(LLVMValueRef) * 4);
    if (format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN &&
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
index 7e4f73f438e..719e9f0ffa1 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
@@ -1368,7 +1368,7 @@ end_primitive_masked(struct lp_build_nir_context * bld_base,
 
 static void end_primitive(struct lp_build_nir_context *bld_base, uint32_t stream_id)
 {
-   struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
+   ASSERTED struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
 
    assert(bld->gs_iface->end_primitive);
 
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index d884c2d232c..5895fa90451 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -3377,6 +3377,7 @@ static void target_to_dims_layer(unsigned target,
       break;
    default:
       assert(0);
+      *dims = 0;
       return;
    }
 }
@@ -3743,7 +3744,7 @@ atomic_emit(
    unsigned buf = bufreg->Register.Index;
    bool is_shared = bufreg->Register.File == TGSI_FILE_MEMORY;
 
-   LLVMAtomicRMWBinOp op;
+   LLVMAtomicRMWBinOp op = -1;
    switch (emit_data->inst->Instruction.Opcode) {
    case TGSI_OPCODE_ATOMUADD:
       op = LLVMAtomicRMWBinOpAdd;



More information about the mesa-commit mailing list