i965: Fix logic_op check.
authorVinson Lee <vlee@freedesktop.org>
Sun, 3 Nov 2013 22:43:53 +0000 (14:43 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sun, 3 Nov 2013 22:45:59 +0000 (14:45 -0800)
Fixes "Macro compares unsigned to 0" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/intel_blit.c

index b5857bbd5a77229798d62fe625aaf1264d2b2a12..0a03859df3e2218fef553d8755d3e014b8e80357 100644 (file)
@@ -417,8 +417,7 @@ intelEmitImmediateColorExpandBlit(struct brw_context *brw,
         return false;
    }
 
-   assert( logic_op - GL_CLEAR >= 0 );
-   assert( logic_op - GL_CLEAR < 0x10 );
+   assert((logic_op >= GL_CLEAR) && (logic_op <= (GL_CLEAR + 0x0f)));
    assert(dst_pitch > 0);
 
    if (w < 0 || h < 0)