[PATCH 01/12] include: fix mask size calculation

Daniel Stone daniel at fooishbar.org
Wed Nov 9 01:18:50 PST 2011


Hi,

On 9 November 2011 02:27, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Tue, Nov 08, 2011 at 02:00:53PM +0000, Daniel Stone wrote:
>> On 7 November 2011 21:39, Peter Hutterer <peter.hutterer at who-t.net> wrote:
>> >  * 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).

Fair enough.

Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel


More information about the xorg-devel mailing list