[Piglit] [PATCH piglit v2] teximage-color: Fix un_to_float for 32-bit builds

Brian Paul brianp at vmware.com
Thu Sep 18 06:27:06 PDT 2014


On 09/18/2014 04:24 AM, Neil Roberts wrote:
> Ilia Mirkin <imirkin at alum.mit.edu> writes:
>
>> Just bikeshedding here, but isn't the common way of doing this to just have
>>
>> (1ULL << bits) - 1
>>
>> ?
>
> Yes, that's probably more clear. One advantage of doing the shift in the
> other direction is if we ever end up supporting textures with 64-bit
> ints then we would need to do (1ULLL << bits) - 1 but that of course
> wouldn't work because there is no ULLL type. But yes, that is entirely
> hypothetical and it really doesn't matter that much what we do as long
> as it works and I already feel bad for continuing the bike shedding :)

FWIW, rather than using somewhat ambiguous UL, ULL, etc suffixes, one 
can use a cast like ((uint64_t) 1).

-Brian



More information about the Piglit mailing list