From: Hans de Goede Date: Wed, 29 Jun 2016 12:32:19 +0000 (+0200) Subject: nv30: Fix "array subscript is below array bounds" compiler warning X-Git-Tag: upstream/17.1.0~8361 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7dfd4cb511b3190c74f5a03ca9bd8351ad6d062;p=platform%2Fupstream%2Fmesa.git nv30: Fix "array subscript is below array bounds" compiler warning gcc6 does not like the trick where we point to one entry before the array start and then start a while with a pre-increment. Signed-off-by: Hans de Goede Reviewed-by: Ilia Mirkin --- diff --git a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c index 9ecbcd1..5299b70 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c @@ -663,8 +663,7 @@ nv30_transfer_rect(struct nv30_context *nv30, enum nv30_transfer_filter filter, {} }; - method = methods - 1; - while ((++method)->possible) { + for (method = methods; method->possible; method++) { if (method->possible(nv30, filter, src, dst)) { method->execute(nv30, filter, src, dst); return;