summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-12 21:15:18 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-12 21:15:18 +0100
commit7548f77fff1832c038e624c655d534387619d825 (patch)
tree7b8660490ce6a1bbbe38a02035a1b45d274380f8 /tools
parenta5a51b55ec07e03c87a9916eca6d023ccaf7d00b (diff)
intel-virtual-output: Initialise width/height for a disabled output
virtual.c:1081:6: warning: variable 'width' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (clone->dst.mode.id == 0) { ^~~~~~~~~~~~~~~~~~~~~~~ virtual.c:1092:6: note: uninitialized use occurs here if (width == clone->width && height == clone->height) ^~~~~ virtual.c:1081:2: note: remove the 'if' if its condition is always false if (clone->dst.mode.id == 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ virtual.c:1079:11: note: initialize the variable 'width' to silence this warning int width, height; Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index d16a55f9..dbbbc279 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1079,8 +1079,8 @@ static int clone_init_xfer(struct clone *clone)
int width, height;
if (clone->dst.mode.id == 0) {
- clone->width = 0;
- clone->height = 0;
+ width = 0;
+ height = 0;
} else if (clone->dri3.xid) {
width = clone->dst.display->width;
height = clone->dst.display->height;