[Mesa-dev] [PATCH] i965: Use unreachable() to silence warning.

Kenneth Graunke kenneth at whitecape.org
Sat Aug 30 14:29:10 PDT 2014


On Saturday, August 30, 2014 09:43:07 AM Matt Turner wrote:
> brw_meta_fast_clear.c:211:17: warning: 'x_scaledown' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>     unsigned int x_scaledown, y_scaledown;
> ---
>  src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
> index 4fb20d7..bcc8827 100644
> --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
> +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
> @@ -289,8 +289,7 @@ get_fast_clear_rect(struct brw_context *brw, struct gl_framebuffer *fb,
>           x_scaledown = 2;
>           break;
>        default:
> -         assert(!"Unexpected sample count for fast clear");
> -         break;
> +         unreachable("Unexpected sample count for fast clear");
>        }
>        y_scaledown = 2;
>        x_align = x_scaledown * 2;
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140830/7efbe4b6/attachment.sig>


More information about the mesa-dev mailing list