Rename XKB_NUM_GROUPS to XKB_MAX_GROUPS

This is a more appropriate name now.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-10-10 17:30:15 +02:00
parent 1dbb2c4a9a
commit bdea377c93
4 changed files with 8 additions and 8 deletions

View File

@ -101,7 +101,7 @@
* the size of the xkb_layout_mask_t type (32). This is more than enough
* though.
*/
#define XKB_NUM_GROUPS 4
#define XKB_MAX_GROUPS 4
/* Don't allow more modifiers than we can hold in xkb_mod_mask_t. */
#define XKB_MAX_MODS ((xkb_mod_index_t) (sizeof(xkb_mod_mask_t) * 8))

View File

@ -396,9 +396,9 @@ ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr,
if (!ok)
return false;
if (result <= 0 || result > XKB_NUM_GROUPS) {
if (result <= 0 || result > XKB_MAX_GROUPS) {
log_err(ctx, "Group index %u is out of range (1..%d)\n",
result, XKB_NUM_GROUPS);
result, XKB_MAX_GROUPS);
return false;
}

View File

@ -559,7 +559,7 @@ extract_layout_index(const char *s, size_t max_len, xkb_layout_index_t *out)
return -1;
if (s[0] != '[' || !isdigit(s[1]) || s[2] != ']')
return -1;
if (s[1] - '0' < 1 || s[1] - '0' > XKB_NUM_GROUPS)
if (s[1] - '0' < 1 || s[1] - '0' > XKB_MAX_GROUPS)
return -1;
/* To zero-based index. */
*out = s[1] - '0' - 1;

View File

@ -561,11 +561,11 @@ HandleIncludeSymbols(SymbolsInfo *info, IncludeStmt *stmt)
next_incl.merge = next_incl.dflt.merge = MERGE_OVERRIDE;
if (stmt->modifier) {
next_incl.explicit_group = atoi(stmt->modifier) - 1;
if (next_incl.explicit_group >= XKB_NUM_GROUPS) {
if (next_incl.explicit_group >= XKB_MAX_GROUPS) {
log_err(info->keymap->ctx,
"Cannot set explicit group to %d - must be between 1..%d; "
"Ignoring group number\n",
next_incl.explicit_group + 1, XKB_NUM_GROUPS);
next_incl.explicit_group + 1, XKB_MAX_GROUPS);
next_incl.explicit_group = info->explicit_group;
}
}
@ -609,11 +609,11 @@ GetGroupIndex(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
}
}
if (i >= XKB_NUM_GROUPS) {
if (i >= XKB_MAX_GROUPS) {
log_err(info->keymap->ctx,
"Too many groups of %s for key %s (max %u); "
"Ignoring %s defined for extra groups\n",
name, KeyInfoText(info, keyi), XKB_NUM_GROUPS + 1, name);
name, KeyInfoText(info, keyi), XKB_MAX_GROUPS, name);
return false;
}