Rename XKB_NUM_GROUPS to XKB_MAX_GROUPS
authorRan Benita <ran234@gmail.com>
Wed, 10 Oct 2012 15:30:15 +0000 (17:30 +0200)
committerRan Benita <ran234@gmail.com>
Wed, 10 Oct 2012 15:30:15 +0000 (17:30 +0200)
This is a more appropriate name now.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/keymap.h
src/xkbcomp/expr.c
src/xkbcomp/rules.c
src/xkbcomp/symbols.c

index 9ce61e4..5bc2a13 100644 (file)
  * 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))
index f8f2a52..eb043e1 100644 (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;
     }
 
index 4287da8..1653f42 100644 (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;
index 32c7855..10efef0 100644 (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;
         }