Commit 18a0ead58758208fd0ba7448c660bd53e07a01e7

Ran Benita 2012-09-14T15:17:20

Rename ACTION_TYPE_LAST to _ACTION_TYPE_NUM_ENTRIES It's not really "last" per-se, and we use this other format in some other enums. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index 7a5193a..50e2529 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -150,7 +150,7 @@ enum xkb_action_type {
     ACTION_TYPE_CTRL_LOCK,
     ACTION_TYPE_KEY_REDIRECT,
     ACTION_TYPE_PRIVATE,
-    ACTION_TYPE_LAST
+    _ACTION_TYPE_NUM_ENTRIES
 };
 
 enum xkb_action_flags {
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 8456ab2..81a5eaa 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -107,8 +107,7 @@ NewActionsInfo(void)
     if (!info)
         return NULL;
 
-    /* This includes PrivateAction. */
-    for (type = 0; type < ACTION_TYPE_LAST; type++)
+    for (type = 0; type < _ACTION_TYPE_NUM_ENTRIES; type++)
         info->actions[type].type = type;
 
     /* Apply some "factory defaults". */
@@ -815,7 +814,7 @@ typedef bool (*actionHandler)(struct xkb_keymap *keymap,
                               const ExprDef *array_ndx,
                               const ExprDef *value);
 
-static const actionHandler handleAction[ACTION_TYPE_LAST] = {
+static const actionHandler handleAction[_ACTION_TYPE_NUM_ENTRIES] = {
     [ACTION_TYPE_NONE] = HandleNoAction,
     [ACTION_TYPE_MOD_SET] = HandleSetLatchMods,
     [ACTION_TYPE_MOD_LATCH] = HandleSetLatchMods,
diff --git a/src/xkbcomp/action.h b/src/xkbcomp/action.h
index 74194a1..82915ef 100644
--- a/src/xkbcomp/action.h
+++ b/src/xkbcomp/action.h
@@ -33,7 +33,7 @@
  * modified within the files (see calls to SetActionField).
  */
 typedef struct {
-    union xkb_action actions[ACTION_TYPE_LAST];
+    union xkb_action actions[_ACTION_TYPE_NUM_ENTRIES];
 } ActionsInfo;
 
 ActionsInfo *