diff options
author | Vinson Lee <vlee@freedesktop.org> | 2015-01-06 16:32:51 -0800 |
---|---|---|
committer | Vinson Lee <vlee@freedesktop.org> | 2015-01-07 12:06:46 -0800 |
commit | cbad94cc796c942ba5b1e834656e14d6f1541de0 (patch) | |
tree | a3c5107e1b6eff0f349111532f75ea79c3681445 | |
parent | a7afac1a2022682c7aa8f5f36a4ef63fc36892c8 (diff) |
gl-1.0-readpixsanity: Fix GCC maybe-uninitialized warnings.
readpix.c: In function 'check_stencil':
readpix.c:325:3: warning: 'expected' may be used uninitialized in this function [-Wmaybe-uninitialized]
printf("\t\tExpected %i; got %i.\n",
^
readpix.c:326:19: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
expected, buf[y*w + x]);
^
readpix.c:326:22: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
expected, buf[y*w + x]);
^
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
-rw-r--r-- | tests/spec/gl-1.0/readpix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/spec/gl-1.0/readpix.c b/tests/spec/gl-1.0/readpix.c index e43a2185d..95977065a 100644 --- a/tests/spec/gl-1.0/readpix.c +++ b/tests/spec/gl-1.0/readpix.c @@ -283,12 +283,12 @@ random_bits(unsigned int bits) bool check_stencil(void) { - int i, x, y; + int i, x = 0, y = 0; bool pass = true; const int w = piglit_width; const int h = piglit_height; GLuint *buf = malloc(h * w * sizeof *buf); - GLuint expected; + GLuint expected = 0; GLint sbits; glGetIntegerv(GL_STENCIL_BITS, &sbits); pass &= piglit_check_gl_error(GL_NO_ERROR); |