diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-01-13 09:19:28 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-01-20 07:48:47 +1000 |
commit | f1326ed2910bd985fafdb48714b1d6f38116b083 (patch) | |
tree | 407b460834be3fc034ee95bd497de3a0dd08ef8c /xkb | |
parent | 16eb4f2a7b67ee169785973f9e0a3773e13fdea6 (diff) |
xkb: Replace a few manual bitflips with SetBit & friends.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/XKBMisc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c index efe291103..96688be18 100644 --- a/xkb/XKBMisc.c +++ b/xkb/XKBMisc.c @@ -454,11 +454,12 @@ unsigned changed,tmp; } if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) { CARD8 old; - old= xkb->ctrls->per_key_repeat[key/8]; + old= BitIsOn(xkb->ctrls->per_key_repeat, key); if (interps[0]->flags&XkbSI_AutoRepeat) - xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8)); - else xkb->ctrls->per_key_repeat[key/8]&= ~(1<<(key%8)); - if (changes && (old!=xkb->ctrls->per_key_repeat[key/8])) + SetBit(xkb->ctrls->per_key_repeat, key); + else + ClearBit(xkb->ctrls->per_key_repeat, key); + if (changes && old != BitIsOn(xkb->ctrls->per_key_repeat, key)) changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask; } } @@ -466,9 +467,9 @@ unsigned changed,tmp; if ((!found)||(interps[0]==NULL)) { if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) { CARD8 old; - old= xkb->ctrls->per_key_repeat[key/8]; - xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8)); - if (changes && (old!=xkb->ctrls->per_key_repeat[key/8])) + old = BitIsOn(xkb->ctrls->per_key_repeat, key); + SetBit(xkb->ctrls->per_key_repeat, key); + if (changes && (old != BitIsOn(xkb->ctrls->per_key_repeat, key))) changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask; } if (((explicit&XkbExplicitBehaviorMask)==0)&& |