i915: Fix logic_op check.
authorVinson Lee <vlee@freedesktop.org>
Sun, 3 Nov 2013 22:42:18 +0000 (14:42 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sun, 3 Nov 2013 22:45:56 +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/i915/intel_blit.c

index 7b59708343ba306dfbb07018ed0940a7b0c47513..5147d8ee307587b050383c4ee73a911d5e443109 100644 (file)
@@ -534,8 +534,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
         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)