[PATCH libXi] 1UL may be 4 bytes, force to 1ULL

Jeremy Huddleston jeremyhu at apple.com
Sun Oct 2 22:06:55 PDT 2011


On Oct 2, 2011, at 16:30, Peter Hutterer wrote:

> On Sun, Oct 02, 2011 at 10:52:03AM -0700, Jamey Sharp wrote:
>> On 10/2/11, Daniel Stone <daniel at fooishbar.org> wrote:
>>> On 2 October 2011 09:19, Jeremy Huddleston <jeremyhu at apple.com> wrote:
>>>> Peter, any thoughts on this?
>>> 
>>> I think using * (1 << 16) * (1 << 16) is a better idea than (1ULL << 32).
>> 
>> And I think ldexp is a much better idea than either. :-) It's more
>> clear, and as an added bonus, probably faster. (You can multiply a
>> double by a power of two just by adding the exponents. Division by an
>> arbitrary constant is stupidly slow by comparison.)
>> 
>> To me, the interesting part of Jeremy's question was whether helper
>> functions are worthwhile for these conversions, 
> 
> yes.
> 
>> and if so, where they should live.
> 
> preferably not in in the protocol. it exposes us to more bugs in the
> protocol headers (which in theory should be static). And since they're
> built-in updating them in case a bug is found is harder, you'll need to
> rebuild anything that uses the headers, simply updating the component isn't
> enough (that's from a distro POV).
> 
> tbh, that's one case where I'd accept duplicate implementations in the
> server and libX*.

Yeah, with my port maintainer hat on, a bug in a proto header like that would be *incredibly* annoying to push out.  I like the idea of them living as static functions in libXi and the server.


More information about the xorg-devel mailing list