kbproto unentanglement: XkbSI_AutoRepeat
authorDaniel Stone <daniel@fooishbar.org>
Tue, 11 Sep 2012 11:32:18 +0000 (12:32 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Tue, 11 Sep 2012 11:32:18 +0000 (12:32 +0100)
That was the only interp flag, so just turn it into a straight boolean.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/keymap-dump.c
src/xkb-priv.h
src/xkbcomp/compat.c
src/xkbcomp/keymap.c

index 41adf5b..13d0ebf 100644 (file)
@@ -543,7 +543,7 @@ write_compat(struct xkb_keymap *keymap, struct buf *buf)
         if (interp->match & MATCH_LEVEL_ONE_ONLY)
             write_buf(buf,
                       "\t\t\tuseModMapMods=level1;\n");
-        if (interp->flags & XkbSI_AutoRepeat)
+        if (interp->repeat)
             write_buf(buf, "\t\t\trepeat= True;\n");
 
         write_action(keymap, buf, &interp->act, "\t\t\taction= ", ";\n");
index 7a69356..d43e43e 100644 (file)
@@ -292,7 +292,7 @@ struct xkb_key_type {
 
 struct xkb_sym_interpret {
     xkb_keysym_t sym;
-    unsigned char flags;
+    bool repeat;
     enum xkb_match_operation match;
     uint8_t mods;
     xkb_mod_index_t virtual_mod;
index cab6b33..f7b7404 100644 (file)
@@ -237,7 +237,7 @@ InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap, unsigned file_id,
     info->dflt.file_id = file_id;
     info->dflt.defined = 0;
     info->dflt.merge = MERGE_OVERRIDE;
-    info->dflt.interp.flags = 0;
+    info->dflt.interp.repeat = false;
     info->dflt.interp.virtual_mod = XKB_MOD_INVALID;
     memset(&info->dflt.interp.act, 0, sizeof(info->dflt.interp.act));
     info->dflt.interp.act.type = ACTION_TYPE_NONE;
@@ -255,7 +255,7 @@ ClearCompatInfo(CompatInfo *info)
     info->name = NULL;
     info->dflt.defined = 0;
     info->dflt.merge = MERGE_AUGMENT;
-    info->dflt.interp.flags = 0;
+    info->dflt.interp.repeat = false;
     info->dflt.interp.virtual_mod = XKB_MOD_INVALID;
     memset(&info->dflt.interp.act, 0, sizeof(info->dflt.interp.act));
     info->dflt.interp.act.type = ACTION_TYPE_NONE;
@@ -333,8 +333,7 @@ AddInterp(CompatInfo *info, SymInterpInfo *new)
         }
         if (UseNewInterpField(SI_FIELD_AUTO_REPEAT, old, new, report,
                               &collide)) {
-            old->interp.flags &= ~XkbSI_AutoRepeat;
-            old->interp.flags |= (new->interp.flags & XkbSI_AutoRepeat);
+            old->interp.repeat = new->interp.repeat;
             old->defined |= SI_FIELD_AUTO_REPEAT;
         }
         if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, report,
@@ -596,10 +595,7 @@ SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field,
         if (!ExprResolveBoolean(keymap->ctx, value, &set))
             return ReportSIBadType(info, si, field, "boolean");
 
-        if (set)
-            si->interp.flags |= XkbSI_AutoRepeat;
-        else
-            si->interp.flags &= ~XkbSI_AutoRepeat;
+        si->interp.repeat = set;
 
         si->defined |= SI_FIELD_AUTO_REPEAT;
     }
index 4bad351..b917d79 100644 (file)
@@ -154,7 +154,7 @@ ApplyInterpsToKey(struct xkb_keymap *keymap, struct xkb_key *key)
             /* Infer default key behaviours from the base level. */
             if (group == 0 && level == 0) {
                 if (!(key->explicit & XkbExplicitAutoRepeatMask) &&
-                    (!interp || (interp->flags & XkbSI_AutoRepeat)))
+                    (!interp || interp->repeat))
                     key->repeats = true;
             }