[Mesa-dev] [PATCH] i965: Silence signed-unsigned int comparison warning by compiler

Anuj Phogat anuj.phogat at gmail.com
Wed Jul 29 10:09:23 PDT 2015


On Wed, Jul 29, 2015 at 9:45 AM, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Jul 28, 2015 at 4:45 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>> brw_cs.cpp:386:27: warning: comparison between signed and unsigned
>> integer expressions [-Wsign-compare]
>>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_cs.cpp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_cs.cpp b/src/mesa/drivers/dri/i965/brw_cs.cpp
>> index d61bba0..970d153 100644
>> --- a/src/mesa/drivers/dri/i965/brw_cs.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_cs.cpp
>> @@ -383,7 +383,7 @@ brw_upload_cs_state(struct brw_context *brw)
>>        brw->gen >= 8 ?
>>        SET_FIELD(threads, GEN8_MEDIA_GPGPU_THREAD_COUNT) :
>>        SET_FIELD(threads, MEDIA_GPGPU_THREAD_COUNT);
>> -   assert(threads <= brw->max_cs_threads);
>> +   assert(threads <= (unsigned) brw->max_cs_threads);
>>     desc[dw++] = media_threads;
>
> A better fix would be making max_*_threads in brw_context.h unsigned.
> They get initialized by fields from brw_device_info.c, which are
> unsigned already.
Yes. That's better. I'll drop this and send out a new patch.
Thanks.


More information about the mesa-dev mailing list