[Mesa-dev] [PATCH] swrast: Remove dead code in _swrast_clear_depth_buffer()

Brian Paul brian.e.paul at gmail.com
Fri Dec 30 07:51:47 PST 2011


On Thu, Dec 29, 2011 at 11:20 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> This code was generating the gcc warning:
>
>  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]
> ---
>  src/mesa/swrast/s_depth.c |    9 ---------
>  1 files changed, 0 insertions(+), 9 deletions(-)
>
> diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
> index f87adaa..53f21cb 100644
> --- a/src/mesa/swrast/s_depth.c
> +++ b/src/mesa/swrast/s_depth.c
> @@ -489,7 +489,6 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
>  {
>    struct gl_renderbuffer *rb =
>       ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
> -   GLuint clearValue;
>    GLint x, y, width, height;
>    GLubyte *map;
>    GLint rowStride, i, j;
> @@ -500,14 +499,6 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
>       return;
>    }
>
> -   /* compute integer clearing value */
> -   if (ctx->Depth.Clear == 1.0) {
> -      clearValue = ctx->DrawBuffer->_DepthMax;
> -   }
> -   else {
> -      clearValue = (GLuint) (ctx->Depth.Clear * ctx->DrawBuffer->_DepthMaxF);
> -   }
> -
>    /* compute region to clear */
>    x = ctx->DrawBuffer->_Xmin;
>    y = ctx->DrawBuffer->_Ymin;
> --

Reviewed-by: Brian Paul <brianp at vmare.com>


More information about the mesa-dev mailing list