}
int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases)
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, unsigned nTotalAliases)
{
struct xkb_names * names;
int
XkbcAllocServerMap(struct xkb_desc * xkb, unsigned which, unsigned nNewActions)
{
- int i;
+ unsigned i;
struct xkb_server_map * map;
if (!xkb)
map->num_acts = 1;
map->size_acts = nNewActions + 1;
}
- else if ((map->size_acts - map->num_acts) < nNewActions) {
+ else if ((map->size_acts - map->num_acts) < (int)nNewActions) {
unsigned need;
union xkb_action *prev_acts = map->acts;
newSyms[0] = NoSymbol;
nSyms = 1;
for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
- int nCopy;
+ uint32_t nCopy;
nCopy = nKeySyms = XkbKeyNumSyms(xkb, i);
if ((nKeySyms == 0) && (i != key))
}
union xkb_action *
-XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, int needed)
+XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, uint32_t needed)
{
xkb_keycode_t i, nActs;
union xkb_action *newActs;
}
if (XkbKeyHasActions(xkb, key) &&
- (XkbKeyNumSyms(xkb, key) >= (unsigned)needed))
+ (XkbKeyNumSyms(xkb, key) >= (int)needed))
return XkbKeyActionsPtr(xkb, key);
- if (xkb->server->size_acts - xkb->server->num_acts >= (unsigned)needed) {
+ if (xkb->server->size_acts - xkb->server->num_acts >= (int)needed) {
xkb->server->key_acts[key] = xkb->server->num_acts;
xkb->server->num_acts += needed;
{
unsigned int info = XkbKeyGroupInfo(state->xkb, key);
unsigned int num_groups = XkbKeyNumGroups(state->xkb, key);
- int ret = state->group;
+ unsigned int ret = state->group;
if (ret < XkbKeyNumGroups(state->xkb, key))
return ret;
char *tok, *str;
unsigned present, l_ndx_present, v_ndx_present;
int i;
- int len, ndx;
+ size_t len;
+ int ndx;
_Xstrtokparams strtok_buf;
#ifdef DEBUG
Bool found;
XkbRF_CheckApplyRules( XkbRF_RulesPtr rules,
XkbRF_MultiDefsPtr mdefs,
struct xkb_component_names * names,
- int flags)
+ unsigned int flags)
{
int i;
XkbRF_RulePtr rule;
XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs)
{
char *str, *outstr, *orig, *var;
- int len, ndx;
+ size_t len;
+ int ndx;
orig= name;
str= strchr(name,'%');
#define BUFFER_SIZE 1024
static char textBuffer[BUFFER_SIZE];
-static int tbNext = 0;
+static unsigned int tbNext = 0;
static char *
tbGetBuffer(unsigned int size)
XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI);
extern int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases);
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, unsigned nTotalAliases);
extern int
XkbcAllocControls(struct xkb_desc * xkb, unsigned which);
XkbcResizeKeySyms(struct xkb_desc * xkb, xkb_keycode_t key, uint32_t needed);
extern union xkb_action *
-XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, int needed);
+XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, uint32_t needed);
extern void
XkbcFreeClientMap(struct xkb_desc * xkb);
static void
InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
{
- int i;
+ unsigned int i;
info->xkb = xkb;
info->name = NULL;
static void
ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb)
{
- int i;
+ unsigned int i;
ActionInfo *next;
free(info->name);
static int
FindKeyByLong(KeyNamesInfo * info, unsigned long name)
{
- int i;
+ uint64_t i;
for (i = info->computedMin; i <= info->computedMax; i++)
{
xkb_keycode_t kc,
char *name, unsigned merge, unsigned fileID, Bool reportCollisions)
{
- int old;
+ xkb_keycode_t old;
unsigned long lval;
if (kc > info->arraySize && !ResizeKeyNameArrays(info, kc)) {
MergeIncludedKeycodes(KeyNamesInfo * into, KeyNamesInfo * from,
unsigned merge)
{
- int i;
+ uint64_t i;
char buf[5];
if (from->errorCount > 0)
{
unsigned newMerge;
XkbFile *rtrn;
- KeyNamesInfo included = {NULL};
+ KeyNamesInfo included;
Bool haveSelf;
+ memset(&included, 0, sizeof(included));
+
haveSelf = False;
if ((stmt->file == NULL) && (stmt->map == NULL))
{
if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0)
== Success)
{
- int i;
+ uint64_t i;
for (i = info.computedMin; i <= info.computedMax; i++)
LongToKeyName(info.names[i], xkb->names->keys[i].name);
}
unsigned mask;
unsigned vmask;
Bool groupInfo;
- int numLevels;
- int nEntries;
- int szEntries;
+ unsigned numLevels;
+ unsigned nEntries;
+ unsigned szEntries;
struct xkb_kt_map_entry * entries;
PreserveInfo *preserve;
- int szNames;
+ unsigned szNames;
xkb_atom_t *lvlNames;
} KeyTypeInfo;
int errorCount;
int fileID;
unsigned stdPresent;
- int nTypes;
+ unsigned nTypes;
KeyTypeInfo *types;
KeyTypeInfo dflt;
VModInfo vmods;
static struct xkb_kt_map_entry *
FindMatchingMapEntry(KeyTypeInfo * type, unsigned mask, unsigned vmask)
{
- int i;
+ unsigned int i;
struct xkb_kt_map_entry * entry;
for (i = 0, entry = type->entries; i < type->nEntries; i++, entry++)
static void
DeleteLevel1MapEntries(KeyTypeInfo * type)
{
- int i, n;
+ unsigned int i, n;
for (i = 0; i < type->nEntries; i++)
{
HandleKeyTypeDef(KeyTypeDef * def,
struct xkb_desc * xkb, unsigned merge, KeyTypesInfo * info)
{
- int i;
+ unsigned int i;
KeyTypeInfo type;
if (def->merge != MergeDefault)
static Bool
CopyDefToKeyType(struct xkb_desc * xkb, struct xkb_key_type * type, KeyTypeInfo * def)
{
- int i;
+ unsigned int i;
PreserveInfo *pre;
for (pre = def->preserve; pre != NULL;
if (info.errorCount == 0)
{
- int i;
+ unsigned int i;
KeyTypeInfo *def;
struct xkb_key_type *type, *next;
FindNamedKey(struct xkb_desc * xkb,
unsigned long name,
xkb_keycode_t *kc_rtrn,
- Bool use_aliases, Bool create, int start_from)
+ Bool use_aliases, Bool create, xkb_keycode_t start_from)
{
unsigned n;
FindKeyNameForAlias(struct xkb_desc * xkb, unsigned long lname,
unsigned long *real_name)
{
- int i;
+ unsigned int i;
char name[XkbKeyNameLength + 1];
if (xkb && xkb->names && xkb->names->key_aliases)
xkb_keycode_t * /* kc_rtrn */ ,
Bool /* use_aliases */ ,
Bool /* create */ ,
- int /* start_from */
+ xkb_keycode_t /* start_from */
);
extern Bool FindKeyNameForAlias(struct xkb_desc * /* xkb */ ,
unsigned char typesDefined;
unsigned char symsDefined;
unsigned char actsDefined;
- short numLevels[XkbNumKbdGroups];
+ unsigned int numLevels[XkbNumKbdGroups];
xkb_keysym_t *syms[XkbNumKbdGroups];
union xkb_action *acts[XkbNumKbdGroups];
xkb_atom_t types[XkbNumKbdGroups];
}
else
{
- int width;
+ unsigned int width;
for (i = 0; i < XkbNumKbdGroups; i++)
{
width = new->numLevels[i];
static void
FreeSymbolsInfo(SymbolsInfo * info)
{
- int i;
+ unsigned int i;
free(info->name);
if (info->keys)
{
xkb_keysym_t *resultSyms;
union xkb_action *resultActs;
- int resultWidth;
- int i;
+ unsigned int resultWidth;
+ unsigned int i;
Bool report, clobber;
clobber = (from->defs.merge != MergeAugment);
static Bool
AddKeySymbols(SymbolsInfo * info, KeyInfo * key, struct xkb_desc * xkb)
{
- int i;
+ unsigned int i;
unsigned long real_name;
for (i = 0; i < info->nKeys; i++)
MergeIncludedSymbols(SymbolsInfo * into, SymbolsInfo * from,
unsigned merge, struct xkb_desc * xkb)
{
- int i;
+ unsigned int i;
KeyInfo *key;
if (from->errorCount > 0)
ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info)
{
unsigned ndx, nSyms;
- int i;
+ unsigned int i;
+ long j;
if (!GetGroupIndex(key, arrayNdx, SYMBOLS, &ndx))
return False;
key->syms[ndx][i] = NoSymbol;
}
}
- for (i = key->numLevels[ndx] - 1;
- (i >= 0) && (key->syms[ndx][i] == NoSymbol); i--)
+ for (j = key->numLevels[ndx] - 1;
+ (j >= 0) && (key->syms[ndx][j] == NoSymbol); j--)
{
key->numLevels[ndx]--;
}
char *field,
ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info)
{
- int i;
+ unsigned int i;
unsigned ndx, nActs;
ExprDef *act;
struct xkb_any_action *toAct;
static Bool
CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{
- int i;
+ unsigned int i;
xkb_keycode_t kc;
unsigned width, tmp, nGroups;
struct xkb_key_type * type;
Bool
CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
{
- int i;
+ unsigned int i;
SymbolsInfo info;
InitSymbolsInfo(&info, xkb);
typedef struct _XkbFile
{
ParseCommon common;
- int type;
+ unsigned type;
char *topName;
char *name;
ParseCommon *defs;
static Bool noDefaultPath = False;
/* number of entries allocated for includePath */
-static int szPath;
+static size_t szPath;
/* number of actual entries in includePath */
-static int nPathEntries;
+static size_t nPathEntries;
/* Holds all directories we might be including data from */
static char **includePath = NULL;
static void
XkbClearIncludePath(void)
{
- int i;
+ size_t i;
if (szPath > 0)
{
includePath[nPathEntries] = strdup(dir);
if (includePath[nPathEntries] == NULL)
{
- WSGO("Allocation failed (includePath[%d])\n", nPathEntries);
+ WSGO("Allocation failed (includePath[%zd])\n", nPathEntries);
return False;
}
nPathEntries++;
FILE *
XkbFindFileInPath(const char *name, unsigned type, char **pathRtrn)
{
- int i, ret;
+ size_t i;
+ int ret;
FILE *file = NULL;
char buf[PATH_MAX];
const char *typeDir;
ret = snprintf(buf, sizeof(buf), "%s/%s/%s",
includePath[i], typeDir, name);
- if (ret >= sizeof(buf))
+ if (ret >= (ssize_t)sizeof(buf))
{
ERROR("File name (%s/%s/%s) too long\n", includePath[i],
typeDir, name);