On Wed, Dec 09, 2015 at 11:46:37AM -0800, Keith Packard wrote:
> Peter Hutterer <[email protected]> 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
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel