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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
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 *