On Tue, Nov 08, 2011 at 02:00:53PM +0000, Daniel Stone wrote:
> Hi,
> 
> On 7 November 2011 21:39, Peter Hutterer <[email protected]> wrote:
> > Same bug as inputproto-2.0.1-9-gb1149ab, if the XI2LASTEVENT was a multiple
> > of 8, the mask was one bit too short.
> >
> > Signed-off-by: Peter Hutterer <[email protected]>
> > ---
> >  include/inputstr.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/inputstr.h b/include/inputstr.h
> > index 0a21287..f482a22 100644
> > --- a/include/inputstr.h
> > +++ b/include/inputstr.h
> > @@ -72,7 +72,7 @@ extern _X_EXPORT int CountBits(const uint8_t *mask, int 
> > len);
> >  * this number here is bumped.
> >  */
> >  #define XI2LASTEVENT    17 /* XI_RawMotion */
> > -#define XI2MASKSIZE     ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
> > +#define XI2MASKSIZE     ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks 
> > */
> 
> The usual form would be ((XI2LASTEVENT + 7) & ~7), no?

Didn't know there was a "usual form" but the suggested change is the same as
we have in the inputproto headers and I'd like to keep the two identical. 

Besides, your suggestion isn't quite the same as the proposed fix. For a
XI2LASTEVENT of 8, we need a masksize of 2 bytes since event masks are
defined as (1 << type).

Cheers,
  Peter
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to