gcc, in its finite wisdom, complains about:

fbblt.c: In function 'fbBltStip':
fbblt.c:645:38: warning: 'rightShiftOdd' may be used uninitialized in
this function [-Wmaybe-uninitialized]
                     bits1 |= FbScrRight(bits, rightShift);
                                      ^
fbblt.c:542:23: note: 'rightShiftOdd' was declared here
     int leftShiftOdd, rightShiftOdd;
                       ^
fbblt.c:643:27: warning: 'leftShiftOdd' may be used uninitialized in
this function [-Wmaybe-uninitialized]
                     bits1 = FbScrLeft(bits, leftShift);
                           ^
fbblt.c:542:9: note: 'leftShiftOdd' was declared here
     int leftShiftOdd, rightShiftOdd;
         ^

Now the branch this appears in shouldn't ever have a problem, since the
initializer only kicks in when sx != dx, and that's precisely this
branch.  But either gcc isn't smart enough to notice that, or it's smart
enough to notice something I'm missing.  Either way, when sx == dx the
shifts here should be 0.

Signed-off-by: Adam Jackson <[email protected]>
---
 fb/fbblt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fb/fbblt.c b/fb/fbblt.c
index 37bd912..471454a 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -36,6 +36,8 @@
            rs = dx - sx; \
            ls = FB_UNIT - rs; \
        } \
+    } else { \
+       ls = rs = 0; \
     } \
 }
 
-- 
1.8.5.3

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to