From b116ed8f9b80bb4cd944337993dd446f4b9ad936 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 5 Jun 2018 22:11:06 +0200 Subject: [PATCH] vrend_renderer.c: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vrend_renderer.c: in function »vrend_renderer_resource_create«: vrend_renderer.c:4735:35: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (level = 0; level <= args->last_level; level++) { ^~ vrend_renderer.c:4745:32: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (level = 0; level <= args->last_level; level++) { ^~ vrend_renderer.c:4756:32: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (level = 0; level <= args->last_level; level++) { ^~ vrend_renderer.c:4763:32: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (level = 0; level <= args->last_level; level++) { ^~ vrend_renderer.c: in function »read_transfer_data«: vrend_renderer.c:4893:27: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (h = 0; h < bh; h++) { ^ vrend_renderer.c: in function »write_transfer_data«: vrend_renderer.c:4936:24: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] for (h = 0; h < bh; h++) { ^ vrend_renderer.c: in function »check_transfer_bounds«: vrend_renderer.c:4981:28: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] if (info->box->depth > res->base.array_size) ^ vrend_renderer.c:4983:24: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] if (info->box->z > res->base.array_size) ^ vrend_renderer.c:4985:43: warning: comparison between signed and unsigned integer expressions[-Wsign-compare] if (info->box->z + info->box->depth > res->base.array_size) v2: Correct language of warnings Reviewed-by: Gurchetan Singh Signed-off-by: Gert Wollny Signed-off-by: Jakob Bornecrantz --- src/vrend_renderer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 492f66e..657234c 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4610,7 +4610,7 @@ static void vrend_create_buffer(struct vrend_resource *gr, uint32_t width) int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs) { struct vrend_resource *gr; - int level; + uint32_t level; int ret; ret = check_resource_valid(args); @@ -4894,7 +4894,7 @@ static void read_transfer_data(struct pipe_resource *res, uint32_t send_size = util_format_get_nblocks(res->format, box->width, box->height) * blsize * box->depth; uint32_t bwx = util_format_get_nblocksx(res->format, box->width) * blsize; - uint32_t bh = util_format_get_nblocksy(res->format, box->height); + int32_t bh = util_format_get_nblocksy(res->format, box->height); int d, h; if ((send_size == size || bh == 1) && !invert && box->depth == 1) @@ -4937,7 +4937,7 @@ static void write_transfer_data(struct pipe_resource *res, uint32_t send_size = util_format_get_nblocks(res->format, box->width, box->height) * blsize * box->depth; uint32_t bwx = util_format_get_nblocksx(res->format, box->width) * blsize; - uint32_t bh = util_format_get_nblocksy(res->format, box->height); + int32_t bh = util_format_get_nblocksy(res->format, box->height); int d, h; uint32_t stride = dst_stride ? dst_stride : util_format_get_nblocksx(res->format, u_minify(res->width0, level)) * blsize; @@ -5000,11 +5000,11 @@ static bool check_transfer_bounds(struct vrend_resource *res, if (info->box->z + info->box->depth > ldepth) return false; } else { - if (info->box->depth > res->base.array_size) + if (info->box->depth > (int)res->base.array_size) return false; - if (info->box->z > res->base.array_size) + if (info->box->z > (int)res->base.array_size) return false; - if (info->box->z + info->box->depth > res->base.array_size) + if (info->box->z + info->box->depth > (int)res->base.array_size) return false; }