gallium: Fix uninitialized variable warning in compute test.
authorEric Anholt <eric@anholt.net>
Mon, 26 Nov 2018 21:11:31 +0000 (13:11 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 27 Nov 2018 19:23:22 +0000 (11:23 -0800)
The compiler doesn't know that ny != 0, so x might be uninitialized for
the printf at the end.

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
src/gallium/tests/trivial/compute.c

index afe5d3e9f2be62e988ab5b6b06d1341a28cb6ac4..20e5a4f140c9918ebba48f32136bc4a86a2676b7 100644 (file)
@@ -240,7 +240,7 @@ static void check_tex(struct context *ctx, int slot,
                   util_format_get_nblocksy(tex->format, tex->height0));
         struct pipe_transfer *xfer;
         char *map;
-        int x, y, i;
+        int x = 0, y, i;
         int err = 0;
 
         if (!check)