[PATCH xserver 6/6] dix: Reallocate touchpoint buffer at input event time

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 9 14:43:16 PST 2015


On Wed, Dec 09, 2015 at 11:46:37AM -0800, Keith Packard wrote:
> Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> 
> > this hunk took me a while, wouldn't it be easier do do something like:
> >     do {
> >        for (i = 0, ...) {
> >            ...
> >        }
> >
> >        if (!ti)
> >            TouchResizeQueue(dev))
> >     } while (!ti); 
> 
> It's similar, but you still need to deal with the possibility that
> TouchResizeQueue can fail. Given that there are two ways out of the loop
> (ti != NULL or TouchResizeQueue fails), having the two tests with a
> break seems clearer to me, but I guess that's just a matter of opinion.

if (!ti && !TouchResizeQueue(dev)))
        break;

will do then, the while (!ti) makes it a lot more obvious that we're looping
until we find a touchpoint. (plus, I never understood the benefit of for (;;)
over a while(1) :)

Cheers,
   Peter


More information about the xorg-devel mailing list