* 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))
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;
}
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;
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;
}
}
}
}
- 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;
}