[PATCH v8 68/71] drm: i915: fixed uninitialized variable warning for dest_reg

"Enrico Weigelt, metux IT consult" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
---
 src/drm/cairo-drm-i915-shader.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/drm/cairo-drm-i915-shader.c b/src/drm/cairo-drm-i915-shader.c
index 0205739..b5b2459 100644
--- a/src/drm/cairo-drm-i915-shader.c
+++ b/src/drm/cairo-drm-i915-shader.c
@@ -911,6 +911,16 @@ i915_set_shader_program (i915_device_t *device,
 	    break;
 	}
     }
+    else
+    {
+	/* make the compiler happy - fix warning on unused variable.
+	   we could simply assign an init value on declaration, but
+	   this way it's more robust against possible future changes
+	   to this code (otherwise potentially newly introduced
+	   unitialized variable issues could easily become unnoticed.
+	*/
+	dest_reg = 0;
+    }
 
     if (shader->clip.type.fragment == FS_TEXTURE) {
 	assert (mask_reg != ~0U);
-- 
2.6.4.442.g545299f

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.