diff options
-rw-r--r-- | expr.c | 2 | ||||
-rw-r--r-- | keycodes.c | 4 | ||||
-rw-r--r-- | keymap.c | 6 | ||||
-rw-r--r-- | symbols.c | 52 | ||||
-rw-r--r-- | vmod.c | 8 |
5 files changed, 36 insertions, 36 deletions
@@ -273,7 +273,7 @@ LookupModMask(XPointer priv, else if (uStrCaseCmp(str, "none") == 0) val_rtrn->uval = 0; else if (LookupModIndex(priv, elem, field, type, val_rtrn)) - val_rtrn->uval = (1 << val_rtrn->uval); + val_rtrn->uval = (1U << val_rtrn->uval); else if (priv != NULL) { LookupPriv *lpriv = (LookupPriv *) priv; @@ -880,8 +880,8 @@ CompileKeycodes(XkbFile * file, XkbFileInfo * result, unsigned merge) XkbAtomGetString(NULL, ii->name), False); if (xkb->indicators != NULL) { - unsigned bit; - bit = 1 << (ii->ndx - 1); + unsigned bit = 1U << (ii->ndx - 1); + if (ii->virtual) xkb->indicators->phys_indicators &= ~bit; else @@ -85,7 +85,7 @@ CompileKeymap(XkbFile * file, XkbFileInfo * result, unsigned merge) while ((file) && (ok)) { file->topName = mainName; - if ((have & (1 << file->type)) != 0) + if ((have & (1U << file->type)) != 0) { ERROR("More than one %s section in a %s file\n", XkbConfigText(file->type, XkbMessage), @@ -93,7 +93,7 @@ CompileKeymap(XkbFile * file, XkbFileInfo * result, unsigned merge) ACTION("All sections after the first ignored\n"); ok = False; } - else if ((1 << file->type) & (~legal)) + else if ((1U << file->type) & (~legal)) { ERROR("Cannot define %s in a %s file\n", XkbConfigText(file->type, XkbMessage), @@ -138,7 +138,7 @@ CompileKeymap(XkbFile * file, XkbFileInfo * result, unsigned merge) break; } if (ok) - have |= (1 << file->type); + have |= (1U << file->type); file = (XkbFile *) file->common.next; } /* compile the sections we have in the file one-by-one, or fail. */ @@ -451,10 +451,10 @@ MergeKeyGroups(SymbolsInfo * info, from->syms[group] = NULL; into->acts[group] = resultActs; from->acts[group] = NULL; - into->symsDefined |= (1 << group); - from->symsDefined &= ~(1 << group); - into->actsDefined |= (1 << group); - from->actsDefined &= ~(1 << group); + into->symsDefined |= (1U << group); + from->symsDefined &= ~(1U << group); + into->actsDefined |= (1U << group); + from->actsDefined &= ~(1U << group); return True; } @@ -490,11 +490,11 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from) into->numLevels[i] = from->numLevels[i]; into->syms[i] = from->syms[i]; into->acts[i] = from->acts[i]; - into->symsDefined |= (1 << i); + into->symsDefined |= (1U << i); from->syms[i] = NULL; from->acts[i] = NULL; from->numLevels[i] = 0; - from->symsDefined &= ~(1 << i); + from->symsDefined &= ~(1U << i); if (into->syms[i]) into->defs.defined |= _Key_Syms; if (into->acts[i]) @@ -876,7 +876,7 @@ GetGroupIndex(KeyInfo * key, for (int i = 0; i < XkbNumKbdGroups; i++) { - if ((defined & (1 << i)) == 0) + if ((defined & (1U << i)) == 0) { *ndx_rtrn = i; return True; @@ -918,7 +918,7 @@ AddSymbolsToKey(KeyInfo * key, return False; if (value == NULL) { - key->symsDefined |= (1 << ndx); + key->symsDefined |= (1U << ndx); return True; } if (value->op != ExprKeysymList) @@ -944,7 +944,7 @@ AddSymbolsToKey(KeyInfo * key, ACTION("Symbols lost\n"); return False; } - key->symsDefined |= (1 << ndx); + key->symsDefined |= (1U << ndx); for (int i = 0; i < nSyms; i++) { if (!LookupKeysym(value->value.list.syms[i], &key->syms[ndx][i])) { if (warningLevel > 0) @@ -978,7 +978,7 @@ AddActionsToKey(KeyInfo * key, if (value == NULL) { - key->actsDefined |= (1 << ndx); + key->actsDefined |= (1U << ndx); return True; } if (value->op != ExprActionList) @@ -1011,7 +1011,7 @@ AddActionsToKey(KeyInfo * key, ACTION("Actions lost\n"); return False; } - key->actsDefined |= (1 << ndx); + key->actsDefined |= (1U << ndx); toAct = (XkbAnyAction *) key->acts[ndx]; act = value->value.child; @@ -1054,7 +1054,7 @@ SetAllowNone(KeyInfo * key, ExprDef * arrayNdx, ExprDef * value) tmp.uval); return False; } - radio_groups |= (1 << (tmp.uval - 1)); + radio_groups |= (1U << (tmp.uval - 1)); } if (!ExprResolveBoolean(value, &tmp, NULL, NULL)) { @@ -1140,7 +1140,7 @@ SetSymbolsField(KeyInfo * key, else { key->types[ndx.uval - 1] = XkbInternAtom(NULL, tmp.str, False); - key->typesDefined |= (1 << (ndx.uval - 1)); + key->typesDefined |= (1U << (ndx.uval - 1)); } } else if (uStrCaseCmp(field, "symbols") == 0) @@ -1206,7 +1206,7 @@ SetSymbolsField(KeyInfo * key, key->behavior.type = XkbKB_RadioGroup | (permanent ? XkbKB_Permanent : 0); key->behavior.data = tmp.uval - 1; - if (key->allowNone & (1 << (tmp.uval - 1))) + if (key->allowNone & (1U << (tmp.uval - 1))) key->behavior.data |= XkbKB_RGAllowNone; key->defs.defined |= _Key_Behavior; } @@ -1532,7 +1532,7 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) key->types[i] = (Atom) 0; } } - key->typesDefined = key->symsDefined = key->actsDefined = 1 << group; + key->typesDefined = key->symsDefined = key->actsDefined = 1U << group; key->numLevels[group] = key->numLevels[0]; key->numLevels[0] = 0; @@ -1831,7 +1831,7 @@ PrepareKeyDef(KeyInfo * key) /* get highest group number */ for (i = XkbNumKbdGroups - 1; i >= 0; i--) { - if (defined & (1 << i)) + if (defined & (1U << i)) break; } lastGroup = i; @@ -1846,7 +1846,7 @@ PrepareKeyDef(KeyInfo * key) { int width; - if (defined & (1 << i)) + if (defined & (1U << i)) continue; width = key->numLevels[0]; if (key->typesDefined & 1) @@ -1855,7 +1855,7 @@ PrepareKeyDef(KeyInfo * key) { key->types[i] = key->types[0]; } - key->typesDefined |= 1 << i; + key->typesDefined |= 1U << i; } if ((key->actsDefined & 1) && key->acts[0]) { @@ -1863,7 +1863,7 @@ PrepareKeyDef(KeyInfo * key) if (key->acts[i] == NULL) continue; memcpy(key->acts[i], key->acts[0], width * sizeof(XkbAction)); - key->actsDefined |= 1 << i; + key->actsDefined |= 1U << i; } if ((key->symsDefined & 1) && key->syms[0]) { @@ -1871,7 +1871,7 @@ PrepareKeyDef(KeyInfo * key) if (key->syms[i] == NULL) continue; memcpy(key->syms[i], key->syms[0], width * sizeof(KeySym)); - key->symsDefined |= 1 << i; + key->symsDefined |= 1U << i; } if (defined & 1) { @@ -1962,8 +1962,8 @@ CopySymbolsDef(XkbFileInfo * result, KeyInfo * key, int start_from) for (i = width = nGroups = 0; i < XkbNumKbdGroups; i++) { if (((i + 1) > nGroups) - && (((key->symsDefined | key->actsDefined) & (1 << i)) - || (key->typesDefined) & (1 << i))) + && (((key->symsDefined | key->actsDefined) & (1U << i)) + || (key->typesDefined) & (1U << i))) nGroups = i + 1; if (key->acts[i]) haveActions = True; @@ -1993,7 +1993,7 @@ CopySymbolsDef(XkbFileInfo * result, KeyInfo * key, int start_from) if (FindNamedType(xkb, key->types[i], &types[i])) { if (!autoType || key->numLevels[i] > 2) - xkb->server->explicit[kc] |= (1 << i); + xkb->server->explicit[kc] |= (1U << i); } else { @@ -2128,9 +2128,9 @@ CopySymbolsDef(XkbFileInfo * result, KeyInfo * key, int start_from) if (key->repeat != RepeatUndefined) { if (key->repeat == RepeatYes) - xkb->ctrls->per_key_repeat[kc / 8] |= (1 << (kc % 8)); + xkb->ctrls->per_key_repeat[kc / 8] |= (1U << (kc % 8)); else - xkb->ctrls->per_key_repeat[kc / 8] &= ~(1 << (kc % 8)); + xkb->ctrls->per_key_repeat[kc / 8] &= ~(1U << (kc % 8)); xkb->server->explicit[kc] |= XkbExplicitAutoRepeatMask; } @@ -2174,7 +2174,7 @@ CopyModMapDef(XkbFileInfo * result, ModMapEntry * entry) } return False; } - xkb->map->modmap[kc] |= (1 << entry->modifier); + xkb->map->modmap[kc] |= (1U << entry->modifier); return True; } @@ -137,9 +137,9 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info) ACTION("Exiting\n"); return False; } - info->defined |= (1 << nextFree); - info->newlyDefined |= (1 << nextFree); - info->available |= (1 << nextFree); + info->defined |= (1U << nextFree); + info->newlyDefined |= (1U << nextFree); + info->available |= (1U << nextFree); names->vmods[nextFree] = stmtName; if (stmt->value == NULL) return True; @@ -217,7 +217,7 @@ LookupVModMask(XPointer priv, if (LookupVModIndex(priv, elem, field, type, val_rtrn)) { unsigned ndx = val_rtrn->uval; - val_rtrn->uval = (1 << (XkbNumModifiers + ndx)); + val_rtrn->uval = (1U << (XkbNumModifiers + ndx)); return True; } return False; |