[Mesa-dev] [PATCH] mesa/main: fix incorrect use of _mesa_ffsll. _mesa_ffsll may or may not be defined on GNUC

Alexander von Gluck kallisti5 at unixzen.com
Wed Jan 4 09:07:36 PST 2012


On 03.01.2012 16:54, Brian Paul wrote:
> On Tue, Jan 3, 2012 at 1:49 PM, Alexander von Gluck
> <kallisti5 at unixzen.com> wrote:
>> ---
>>  src/mesa/main/arrayobj.c |    2 +-
>>  src/mesa/main/imports.h  |    2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
>> index 4b3e07b..29bfed8 100644
>> --- a/src/mesa/main/arrayobj.c
>> +++ b/src/mesa/main/arrayobj.c
>> @@ -303,7 +303,7 @@ _mesa_update_array_object_max_element(struct 
>> gl_context
>> *ctx,
>>    GLuint min = ~0u;
>>
>>    while (enabled) {
>> -      GLint attrib = _mesa_ffsll(enabled) - 1;
>> +      GLint attrib = ffsll(enabled) - 1;
>
> Why are you changing this line?  On a non-gnu platform we may not have 
> ffsll().

You're right, I have a much better patch that simplifies this logic in 
flight.

The reasoning was that I kept running into undefined ffsll in my final 
binaries.
_mesa_ffs makes some strange assumptions on the existence of ffs without 
ensuring it exists first.

A new patch should be on the ML soon, please closely look at it to make sure 
i'm not missing any logic anywhere.

   -- Alex


More information about the mesa-dev mailing list