From e8a2f801af67630f7f767c3624b5c0c08ca70c96 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 4 Nov 2022 20:45:44 +0800 Subject: [PATCH] softpipe: fixes -Werror,-Wunused-but-set-variable for clang-15 in sp_tile_cache.c error message: ../../src/gallium/drivers/softpipe/sp_tile_cache.c:346:9: error: variable 'numCleared' set but not used [-Werror,-Wunused-but-set-variable] uint numCleared = 0; ^ Signed-off-by: Yonggang Luo Reviewed-by: Jose Fonseca Part-of: --- src/gallium/drivers/softpipe/sp_tile_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index b185320..33f58bc 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -343,7 +343,7 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc, int layer) const uint w = tc->transfer[layer]->box.width; const uint h = tc->transfer[layer]->box.height; uint x, y; - uint numCleared = 0; + UNUSED uint numCleared = 0; assert(pt->resource); @@ -414,11 +414,11 @@ sp_flush_tile(struct softpipe_tile_cache* tc, unsigned pos) void sp_flush_tile_cache(struct softpipe_tile_cache *tc) { - int inuse = 0, pos; + UNUSED int inuse = 0; int i; if (tc->num_maps) { /* caching a drawing transfer */ - for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) { + for (int pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) { struct softpipe_cached_tile *tile = tc->entries[pos]; if (!tile) { -- 2.7.4