Mesa (master): radv: fix uninitialized variables

Dave Airlie airlied at kemper.freedesktop.org
Tue Oct 11 23:00:33 UTC 2016


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

Author: Grigori Goronzy <greg at chown.ath.cx>
Date:   Wed Oct 12 00:47:19 2016 +0200

radv: fix uninitialized variables

This gets rid of "may be used uninitialized" compiler warnings.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/vulkan/radv_formats.c  | 2 +-
 src/amd/vulkan/radv_pipeline.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 90c140c..76d5fa1 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -804,7 +804,7 @@ bool radv_format_pack_clear_color(VkFormat format,
 				  uint32_t clear_vals[2],
 				  VkClearColorValue *value)
 {
-	uint8_t r, g, b, a;
+	uint8_t r = 0, g = 0, b = 0, a = 0;
 	const struct vk_format_description *desc = vk_format_description(format);
 
 	if (vk_format_get_component_bits(format, VK_FORMAT_COLORSPACE_RGB, 0) <= 8) {
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 89300e5..eb64b69 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -367,7 +367,7 @@ radv_pipeline_compile(struct radv_pipeline *pipeline,
 	struct radv_shader_variant *variant;
 	nir_shader *nir;
 	void *code = NULL;
-	unsigned code_size;
+	unsigned code_size = 0;
 
 	if (module->nir)
 		_mesa_sha1_compute(module->nir->info.name,




More information about the mesa-commit mailing list