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

Peter Hutterer peter.hutterer at who-t.net
Mon Oct 3 13:49:40 PDT 2011


On Sun, Oct 02, 2011 at 10:06:55PM -0700, Jeremy Huddleston wrote:
> 
> 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.

I'd vote for putting them into the server with a few tests to make sure they
work mostly as requested. Once that's in, we can add them to the library,
hoping that there aren't any big bugs left.

Cheers,
  Peter


More information about the xorg-devel mailing list