Rename ACTION_TYPE_LAST to _ACTION_TYPE_NUM_ENTRIES
authorRan Benita <ran234@gmail.com>
Fri, 14 Sep 2012 12:17:20 +0000 (15:17 +0300)
committerRan Benita <ran234@gmail.com>
Fri, 14 Sep 2012 18:09:49 +0000 (21:09 +0300)
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>
src/xkb-priv.h
src/xkbcomp/action.c
src/xkbcomp/action.h

index 7a5193a..50e2529 100644 (file)
@@ -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 {
index 8456ab2..81a5eaa 100644 (file)
@@ -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,
index 74194a1..82915ef 100644 (file)
@@ -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 *