From ad192385e3348b12d15f466225c2792adf42e7e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 26 Feb 2020 17:21:43 -0500 Subject: [PATCH] mesa: fix 11 warnings Reviewed-by: Eric Anholt Part-of: --- 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 261eaf3..8325786 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 904c676..5dd2522 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 2bf0109..4cd9abb 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 ae20092..952327a 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 -- 2.7.4