Mesa (master): mesa: fix 11 warnings

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


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

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

mesa: fix 11 warnings

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

---

 src/mesa/main/get.c                        | 2 ++
 src/mesa/main/texcompress_s3tc_tmp.h       | 2 +-
 src/mesa/program/ir_to_mesa.cpp            | 6 +++---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 261eaf37323..8325786a396 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1548,6 +1548,8 @@ find_value(const char *func, GLenum pname, void **p, union value *v)
    const struct value_desc *d;
    int api;
 
+   *p = NULL;
+
    api = ctx->API;
    /* We index into the table_set[] list of per-API hash tables using the API's
     * value in the gl_api enum. Since GLES 3 doesn't have an API_OPENGL* enum
diff --git a/src/mesa/main/texcompress_s3tc_tmp.h b/src/mesa/main/texcompress_s3tc_tmp.h
index 904c6765261..5dd25222f15 100644
--- a/src/mesa/main/texcompress_s3tc_tmp.h
+++ b/src/mesa/main/texcompress_s3tc_tmp.h
@@ -197,7 +197,7 @@ static void fancybasecolorsearch( UNUSED GLubyte *blkaddr, GLubyte srccolors[4][
    GLuint pixerror, pixerrorred, pixerrorgreen, pixerrorblue, pixerrorbest;
    GLint colordist, blockerrlin[2][3];
    GLubyte nrcolor[2];
-   GLint pixerrorcolorbest[3];
+   GLint pixerrorcolorbest[3] = {0};
    GLubyte enc = 0;
    GLubyte cv[4][4];
    GLubyte testcolor[2][3];
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 2bf01098db9..4cd9abb9ce3 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1367,7 +1367,7 @@ ir_to_mesa_visitor::visit(ir_swizzle *ir)
 {
    src_reg src;
    int i;
-   int swizzle[4];
+   int swizzle[4] = {0};
 
    /* Note that this is only swizzles in expressions, not those on the left
     * hand side of an assignment, which do write masking.  See ir_assignment
@@ -2420,8 +2420,8 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
     * This avoids relying on names to match parameters and uniform
     * storages later when associating uniform storage.
     */
-   unsigned location;
-   const bool found =
+   unsigned location = -1;
+   ASSERTED const bool found =
       shader_program->UniformHash->get(location, params->Parameters[index].Name);
    assert(found);
 
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index ae20092c498..952327a3b20 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2410,7 +2410,7 @@ glsl_to_tgsi_visitor::visit(ir_swizzle *ir)
 {
    st_src_reg src;
    int i;
-   int swizzle[4];
+   int swizzle[4] = {0};
 
    /* Note that this is only swizzles in expressions, not those on the left
     * hand side of an assignment, which do write masking.  See ir_assignment



More information about the mesa-commit mailing list