radv: fix uninitialized variables
authorGrigori Goronzy <greg@chown.ath.cx>
Tue, 11 Oct 2016 22:47:19 +0000 (00:47 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 11 Oct 2016 23:00:22 +0000 (09:00 +1000)
This gets rid of "may be used uninitialized" compiler warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_formats.c
src/amd/vulkan/radv_pipeline.c

index 90c140c18b76358b12803c1ab82f3ceff70f432e..76d5fa1448c1923117eb4c43c20a744724cb5099 100644 (file)
@@ -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) {
index 89300e59924f046e4cce91a393a1fbe06f3d464e..eb64b6972ab86b25f6680baaac0b38cf7693a281 100644 (file)
@@ -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,