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

Matt Turner mattst88 at gmail.com
Sat Aug 30 09:43:07 PDT 2014


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;
-- 
1.8.5.5



More information about the mesa-dev mailing list