Re: [Mesa-dev] [PATCH 3/3] mesa: Fix tautological compare

2018-02-27 Thread Ian Romanick
On 02/27/2018 07:38 PM, Brian Paul wrote: > On 02/27/2018 06:07 PM, Ian Romanick wrote: >> From: Ian Romanick >> >> _BaseFormat is GLenum16, but it is compared with an integer -1.  Even if >> _mesa_base_tex_format returned -1, it becomes 0x, and the >> comparison, after type promotion, will al

Re: [Mesa-dev] [PATCH 3/3] mesa: Fix tautological compare

2018-02-27 Thread Brian Paul
On 02/27/2018 06:07 PM, Ian Romanick wrote: From: Ian Romanick _BaseFormat is GLenum16, but it is compared with an integer -1. Even if _mesa_base_tex_format returned -1, it becomes 0x, and the comparison, after type promotion, will always fail. Fix this by explicitly casting both to GLenu

[Mesa-dev] [PATCH 3/3] mesa: Fix tautological compare

2018-02-27 Thread Ian Romanick
From: Ian Romanick _BaseFormat is GLenum16, but it is compared with an integer -1. Even if _mesa_base_tex_format returned -1, it becomes 0x, and the comparison, after type promotion, will always fail. Fix this by explicitly casting both to GLenum16. This should be more future proof that ca