[PATCH] dix: fix calculation of valuator events.

Daniel Stone daniel at fooishbar.org
Thu Dec 4 17:04:52 PST 2008


On Thu, Dec 04, 2008 at 04:56:09PM -0800, Keith Packard wrote:
> On Fri, 2008-12-05 at 10:45 +1000, Peter Hutterer wrote:
> >      if (num_valuators) {
> > -        if ((num_valuators / 6) + 1 > MAX_VALUATOR_EVENTS)
> > +        if (((num_valuators - 1) / 6) + 1 > MAX_VALUATOR_EVENTS)
> >              num_valuators = MAX_VALUATOR_EVENTS;
> 
> This still looks wrong to me; why would you assign MAX_VALUATOR_EVENTS t
> num_valuators? (no, I haven't looked at the surrounding code, just this
> patch).

Alternately, we could just cap valuator->numAxes so it can never be
larger than M_V_E * 6, and then make sure num_valuators is never greater
than that.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20081205/4570e7bf/attachment.pgp>


More information about the xorg mailing list