Mesa (master): llvmpipe: Silence uninitialized variable warning about "chan"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 19 00:13:35 UTC 2020


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 16 20:52:22 2019 -0800

llvmpipe: Silence uninitialized variable warning about "chan"

Both arms of an if define it, but gcc doesn't notice.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>

---

 src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
index c5962a66699..673ba2af001 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
@@ -874,7 +874,7 @@ lp_build_insert_soa_chan(struct lp_build_context *bld,
     const unsigned width = chan_desc.size;
     const unsigned start = chan_desc.shift;
     const unsigned stop = start + width;
-    LLVMValueRef chan;
+    LLVMValueRef chan = NULL;
     switch(chan_desc.type) {
     case UTIL_FORMAT_TYPE_UNSIGNED:
 



More information about the mesa-commit mailing list