Make ATSPI_*_COUNT macros not depend on being updated by hand
After !146 (merged), I think this is a good time to make is so that all the ATSPI_*_COUNT
macros always have the correct value, instead of depending on being updated by hand. For that particular case, we have:
typedef enum
{
ATSPI_ROLE_INVALID,
/* ... */
ATSPI_ROLE_PUSH_BUTTON_MENU,
ATSPI_ROLE_LAST_DEFINED,
} AtspiRole;
#define ATSPI_ROLE_COUNT (130 + 1)
In this case, we can instead #define ATSPI_ROLE_COUNT ((unsigned int) ATSPI_ROLE_LAST_DEFINED)
and forget about it.
Some enums do not have a LAST_DEFINED
variant at the end, for example:
typedef enum
{
ATSPI_SCROLL_TOP_LEFT,
ATSPI_SCROLL_BOTTOM_RIGHT,
ATSPI_SCROLL_TOP_EDGE,
ATSPI_SCROLL_BOTTOM_EDGE,
ATSPI_SCROLL_LEFT_EDGE,
ATSPI_SCROLL_RIGHT_EDGE,
ATSPI_SCROLL_ANYWHERE
} AtspiScrollType;
In that case I think we can add ATSPI_SCROLL_LAST_DEFINED
variant, and use it in the ATSPI_SCROLLTYPE_COUNT
macro. We can handle other enums in a similar way.
@michaelweghorn How did you find the discrepancy in ATSPI_ROLE_COUNT
? I'm curious