Replace 0xff with MOD_REAL_MASK_ALL
authorRan Benita <ran234@gmail.com>
Sat, 6 Oct 2012 15:53:53 +0000 (17:53 +0200)
committerRan Benita <ran234@gmail.com>
Sat, 6 Oct 2012 19:42:00 +0000 (21:42 +0200)
To make it easier to see where it's used. The name is just to match
MOD_REAL.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/keymap.h
src/text.c
src/xkbcomp/compat.c
src/xkbcomp/expr.c
src/xkbcomp/keymap.c

index 0bc6509..9734343 100644 (file)
@@ -115,6 +115,8 @@ enum mod_type {
     MOD_BOTH = (MOD_REAL | MOD_VIRT),
 };
 
+#define MOD_REAL_MASK_ALL ((xkb_mod_mask_t) 0x000000ff)
+
 enum xkb_action_type {
     ACTION_TYPE_NONE = 0,
     ACTION_TYPE_MOD_SET,
index ccf784c..6b96b72 100644 (file)
@@ -244,7 +244,7 @@ ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask)
     if (mask == 0)
         return "none";
 
-    if (mask == 0xff)
+    if (mask == MOD_REAL_MASK_ALL)
         return "all";
 
     str = buf;
index d7e24b0..04ab2f9 100644 (file)
@@ -389,7 +389,7 @@ ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
                                              expr->value.str);
         if (pred_txt && istreq(pred_txt, "any")) {
             *pred_rtrn = MATCH_ANY;
-            *mods_rtrn = 0xff;
+            *mods_rtrn = MOD_REAL_MASK_ALL;
             return true;
         }
     }
index 50e4a17..f8f2a52 100644 (file)
@@ -103,7 +103,7 @@ LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
     str = xkb_atom_text(ctx, field);
 
     if (istreq(str, "all")) {
-        *val_rtrn  = 0xff;
+        *val_rtrn  = MOD_REAL_MASK_ALL;
         return true;
     }
 
index f670a08..90ee7d7 100644 (file)
@@ -36,7 +36,7 @@ ComputeEffectiveMask(struct xkb_keymap *keymap, struct xkb_mods *mods)
     xkb_mod_index_t i;
 
     /* The effective mask is only real mods for now. */
-    mods->mask = mods->mods & 0xff;
+    mods->mask = mods->mods & MOD_REAL_MASK_ALL;
 
     darray_enumerate(i, mod, keymap->mods)
         if (mods->mods & (1 << i))