[Mesa-dev] [PATCH] radeon: Silence GCC unused-but-set-variable warnings.
Marek Olšák
maraeo at gmail.com
Wed Jul 22 12:16:54 PDT 2015
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Wed, Jul 22, 2015 at 7:04 AM, Vinson Lee <vlee at freedesktop.org> wrote:
> radeon_fbo.c: In function 'radeon_map_renderbuffer_s8z24':
> radeon_fbo.c:162:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> int ret;
> ^
> radeon_fbo.c: In function 'radeon_map_renderbuffer_z16':
> radeon_fbo.c:200:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> int ret;
> ^
> radeon_fbo.c: In function 'radeon_map_renderbuffer':
> radeon_fbo.c:242:8: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> int ret;
> ^
> radeon_fbo.c: In function 'radeon_unmap_renderbuffer':
> radeon_fbo.c:419:14: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
> GLboolean ok;
> ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/mesa/drivers/dri/radeon/radeon_fbo.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> index 5e4aaca..5eece51 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> @@ -169,6 +169,7 @@ radeon_map_renderbuffer_s8z24(struct gl_context *ctx,
> rrb->map_buffer = malloc(w * h * 4);
> ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
> assert(!ret);
> + (void) ret;
> untiled_s8z24_map = rrb->map_buffer;
> tiled_s8z24_map = rrb->bo->ptr;
>
> @@ -207,6 +208,7 @@ radeon_map_renderbuffer_z16(struct gl_context *ctx,
> rrb->map_buffer = malloc(w * h * 2);
> ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
> assert(!ret);
> + (void) ret;
>
> untiled_z16_map = rrb->map_buffer;
> tiled_z16_map = rrb->bo->ptr;
> @@ -324,6 +326,7 @@ radeon_map_renderbuffer(struct gl_context *ctx,
>
> ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
> assert(!ret);
> + (void) ret;
>
> map = rrb->bo->ptr;
> stride = rrb->map_pitch;
> @@ -416,7 +419,6 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
> {
> struct radeon_context *const rmesa = RADEON_CONTEXT(ctx);
> struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
> - GLboolean ok;
>
> if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) && !rrb->has_surface) {
> if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT || rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT) {
> @@ -438,6 +440,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
> radeon_bo_unmap(rrb->map_bo);
>
> if (rrb->map_mode & GL_MAP_WRITE_BIT) {
> + GLboolean ok;
> ok = rmesa->vtbl.blit(ctx, rrb->map_bo, 0,
> rb->Format, rrb->map_pitch / rrb->cpp,
> rrb->map_w, rrb->map_h,
> @@ -449,6 +452,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
> rrb->map_w, rrb->map_h,
> GL_FALSE);
> assert(ok);
> + (void) ok;
> }
>
> radeon_bo_unref(rrb->map_bo);
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list