On 10/26/2013 12:36 AM, Vinson Lee wrote:
> logic_op is of type GLenum (unsigned int).
> 
> Fixes "Macro compares unsigned to 0" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <[email protected]>
> ---
>  src/mesa/drivers/dri/i915/intel_blit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i915/intel_blit.c 
> b/src/mesa/drivers/dri/i915/intel_blit.c
> index 7b59708..9a66736 100644
> --- a/src/mesa/drivers/dri/i915/intel_blit.c
> +++ b/src/mesa/drivers/dri/i915/intel_blit.c
> @@ -534,7 +534,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context 
> *intel,
>        return false;
>     }
>  
> -   assert( logic_op - GL_CLEAR >= 0 );
> +   assert( logic_op >= GL_CLEAR );
>     assert( logic_op - GL_CLEAR < 0x10 );

I'd squash both of these together:

    assert((logic_op >= GL_CLEAR) && (logic_op <= (GL_CLEAR + 0x0f)));

GL_CLEAR + 0x0f is GL_SET, but who remembers that?  Assuming that change
also makes Coverity happy,

Reviewed-by: Ian Romanick <[email protected]>

It looks like src/mesa/drivers/dri/i965/intel_blit.c has the same
assertions.  The same fix on that file is preemptively R-b. :)

>     assert(dst_pitch > 0);
>  
> 

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to